moved a bunch of reconnecting logic over to sourcemod again and just simply give the bot more time for connecting than previous

This commit is contained in:
jenz
2026-05-17 13:43:28 +02:00
parent 44e5af3586
commit 783657d95b
2 changed files with 82 additions and 221 deletions
@@ -29,8 +29,6 @@ int g_WriteHead[MAXPLAYERS+1]; // where were writing next
int g_FrameCount[MAXPLAYERS+1]; // total frames captured
int g_DelayTicks = 128; // delay
int ports[7] = {48470, 48471, 48472, 48473, 48474, 48479, 48480}; //last three indexes are ports its sending udp from in plugin
int server_ports[2] = {27015, 27035}; //server ports: ze, ze2
@@ -66,7 +64,7 @@ public void OnPluginStart()
connect_socket();
chat_cooldown = false;
g_hTimer_bot_connect = CreateTimer(90.0, bot_check_connect, _, TIMER_REPEAT);
g_hTimer_bot_connect = CreateTimer(60.0, bot_check_connect, _, TIMER_REPEAT);
g_hTimer_pressing = CreateTimer(2.0, check_team, _, TIMER_REPEAT);
target_client[1] = -1;
@@ -95,6 +93,30 @@ public void OnPluginEnd()
}
}
public void OnMapEnd()
{
int autism_bot_counter = 0;
for (int i = 1; i <= MaxClients; i++)
{
if (IsValidClient(i) && specific_bot_player[i] != -1)
{
autism_bot_counter++;
}
}
for (int i = 1; i <= MaxClients; i++)
{
if (autism_bot_counter <= 1)
{
break;
}
if (IsValidClient(i) && specific_bot_player[i] != -1)
{
KickClient(i);
autism_bot_counter--;
}
}
}
public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float vel[3], const float angles[3], int weapon, int subtype, int cmdnum, int tickcount, int seed, const int mouse[2])
{
if (!IsValidClient(client) || IsFakeClient(client))