Web server status?

This is the place where you can find everything related to the dedicated server, control scripts and community tools.

Moderators: Pit Crew, TM-Patrol

Post Reply
helliaby
pedestrian
pedestrian
Posts: 10
Joined: 03 Nov 2018 22:13
Owned TM-games: TMNF

Web server status?

Post by helliaby » 03 Nov 2018 22:15

Hi everyall

Is it possible to have the status of my TrackMania server on my website? Only appear Status - Running Play Players 5/50 and such?

:ftw: :ftw: :ftw: :ftw:

Xymph
Pit Crew
Pit Crew
Posts: 5685
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Web server status?

Post by Xymph » 04 Nov 2018 09:20

helliaby wrote:
03 Nov 2018 22:15
Is it possible to have the status of my TrackMania server on my website? Only appear Status - Running Play Players 5/50 and such?
Sure:

Code: Select all

#!/usr/bin/php -q
<?php
	$ip   = '127.0.0.1';    // IP address of server
	$port = YourPort;       // Port for remote access
	$user = 'SuperAdmin';   // Server Login
	$pass = 'YourPassword'; // Login Password

	require('PathTo/includes/GbxRemote.inc.php');
	$client = new IXR_Client_Gbx;

	if (!$client->InitWithIp($ip, $port)) {
		echo 'Cannot connect - ' . $client->getErrorCode() . ': ' . $client->getErrorMessage() . "\n";
		exit;
	}
	if (!$client->query('Authenticate', $user, $pass)) {
		echo 'Cannot authenticate - ' . $client->getErrorCode() . ': ' . $client->getErrorMessage() . "\n";
		exit;
	}

	if (!$client->query('GetStatus')) {
		echo 'Cannot get status - ' . $client->getErrorCode() . ': ' . $client->getErrorMessage() . "\n";
		exit;
	}
	$status = $client->getResponse();
	print_r($status); // do your own formatting here

	// repeat for other methods
?>
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

helliaby
pedestrian
pedestrian
Posts: 10
Joined: 03 Nov 2018 22:13
Owned TM-games: TMNF

Re: Web server status?

Post by helliaby » 05 Nov 2018 00:00

Hi, thanks for answering me so fast. But it does not work, I get the error 500

Xymph
Pit Crew
Pit Crew
Posts: 5685
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Web server status?

Post by Xymph » 06 Nov 2018 07:52

helliaby wrote:
05 Nov 2018 00:00
Hi, thanks for answering me so fast. But it does not work, I get the error 500
The script is fine, but there could be various reasons (wrong configuration, blocked port, etc.) why it doesn't work in your set-up. It's up to you to debug that.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

User avatar
undef.de
Pit Crew
Pit Crew
Posts: 1323
Joined: 31 Aug 2009 18:38
Owned TM-games: TMF, TM2C/S/V, SM
Manialink(s): undef, tmkarma
Location: Germany
Contact:

Re: Web server status?

Post by undef.de » 06 Nov 2018 18:28

helliaby wrote:
05 Nov 2018 00:00
Hi, thanks for answering me so fast. But it does not work, I get the error 500
This script isn't meant to be used by HTTP, it's a console script.
Developer of various plugins for XAseco/XAseco2 and MPAseco,
like Records-Eyepiece, TM-Karma, Alternate Scoretable...
Visit my Lab: www.undef.name

Get it now:
» TM2 Valley
» TM2 Canyon
» TM2 Stadium
» SM Storm

helliaby
pedestrian
pedestrian
Posts: 10
Joined: 03 Nov 2018 22:13
Owned TM-games: TMNF

Re: Web server status?

Post by helliaby » 07 Nov 2018 21:46

thanks for your clarification. In this case, for console, how is that? I do not understand, I thought it was accessible from HTTP. What should I do to make it accessible from the page? in this case done through Joomla

User avatar
undef.de
Pit Crew
Pit Crew
Posts: 1323
Joined: 31 Aug 2009 18:38
Owned TM-games: TMF, TM2C/S/V, SM
Manialink(s): undef, tmkarma
Location: Germany
Contact:

Re: Web server status?

Post by undef.de » 08 Nov 2018 17:27

helliaby wrote:
07 Nov 2018 21:46
In this case, for console, how is that? I do not understand.
XAseco (for example) is a console script too, which also do not run by HTTP. Details about console/cli: http://php.net/manual/en/features.comma ... uction.php
helliaby wrote:
07 Nov 2018 21:46
What should I do to make it accessible from the page? in this case done through Joomla
You have to change the script (which also is just a short example how to do it) to be a plugin for Joomla.
Developer of various plugins for XAseco/XAseco2 and MPAseco,
like Records-Eyepiece, TM-Karma, Alternate Scoretable...
Visit my Lab: www.undef.name

Get it now:
» TM2 Valley
» TM2 Canyon
» TM2 Stadium
» SM Storm

helliaby
pedestrian
pedestrian
Posts: 10
Joined: 03 Nov 2018 22:13
Owned TM-games: TMNF

Re: Web server status?

Post by helliaby » 11 Nov 2018 21:06

Hi. I found this: https://github.com/cyco77/gameserver

I have installed it on my website, but it does not work. It is ensured that the ports are not blocked. Will I have to edit something?

User avatar
undef.de
Pit Crew
Pit Crew
Posts: 1323
Joined: 31 Aug 2009 18:38
Owned TM-games: TMF, TM2C/S/V, SM
Manialink(s): undef, tmkarma
Location: Germany
Contact:

Re: Web server status?

Post by undef.de » 12 Nov 2018 15:07

helliaby wrote:
11 Nov 2018 21:06
Hi. I found this: https://github.com/cyco77/gameserver

I have installed it on my website, but it does not work. It is ensured that the ports are not blocked. Will I have to edit something?
That won't work, because it's not for TM (I didn't saw anything about TM there). Maybe the "Website Stats for TMF" which can be found at http://www.xaseco.org/tools.php could be a thing for you. But that's not a Joomla!-Plugin, it's a stand-alone software.
Developer of various plugins for XAseco/XAseco2 and MPAseco,
like Records-Eyepiece, TM-Karma, Alternate Scoretable...
Visit my Lab: www.undef.name

Get it now:
» TM2 Valley
» TM2 Canyon
» TM2 Stadium
» SM Storm

helliaby
pedestrian
pedestrian
Posts: 10
Joined: 03 Nov 2018 22:13
Owned TM-games: TMNF

Re: Web server status?

Post by helliaby » 17 Nov 2018 22:59

Thx a lot! It was really what I was looking for

Post Reply