andreixd23 / zombiereloaded

Automatically exported from code.google.com/p/zombiereloaded
0 stars 0 forks source link

Server crash during intermission time (respawn loop) #231

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
On maps that end with a nuke to kill all players (most escape maps), clients 
will continually respawn and die during intermission time. If there are enough 
players on the server, and the intermission is long enough, this loop results 
in a server crash.

For reference: Intermission time in CS:S is at the end of the map when the 
scoreboard is shown. The length of this time is controlled with the 
"mp_chattime" cvar.

A quick fix that I applied to my server: http://ampaste.net/f5c7d44b9

Original issue reported on code.google.com by aangi...@gmail.com on 18 Sep 2010 at 6:20

GoogleCodeExporter commented 8 years ago
Thank you.

The respawn module does hook the round_end event and stop respawn timers from 
spawning players at that time. Though we haven't tested this with very short 
respawn times in maps with AFK-killers that end up in a fast respawn loop.

Although the respawn loop issue itself is caused by the AFK-killers/nuke on 
escape maps and respawn should be blocked on round end, there still might be a 
glitch. We need to test and confirm this.

I'll paste your quick fix here in case the link will be broken some time:
#pragma semicolon 1

#include <sourcemod>

#define PLUGIN_VERSION "1.0.0"

public Plugin:myinfo =
{
        name = "ZR Respawn Fix",
        author = "GoD-Tony",
        description = "Prevents players from respawning during intermission",
        version = PLUGIN_VERSION,
        url = "http://www.sourcemod.net/"
};

public OnPluginStart()
{
        HookEvent("cs_win_panel_match", Event_CSWinPanelMatch, EventHookMode_PostNoCopy);
}

public Event_CSWinPanelMatch(Handle:event, const String:name[], 
bool:dontBroadcast)
{
        new Handle:cvar_respawn = FindConVar("zr_respawn");
        new Handle:cvar_zspawn = FindConVar("zr_zspawn");

        if (cvar_respawn != INVALID_HANDLE)
                SetConVarBool(cvar_respawn, false);

        if (cvar_zspawn != INVALID_HANDLE)
                SetConVarBool(cvar_zspawn, false);
}

Original comment by richard.helgeby@gmail.com on 21 Sep 2010 at 2:04