General > Developers Corner

RCON Help!

(1/2) > >>

Samg381:
Hello,
I am having some difficulty with an RCON Command that is being sent from my website
through an auto donate PHP code. Once you have donated, it sends the RCOn command
like this:


  define( 'SQ_SERVER_ADDR', 'xx.xxx.xxx.xx' );
    define( 'SQ_SERVER_PORT', 27015 );
    define( 'SQ_TIMEOUT',     1 );
    define( 'SQ_ENGINE',      SourceQuery :: SOURCE );
    // Edit this <-
    
    $Query = new SourceQuery( );
    
    try
    {
        $Query->Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE );
        $Query->SetRconPassword( 'xxxxxxxx' );
        $Query->Rcon ( 'say A donation has been received from SteamID: '.$steamid.'. Donation amount: '.$amount.'$.' );
        $Query->Rcon ( 'ulx adduserid '.$steamid.' donator' );



But, for some reason whenever I test it, I get this error when the RCON runs:


--- Code: ---Can't connect to RCON server: Connection timed out
--- End code ---


The webserver connects fine with PayPal, and I can ping it and what not, and all of the required ports are open on my gameserver.


Please help!
This is realtime!




www.samg381.com/donate.php

JamminR:
Should the SQ_SERVER_PORT variable definition, and perhaps timeout also be in ' ' ?
Been long time since I tinkered with PHP (~10 years), but looking at the definitions, it seemed off.

Samg381:
That's what I thought! Can you tell me what I should change?

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given

[0] Board index

Go to full version