Bugzilla – Bug 3142
cs_set_user_model gets Fatal Error: SZ_GetSpace: overflow...
Last modified: 2013-06-25 08:26:58 PDT
I get this error below playing with 21+ pod bots with the code below. Does anyone know what's wrong? Or is it the bots... <code>Fatal Error: SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Reliable Datagram</code> <code>#include <amxmodx> #include <cstrike> #define PLUGIN "handle models" #define AUTHOR "Unknown" #define VERSION "1.0" new g_playermodel[33] new const g_models[9][] = { "urban", "terror", "leet", "arctic", "gsg9", "gign", "sas", "guerilla", "vip" } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("ResetHUD", "event_resethud", "be") } public client_authorized(id) g_playermodel[id] = random_num(0, 8) public event_resethud(id) cs_set_user_model(id, g_models[g_playermodel[id]])</code> Or <code>#include <amxmodx> #include <fakemeta> #define PLUGIN "handle models" #define AUTHOR "Unknown" #define VERSION "1.0" new g_playermodel[33] new const g_models[9][] = { "urban", "terror", "leet", "arctic", "gsg9", "gign", "sas", "guerilla", "vip" } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_forward(FM_PlayerPostThink, "fwd_playerpostthink") register_forward(FM_ClientUserInfoChanged, "fwd_clientuserinfochanged") } public client_authorized(id) g_playermodel[id] = random_num(0, 8) public fwd_clientuserinfochanged(id, infobuffer) { static buffer[32] engfunc(EngFunc_InfoKeyValue, infobuffer, "model", buffer, 31) static i for(i = 0; i < 9; i++) if(equal(buffer, g_models[i])) return FMRES_SUPERCEDE return FMRES_IGNORED } public fwd_playerpostthink(id) { static buffer buffer = engfunc(EngFunc_GetInfoKeyBuffer, id) engfunc(EngFunc_SetClientKeyValue, id, buffer, "model", g_models[g_playermodel[id]]) return FMRES_IGNORED }</code>
I'm confirming the bug. I was about to write my own bug report, but since this is the known problem I can only say what I experienced my self... ChickenMod Rebirth, Playermodel (by commonbullet), Zombie Me - all of these plugins are having the same issue - whenever I'm using 31 bots and me on the server (sometimes it happens even with 16 bots), when I change the model of everybody - during the change everything seems to be yet OK. But next respawn - on the ResetHud event - when CS is reseting the model of the players to the original one and AMX X is changing it to the custom one, I'm getting the message with "FSB_ALLOWOVERFLOW"... What I can say additionally is this - I have tested about 5 days ago amx_chicken plugin with AMX 2006.3. I did the same tests with 32 bots and the server never crashed. VEXDUM is changing the player's model the right way. I was looking into the code of VEXDUM and there is a small difference in the code between this what is used in cstrike module of AMX X - VEXDUM is checking if the amount of players they need to be transformed is above some constant value 14, then is adding some random small delays in changing the models of the players. I believe this is the cause (AMX X doesn't have that) why it's crashing.
Addiditional info - I did also tests with RealBot and JoeBot (they are different ones than all podbot clones). The server got crashed, too, with them (more than 28 bots on the server and round restart). The only bot with the server was working normally (without crashing at round start when using custom models for all players) it was CZERO bot, but that one has the direct access to the game engine and it is not a metamod plugin.
I can confirm this crash happening whenever any kind of set_user_info() code is executed for lots of players at once. It would seem that the code triggers a lot of MSG_ALL messages at the same time, causing a reliable datagram overflow. As Kwo suggested, a good workaround would be to add delays for subsequent executions. -MeRcyLeZZ
*** This bug has been marked as a duplicate of bug 3134 ***