1
0

Fixed client packet parsing.

When the packet wouldn't fit the current buffer, the server would mis-parse the next packet. This was the cause for #541.
Also modified comm logging, now each direction can be turned on separately.
This commit is contained in:
madmaxoft
2014-01-26 17:54:18 +01:00
parent ab4672be40
commit 30c431b479
2 changed files with 56 additions and 15 deletions

View File

@@ -19,8 +19,11 @@ bool g_SERVER_TERMINATED = false; // Set to true when the server terminates, so
/** If set to true, the protocols will log each player's communication to a separate logfile */
bool g_ShouldLogComm;
/** If set to true, the protocols will log each player's incoming (C->S) communication to a per-connection logfile */
bool g_ShouldLogCommIn;
/** If set to true, the protocols will log each player's outgoing (S->C) communication to a per-connection logfile */
bool g_ShouldLogCommOut;
@@ -242,7 +245,24 @@ int main( int argc, char **argv )
(NoCaseCompare(argv[i], "/logcomm") == 0)
)
{
g_ShouldLogComm = true;
g_ShouldLogCommIn = true;
g_ShouldLogCommOut = true;
}
if (
(NoCaseCompare(argv[i], "/commlogin") == 0) ||
(NoCaseCompare(argv[i], "/comminlog") == 0) ||
(NoCaseCompare(argv[i], "/logcommin") == 0)
)
{
g_ShouldLogCommIn = true;
}
if (
(NoCaseCompare(argv[i], "/commlogout") == 0) ||
(NoCaseCompare(argv[i], "/commoutlog") == 0) ||
(NoCaseCompare(argv[i], "/logcommout") == 0)
)
{
g_ShouldLogCommOut = true;
}
}