From 55c4d58637fa72f63f652c6c77a1a353ac2763cd Mon Sep 17 00:00:00 2001 From: johns <> Date: Wed, 6 Jun 2001 21:20:16 +0000 Subject: [PATCH] Fixed compile for win32. --- src/network/netconnect.cpp | 9 ++++++++- src/ui/menus.cpp | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/network/netconnect.cpp b/src/network/netconnect.cpp index 8a55fc2f4..5143e1c7c 100644 --- a/src/network/netconnect.cpp +++ b/src/network/netconnect.cpp @@ -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; diff --git a/src/ui/menus.cpp b/src/ui/menus.cpp index dc1b048b9..0732bfec0 100644 --- a/src/ui/menus.cpp +++ b/src/ui/menus.cpp @@ -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();