Digital Paint Discussion Board

Paintball 2: The Game => Server Discussion => Topic started by: sk89q on April 01, 2008, 07:34:33 PM

Title: DP Match Server Tool -- for clans with servers that can be reserved
Post by: sk89q on April 01, 2008, 07:34:33 PM
If you have a few match servers that you want to let others use, you can install this application on your web server so that they can use them without needing to know your password. This is like what various clans on PB have (such as GT, OTB, QeHS).

Features:
- Auto-select available server option
- Grace period
- Completely skinnable/themable
- Allow users to change some cvars (restricted)
- Allow users to change some cvars after they've leased the server
- If they try to change cvars after they've leased the server, warnings will be issued to the game (so cheating with it is out of the question)
- Displays server status
- Spam-bot check

http://code.google.com/p/dpmatchreserve/

PHP 5 required. register_globals and magic_quotes_gpc need to be off; they can be turned off via .htaccess. Localization is not supported currently.

==

Example configuration file:

Code: [Select]
<-?php
# Configuration file for DPMatchReserve
$CONFIG = array();

##################################
# Settings
##################################

# The base URL to the directory that contains this
# application. Leave it blank for autodetection
$CONFIG['base_url'] = '';

# The default map that the server will be changed to when
# a server is requested
$CONFIG['default_map'] = 'pbcup';

# Name of theme to use
$CONFIG['theme'] = 'simple';

# Set to 1 if to enable the debugging console for Smarty that
# displays the variables available for the template
$CONFIG['theme_debug_console'] = '0';

# Set to 1 if developing a theme, and to 0 to turn it off.
# Turning on debug mode will force templates to be recompiled
# as necessary, otherwise your templates will be cached and your
# changes will not change anything!
$CONFIG['theme_debug'] = '0';

# Number of seconds to allow a grace period so that they can join
# the server before anyone else can try again. Specified in
# seconds
$CONFIG['grace_period'] = '30';

# Shows an option for the user to select the application to
# automatically select a open server for them
$CONFIG['enable_autoselect'] = '1';

# Requires that the server have at least one player on it
# before someone is allowed to change the game variables *after*
# the server has been leased to them
$CONFIG['custom_var_require_nonempty'] = '1';

# Requires that the person trying to change the game variables
# *after* the server has been leased to them to be on the
# server (checks by IP)
$CONFIG['custom_var_require_ip_on'] = '0';

# This prevents automated spam bots that scour the Internet
# from submitting this form
$CONFIG['bot_check_string'] = 'paintball';

##################################
# Server configurations
##################################

# Configure all the match servers below that you want others
# to be able to lease. Just copy the section and paste it over,
# remembering to modify the information for each one

$CONFIG['servers'][] = array(
'name' => 'Match Server #1',
'host' => '127.0.0.1',
'port' => '27910',
'rcon_password' => 'hackme',
'op_pass_num' => '1',
);

$CONFIG['servers'][] = array(
'name' => 'Match Server #2',
'host' => '127.0.0.1',
'port' => '27911',
'rcon_password' => 'hackme',
'op_pass_num' => '1',
);

##################################
# Default settings
##################################

# These settings will be applied when someone uses the match
# tool to lease a server. This is useful if you allow people
# to change the game settings because it will reset the
# settings for the next group.

$CONFIG['default_settings']['elim'] = '60';
$CONFIG['default_settings']['ffire'] = '1';
$CONFIG['default_settings']['flagcapendsround'] = '1';
$CONFIG['default_settings']['flagmustbeatbase'] = '0';
$CONFIG['default_settings']['gren_explodeonimpact'] = '0';
$CONFIG['default_settings']['guntemp_dec'] = '4';
$CONFIG['default_settings']['guntemp_inc'] = '11';
$CONFIG['default_settings']['PaintGrens'] = '2';
$CONFIG['default_settings']['pong_nokill'] = '1';
$CONFIG['default_settings']['SmokeGrens'] = '1';

##################################
# User-modifiable settings
##################################

# Users will be able to modify these settings when trying to
# lease the match server and after the match server has been
# leased to them. Just copy each block and modify it as needed.
#
# type = {bool|int|float}
# min = <number>
# max = <number>
# only_after_lease = {1|0}
#
# Notes:
# - only_after_lease: Prevents users from changing this setting
#   until after they have leased the server

$CONFIG['user_settings']['elim'] = array(
'type' => 'int',
'min' => '0',
'max' => '120',
);

$CONFIG['user_settings']['ffire'] = array(
'type' => 'bool',
);

$CONFIG['user_settings']['flagcapendsround'] = array(
'type' => 'bool',
);

$CONFIG['user_settings']['flagmustbeatbase'] = array(
'type' => 'bool',
);

$CONFIG['user_settings']['gren_explodeonimpact'] = array(
'type' => 'bool',
);

$CONFIG['user_settings']['guntemp_dec'] = array(
'type' => 'int',
'min' => '1',
'max' => '5',
);

$CONFIG['user_settings']['guntemp_inc'] = array(
'type' => 'int',
'min' => '0',
'max' => '11',
);

$CONFIG['user_settings']['PaintGrens'] = array(
'type' => 'int',
'min' => '0',
'max' => '5',
);

$CONFIG['user_settings']['pong_nokill'] = array(
'type' => 'bool',
);

$CONFIG['user_settings']['SmokeGrens'] = array(
'type' => 'int',
'min' => '0',
'max' => '5',
);

$CONFIG['user_settings']['sv_gravity'] = array(
'type' => 'int',
'min' => '0',
'max' => '800',
'only_after_lease' => '1',
);
?>
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: Zorchenhimer on April 01, 2008, 08:16:50 PM
Ooooh.  Looks nice.  One question though, do the boolean settings (ffire, flagcapendsround, etc) need the empty option?  Shouldn't that just be left out so you can only choose "True" or "False"?
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: sk89q on April 01, 2008, 08:29:56 PM
Well, it just won't change the setting if you choose the blank. Likewise if you clear one of the text input boxes.
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: Cameron on April 01, 2008, 11:22:17 PM
* Cameron sits in confusion on what all of that means but likes it.  I'll keep that for when i get servers (when i grow up) :)
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: sk89q on April 01, 2008, 11:34:08 PM
I really need to remember to explain my topics sometimes :<

"If you have a few match servers that you want to let others use, you can install this application on your web server so that they can use them without needing to know your password."

Examples of similar scripts:
http://www.graffiti-taggerz.com/~dpaintball/index-MatchTool.shtml
http://www.otb-server.de/access/register.php
http://qehs.indiereview.co.uk/index.php?site=rent_server
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: Cameron on April 02, 2008, 12:41:18 AM
Is it the same script, well, close?  Or does it allow completely different things?
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: sk89q on April 02, 2008, 01:03:33 AM
Uh... it's completely different code, but it essentially does the same thing, just with more features (namely the cvar stuff).

Which is why you, Cameron, should convince GT to switch! ;D
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: sk89q on April 02, 2008, 03:39:42 AM
Beta2 has a new theme that's less... text-heavy (but also less informative).

The demo also kind of fake-works now, but you need to enter "test" for the login password to be able to use the cvar-change page.
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: Cameron on April 02, 2008, 06:28:02 AM
I'll try, maybe when i get around to finishing the new site I might put it on there and casso can do all of the server stuff.
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: jitspoe on April 02, 2008, 12:02:48 PM
Nifty.  I'll have to play around with this some later.
Title: Re: DP Match Server Tool -- for clans with servers that can be leased
Post by: KnacK on April 02, 2008, 12:52:19 PM
ummmmm.....

Code: [Select]
$CONFIG['user_settings']['snaz-bot'] = array(
'type' => 'bool',
);

?????
Title: Re: DP Match Server Tool -- for clans with servers that can be reserved
Post by: jitspoe on May 22, 2008, 01:53:12 AM
I keep meaning to set this up on my server, but it seems other things keep requiring more immediate attention.  Wish I could SSH from work...
Title: Re: DP Match Server Tool -- for clans with servers that can be reserved
Post by: Zorchenhimer on May 22, 2008, 02:16:08 AM
I keep meaning to set this up on my server, but it seems other things keep requiring more immediate attention.  Wish I could SSH from work...

Firewall stuffs?
Title: Re: DP Match Server Tool -- for clans with servers that can be reserved
Post by: lekky on June 05, 2008, 08:50:35 PM
Yeah thats painful, the place where i was working for past 8 months wouldn't let me ssh/ftp either..
Title: Re: DP Match Server Tool -- for clans with servers that can be reserved
Post by: Justinph5 on February 05, 2013, 06:40:54 PM
Hi guys,

I edited the play.tpl file so that when a server is rented, it gives you a copy/paste code like:  connect 123.456.789.123:12345; password asdf

<p><strong>In-Game Copy/Paste:</strong> connect {$host}:{$port}; password {$password}</p>

If you paste this in the file, and then clear the play.tpl cache, it will update so you can have this too.
Title: Re: DP Match Server Tool -- for clans with servers that can be reserved
Post by: CheMiCal on February 06, 2013, 10:19:36 PM
tR was playing senix and nookie and force spec is enabled on your servers, was just wondering if you could take it off.
Title: Re: DP Match Server Tool -- for clans with servers that can be reserved
Post by: vLaD on March 30, 2014, 02:12:20 AM
I'm having a problem where it doesn't apply the server settings. say's it does but it doesn't work. I'll try to figure this out once I get some more time. geektwks.com/match
Title: Re: DP Match Server Tool -- for clans with servers that can be reserved
Post by: SuperMAn on March 30, 2014, 09:40:37 AM
I'm having a problem where it doesn't apply the server settings. say's it does but it doesn't work. I'll try to figure this out once I get some more time. geektwks.com/match

Maybe you forgot to close the quotation marks somewhere?

Also, I will add a link to my site later today.
Title: Re: DP Match Server Tool -- for clans with servers that can be reserved
Post by: Davew_ on December 27, 2015, 08:38:11 AM
http://www.davewsgameservers.com/rentdp/

up and working  3 match server  so far