12.02.2014, 20:24
To fix the timeouts, make a script to "whitelist" players. All you need to do is keep sending SendRconCommand("unbanip x.x.x.x") every 150ms or so.
Don't whitelist everyone, though, as that would allow attackers to do their thing.
Edit: Proof-of-concept:
Don't whitelist everyone, though, as that would allow attackers to do their thing.
Edit: Proof-of-concept:
Code:
#include <a_samp> new g_FixTimeout[MAX_PLAYERS]; public OnFilterScriptInit() { SetTimer("TimeoutFix", 200, true); } public OnPlayerCommandText(playerid, cmdtext[]) { if (!IsPlayerAdmin(playerid)) { return 0; } if (!strcmp(cmdtext, "/fixtimeout ", _, 12)) { new pid = strval(cmdtext[12]); if (0 <= pid < MAX_PLAYERS) { g_FixTimeout[pid] = true; SendClientMessage(playerid, 0x00CC00FF, "> Player added to fix list"); } else { SendClientMessage(playerid, 0xC00000FF, "> Invalid ID"); } return 1; } return 0; } public OnPlayerDisconnect(playerid, reason) { g_FixTimeout[playerid] = false; return 1; } public TimeoutFix(); public TimeoutFix() { new tick = GetTickCount(); for (new i = 0; i < MAX_PLAYERS; i++) { if (!g_FixTimeout[i]) { continue; } new cmd[32]; GetPlayerIp(i, cmd, sizeof(cmd)); format(cmd, sizeof(cmd), "unbanip %s", cmd); SendRconCommand(cmd); } tick = GetTickCount() - tick; if (tick > 10) { printf("Warning: timeoutfix took %dms", GetTickCount() - tick); } }