FakeClients: handle insta reconnect block differently

This commit is contained in:
dogan 2020-07-21 14:39:29 +02:00
parent 164a81d17c
commit c008c39a86

View File

@ -18,7 +18,6 @@ int g_iAdminFakes;
bool g_bCheckRequested; bool g_bCheckRequested;
int g_iBlockInstantFakeConnects;
bool g_bBlockInstantFakeConnects; bool g_bBlockInstantFakeConnects;
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
@ -48,7 +47,6 @@ public void OnPluginStart()
g_iAdminFakes = -1; g_iAdminFakes = -1;
g_bMapEnded = false; g_bMapEnded = false;
g_bBlockInstantFakeConnects = false; g_bBlockInstantFakeConnects = false;
g_iBlockInstantFakeConnects = 0;
CreateTimer(5.0, BlockInstantFakeConnects, _, TIMER_REPEAT); CreateTimer(5.0, BlockInstantFakeConnects, _, TIMER_REPEAT);
CreateTimer(3.0, RandomizePing, _, TIMER_REPEAT); CreateTimer(3.0, RandomizePing, _, TIMER_REPEAT);
CreateTimer(150.0, RandomizeNames, _, TIMER_REPEAT); CreateTimer(150.0, RandomizeNames, _, TIMER_REPEAT);
@ -106,8 +104,6 @@ public void OnMapStart()
g_bMapEnded = false; g_bMapEnded = false;
g_bBlockInstantFakeConnects = false; g_bBlockInstantFakeConnects = false;
g_iBlockInstantFakeConnects = 0;
CreateTimer(5.0, BlockInstantFakeConnects, _, TIMER_REPEAT);
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
@ -124,13 +120,9 @@ public void OnMapEnd()
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public Action BlockInstantFakeConnects(Handle timer) public Action BlockInstantFakeConnects(Handle timer)
{ {
g_iBlockInstantFakeConnects++;
g_bBlockInstantFakeConnects = false; g_bBlockInstantFakeConnects = false;
RequestFrame(CheckPopulation); RequestFrame(CheckPopulation);
if(g_iBlockInstantFakeConnects > 5)
return Plugin_Stop;
return Plugin_Continue; return Plugin_Continue;
} }
@ -229,12 +221,6 @@ public Action Command_DebugFakes(int client, int argc)
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public Action Command_SetFakes(int client, int argc) public Action Command_SetFakes(int client, int argc)
{ {
if(g_iBlockInstantFakeConnects <= 6)
{
ReplyToCommand(client, "[SM] Not available right now, because the Plugin is still loading. Try again in couple seconds.");
return Plugin_Handled;
}
if (argc < 1) if (argc < 1)
{ {
ReplyToCommand(client, "[SM] Usage: sm_setfakes <amount of fakes>"); ReplyToCommand(client, "[SM] Usage: sm_setfakes <amount of fakes>");
@ -434,7 +420,7 @@ public void CheckPopulation()
//CS_SetClientClanTag(iIndex, "UNLOZE"); //CS_SetClientClanTag(iIndex, "UNLOZE");
iFakes++; iFakes++;
if(g_iBlockInstantFakeConnects <= 6 && g_iAdminFakes == -1) if(g_iAdminFakes == -1)
g_bBlockInstantFakeConnects = true; g_bBlockInstantFakeConnects = true;
} }