Digital Paint Discussion Board

Paintball 2: The Game => Paintball 2 Discussion => Topic started by: sk89q on July 11, 2007, 04:45:47 PM

Title: Web-based RCON client
Post by: sk89q on July 11, 2007, 04:45:47 PM
(http://img337.imageshack.us/img337/2523/pbserverconsoleke3.png)

I am very gradually working on this. It's web-based and so it requires a web server to run on, but it means that you can access it from anywhere. This is version two, since I've been using an older thing I made a while ago to manage my server (from the web).

The color coded log only appears if it's running on the same server and the log file can be accessed, though alternative ways ("drivers") can be made to get the log some other way. Passwords are censored (to the best ability of my script) as they show too.

If anyone has any ideas or comments, feel free to say anything. I'm also curious if anyone would find it even useful, since there's ASE's RCON client (and others) already.
Title: Re: Web-based RCON client
Post by: Eiii on July 11, 2007, 04:49:06 PM
This looks great. A web-based remote rcon client would be incredibly useful for server admins.
Title: Re: Web-based RCON client
Post by: b00nlander on July 11, 2007, 04:56:54 PM
ASE is not very handy, so yours seems to be nice.  I'm using "Rcon Unlimited" for 2 years now, and would only switch to yours if you could include stuff like timebased/event based execution of commands, but I bet for many server admins, your tool could come in handy. nice job there.
Title: Re: Web-based RCON client
Post by: PiCaSSo on July 11, 2007, 05:12:51 PM
ASE is not very handy, so yours seems to be nice.  I'm using "Rcon Unlimited" for 2 years now, and would only switch to yours if you could include stuff like timebased/event based execution of commands, but I bet for many server admins, your tool could come in handy. nice job there.

Same :)
Title: Re: Web-based RCON client
Post by: sk89q on July 11, 2007, 07:25:06 PM
Well, time-based/event/delayed command execution seems to be something more fit for an actual program, but in the mean time, what are some uses you have in mind for a time-based/event/delayed command execution function?

I might make an actual RCON program for Paintball actually, since a web-based client does have its limitations.
Title: Re: Web-based RCON client
Post by: jitspoe on July 11, 2007, 11:00:09 PM
Looks cool.  If you decide to make a standalone program, you might consider building it into the standalone server browser.  A few people have requested that.  Though it may be simpler/cleaner to have a separate program that can be launched from the server browser, I don't know.  Source should be attached near the end of the thread: http://dplogin.com/forums/index.php?topic=1683.0
Title: Re: Web-based RCON client
Post by: b00nlander on July 12, 2007, 01:44:22 AM
time-based:  advertisement?
event-based:  for example, execute a config when the last person quits the server
Title: Re: Web-based RCON client
Post by: sk89q on July 14, 2007, 10:51:44 PM
It's been too long since I've worked with C++. If I had more time, maybe I'd work on it (I would prefer it written in C++ over .NET and, diety forbid, Java).

As for the time-based/event-based stuff, I recall myself trying that once, but I wrote it PHP since it was really quick to make. I probably couldn't find it anymore if I tried but I sure could redo it. Would you mind if it were in PHP?

And for the RCON client, the menus are semi-customizable and custom commands are implemented (!yourcommandhere). Just a little more work and it should be in releasable beta.

By the way, is it possible to do forcejoin (or whatever it's called) via RCON? I failed to get it to work, and with the sv prefix too. I was trying to make a "shuffle teams" feature.

And is cprint possible via RCON (I assume not, from what I remember looking at the game's source)?
Title: Re: Web-based RCON client
Post by: b00nlander on July 15, 2007, 06:25:18 AM
there's no cprint via RCON, dunno about the forcejoin part.  jitspoe is gone for another week or so.
Title: Re: Web-based RCON client
Post by: jitspoe on July 24, 2007, 02:48:30 PM
I don't think either are available through rcon.
Title: Re: Web-based RCON client
Post by: Fyre on July 24, 2007, 08:06:17 PM
Looks very nice. Everyone has a web browser, whereas not every has ASE, so this could be used by all server admins. Good job.
Title: Re: Web-based RCON client
Post by: QueeNiE on July 25, 2007, 11:37:34 AM
That looks amazing.  I was wondering if you, or possibly anyone else here could direct me to a list of all the rcon commands?
Title: Re: Web-based RCON client
Post by: sk89q on July 25, 2007, 05:55:41 PM
Here's a copy of my program: PBServerConsole 1.0
http://digitalpaint.therisenrealm.com/downloads/pbsc/pbsc_1_0.zip

I've been busy lately and haven't had too much time on this, though the only thing left really is the documentation. Read README.txt for installation information.

For RCON commands, I don't think there's a list anywhere. A lot of regular commands work though, and some will work if you prefix it with sv. I have a reference of commands and variables here:
http://digitalpaint.therisenrealm.com/reference/commands
Title: Re: Web-based RCON client
Post by: jitspoe on July 26, 2007, 03:59:52 PM
rcon just stands for remote console, so any server console command will work.  The client/game commands, however won't (things like join, dropgun, etc., as well as some of the login admin commands).  Some of the commands work with the sv prefix, though, as sk89q said.
Title: Re: Web-based RCON client
Post by: T3RR0R15T on July 28, 2007, 07:03:10 PM
Code: [Select]
An error has occurred:
Specified profile does not exist.

I must change something with "global registers = off" ?
Title: Re: Web-based RCON client
Post by: sk89q on August 11, 2007, 03:19:15 AM
I've been away/unavailable, but anyway... time to resurrect a thread.

It should work whether register_globals is on or off. I just tested it on both configurations.

What did you put in your servers.php file, without the passwords and sensitive information of course?
Title: Re: Web-based RCON client
Post by: T3RR0R15T on August 11, 2007, 10:40:50 AM
I tested it with and without any password and with the examples. The message is always the same.
Title: Re: Web-based RCON client
Post by: KnacK on August 11, 2007, 02:34:10 PM
Looks like your zip file is now corrupt.
Title: Re: Web-based RCON client
Post by: y00tz on August 11, 2007, 05:42:04 PM
Looks like your zip file is now corrupt.

http://digitalpaint.therisenrealm.com/downloads/pbsc/pbsc_1_0.zip ?


Title: Re: Web-based RCON client
Post by: KnacK on August 11, 2007, 08:30:35 PM
hmmm
n/m it works now.
Title: Re: Web-based RCON client
Post by: Leezerz.com|A.D.M.I.N on November 05, 2007, 08: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?
Title: Re: Web-based RCON client
Post by: Sonny on November 05, 2007, 08:32:04 AM
waddup partner
Title: Re: Web-based RCON client
Post by: sk89q on November 05, 2007, 01: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'
                   
                    
),
);


}
?>
Title: Re: Web-based RCON client
Post by: Leezerz.com|A.D.M.I.N on November 05, 2007, 01: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.
Title: Re: Web-based RCON client
Post by: sk89q on November 05, 2007, 05: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...
Title: Re: Web-based RCON client
Post by: KiLo on November 05, 2007, 05: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.
Title: Re: Web-based RCON client
Post by: Leezerz.com|A.D.M.I.N on November 06, 2007, 08:33:21 AM
does that mean, there isnt any way to set $test to the value of listuserip?
Title: Re: Web-based RCON client
Post by: XtremeBain on November 06, 2007, 11: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 (http://code.google.com/p/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 (http://misc.slowchop.com/misc/wiki/q3query) code to meet your needs, even though it's for Q3, it's all the same.
Title: Re: Web-based RCON client
Post by: magalhaes on November 06, 2007, 11: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 ;)
Title: Re: Web-based RCON client
Post by: sk89q on November 06, 2007, 12:42:07 PM
You're better off hacking this (http://misc.slowchop.com/misc/wiki/q3query) code to meet your needs, even though it's for Q3, it's all the same.

Or better, this: libdpserver (http://digitalpaint.therisenrealm.com/tools/sdk/libdpserver)
Title: Re: Web-based RCON client
Post by: Leezerz.com|A.D.M.I.N on November 06, 2007, 12:48:17 PM
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.



Title: Re: Web-based RCON client
Post by: Leezerz.com|A.D.M.I.N on November 06, 2007, 12:56:48 PM
Or better, this: libdpserver (http://digitalpaint.therisenrealm.com/tools/sdk/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...
Title: Re: Web-based RCON client
Post by: sk89q on November 06, 2007, 01: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.
Title: Re: Web-based RCON client
Post by: KiLo on November 06, 2007, 01: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.
Title: Re: Web-based RCON client
Post by: Leezerz.com|A.D.M.I.N on November 06, 2007, 01:32:36 PM
I need a web-based rcon-client.
An example: http://www.memi-clan.de/index.php?page=rent&lang=de (http://www.memi-clan.de/index.php?page=rent&lang=de)
Title: Re: Web-based RCON client
Post by: KiLo on November 06, 2007, 01: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.
Title: Re: Web-based RCON client
Post by: T3RR0R15T on November 06, 2007, 01:49:47 PM
Our system has a bug. We search for a good matchserver tool too.
Title: Re: Web-based RCON client
Post by: sk89q on November 06, 2007, 02: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.
Title: Re: Web-based RCON client
Post by: Leezerz.com|A.D.M.I.N on November 06, 2007, 02:36:13 PM
changing password and login, what is all

( password, oppass1...)
Title: Re: Web-based RCON client
Post by: XtremeBain on November 06, 2007, 02: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 ;)
Title: Re: Web-based RCON client
Post by: sk89q on November 06, 2007, 03:04:03 PM
I'm not doing it for anyone in particular. :P

I'll release it on DP Resource.
Title: Re: Web-based RCON client
Post by: T3RR0R15T on November 06, 2007, 04:40:49 PM
changing password and login, what is all

( password, oppass1...)
Yes, if u can include "exec publicmode.cfg" it would be great.
Title: Re: Web-based RCON client
Post by: sk89q on November 07, 2007, 01:52:45 PM
By the way, when does the lease on the match server 'expire'? How does it expire? A process checking the server occasionally? A cvar?
Title: Re: Web-based RCON client
Post by: KiLo on November 07, 2007, 02:02:09 PM
The following is using the match <password> <login> command.

Quote
When the match command is executed, the server will set the default (strict) match settings (like typing the "matchmode" command).  There's also a "match_timeout" setting (defaults to 1 minute if unset) that, like "passwordtimeout", resets the password (as well as match settings -- executes the "publicmode" command) after a given period of time (in minutes) if nobody else connects.


Hopefully that helps.
Title: Re: Web-based RCON client
Post by: lekky on November 07, 2007, 06:24:20 PM
I don't think that's what he meant KiLo.

sk89q, can't you just check to see if the server is in use on a lease request, and if not issue a new password/login? (not including like 5 minutes of free time after requesting it)
Title: Re: Web-based RCON client
Post by: sk89q on November 07, 2007, 07:48:05 PM
Well, what is defined as 'in use'? Someone is in the server?
Title: Re: Web-based RCON client
Post by: lekky on November 07, 2007, 07:51:07 PM
I would guess so.
Title: Re: Web-based RCON client
Post by: sk89q on November 07, 2007, 07:55:29 PM
Let's see what these people have to say. :O
Title: Re: Web-based RCON client
Post by: lekky on November 07, 2007, 08:01:04 PM
:P
Title: Re: Web-based RCON client
Post by: Leezerz.com|A.D.M.I.N on November 08, 2007, 01:05:14 AM
Well, what is defined as 'in use'? Someone is in the server?

Yes, a server is in use, when someone is in the server. If nobody is on the server, the user can rent it. If not, it should display a message like "Server is in use, sorry!" or something like this.