Wildebeest Posted February 7, 2007 Share Posted February 7, 2007 MovieBattles recently experienced a wave of Q3fill server crashers. The two connections per IP limit did not stop the crash. We discovered that the invalid clients Q3Fill was creating were overrunning the bgForcePowerCost array in the BG_LegalizedForcePowers function. Here's the fix: In bg_misc.c, in the BG_LegalizedForcePowers function: usedPoints = 0; i = 0; while (i < NUM_FORCE_POWERS) { countDown = 0; countDown = final_Powers[i]; //The next block fixes the crash if(countDown > 3) { return -1; } //End of fix while (countDown > 0) { if(bgForcePowerCost[i][nClass][countDown] > 0) { usedPoints += bgForcePowerCost[i][nClass][countDown]; //[fp index][fp level] } The important thing here is the return. I used the -1 as a flag to drop the clients in w_force.c, but returning 0 also works. Hope no one else has to deal with these *****es. Link to comment Share on other sites More sharing options...
ensiform Posted February 7, 2007 Share Posted February 7, 2007 Thanks, for the fix. However, please move to Bugs thread. Edit: Technically you should be returning qfalse because the return type is qboolean even though it is an enum. Link to comment Share on other sites More sharing options...
dumbledore Posted February 24, 2007 Share Posted February 24, 2007 -1 is qtrue, not qfalse. Link to comment Share on other sites More sharing options...
ensiform Posted February 24, 2007 Share Posted February 24, 2007 well the function is supposed to return qfalse if it was originally bad, which in that case it is and not qtrue. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.