Author Topic: Web-based RCON client  (Read 7839 times)

Leezerz.com|A.D.M.I.N

  • PGP
  • Posts: 8
Re: Web-based RCON client
« Reply #20 on: November 05, 2007, 07:30:43 AM »
Well done, this script is very nice, thank you sk89q.

Probably someone know my project: leezerz.com. We want to build a huge DP-Community, there you can upload videos, can join groups and clans, chat via IRC or just connect to our teamspeakserver. But there is a 2nd big part of leezerz.com: We have got many DP-Servers and you rent them. To enable this, I have to edit your script, so that the players just can rent them, if nobody is on the server. My PHP-Skills are not very good, so I tried follow code, but it doenst work:


<?php

$test = ("pbConsole.send('listuserid')");

if strlen($test)== 0
{

$DMENU = array(
                'Console' => array(
                    array('Toggle log display', "pbConsole.showLog=!pbConsole.showLog;pbConsole.readjustWindow()"),
                    array('----', ""),
                    array('Close console', "window.close()"),
                    ),
                'Server' => array(
                    array('Game version', "pbConsole.send('version')"),
                    array('Server information', "pbConsole.send('serverinfo')"),
                    array('Send a heartbeat', "pbConsole.send('heartbeat')"),
                    array('Execute a config/script file...', "pbConsole.askSend('exec ', '', ['Script filename?'])"),
                    array('Set server list master servers...', "pbConsole.askSend('setmaster ', '', ['Space separated list of server hosts?'])"),
                    array('----', ""),
                    array('Get a variable...', "pbConsole.askSend('get ', '', ['Name of variable?'])"),
                    array('Set a variable...', "pbConsole.askSend('set ', '', ['Name of variable?', 'Value?'])"),
                    array('Clear a variable...', "pbConsole.askSend('sv cvar_clear ', '', ['Name of variable?'])"),
                    array('Reset server variables...', "pbConsole.send('!resetvars')"),
                    array('----', ""),
                    array('List maps in rotation', "pbConsole.send('sv maplist')"),
                    array('Add map to rotation...', "pbConsole.askSend('sv rotation add ', '', ['Map name?'])"),
                    array('Remove map from rotation...', "pbConsole.askSend('sv rotation remove ', '', ['Map name?'])"),
                    ),
                'Game' => array(
                    array('Change to a new map...', "pbConsole.askSend('sv newmap ', '', ['Map name?'])"),
                    array('Select random map from rotation', "pbConsole.send('!randommap')"),
                    array('----', ""),
                    array('Expert mode...', "pbConsole.send('sv expert');pbConsole.askSend('sv expert ', '', ['ID # for gun?'])"),
                    array('----', ""),
                    array('Shuffle teams randomly', "pbConsole.send('!shuffleteams')"),
                    array('Shuffle teams by kills', "pbConsole.send('!shuffleteams kills')"),
                    array('Shuffle teams by flag captures', "pbConsole.send('!shuffleteams caps')"),
                    array('----', ""),
                    array('Record a demo...', "pbConsole.askSend('serverrecord ', '', ['Name of demo?'])"),
                    array('End recording of demo', "pbConsole.send('serverstop')"),
                    ),
                'Users' => array(
                    array('Players information', "pbConsole.send('status')"),
                    array('List player IP information', "pbConsole.send('sv listuserip')"),
                    array('----', ""),
                    array('Dump player information...', "pbConsole.askSend('dumpuser ', '', ['User ID #?'])"),
                    array('Kick a player...', "pbConsole.askSend('kick ', '', ['User ID #?'])"),
                    array('----', ""),
                    array('Kick all players?', "pbConsole.confirmSend('!kickallplayers', 'Kick all players?')"),
                    array('Kick all players and bots?', "pbConsole.confirmSend('!kickallplayersbots', 'Kick all players and bots?')"),
                    array('----', ""),
                    array('Add an ACEBot', "pbConsole.send('sv addbot')"),
                    array('Add a custom named ACEBot...', "pbConsole.askSend('sv addbot ', '', ['Name of bot?'])"),
                    array('Remove a bot...', "pbConsole.askSend('sv removebot ', '', ['Name of bot?'])"),
                    array('Remove all bots', "pbConsole.send('sv removebot all')"),
                    array('Bot command...', "pbConsole.askSend('sv botcommand ', '', ['Command to execute?'])"),
                    array('Save nodes', "pbConsole.send('sv savenodes')"),
                    ),
                'Administration' => array(
                    array('Talk into game from console...', "pbConsole.askSend('say ', '', ['Message?'])"),
                    array('----', ""),
                    array('List banned IP addresses', "pbConsole.send('sv listip')"),
                    array('Add IP to ban list', "pbConsole.askSend('sv addip ', '', ['IP address/mask?'])"),
                    array('Save ban list to disk', "pbConsole.send('sv writeip')"),
                    array('----', ""),
                    array('Remove all temporary bans?', "pbConsole.confirmSend('sv removetbans', 'Remove temporary bans?')"),
                    array('----', ""),
                    array('Kill server?', "pbConsole.confirmSend('quit', 'Are you sure you wish to KILL THE SERVER?')"),
                    ),
               'Password and Login' => array(
                   array('----', ""),
                   array('Set the password', "pbConsole.askSend('password ', '', ['Password?'])"),
           array('Set the login', "pbConsole.askSend('oppass1 ', '', ['Login?'])"),
                   array('----', ""), 

                ); 
}
else
{

$DMENU = array(
                'Sorry, Server already in use!' => array( 'Nothing to use'
                   
                    ),
);


}
?>

Somewhere in this code are bugs, but i cant find them. Can  someone help me?
« Last Edit: November 05, 2007, 10:25:51 AM by Leezerz.com|A.D.M.I.N »

Sonny

  • 68 Carbine
  • Posts: 380
Re: Web-based RCON client
« Reply #21 on: November 05, 2007, 07:32:04 AM »
waddup partner

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Web-based RCON client
« Reply #22 on: November 05, 2007, 12:04:28 PM »
Code: [Select]
<?php

$test 
= ("pbConsole.send('listuserid')");

if( 
strlen($test)== 0)
{

$DMENU = array(
                
'Console' => array(
                    array(
'Toggle log display'"pbConsole.showLog=!pbConsole.showLog;pbConsole.readjustWindow()"),
                    array(
'----'""),
                    array(
'Close console'"window.close()"),
                    ),
                
'Server' => array(
                    array(
'Game version'"pbConsole.send('version')"),
                    array(
'Server information'"pbConsole.send('serverinfo')"),
                    array(
'Send a heartbeat'"pbConsole.send('heartbeat')"),
                    array(
'Execute a config/script file...'"pbConsole.askSend('exec ', '', ['Script filename?'])"),
                    array(
'Set server list master servers...'"pbConsole.askSend('setmaster ', '', ['Space separated list of server hosts?'])"),
                    array(
'----'""),
                    array(
'Get a variable...'"pbConsole.askSend('get ', '', ['Name of variable?'])"),
                    array(
'Set a variable...'"pbConsole.askSend('set ', '', ['Name of variable?', 'Value?'])"),
                    array(
'Clear a variable...'"pbConsole.askSend('sv cvar_clear ', '', ['Name of variable?'])"),
                    array(
'Reset server variables...'"pbConsole.send('!resetvars')"),
                    array(
'----'""),
                    array(
'List maps in rotation'"pbConsole.send('sv maplist')"),
                    array(
'Add map to rotation...'"pbConsole.askSend('sv rotation add ', '', ['Map name?'])"),
                    array(
'Remove map from rotation...'"pbConsole.askSend('sv rotation remove ', '', ['Map name?'])"),
                    ),
                
'Game' => array(
                    array(
'Change to a new map...'"pbConsole.askSend('sv newmap ', '', ['Map name?'])"),
                    array(
'Select random map from rotation'"pbConsole.send('!randommap')"),
                    array(
'----'""),
                    array(
'Expert mode...'"pbConsole.send('sv expert');pbConsole.askSend('sv expert ', '', ['ID # for gun?'])"),
                    array(
'----'""),
                    array(
'Shuffle teams randomly'"pbConsole.send('!shuffleteams')"),
                    array(
'Shuffle teams by kills'"pbConsole.send('!shuffleteams kills')"),
                    array(
'Shuffle teams by flag captures'"pbConsole.send('!shuffleteams caps')"),
                    array(
'----'""),
                    array(
'Record a demo...'"pbConsole.askSend('serverrecord ', '', ['Name of demo?'])"),
                    array(
'End recording of demo'"pbConsole.send('serverstop')"),
                    ),
                
'Users' => array(
                    array(
'Players information'"pbConsole.send('status')"),
                    array(
'List player IP information'"pbConsole.send('sv listuserip')"),
                    array(
'----'""),
                    array(
'Dump player information...'"pbConsole.askSend('dumpuser ', '', ['User ID #?'])"),
                    array(
'Kick a player...'"pbConsole.askSend('kick ', '', ['User ID #?'])"),
                    array(
'----'""),
                    array(
'Kick all players?'"pbConsole.confirmSend('!kickallplayers', 'Kick all players?')"),
                    array(
'Kick all players and bots?'"pbConsole.confirmSend('!kickallplayersbots', 'Kick all players and bots?')"),
                    array(
'----'""),
                    array(
'Add an ACEBot'"pbConsole.send('sv addbot')"),
                    array(
'Add a custom named ACEBot...'"pbConsole.askSend('sv addbot ', '', ['Name of bot?'])"),
                    array(
'Remove a bot...'"pbConsole.askSend('sv removebot ', '', ['Name of bot?'])"),
                    array(
'Remove all bots'"pbConsole.send('sv removebot all')"),
                    array(
'Bot command...'"pbConsole.askSend('sv botcommand ', '', ['Command to execute?'])"),
                    array(
'Save nodes'"pbConsole.send('sv savenodes')"),
                    ),
                
'Administration' => array(
                    array(
'Talk into game from console...'"pbConsole.askSend('say ', '', ['Message?'])"),
                    array(
'----'""),
                    array(
'List banned IP addresses'"pbConsole.send('sv listip')"),
                    array(
'Add IP to ban list'"pbConsole.askSend('sv addip ', '', ['IP address/mask?'])"),
                    array(
'Save ban list to disk'"pbConsole.send('sv writeip')"),
                    array(
'----'""),
                    array(
'Remove all temporary bans?'"pbConsole.confirmSend('sv removetbans', 'Remove temporary bans?')"),
                    array(
'----'""),
                    array(
'Kill server?'"pbConsole.confirmSend('quit', 'Are you sure you wish to KILL THE SERVER?')"),
                    ),
               
'Password and Login' => array(
                    array(
'----'""),
                    array(
'Set the password'"pbConsole.askSend('password ', '', ['Password?'])"),
                    array(
'Set the login'"pbConsole.askSend('oppass1 ', '', ['Login?'])"),
                    array(
'----'""), 
                    ),
                ); 
}
else
{

$DMENU = array(
                
'Sorry, Server already in use!' => array( 'Nothing to use'
                   
                    
),
);


}
?>

Leezerz.com|A.D.M.I.N

  • PGP
  • Posts: 8
Re: Web-based RCON client
« Reply #23 on: November 05, 2007, 12:50:03 PM »
Thank you


EDIT: Uh, I got again an error:

$test = ("pbConsole.send('listuserip')");

if( strlen($test)== 0)



$test is the same value all the time and it doesn´t matter, whether a player is on the server or not.
« Last Edit: November 05, 2007, 02:53:30 PM by Leezerz.com|A.D.M.I.N »

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Web-based RCON client
« Reply #24 on: November 05, 2007, 04:00:39 PM »
Err, what error?

$test would be the same value all the time because... you set it to a string.

"pbConsole.send('listuserip')" is JavaScript code, and it's not related to PHP at all. I think you might have to learn some more PHP before attempting this further...

KiLo

  • Autococker
  • Posts: 2086
Re: Web-based RCON client
« Reply #25 on: November 05, 2007, 04:31:55 PM »
Another option may be to get on IRC and have Xbain help you out to setup a !match command if he is willing to.

Leezerz.com|A.D.M.I.N

  • PGP
  • Posts: 8
Re: Web-based RCON client
« Reply #26 on: November 06, 2007, 07:33:21 AM »
does that mean, there isnt any way to set $test to the value of listuserip?

XtremeBain

  • Developer
  • Autococker
  • Posts: 1470
Re: Web-based RCON client
« Reply #27 on: November 06, 2007, 10:35:39 AM »
Another option may be to get on IRC and have Xbain help you out to setup a !match command if he is willing to.

My !match script is currently hosted on a server which may disappear this coming month.  I've been looking for an alternative host to place it, but I've been having trouble finding anyone with a dedicated server that allows IRC.

I would much rather get away from the Eggdrop and its TCL horridness.  I've been looking at autumn-leaves since it is a nice little IRC framework written in Ruby.  TCL has become so tedious that I'm usually doing anything that's almost difficult with PHP and reading the output to the bot. 

I've always preferred having people reserve the servers through IRC since it's easier to control access and detect abuse.  However with the ideas I've had (and MeMi has impemented) around a web-based script, I may decide to go with that.

Back on topic, using this web-based rcon script is a waste of time.  It does way more than what you need, and you're trying to use it for something other than what it was intended for.  You're better off hacking this code to meet your needs, even though it's for Q3, it's all the same.

magalhaes

  • Autococker
  • Posts: 1256
Re: Web-based RCON client
« Reply #28 on: November 06, 2007, 10:38:51 AM »
Another option may be to get on IRC and have Xbain help you out to setup a !match command if he is willing to.
They want to get more people to visit their website ;)

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Web-based RCON client
« Reply #29 on: November 06, 2007, 11:42:07 AM »
You're better off hacking this code to meet your needs, even though it's for Q3, it's all the same.

Or better, this: libdpserver

Leezerz.com|A.D.M.I.N

  • PGP
  • Posts: 8
Re: Web-based RCON client
« Reply #30 on: November 06, 2007, 11:48:17 AM »
My !match script is currently hosted on a server which may disappear this coming month.  I've been looking for an alternative host to place it, but I've been having trouble finding anyone with a dedicated server that allows IRC.


What requirements need IRC or your script? Probably we can help you.




Leezerz.com|A.D.M.I.N

  • PGP
  • Posts: 8
Re: Web-based RCON client
« Reply #31 on: November 06, 2007, 11:56:48 AM »
Or better, this: libdpserver

Thats looking just like a "serverviewer", but you can´t set the password or the login, can you?

EDIT: Sorry for the 2nd post, but I missed the right button...

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Web-based RCON client
« Reply #32 on: November 06, 2007, 12:24:34 PM »
Thats looking just like a "serverviewer", but you can´t set the password or the login, can you?

No... it's a library... a class... a software development kit... whatever you want to call it.

KiLo

  • Autococker
  • Posts: 2086
Re: Web-based RCON client
« Reply #33 on: November 06, 2007, 12:27:53 PM »
Leezerz: If you are in need of a RCON client get something like RCON Unlimited.

I think logins can only be set in the server.cfg buy I may be wrong.

Leezerz.com|A.D.M.I.N

  • PGP
  • Posts: 8
Re: Web-based RCON client
« Reply #34 on: November 06, 2007, 12:32:36 PM »
I need a web-based rcon-client.
An example: http://www.memi-clan.de/index.php?page=rent&lang=de

KiLo

  • Autococker
  • Posts: 2086
Re: Web-based RCON client
« Reply #35 on: November 06, 2007, 12:41:32 PM »
o_0 I wouldn't call that an RCON client exactly.

You may want to try to get in touch with Snipen from GT or Terrorist from OTB because they both run things similar to that.

T3RR0R15T

  • Map Committee
  • Autococker
  • Posts: 2593
Re: Web-based RCON client
« Reply #36 on: November 06, 2007, 12:49:47 PM »
Our system has a bug. We search for a good matchserver tool too.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Web-based RCON client
« Reply #37 on: November 06, 2007, 01:25:53 PM »
I am so not seeing the difficulty with making a match server tool. o.o With my class... it'd take < 20 minutes. Building an IRC bot in PHP... also takes < 20 minutes. o.o

I might be able to make one if I get some time today. What features do you need? What exactly (i.e. the commands) needs to be done? I'm not going to do the IRC bot though.

Leezerz.com|A.D.M.I.N

  • PGP
  • Posts: 8
Re: Web-based RCON client
« Reply #38 on: November 06, 2007, 01:36:13 PM »
changing password and login, what is all

( password, oppass1...)

XtremeBain

  • Developer
  • Autococker
  • Posts: 1470
Re: Web-based RCON client
« Reply #39 on: November 06, 2007, 01:57:41 PM »
I am so not seeing the difficulty with making a match server tool. o.o With my class... it'd take < 20 minutes. Building an IRC bot in PHP... also takes < 20 minutes. o.o

I might be able to make one if I get some time today. What features do you need? What exactly (i.e. the commands) needs to be done? I'm not going to do the IRC bot though.

You're selling out to the script kiddies ;)