AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   Reduce 'SZ_GetSpace overflow on (Nick)' (https://forums.alliedmods.net/showthread.php?t=334122)

baneado 08-30-2021 06:39

Reduce 'SZ_GetSpace overflow on (Nick)'
 
This error appears at server console when player reliable channel is overflowed.

I have noticed that this happens in two different situations:
  1. Player loses connection or crashed and all data packets start to accumulate
  2. Server is sending too much data for him

That can't be fixed at all, because depends on player network.
But we can reduce the overflow on player.

First step. Configure your 'sv_timeout' cvar.
Code:

sv_timeout - Controls how long before the server disconnects a client that has stopped responding.
This isn't applied when player is AFK, only when client game doesn't receive any data packet.

Default value is 60 seconds, sooo many seconds.
I'm using right now 20 seconds and all works fine. But this can be reduced to 15 or 10 seconds.
Be careful about players that lose connection for some seconds.

Second step. Check your plugins
Plugins sending too many reliable messages like show_hudmessage, ShowSyncHud, show_dhudmessage, client_print, etc.
Try to reduce the calls.

I will expose one EXAMPLE.

In my case, I had problems with one plugin doing like this:
PHP Code:

new g_MsgSync

public plugin_init()
{
    
register_event("Damage""event_damage""b""2!0""3=0""4!0")
    
g_MsgSync CreateHudSyncObj()
}

public 
event_damage(id)
{
    static 
attackerattacker get_user_attacker(id)
    static 
damagedamage read_data(2)

    
set_hudmessage(255000.450.5020.12.00.10.1, -1)
    
ShowSyncHudMsg(idg_MsgSync"%i"damage)


Imagine: one player with 30k health and 20 players shooting him.
Every player doing damage is a new HUD shown. Many many calls.

This can produce player that receives damage being overflowed.

How to fix? Well, maybe trying to reduce the HUD calls.
Idea: Only show a new HUD if damage is higher or X seconds passed:
PHP Code:

new g_MsgSync
new Float:g_fLastDmgShowed[33]
new 
g_iLastDamageVic[33]

public 
plugin_init()
{
    
register_event("Damage""event_damage""b""2!0""3=0""4!0")
    
g_MsgSync CreateHudSyncObj()
}

public 
event_damage(id)
{
    static 
attackerattacker get_user_attacker(id)
    static 
damagedamage read_data(2)

    
// To prevent sending too much HUDs to victims
    
static Float:gametimegametime get_gametime()
    if (
damage g_iLastDamageVic[id] || gametime g_fLastDmgShowed[id] >= 1.0)
    {
        
set_hudmessage(255000.450.5020.12.00.10.1, -1)
        
ShowSyncHudMsg(idg_MsgSync"%i"damage)

        
g_fLastDmgShowed[id] = gametime
        g_iLastDamageVic
[id] = damage
    
}



Celena Luna 09-05-2021 22:26

Re: Reduce 'SZ_GetSpace overflow on (Nick)'
 
Usually, my players got overflowed after the New Round started (right at the Freeze Time after the previous round ended)
I also used the "Damage Display" whenever player deal damage but they was never got overflowed.
I don't think Hud is the main offender here.

PHP Code:

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage_Post"1);
    
RegisterHam(Ham_TakeDamage"func_breakable""fw_TakeDamage_Post"1);
}

public 
fw_TakeDamage_Post(EntinflictorattackerFloat:damagedamagebits)
{
    if(!
is_user_alive(attacker))
        return 

    
set_hudmessage(255000.450.5020.12.00.10.11//Sorry, borrow this
    
show_hudmessage(attacker"%i"floatround(damage));


I usually force Damage Display to 1 channel (it is 1 in my example) so it will always replace to the same channel, preventing other hud from flashing because it got overrided by damage hud.

Edit: oh wait, that was "Reliable channel overflow" which is another problem. But still, I used damage display but there ain't any overflow happened.

baneado 09-07-2021 11:20

Re: Reduce 'SZ_GetSpace overflow on (Nick)'
 
It's not the same attacker than victim.

One victim can have a lot of attackers at the same time.
Read the example I've posted:
Code:

Imagine: one player with 30k health and 20 players shooting him.
Every player doing damage is a new HUD shown. Many many calls.

Anyways, I recommend you to 'optimize' that hud too

Celena Luna 09-07-2021 22:38

Re: Reduce 'SZ_GetSpace overflow on (Nick)'
 
I guess showing damage to victim could cause this error since it a lot more than only show to attacker...

But still, it is only one offender for this error.

P/S: Yeah, I could optimized that. But it doesn't cause any issue (to me at least) so I didn't mind keep it that way

baneado 09-08-2021 18:23

Re: Reduce 'SZ_GetSpace overflow on (Nick)'
 
Quote:

Originally Posted by Celena Luna (Post 2757223)
I guess showing damage to victim could cause this error since it a lot more than only show to attacker...

But still, it is only one offender for this error.

P/S: Yeah, I could optimized that. But it doesn't cause any issue (to me at least) so I didn't mind keep it that way

See your logs searching 'overflow'

For me it wasn't causing any error, but for other players yes.
Depends on player's network


All times are GMT -4. The time now is 00:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.