Fixed compile for win32.

This commit is contained in:
johns 2001-06-06 21:20:16 +00:00
parent d9cc0e3ca9
commit 55c4d58637
2 changed files with 17 additions and 1 deletions

View file

@ -36,8 +36,9 @@
#include <stddef.h>
#include <string.h>
#include "net_lowlevel.h"
#include "freecraft.h"
#include "net_lowlevel.h"
#include "player.h"
#include "map.h"
#include "network.h"
@ -622,7 +623,10 @@ local void NetworkSendRateLimitedClientMessage(InitMessage *msg, long msecs)
unsigned long s, u, d;
int n;
#ifndef USE_WIN32
DebugLevel0Fn("Didn't work with win32\n");
gettimeofday(&now, NULL);
#endif
s = now.tv_sec - NetLastPacketSent.tv_sec;
u = now.tv_usec - NetLastPacketSent.tv_usec;
d = s * 1000 + u / 1000;
@ -649,7 +653,10 @@ global void NetworkInitClientConnect(void)
int i;
NetConnectRunning = 2;
#ifndef USE_WIN32
DebugLevel0Fn("Didn't work with win32\n");
gettimeofday(&NetLastPacketSent, NULL);
#endif
NetLocalState = ccs_connecting;
NetStateMsgCnt = 0;
LastStateMsgType = ICMServerQuit;

View file

@ -47,7 +47,10 @@
#include "map.h"
#include "pud.h"
#include "iolib.h"
#ifndef USE_WIN32
#warning "NOT HERE LOW-LEVEL = LOW-LEVEL!!!"
#include "net_lowlevel.h"
#endif
#include "network.h"
#include "netconnect.h"
#include "settings.h"
@ -1259,15 +1262,21 @@ local void JoinNetGameMenu(void)
ServerHostBuf[EnterServerIPMenuItems[1].d.input.nch] = 0; // Now finally here is the address
addr = NetResolveHost(ServerHostBuf);
#ifndef USE_WIN32
DebugLevel0Fn("Didn't work with win32\n");
if (addr == INADDR_NONE) {
return;
}
#endif
NetworkServerIP = addr;
#ifndef USE_WIN32
DebugLevel0Fn("Didn't work with win32\n");
DebugLevel1Fn("SELECTED SERVER: %s (%d.%d.%d.%d)\n", ServerHostBuf,
NIPQUAD(ntohl(addr)));
sprintf(NetworkServerText, "%d.%d.%d.%d", NIPQUAD(ntohl(addr)));
#endif
NetworkInitClientConnect();