IVAN NEDORN
Участник
- Сообщения
- 5
- Реакции
- 2
Всем привет! Раньше, года 2 назад использовал плагин Join Info v1.2 но он уже не работает, так как на сайте, где получается инфа были изменения
Пробовал ставить /ip-address-tracker.php?lookup=%s не работает) Подскажите пожалуйста, как исправить
#pragma semicolon 1
#include <sourcemod>
#include <socket>
public Plugin:myinfo =
{
name = "Join Info",
author = "wS (World-Source.Ru)",
version = "1.2",
};
new String:g_IP[MAXPLAYERS + 1][25];
public OnClientPutInServer(client)
{
if (IsFakeClient(client) || !GetClientIP(client, g_IP[client], 25))
return;
new Handle:socket = SocketCreate(SOCKET_TCP, OnSocketError);
SocketSetArg(socket, GetClientUserId(client));
SocketConnect(socket, OnSocketConnected, OnSocketReceive, OnSocketDisconnected, "www.ipaddresslocation.org", 80);
}
public OnSocketConnected(Handle:socket, any:id)
{
new client = GetClientOfUserId(id);
if (client < 1)
return;
decl String:info[150];
Format(info, 150, "GET /ip-address-locator.php?lookup=%s HTTP/1.0\r\nHost: www.ipaddresslocation.org\r\nConnection: close\r\n\r\n", g_IP[client]);
SocketSend(socket, info);
}
public OnSocketReceive(Handle:socket, String:receiveData[], const dataSize, any:id)
{
new position = StrContains(receiveData, "IP Location: ", false);
if (position < 1)
return;
decl String:info[2][65];
if (ExplodeString(receiveData[position + 13], " ", info, 2, 65) > 1)
{
CloseHandle(socket);
decl client;
if ((client = GetClientOfUserId(id)) < 1)
return;
decl String:steamid[30];
if (!GetClientAuthString(client, steamid, 30)) strcopy(steamid, 30, "steamid: -");
TrimString(info[1]); TrimString(info[0]);
PrintToChatAll("\x01\x04********************\n%N\n%s, %s\n%s (%s)\nId: %d, Index: %d", client, steamid, g_IP[client], info[1], info[0], id, client);
}
}
public OnSocketDisconnected(Handle:socket, any:id)
{
CloseHandle(socket);
}
public OnSocketError(Handle:socket, const errorType, const errorNum, any:id)
{
CloseHandle(socket);
LogError("socket error %d (errno %d)", errorType, errorNum);
}
#include <sourcemod>
#include <socket>
public Plugin:myinfo =
{
name = "Join Info",
author = "wS (World-Source.Ru)",
version = "1.2",
};
new String:g_IP[MAXPLAYERS + 1][25];
public OnClientPutInServer(client)
{
if (IsFakeClient(client) || !GetClientIP(client, g_IP[client], 25))
return;
new Handle:socket = SocketCreate(SOCKET_TCP, OnSocketError);
SocketSetArg(socket, GetClientUserId(client));
SocketConnect(socket, OnSocketConnected, OnSocketReceive, OnSocketDisconnected, "www.ipaddresslocation.org", 80);
}
public OnSocketConnected(Handle:socket, any:id)
{
new client = GetClientOfUserId(id);
if (client < 1)
return;
decl String:info[150];
Format(info, 150, "GET /ip-address-locator.php?lookup=%s HTTP/1.0\r\nHost: www.ipaddresslocation.org\r\nConnection: close\r\n\r\n", g_IP[client]);
SocketSend(socket, info);
}
public OnSocketReceive(Handle:socket, String:receiveData[], const dataSize, any:id)
{
new position = StrContains(receiveData, "IP Location: ", false);
if (position < 1)
return;
decl String:info[2][65];
if (ExplodeString(receiveData[position + 13], " ", info, 2, 65) > 1)
{
CloseHandle(socket);
decl client;
if ((client = GetClientOfUserId(id)) < 1)
return;
decl String:steamid[30];
if (!GetClientAuthString(client, steamid, 30)) strcopy(steamid, 30, "steamid: -");
TrimString(info[1]); TrimString(info[0]);
PrintToChatAll("\x01\x04********************\n%N\n%s, %s\n%s (%s)\nId: %d, Index: %d", client, steamid, g_IP[client], info[1], info[0], id, client);
}
}
public OnSocketDisconnected(Handle:socket, any:id)
{
CloseHandle(socket);
}
public OnSocketError(Handle:socket, const errorType, const errorNum, any:id)
{
CloseHandle(socket);
LogError("socket error %d (errno %d)", errorType, errorNum);
}
Пробовал ставить /ip-address-tracker.php?lookup=%s не работает) Подскажите пожалуйста, как исправить