diff --git a/Binary/CharServer.exe b/Binary/CharServer.exe index 4d2b5a2..b32d749 100644 Binary files a/Binary/CharServer.exe and b/Binary/CharServer.exe differ diff --git a/Binary/LoginServer.exe b/Binary/LoginServer.exe index 603474f..08929af 100644 Binary files a/Binary/LoginServer.exe and b/Binary/LoginServer.exe differ diff --git a/Binary/WorldServer.exe b/Binary/WorldServer.exe index 181b2e4..438cea4 100644 Binary files a/Binary/WorldServer.exe and b/Binary/WorldServer.exe differ diff --git a/Servers/.vs/Servers/v16/.suo b/Servers/.vs/Servers/v16/.suo index 2b4ef94..f9e4740 100644 Binary files a/Servers/.vs/Servers/v16/.suo and b/Servers/.vs/Servers/v16/.suo differ diff --git a/Servers/.vs/Servers/v16/Browse.VC.db b/Servers/.vs/Servers/v16/Browse.VC.db index dd27b0c..2d5db39 100644 Binary files a/Servers/.vs/Servers/v16/Browse.VC.db and b/Servers/.vs/Servers/v16/Browse.VC.db differ diff --git a/Src/Common/SocketClient.cpp b/Src/Common/SocketClient.cpp index 19d823e..b3644b4 100644 --- a/Src/Common/SocketClient.cpp +++ b/Src/Common/SocketClient.cpp @@ -91,10 +91,29 @@ bool CClientSocket::ReceiveData( ) CPacket* pak = (CPacket*)&Buffer; //comment to prevent packet logging + /// FK: Prepare Logging. + string ThisServer; + + switch (LOG_THISSERVER) + { + case LOG_LOGIN_SERVER: + ThisServer = "LOGIN Server"; + break; + case LOG_CHARACTER_SERVER: + ThisServer = "CHAR Server"; + break; + case LOG_WORLD_SERVER: + ThisServer = "WORLD Server"; + break; + case LOG_SAME_FILE: + ThisServer = "DEFAULT"; + break; + } + FILE *fh = NULL; fopen_s (&fh, "log/inoutpackets.log", "a+"); if ( fh != NULL ) { - fprintf( fh, "(SID:%08u) IN %04x: ", sock, pak->Command ); + fprintf( fh, "%s: (SID:%08u) IN %04x: ", ThisServer.c_str(), sock, pak->Command ); for ( int i=0; iSize-6; ++i ) fprintf( fh, "%02x ", (unsigned char)pak->Buffer[i] ); fprintf( fh, "\n" ); fclose( fh ); @@ -120,12 +139,32 @@ void CClientSocket::SendPacket( CPacket *P ) { //first log it so we don't have to worry about encryption. Comment to prevent logging bool LogFile = true; + /// FK: Prepare Logging. + string ThisServer; + + switch (LOG_THISSERVER) + { + case LOG_LOGIN_SERVER: + ThisServer = "LOGIN Server"; + break; + case LOG_CHARACTER_SERVER: + ThisServer = "CHAR Server"; + break; + case LOG_WORLD_SERVER: + ThisServer = "WORLD Server"; + break; + case LOG_SAME_FILE: + ThisServer = "DEFAULT"; + break; + } FILE *fh = NULL; - fopen_s (&fh, "log/receivedpackets.log", "a+"); + + //fopen_s (&fh, "log/receivedpackets.log", "a+"); + fopen_s (&fh, "log/inoutpackets.log", "a+"); //send in and out to same log if ( fh != NULL && LogFile) { - fprintf( fh, "(SID:%08u) OUT %04x: ", sock, P->Command ); + fprintf( fh, "%s: (SID:%08u) OUT %04x: ", ThisServer.c_str(), sock, P->Command ); for ( int i=0; iSize-6; ++i ) fprintf( fh, "%02x ", (unsigned char)P->Buffer[i] ); fprintf( fh, "\n" ); fclose( fh );