Yes, I already search the error and nothing to solve this found.
only people complaining about this or non-useful solutions.
There are two problems:
First crash I solved it by hooking Con_Printf on ReHLDS and kicking the player who committed that overflow more than 10 times.
Second crash I don't know how to discover what is causing it.
It seems be caused by so many HUDs / messages / information sending to clients. By that's all.
Plugins aren't sending an incorrect message or similar.
That's my plugin to solve first crash:
only people complaining about this or non-useful solutions.
There are two problems:
- Crash with SZ_GetSpace overflow on (Player Nick)
- Crash with SZ_GetSpace overflow on netchan -> message
First crash I solved it by hooking Con_Printf on ReHLDS and kicking the player who committed that overflow more than 10 times.
Second crash I don't know how to discover what is causing it.
It seems be caused by so many HUDs / messages / information sending to clients. By that's all.
Plugins aren't sending an incorrect message or similar.
That's my plugin to solve first crash:
Код:
#include <amxmodx>
#include <reapi>
new g_iWarns[33]
new Float:g_fLastWarn[33]
new g_LogNetchan
public plugin_init()
{
register_plugin("SZ_GetSpace Overflow fix", "0.1", "RauliTop")
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
// to avoid getting console message when server starts up
set_task(20.0, "enable_Con_Printf_hook")
}
public client_putinserver(id)
{
g_iWarns[id] = 0
g_fLastWarn[id] = 0.0
}
public event_new_round()
{
g_LogNetchan = 0
}
public enable_Con_Printf_hook()
{
RegisterHookChain(RH_Con_Printf, "RH_Con_Printf_Pre", 0);
}
public RH_Con_Printf_Pre(const string[])
{
// to be able log_amx without doing a loop crash
new iContain = contain(string, ".amxx")
if (iContain > -1)
return HC_CONTINUE;
iContain = contain(string, "SZ_GetSpace: overflow on ")
if(iContain == -1) {
return HC_CONTINUE;
}
const iLenOfPattern = 25 // length of "SZ_GetSpace: overflow on "
new szName[32]
copy(szName, charsmax(szName), string[iContain + iLenOfPattern])
replace_all(szName, charsmax(szName), "^n", "") // remove 'next line' from name string
new id = get_user_index(szName)
if (!id) // name = netchan->message
{
g_LogNetchan++
if (g_LogNetchan <= 3) // max 3 lines per round
log_to_file("overflow.log", "NOT FOUND overflow on %s", szName)
return HC_SUPERCEDE; // block show message at console
}
g_iWarns[id]++
log_to_file("overflow.log", "Warns: %d | overflow on %s", g_iWarns[id], szName)
new Float:LastTime = get_gametime()
if (g_iWarns[id] >= 10 && LastTime - g_fLastWarn[id] <= 1.5)
{
new iUserId = get_user_userid(id)
server_cmd("kick #%d ^"Unrealiable channel overflowed^"", iUserId)
log_to_file("overflow.log", "kicked %s", szName)
}
g_fLastWarn[id] = LastTime
return HC_SUPERCEDE; // block show message at console
}
Последнее редактирование: