From eeebba11dc42697c5ccb93620fe034abe7c5af14 Mon Sep 17 00:00:00 2001 From: RocketersAlex Date: Tue, 12 Apr 2016 04:03:25 +0300 Subject: [PATCH 1/2] GameAgent - list servers bugfix --- Sources/Engine/GameAgent/GameAgent.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/Engine/GameAgent/GameAgent.cpp b/Sources/Engine/GameAgent/GameAgent.cpp index ec648e0..d90b835 100644 --- a/Sources/Engine/GameAgent/GameAgent.cpp +++ b/Sources/Engine/GameAgent/GameAgent.cpp @@ -163,6 +163,14 @@ void _initializeWinsock(void) return; } + // start WSA + if(WSAStartup(MAKEWORD(2, 2), _wsaData) != 0) { + CPrintF("Error initializing winsock!\n"); + _uninitWinsock(); + return; + } +#endif + _wsaData = new WSADATA; _socket = INVALID_SOCKET; @@ -172,14 +180,6 @@ void _initializeWinsock(void) } _szBuffer = new char[2050]; - // start WSA - if(WSAStartup(MAKEWORD(2, 2), _wsaData) != 0) { - CPrintF("Error initializing winsock!\n"); - _uninitWinsock(); - return; - } -#endif - // get the host IP hostent* phe; if(!ga_bMSLegacy) { From dd0ad843850c1766637c23bc21d9e657f0e7d442 Mon Sep 17 00:00:00 2001 From: RocketersAlex Date: Tue, 12 Apr 2016 04:10:43 +0300 Subject: [PATCH 2/2] GameAgent - list servers bugfix (update) --- Sources/Engine/GameAgent/GameAgent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Engine/GameAgent/GameAgent.cpp b/Sources/Engine/GameAgent/GameAgent.cpp index d90b835..f459d25 100644 --- a/Sources/Engine/GameAgent/GameAgent.cpp +++ b/Sources/Engine/GameAgent/GameAgent.cpp @@ -163,6 +163,9 @@ void _initializeWinsock(void) return; } + _wsaData = new WSADATA; + _socket = INVALID_SOCKET; + // start WSA if(WSAStartup(MAKEWORD(2, 2), _wsaData) != 0) { CPrintF("Error initializing winsock!\n"); @@ -171,9 +174,6 @@ void _initializeWinsock(void) } #endif - _wsaData = new WSADATA; - _socket = INVALID_SOCKET; - // make the buffer that we'll use for packet reading if(_szBuffer != NULL) { delete[] _szBuffer;