Problem(error/warning): Provjera da li igrac koristi moj launcer
public onSocketRemoteConnect( Socket:id, remote_client[], remote_clientid )
{
new ip[24];
get_remote_client_ip(socket, remote_clientid, ip);
printf("Konekcija %s, %d", ip, remote_clientid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
printf("%d napustio", GetPVarInt(playerid, "KoristiLauncher"));
socket_close_remote_client(socket, GetPVarInt(playerid, "KoristiLauncher"));
return 1;
}
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid, "KoristiLauncher", -1);
new plrIP[24];
new ip[24];
new s[64];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
for(new i = 0; i < SOCKET_MAX_CONNECTIONS; i++)
{
get_remote_client_ip(socket, i, ip);
if(strcmp(plrIP,ip, true) == 0)
{
SetPVarInt(playerid, "KoristiLauncher", i);
break;
}
}
if(GetPVarInt(playerid, "KoristiLauncher") == -1)
{
SendClientMessage(0, -1,"Greska...");
}
else if(GetPVarInt(playerid, "KoristiLauncher") != -1)
{
SendClientMessage(0, -1,"Konektovan...");
format(s, 64,"Klijent %d", GetPVarInt(playerid,"KoristiLauncher"));
SendClientMessage(0, -1, s);
}
return 1;
}
Sa ovim kodom radi provjeri IP igraca i IP adrese koje socket klijenti povezani
Da li je ovakva provjera ispravna ili ne?
Dio skripte: [ pawn ]vaš odgovor[ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): /---/
Slika/video ingame problema(obavezno ako je ingame problem): /---/