Jump to content

Home

oversided server commands...


ensiform

Recommended Posts

since the board rolled back b4 this post was made ill post again, and its changed a bit better since then:

 

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 );
}

Link to comment
Share on other sites

  • 4 weeks later...

confirmed... you need something like this also at the top of G_Say:

 

	if (strlen(chatText) > MAX_SAY_TEXT) {
	G_LogPrintf( "G_Say( cl:%d ) length exceeds 150.\n", ent->client->ps.clientNum );
	return;
}

 

this will fix the chat exceeding bug where it causes server to crash. what i posted above (in the first post) the q3msgboom.cfg, etc seemed immune to it. but this stops it.

 

Update: use this in G_Say but remove the trunc line in the top post:

 

G_LogPrintf( "text [%.950s]... truncated\n", text ); return;

 

thats not needed, because it causes lag.

 

 

mmm theres still lag sometimes :S

 

so... in g_syscalls there is:

 

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( "trap_SendServerCommand( %d, ... ) length exceeds 1022.\n", clientNum );
}
syscall( G_SEND_SERVER_COMMAND, clientNum, text );
}

 

then in G_Say:

	if (strlen(chatText) > MAX_SAY_TEXT) {
	G_LogPrintf( "G_Say( cl:%d ) length exceeds 150.\n", ent->client->ps.clientNum );
	return;
}

 

 

but the console basically shows 3 lines of the g_syscall warning.

 

  2:13 G_Say( cl:2 ) length exceeds 150.
 2:13 trap_SendServerCommand( 2, ... ) length exceeds 1022.
 2:13 trap_SendServerCommand( 2, ... ) length exceeds 1022.
 2:13 trap_SendServerCommand( 2, ... ) length exceeds 1022.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...