SA-MP Forums Archive
Is there any way to - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Is there any way to (/showthread.php?tid=313801)



Is there any way to - iTorran - 27.01.2012

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


Re: Is there any way to - iTorran - 28.01.2012

Bump ^^


Re: Is there any way to - Scenario - 28.01.2012

...

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}
By the way, the rules have changed. You now need to wait 48 hours before bumping your thread!


Re: Is there any way to - jamesbond007 - 28.01.2012

yea.. why do shit ?

just use if(!success)

and look on wiki for more examples


Re: Is there any way to - blewert - 28.01.2012

Never used sockets in C# before, but I assume you can detect failure in the contructor of the RCONQuery and Query classes, when the application throws a SocketException:

PHP код:
public RCONQuery(string IPint portstring password)
{
    
qSocket = new Socket(AddressFamily.InterNetworkSocketType.DgramProtocolType.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;

Either that, or check up on Socket.Connected.


Re: Is there any way to - iTorran - 29.01.2012

This is for C# not PAWN, which is why i was unsure about the section

@blewert, thanks i'll try.

And woops didnt know about the 48 hour rule now