Beta4: TM²-Server Remote Control Using RCP4 (by hal|Sascha)

Moderator: NADEO

Fleckman
Posts: 8
Joined: 15 Jun 2010, 11:39

Beta4: TM²-Server Remote Control Using RCP4 (by hal|Sascha)

Post by Fleckman » 27 Aug 2011, 07:50

EDIT: Works now for Beta4 (including support for Planets) - see Update-notices at the end of this post!

WARNING: The following is exclusively intended for Canyon-Servers!
If you want to use RCP for both TMF and Canyon you need two seperate instances of RCP (without the modifications for TMF, with the modifications for Canyon).

Since there is (AFAIK) no remote server controller for Canyon out there, I modified RCP4 (by hal|Sascha) which was intended for TMUF/TMNF. All it requires is an internet-browser, and then it will allow you to remotely modify the playlist, chat with players while not being on the server, modify the GameMode, etc. RCP is an awesome tool that is just too good not to be used anymore.

I hope the following instructions work as well for you as they do for me, if not I will try to give support here, but please note that I will not take any responsibility, if you screw up your server :shock:
Don't despair if you have no experiece with coding - at the end of this post you can find the files already modified. Just copy them over the official RCP-files and you should be all set!

1) First of all you need Sascha's excellent RCP, of course. Get it here: http://www.tmbase.de/
I urge you to get this up and running before you apply my modifications!. Sascha's site provides detailed instructions on how to install RCP. I used version 4.0.3.5 (not the live one though).

The differences relevant to what I want to do between the dedicated servers for TMF and TM² are in the numbers for the GameModes: 0 used to be Rounds, 1 TA etc. Now 0 is Script, 1 Rounds, 2 TA etc.

2) In your plugins folder you will find a subfolder "GameSettings".
It should contain an index.php and several language xml-files. Let's start with those:
Correct the numbers to reflect the correct modes, f.i. the English version should have these lines now:

Code: Select all

<mode1>Rounds</mode1>
<mode2>TimeAttack</mode2>
<mode3>Team</mode3>
<mode4>Laps</mode4>
<mode5>Cup</mode5>
<mode0>Script</mode0>
If you want to offer all languages to your RCP-users, you of course need to edit all langeauge-xmls!
Note that this change is only cosmetic - it only changes the names in the labels etc.! The real work is done in the index.php in the same folder. Change it like this:

Code: Select all

... [plenty of lines here that you should not change!]
	private function DisplayMode($Current, $Next)
	{
		switch($this->mode) {
			case 1:
				echo "<fieldset>";
				echo "<div class='legend'>".pt_rounds."</div>";
				echo "	<div class='f-row'>
						<label for='RoundsPointsLimit'>".pt_points."</label>
						<div class='f-field'>
							<div class='current'>{$Current['RoundsPointsLimit']} ".pt_pts."</div>
							<div class='next'><input type='text' name='RoundsPointsLimit' value='{$Next['RoundsPointsLimit']}' /></div>
						</div>
					</div>";
				echo "  <div class='f-row'>
						<label for='RoundsForcedLaps'>".pt_roundlaps."</label>
						<div class='f-field'>
							<div class='current'>{$Current['RoundsForcedLaps']} ".pt_laps."</div>
							<div class='next'><input type='text' name='RoundsForcedLaps' value='{$Next['RoundsForcedLaps']}' /></div>
						</div>
					</div>";
				echo "	<div class='f-row'>
						<label for='RoundsUseNewRules'>".pt_newrules."</label>
						<div class='f-field'>
							<div class='current'>"; if($Current['RoundsUseNewRules']) { echo "True"; } else { echo "False"; } echo "</div>
							<div class='next'><input type='checkbox' class='checkbox' name='RoundsUseNewRules'"; if($Next['RoundsUseNewRules']) { echo " checked='checked'"; } echo " /></div>
						</div>
					</div>";
				echo "  <div class='f-row'>
						<label for='RoundsPointsLimitNewRules'>".pt_pointslimitnewrules."</label>
						<div class='f-field'>
							<div class='current'>{$Current['RoundsPointsLimitNewRules']}</div>
							<div class='next'><input type='text' name='RoundsPointsLimitNewRules' value='{$Next['RoundsPointsLimitNewRules']}' /></div>
						</div>
					</div>";
				echo "</fieldset>";
				echo "<input type='hidden' name='GameMode' value='1' />";
			break;

			case 2:
				echo "<fieldset>";
				echo "<div class='legend'>".pt_timeattack."</div>";
				echo "	<div class='f-row'>
						<label for='TimeAttackLimit'>".pt_timelimit."</label>
						<div class='f-field'>
							<div class='current'>{$Current['TimeAttackLimit']} ".pt_sec."</div>
							<div class='next'><input type='text' name='TimeAttackLimit' value='{$Next['TimeAttackLimit']}' /></div>
						</div>
					</div>";
				echo "	<div class='f-row'>
						<label for='TimeAttackSynchStartPeriod'>".pt_syncstart."</label>
						<div class='f-field'>
							<div class='current'>{$Current['TimeAttackSynchStartPeriod']} ".pt_sec."</div>
							<div class='next'><input type='text' name='TimeAttackSynchStartPeriod' value='{$Next['TimeAttackSynchStartPeriod']}' /></div>
						</div>
					</div>";
				echo "</fieldset>";
				echo "<input type='hidden' name='GameMode' value='2' />";
			break;

			case 3:
				echo "<fieldset>";
				echo "<div class='legend'>".pt_team."</div>";
				echo "	<div class='f-row'>
						<label for='TeamPointsLimit'>".pt_points."</label>
						<div class='f-field'>
							<div class='current'>{$Current['TeamPointsLimit']} ".pt_pts."</div>
							<div class='next'><input type='text' name='TeamPointsLimit' value='{$Next['TeamPointsLimit']}' /></div>
						</div>
					</div>";
				echo "	<div class='f-row'>
						<label for='TeamMaxPoints'>".pt_maxpoints."</label>
						<div class='f-field'>
							<div class='current'>{$Current['TeamMaxPoints']} ".pt_pts."</div>
							<div class='next'><input type='text' name='TeamMaxPoints' value='{$Next['TeamMaxPoints']}'/></div>
						</div>
					</div>";
				echo "	<div class='f-row'>
						<label for='TeamUseNewRules'>".pt_newrules."</label>
						<div class='f-field'>
							<div class='current'>"; if($Current['TeamUseNewRules']) { echo "True"; } else { echo "False"; } echo "</div>
							<div class='next'><input type='checkbox' class='checkbox' name='TeamUseNewRules'"; if($Next['TeamUseNewRules']) { echo " checked='checked'"; } echo " /></div>
						</div>
					</div>";
				echo "  <div class='f-row'>
						<label for='TeamPointsLimitNewRules'>".pt_pointslimitnewrules."</label>
						<div class='f-field'>
							<div class='current'>{$Current['TeamPointsLimitNewRules']}</div>
							<div class='next'><input type='text' name='TeamPointsLimitNewRules' value='{$Next['TeamPointsLimitNewRules']}' /></div>
						</div>
					</div>";
				echo "</fieldset>";
				echo "<input type='hidden' name='GameMode' value='3' />";
			break;

			case 4:
				echo "<fieldset>";
				echo "<div class='legend'>Laps Mode</div>";
				echo "	<div class='f-row'>
						<label for='LapsNbLaps'>".pt_nolaps."</label>
						<div class='f-field'>
							<div class='current'>{$Current['LapsNbLaps']} ".pt_laps."</div>
							<div class='next'><input type='text' name='LapsNbLaps' value='{$Next['LapsNbLaps']}' /></div>
						</div>
					</div>";
				echo "	<div class='f-row'>
						<label for='LapsTimeLimit'>".pt_timelimit."</label>
						<div class='f-field'>
							<div class='current'>{$Current['LapsTimeLimit']} ".pt_sec."</div>
							<div class='next'><input type='text' name='LapsTimeLimit' value='{$Next['LapsTimeLimit']}' /></div>
						</div>
					</div>";
				echo "</fieldset>";
				echo "<input type='hidden' name='GameMode' value='4' />";
			break;

			default:
				echo "<input type='hidden' name='GameMode' value='0' />";
			break;

			case 5:
				echo "<fieldset>";
				echo "<div class='legend'>".pt_cup."</div>";
				echo "	<div class='f-row'>
						<label for='CupPointsLimit'>".pt_points."</label>
						<div class='f-field'>
							<div class='current'>{$Current['CupPointsLimit']} ".pt_pts."</div>
							<div class='next'><input type='text' name='CupPointsLimit' value='{$Next['CupPointsLimit']}' /></div>
						</div>
					</div>";
				echo "	<div class='f-row'>
						<label for='CupRoundsPerChallenge'>".pt_cuproundsperchallenge."</label>
						<div class='f-field'>
							<div class='current'>{$Current['CupRoundsPerChallenge']}</div>
							<div class='next'><input type='text' name='CupRoundsPerChallenge' value='{$Next['CupRoundsPerChallenge']}' /></div>
						</div>
					</div>";
				echo "	<div class='f-row'>
						<label for='CupNbWinners'>".pt_cupnbwinners."</label>
						<div class='f-field'>
							<div class='current'>{$Current['CupNbWinners']}</div>
							<div class='next'><input type='text' name='CupNbWinners' value='{$Next['CupNbWinners']}' /></div>
						</div>
					</div>";
				echo "	<div class='f-row'>
						<label for='CupWarmUpDuration'>".pt_warmupduration."</label>
						<div class='f-field'>
							<div class='current'>{$Current['CupWarmUpDuration']} ".pt_rnd."</div>
							<div class='next'><input type='text' name='CupWarmUpDuration' value='{$Next['CupWarmUpDuration']}' /></div>
						</div>
					</div>";
				echo "</fieldset>";
				echo "<input type='hidden' name='GameMode' value='5' />";
			break;
		}

		if($this->mode != 1) {
			echo "	<input type='hidden' name='RoundsPointsLimit' value='{$Next['RoundsPointsLimit']}' />";
			if($this->mode != 0) echo "	<input type='hidden' name='RoundsUseNewRules' value='{$Next['RoundsUseNewRules']}' />";
			echo "	<input type='hidden' name='RoundsForcedLaps' value='{$Next['RoundsForcedLaps']}' />
					<input type='hidden' name='RoundsPointsLimitNewRules' value='{$Next['RoundsPointsLimitNewRules']}' />";
		}

		if($this->mode != 2) {
			echo "	<input type='hidden' name='TimeAttackLimit' value='{$Next['TimeAttackLimit']}' />
					<input type='hidden' name='TimeAttackSynchStartPeriod' value='{$Next['TimeAttackSynchStartPeriod']}' />";
		}

		if($this->mode != 3) {
			echo "	<input type='hidden' name='TeamPointsLimit' value='{$Next['TeamPointsLimit']}' />";
			if($this->mode != 0) echo "	<input type='hidden' name='TeamUseNewRules' value='{$Next['TeamUseNewRules']}' />";
			echo "	<input type='hidden' name='TeamMaxPoints' value='{$Next['TeamMaxPoints']}' />
					<input type='hidden' name='TeamPointsLimitNewRules' value='{$Next['TeamPointsLimitNewRules']}' />";
		}

		if($this->mode != 4) {
			echo "	<input type='hidden' name='LapsNbLaps' value='{$Next['LapsNbLaps']}' />
					<input type='hidden' name='LapsTimeLimit' value='{$Next['LapsTimeLimit']}' />";
		}

		if($this->mode != 5) {
			echo "	<input type='hidden' name='CupPointsLimit' value='{$Next['CupPointsLimit']}' />
					<input type='hidden' name='CupRoundsPerChallenge' value='{$Next['CupRoundsPerChallenge']}' />
					<input type='hidden' name='CupNbWinners' value='{$Next['CupNbWinners']}' />
					<input type='hidden' name='CupWarmUpDuration' value='{$Next['CupWarmUpDuration']}' />";
		}
	} ...
3) The plugins also contain a subfolder named "Players". Modify it's index.php like this:

Code: Select all

...				//Display Teammode
				if(Core::getObject('status')->gameinfo['GameMode'] == 3) {...
Please note that you will still get an "Index out of bounds"-error - don't worry about it, the script works just fine with it (and I just can't find the error...).

4) Optional: It makes sense to turn off RCP's functions that are not supported by TM² (e.g. copper tranfers.).
To do this, open the xml-folder, open the subfolders "settings" and "default".
There you find "settings.xml". Change it to look like this:

Code: Select all

...
		<!-- plugins -->
		<plugin>Overview</plugin>
		<plugin>Challenges</plugin>
		<plugin>Players</plugin>
		<plugin>Browse</plugin>
		<!--<plugin>Database</plugin>-->
		<plugin>Chat</plugin>
		<!--<plugin>Payment</plugin>-->
		<plugin>GameSettings</plugin>
		<plugin>ServerSettings</plugin>
		<plugin>Maintenance</plugin>
		<plugin>Lists</plugin>
		<plugin>Settings</plugin>
		<plugin>Update</plugin>
		<!--<plugin>Mods</plugin>-->
		<!--<plugin>Messages</plugin>-->
		<plugin>CustomPoints</plugin>-->
...
UPDATE:
Beta4 requires a further change.
The "Browse" plugin index.php needs to be edited, so that the new File-Format (xy.Map.Gbx) is accepted. Find the definition of the 'Trackmania Challenge'-array and edit it thus:

Code: Select all

private $types			= array(
		'map.gbx'	=> array('map.gbx.gif'	, '.map.gbx'	, 'Trackmania Challenge'),
UPDATE2:
Planet Transfers seem to work just fine with Beta4 - just enable the plugin in the settings.xml (see above) and you can send/pay bills in Planets (though it will still say "coppers", of course):

Code: Select all

<plugin>Payment</plugin>
EDIT: Changed the appropriate xml-files in the download-package so that the German and Englisch RCP-versions call the ingame currency "Planets".



If you have trouble with the modifications, here they are in one ready to use package:
http://fleckman.jump.ag/RCP.zip [Including changes for Beta4 (support for Planets & new naming conventions for Maps)]
Last edited by Fleckman on 11 Sep 2011, 09:45, edited 17 times in total.

Fleckman
Posts: 8
Joined: 15 Jun 2010, 11:39

Re: UPDATE: TM²-Server RemoteControl Using RCP4 (by hal|Sasc

Post by Fleckman » 28 Aug 2011, 19:24

*bump*
Sascha is very busy ATM and therefore I asked him for his approval to release my modifications. His upcoming RCP5 will of course be way better than these modifications, but until its release hopefully they will help you with your administrative needs.

User avatar
jonthekiller
Translator
Translator
Posts: 4657
Joined: 15 Jun 2010, 11:07
Location: In Maniaplanet Alpha
Contact:

Re: UPDATE: TM²-Server RemoteControl Using RCP4 (by hal|Sasc

Post by jonthekiller » 28 Aug 2011, 19:41

You don't need to change maps format? Before all maps are like name.Challenge.Gbx and now name.Map.Gbx and the directory GameData/Tracks to UserData/Maps
Image

Fleckman
Posts: 8
Joined: 15 Jun 2010, 11:39

Re: UPDATE: TM²-Server RemoteControl Using RCP4 (by hal|Sasc

Post by Fleckman » 28 Aug 2011, 19:55

I expected that as well (and ServerMania f.i. really does), but apparently not!
RCP only looks for the .Gbx at the end it seems, and that has not changed.
Once the dedicated server functions that still use the old names (e.g. CurrentChallenge) are renamed to reflect the new naming conventions, major changes will be neccessary, but right now it works (for me at least).

User avatar
weerwolf
Posts: 603
Joined: 15 Jun 2010, 21:21
Location: Wijchen, Netherlands
Contact:

Re: UPDATE: TM²-Server Remote Control Using RCP4 (by hal|Sas

Post by weerwolf » 28 Aug 2011, 23:46

Maybe put a Notice in the first post NOT to copy it over any excisting RemoteCP used for Forever.
I may seem logical to the most of us, but no harm to mention it either ;)
LYNX Gaming Community!
Become a member? Join us on TeamSpeak.

Fleckman
Posts: 8
Joined: 15 Jun 2010, 11:39

Re: UPDATE: TM²-Server Remote Control Using RCP4 (by hal|Sas

Post by Fleckman » 29 Aug 2011, 08:05

True - can't hurt to make this absolutely clear. Thx for the hint.

User avatar
Kistrof
Posts: 18
Joined: 28 Jul 2011, 21:30
Location: France
Contact:

Re: UPDATE: TM²-Server RemoteControl Using RCP4 (by hal|Sasc

Post by Kistrof » 07 Sep 2011, 22:38

Thanks a lot Fleckman, I like RCP4 and I didn't want to change for another control panel :thumbsup:
jonthekiller wrote:You don't need to change maps format? Before all maps are like name.Challenge.Gbx and now name.Map.Gbx and the directory GameData/Tracks to UserData/Maps
I think RCP4 is asking to the server where is its tracks directory (Do I already said I loved RCP4 ? ^^)
Image
Image

Fleckman
Posts: 8
Joined: 15 Jun 2010, 11:39

Re: UPDATE: TM²-Server RemoteControl Using RCP4 (by hal|Sasc

Post by Fleckman » 09 Sep 2011, 16:08

jonthekiller wrote:You don't need to change maps format?
Beta4 does - I updated my instructions accordingly.

tmrapidserv
Posts: 43
Joined: 22 May 2011, 20:45

Re: Beta4: TM²-Server Remote Control Using RCP4 (by hal|Sasc

Post by tmrapidserv » 10 Sep 2011, 09:15

The link is dead!! :cry:

Fleckman
Posts: 8
Joined: 15 Jun 2010, 11:39

Re: Beta4: TM²-Server Remote Control Using RCP4 (by hal|Sasc

Post by Fleckman » 10 Sep 2011, 10:43

Oops - typo while updating.
Fixed now!

Post Reply

Return to “Dedicated Server”

Who is online

Users browsing this forum: No registered users and 1 guest