Raised This Month: $ Target: $400
 0% 

PHP RCON


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 11-03-2014 , 17:26   PHP RCON
Reply With Quote #1

Ciao guys,

I searched for an easy way, how to send rcon command to my server via php and I ended up using this php class from SourceBans.

SNIPPET:
PHP Code:
<?php
require_once("ServerRcon.php");

define('SERVER_IP''127.0.0.1');
define('SERVER_PORT''27015');
define('SERVER_RCON''rconpassword');

/* ----- */

$rcon = new ServerRcon(SERVER_IPSERVER_PORTSERVER_RCON);

if (!
$rcon->auth()) {
    exit(
"fail");
}

echo 
nl2br($rcon->execute("status"));
?>
Cheers! :-)

Last edited by KissLick; 11-18-2014 at 09:21.
KissLick is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 11-13-2014 , 06:47   Re: PHP RCON
Reply With Quote #2

Source Query Class from xPaw it's pretty simple. https://github.com/xPaw/PHP-Source-Q...conExample.php
__________________
PM for help = ignore

Last edited by guipatinador; 11-13-2014 at 06:47.
guipatinador is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 11-17-2014 , 01:43   Re: PHP RCON
Reply With Quote #3

http://www.ruckman.net./downloads-1
eric0279 is offline
zakke221298
New Member
Join Date: Jan 2015
Old 01-26-2015 , 14:24   Re: PHP RCON
Reply With Quote #4

The ruckman and Source Query Class from xPaw is not working ??
zakke221298 is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 01-27-2015 , 06:06   Re: PHP RCON
Reply With Quote #5

work 100%
eric0279 is offline
zakke221298
New Member
Join Date: Jan 2015
Old 01-28-2015 , 13:50   Re: PHP RCON
Reply With Quote #6

How can i edit Source Query Class so it can get ip, port and rcon from mysql ?
zakke221298 is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-28-2015 , 14:27   Re: PHP RCON
Reply With Quote #7

Quote:
Originally Posted by zakke221298 View Post
How can i edit Source Query Class so it can get ip, port and rcon from mysql ?
OR

You can just fetch those in a php file you write then pass them to SourceQuery without editting it.
__________________
WildCard65 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode