Page 1 of 2

Re: Trackmania Updates for ManiaControl, Release v0.220

Posted: 06 Jun 2017, 10:54
by chapelier
hey,
Question surely posed full of times but I have not found the answer :
- Is it possible to setup ManiaControl to support multitple Dedicated servers on a single machine ?

Re: Trackmania Updates for ManiaControl, Release v0.220

Posted: 07 Jun 2017, 13:27
by chapelier
kremsy wrote: 06 Jun 2017, 11:53

Code: Select all

	<server id="server1">
		<!-- MC Dev Elite -->
		<host>ip1</host>
		<port>5001</port>
		<login>SuperAdmin</login>
		<pass>YOUR_PASS</pass>
	</server>
	
	<server id="server2">
		<host>ip2</host>
		<port>5001</port>
		<login>SuperAdmin</login>
		<pass>YOUR_PASS</pass>
	</server>
while the id corresponds to the id in the sh file.
I feel confused, for me ip1 et ip2 are the sames and i have 2 differents ports like 5001 and 5002.
But anyway it doesnt worked... did i missed something ?

Re: Trackmania Updates for ManiaControl, Release v0.220

Posted: 07 Jun 2017, 18:01
by chapelier
The 2 maniaControl instances send their commands to the same server, the first in the server.xml file.
for instance, when i switch the servers in that file, then it is the first which works and the commands are send 2 times.

Re: Trackmania Updates for ManiaControl, Release v0.220

Posted: 07 Jun 2017, 21:54
by chapelier
here it is :
ManiaControlLagoon.sh

Code: Select all

#!/bin/sh
php ManiaControl.php -id serverLagoon -sh ManiaControlLagoon.sh >ManiaControl.log 2>&1 &
echo $! > ManiaControl.pid
ManiaControlTrial.sh

Code: Select all

#!/bin/sh
php ManiaControl.php -id serverTrial -sh ManiaControlTrial.sh >ManiaControl.log 2>&1 &
echo $! > ManiaControl.pid
and the server.xml

Code: Select all

         <server id="serverLagoon">
		<host>127.0.0.1</host>
		<port>5002</port>
		<user>SuperAdmin</user>
		<pass>xxxx</pass>
	</server>
	
	<server id="serverTrial">
  	        <host>127.0.0.1</host>
		<port>5000</port>
		<user>SuperAdmin</user>
		<pass>xxxx</pass>
	</server>

Re: Trackmania Updates for ManiaControl, Release v0.220

Posted: 08 Jun 2017, 11:28
by chapelier
I think the problem is here :

Code: Select all

public static function getParameter($paramName) {
		$paramName = (string) $paramName;
		$params    = self::getAllParameters();
		foreach ($params as $param) {
			$parts = explode('=', $param, 2);
We need to use "=" for the parameters.

And we need to use "-config=server1.xml" in the command line.

Code: Select all

private function loadConfig() {
		$configId       = CommandLineHelper::getParameter('-config');
		$configFileName = ($configId ? $configId : 'server.xml');
so we need to have 2 xml files.

and now it works !

edit : and having 2 xml files, we can have 2 distinct databases for each server.