Enemy Territory

Project: Bug Fix

The objective

The goal of this project is to provide modders in the ET community with a SDK code base that contains fixes for various bugs which are present in the stock etmain game (version 2.60).

26th september 2006: Sadly bugfix 088 had a bug :-( There were 3 lines that should have been deleted for the fix to work correctly.

Show index
Next bug: Backstab knife damage on wounded players exploit

Bugfix 001 - Oversize server commands

Problem:

Commands exceeding 1022 characters is causing the client engine to crash.

Solution:

This fix makes sure that commands send are not above 1022 characters. It writes an entry in the log telling that it has dropped a package.

References:

Spawning thread
Original fix

Notes

Testing has shown that client engine wasn't fixed in 2.60 and still crashes, so I'll leave the bugfix in. However the bugfix in the 2.60 SDK causes the server log to be missing a linebreak because the command gets truncated by G_LogPrintf, so I'll truncate the command.

2.60 Code

g_syscalls.c @ 110 void trap_SendServerCommand( int clientNum, const char *text ) { // rain - #433 - commands over 1022 chars will crash the // client engine upon receipt, so ignore them
// CHRUKER: b001 - Truncating the oversize server command before writing it to the log
if( strlen( text ) > 1022 ) { G_LogPrintf( "%s: trap_SendServerCommand( %d, ... ) length exceeds 1022.\n", GAMEVERSION, clientNum ); G_LogPrintf( "%s: text [%.950s]... truncated\n", GAMEVERSION, text ); return; } syscall( G_SEND_SERVER_COMMAND, clientNum, text ); }

2.56 Code

g_syscalls.c @ 106 void trap_SendServerCommand( int clientNum, const char *text ) {
// CHRUKER: b001 - Oversize server commands // rain - hack - commands over 1022 chars will crash the // client upon receipt, so ignore them if( strlen( text ) > 1022 ) { G_LogPrintf( "trap_SendServerCommand( %d, ... ) length exceeds 1022.\n", clientNum ); G_LogPrintf( "text [%.950s]... truncated\n", text ); return; }
syscall( G_SEND_SERVER_COMMAND, clientNum, text ); }

Show index
Next bug: Backstab knife damage on wounded players exploit

Color coding

Sample = New code
Sample = Changed code (the new version is what is displayed)
Sample = Deleted code

©2017 Chruker