Created a NetworkGameObserver class able to extend the serialization code of GameObserver to synchronize and forward game actions on the network
Fixes in GameObserver serialization/deserialization code Fixes in JNetwork and JSocket on windows Various code cleanup (currentGamePhase access in particular) Updated GUI code to re-enable a basic network GUI Activated threaded tests on Windows. It uses 4 threads by default.
This commit is contained in:
@@ -264,9 +264,17 @@ int JSocket::Read(char* buff, int size)
|
||||
#endif //WINDOWS
|
||||
if(readbytes < 0)
|
||||
{
|
||||
DebugTrace("Error reading from socket\n");
|
||||
#ifdef WIN32
|
||||
DebugTrace("Error reading from socket: " << WSAGetLastError());
|
||||
#endif //WINDOWS
|
||||
Disconnect();
|
||||
return -1;
|
||||
}
|
||||
else if(readbytes == 0)
|
||||
{
|
||||
Disconnect();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return readbytes;
|
||||
}
|
||||
@@ -303,6 +311,7 @@ int JSocket::Write(char* buff, int size)
|
||||
}
|
||||
else if (result < 0)
|
||||
{
|
||||
Disconnect();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user