27.01.2012, 15:04
Is there anyway to see if the RCON connection was successfull or not.. using: https://sampwiki.blast.hk/wiki/Query_Mechanism/Csharp ?
Dunno if right section for this :P
Dunno if right section for this :P
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public RCONQuery(string IP, int port, string password)
{
qSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
qSocket.SendTimeout = 5000;
qSocket.ReceiveTimeout = 5000;
try
{
//Successful connect, we've resolved the address to a host.
address = Dns.GetHostAddresses(IP)[0];
}
catch
{
/*
There was an exception with resolving the address,
therefore it didn't connect properly and there was an error.
*/
//...
}
_port = port;
_password = password;
}