fixed connecting again
This commit is contained in:
parent
7ff258df50
commit
80ba110c42
@ -253,6 +253,7 @@ public void OnMapStart()
|
|||||||
|
|
||||||
public void send_socket_msg(char[] query_msg, int len, int port)
|
public void send_socket_msg(char[] query_msg, int len, int port)
|
||||||
{
|
{
|
||||||
|
//LogMessage("query_msg: %s port: %i", query_msg, port);
|
||||||
if (global_socket != INVALID_HANDLE && SocketIsConnected(global_socket))
|
if (global_socket != INVALID_HANDLE && SocketIsConnected(global_socket))
|
||||||
SocketSendTo(global_socket, query_msg, len, "127.0.0.1", port); //udp
|
SocketSendTo(global_socket, query_msg, len, "127.0.0.1", port); //udp
|
||||||
}
|
}
|
||||||
@ -263,6 +264,10 @@ public Action bot_check_connect(Handle timer, any data)
|
|||||||
char msg[generic_length];
|
char msg[generic_length];
|
||||||
//PrintToChatAll("sending UDP message...");
|
//PrintToChatAll("sending UDP message...");
|
||||||
Format(msg, sizeof(msg), "connect to ze");
|
Format(msg, sizeof(msg), "connect to ze");
|
||||||
|
bool found_bot1 = false;
|
||||||
|
bool found_bot2 = false;
|
||||||
|
bool found_bot3 = false;
|
||||||
|
bool found_bot4 = false;
|
||||||
for (int i = 1; i <= MaxClients; i++)
|
for (int i = 1; i <= MaxClients; i++)
|
||||||
if (IsValidClient(i) && !IsFakeClient(i))
|
if (IsValidClient(i) && !IsFakeClient(i))
|
||||||
{
|
{
|
||||||
@ -275,25 +280,39 @@ public Action bot_check_connect(Handle timer, any data)
|
|||||||
}
|
}
|
||||||
else if (client_count < 50)
|
else if (client_count < 50)
|
||||||
{
|
{
|
||||||
char auth[50];
|
|
||||||
GetClientAuthId(i, AuthId_Engine, auth, sizeof(auth));
|
|
||||||
if (is_autism_bot1(i))
|
if (is_autism_bot1(i))
|
||||||
{
|
{
|
||||||
send_socket_msg(msg, strlen(msg), ports[0]);
|
found_bot1 = true;
|
||||||
}
|
}
|
||||||
if (is_autism_bot2(i))
|
if (is_autism_bot2(i))
|
||||||
{
|
{
|
||||||
send_socket_msg(msg, strlen(msg), ports[1]);
|
found_bot2 = true;
|
||||||
}
|
}
|
||||||
if (is_autism_bot3(i))
|
if (is_autism_bot3(i))
|
||||||
{
|
{
|
||||||
send_socket_msg(msg, strlen(msg), ports[2]);
|
found_bot3 = true;
|
||||||
}
|
}
|
||||||
if (is_autism_bot4(i))
|
if (is_autism_bot4(i))
|
||||||
{
|
{
|
||||||
send_socket_msg(msg, strlen(msg), ports[3]);
|
found_bot4 = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!found_bot1)
|
||||||
|
{
|
||||||
|
send_socket_msg(msg, strlen(msg), ports[0]);
|
||||||
|
}
|
||||||
|
if (!found_bot2)
|
||||||
|
{
|
||||||
|
send_socket_msg(msg, strlen(msg), ports[1]);
|
||||||
|
}
|
||||||
|
if (!found_bot3)
|
||||||
|
{
|
||||||
|
send_socket_msg(msg, strlen(msg), ports[2]);
|
||||||
|
}
|
||||||
|
if (!found_bot4)
|
||||||
|
{
|
||||||
|
send_socket_msg(msg, strlen(msg), ports[3]);
|
||||||
}
|
}
|
||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user