Bug 3142 - cs_set_user_model gets Fatal Error: SZ_GetSpace: overflow...
cs_set_user_model gets Fatal Error: SZ_GetSpace: overflow...
Status: RESOLVED DUPLICATE of bug 3134
Product: AMX Mod X
Classification: Unclassified
Component: Addon: Counter-Strike
trunk
PC All
: P4 minor
Assigned To: amxmodx-bugs@alliedmods.net
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-08 16:05 PST by Barry J.
Modified: 2013-06-25 08:26 PDT (History)
5 users (show)

See Also:


Attachments

Description Barry J. 2008-02-08 16:05:10 PST
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> 
Comment 1 KWo 2008-03-30 13:08:32 PDT
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.
Comment 2 KWo 2008-04-03 00:56:16 PDT
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.
Comment 3 WiLS (MeRcyLeZZ) 2009-02-24 20:21:31 PST
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
Comment 4 Vincent Herbet [:Arkshine] 2013-06-25 08:26:58 PDT

*** This bug has been marked as a duplicate of bug 3134 ***

Note You need to log in before you can comment on or make changes to this bug.