Trackmania Server Viewer

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
s0xen
happy cruiser
happy cruiser
Posts: 115
Joined: 11 Nov 2007 20:31
Owned TM-games: TMN

Trackmania Server Viewer

Post by s0xen » 12 Sep 2008 15:42

Hi.
I worked a couple of days on it.
The TMF server viewer.
No need for aseco, DB's, php.
Options:
  • 4 Diffrent images. Possible to use them on forums.
    • Standard.
    • Normal.
    • Small.
    • Compact
  • An inline frame automatic settings.
    • Refresh Time.
    • Frame Border.
    • Frame Width.
    • Frame Hight.
    • Frame Bacground color.
For every server on Trackmania Forever.

Preview images:
Image
Live

Image
Not Live

Image
Not Live

Image
Live

You only need to change:

Code: Select all

<xmlrpc_allowremote>False</xmlrpc_allowremote>
To:

Code: Select all

<xmlrpc_allowremote>True</xmlrpc_allowremote>
It needs to be a capital.
This is to connect and get the information.
Remember to use strong Admin, SuperAdmin passwords for sercurity reasons.


Get your own now at:

http://tmf.xf-s.com/
Last edited by s0xen on 21 Sep 2008 09:32, edited 3 times in total.

User avatar
kristjan
speedy pilot
speedy pilot
Posts: 427
Joined: 18 Aug 2005 13:17
Location: Norway

Re: Trackmania Server Viewer

Post by kristjan » 13 Sep 2008 22:56

I thought of doing something like this. But i also had the idea of adding graphs for history so the server owner and players could see players count stats (min/max/avg) all days in the past...

Maybe we could go together and develop something like that? :D
PM me.
kristjan aka MiniGod

eekcage
cyclist
cyclist
Posts: 41
Joined: 19 Apr 2008 13:52
Owned TM-games: TMUF

Re: Trackmania Server Viewer

Post by eekcage » 17 Sep 2008 10:52

I'd call using a round robin database with rrdgraph, I have done it with bandwidth per server port (monitoring 2350/2352 ect with 'iptraf' out logs) but never using the collected data from the game.

plan .

eek/nico :lovetm


month later edit: yeah sig :D using php to fetch rcp data to graph
Last edited by eekcage on 01 Jan 2009 19:53, edited 1 time in total.

woki
sunday driver
sunday driver
Posts: 61
Joined: 20 Jul 2008 08:29
Owned TM-games: TMN,TMUF
Manialink(s): woki
Location: Netherlands,Friesland: ijlst
Contact:

Re: Trackmania Server Viewer

Post by woki » 18 Sep 2008 18:28

Nice one Soxen ;)

Gr Woki
Image

Image

User avatar
Big_Al
road tourist
road tourist
Posts: 80
Joined: 09 Apr 2009 07:52
Owned TM-games: TMU TMUF TMN TMNF

Re: Trackmania Server Viewer

Post by Big_Al » 08 Aug 2009 13:35

The link doesn´t work anymore :(

User avatar
Warrior
smooth traffic navigator
smooth traffic navigator
Posts: 200
Joined: 29 Apr 2008 13:56
Owned TM-games: tmnf, tmu
Location: worldwide
Contact:

Re: Trackmania Server Viewer

Post by Warrior » 09 Aug 2009 19:59

ya that link is dead

djarrett
smooth traffic navigator
smooth traffic navigator
Posts: 235
Joined: 04 Jul 2006 15:01
Owned TM-games: TMO,TMS,TMN,TMU,TMUF
Location: Fayetteville,GA
Contact:

Re: Trackmania Server Viewer

Post by djarrett » 09 Aug 2009 21:13

its a year old...it should be dead

User avatar
Warrior
smooth traffic navigator
smooth traffic navigator
Posts: 200
Joined: 29 Apr 2008 13:56
Owned TM-games: tmnf, tmu
Location: worldwide
Contact:

Re: Trackmania Server Viewer

Post by Warrior » 10 Aug 2009 11:59

is there a nother place to get this program ?

Mort
smooth traffic navigator
smooth traffic navigator
Posts: 275
Joined: 16 Jan 2009 10:57
Owned TM-games: TMUF, TMNF
Location: Australia
Contact:

Re: Trackmania Server Viewer

Post by Mort » 30 Dec 2009 03:18

djarrett wrote:its a year old...it should be dead
TM is over a year old... should it be dead as well?

Does anyone know of another project like this? I'm looking for something that can create a graphic image that can appear down the side of a PHPBB portal page.

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: Trackmania Server Viewer

Post by w1lla » 02 Jan 2010 10:29

Code: Select all

<?php
/*
*/
######
/*Config
*/
$ip="127.0.0.1"; // ip server
$port='5225'; // xml poort
  $user= "SuperAdmin";                  // SuperAdmin Login
  $pass= "SuperAdmin";                        // SuperAdmin Password
#######
require("includes/GbxRemote.inc.php");
require("includes/tmfcolorparser.inc.php");

function stripColors($str,$for_tm_drawing=true){
$str2 = str_replace("$", "\001", ereg_replace("[\001\002]","","a".$str) );
if($for_tm_drawing)
$str2 = str_replace("\001\001","$$", $str2);
else
$str2 = str_replace("\001\001","$", $str2);
$str2 = preg_replace("`\001[hlHL]`","\002",$str2);
$str2 = preg_replace("`\002\[([^\]]*)\]([^\002]*)\002`","$2",$str2);
$str2 = preg_replace("`\002\[([^\]]*)\]`","",$str2);
$str2 = str_replace("\002","", $str2);
$str2 = ereg_replace("\001([0-9a-fA-F][0-9a-zA-Z][0-9a-zA-Z]|[^\001])","",$str2);
$str2 = str_replace("\001","$$", substr($str2,1) );
  return $str2;
}
$client = new IXR_Client_Gbx;
$cp = new TMFColorParser;

if (!$client->InitWithIp($ip,$port)) {
   echo'An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage();
}
if (!$client->query("Authenticate", $user, $pass)) {
   
   print "login failed !<br/>";
}
if($client->query('GetStatus')) {
   $Status = $client->getResponse();
   }
if($client->query('GetPlayerList',500,0)) {
   $Players = $client->getResponse();
   }
if($client->query('GetServerOptions')) {
   $ServerOptions = $client->getResponse();
   $servername=$ServerOptions['Name'];
   $MaxPLayers=$ServerOptions['CurrentMaxPlayers'];
   }   
$pl=0;   
foreach ($Players as $player) {
   $pl++;
   }
if($client->query('GetCurrentChallengeInfo')) {
   $CurrentChallengeInfo = $client->getResponse();
   $trackname=$CurrentChallengeInfo['Name'];   
   }
   
//Taking game info
if($client->query('GetCurrentGameInfo')) {
   $GetCurrentGameInfo=$client->getResponse();
   $GameMode=$GetCurrentGameInfo["GameMode"];
}

//Formatting the gamemode of the server
switch($GameMode){
   case 0:
      $GameMode="Rounds";
      Break;
   case 1:
      $GameMode="Time Attack";
      Break;
   case 2:
      $GameMode="Team";
      Break;
   case 3:
      $GameMode="Laps";
      Break;
   case 4:
      $GameMode="Stunts";
      Break;
   case 5:
      $GameMode="Cup";
      Break;
}
// Set the content-type
header('Content-type: image/png');
header('meta http-equiv="Content-Type" content="text/html; charset=utf-8');
// Create the image
$im = imagecreatetruecolor(435, 150);

// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);

// The text to draw
$text1 = 'Servername:         '.stripcolors($servername);
$text2 = 'Gamemode:          '.$GameMode.'';
$text3 = 'Current Track:       '.stripcolors($trackname); 
$text4 = 'Players Online:      '.$pl.'/'.$MaxPLayers.'';
$text5 = 'Status:                  '.$Status['Name'].'';

// Replace path by your own font path
$font = './fonts/tahoma.ttf';

// Add some shadow to the text
imagettftext($im, 15, 0, 11, 22, $white, $font, $text1);
imagettftext($im, 15, 0, 11, 52, $white, $font, $text2);
imagettftext($im, 15, 0, 11, 82, $white, $font, $text3);
imagettftext($im, 15, 0, 11, 112, $white, $font, $text4);
imagettftext($im, 15, 0, 11, 142, $white, $font, $text5);

// Add the text
imagettftext($im, 15, 0, 10, 21, $grey, $font, $text1);
imagettftext($im, 15, 0, 10, 51, $grey, $font, $text2);
imagettftext($im, 15, 0, 10, 81, $grey, $font, $text3);
imagettftext($im, 15, 0, 10, 111, $grey, $font, $text4);
imagettftext($im, 15, 0, 10, 141, $grey, $font, $text5);

// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

Mort
smooth traffic navigator
smooth traffic navigator
Posts: 275
Joined: 16 Jan 2009 10:57
Owned TM-games: TMUF, TMNF
Location: Australia
Contact:

Re: Trackmania Server Viewer

Post by Mort » 02 Jan 2010 10:57

Thanks, I'll try it out.

Does that script need anything other include libs or is tmfcolourpaser and gbxremote all I need?

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: Trackmania Server Viewer

Post by w1lla » 02 Jan 2010 11:15

only those 2 are needed.

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

Gossamer
highway camper
highway camper
Posts: 1
Joined: 15 Apr 2010 18:11
Owned TM-games: TMNF

Re: Trackmania Server Viewer

Post by Gossamer » 15 Apr 2010 18:17

Can somebody upload this as a complete package. I tried to get those two includes and named them properly/put them in an includes folder and it still errored.

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: Trackmania Server Viewer

Post by w1lla » 16 Apr 2010 09:02

http://www.w1lla.nl/TMFLive.rar
http://www.w1lla.nl/TMFLive.zip

not the best work of art but its a start...

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

Wolfseye
pedestrian
pedestrian
Posts: 11
Joined: 15 Apr 2008 16:33
Owned TM-games: TMU

Re: Trackmania Server Viewer

Post by Wolfseye » 07 Apr 2011 16:38

I tried the script above to pull the Server Information from my TM Server.

Do I understand it right, I dont need more than the tmfcolorparser.inc.php and the GbxRemote.inc.php to make this work ?

The status is displayed on my Website (URL changed in the quote) while the TM Server is on a rented Rootserver someplace else. Not where the webspace is. I added the correct IP into the script posted couple posts above.

And when I try to load the status, it comes up as this.
An error occurred - -32300:transport error - could not open socketlogin failed !

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 51

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php:33) in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 87

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php:33) in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 88

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 107

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 108

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 109

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 110

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 111

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 114

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 115

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 116

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 117

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/vhosts/meine-domain.com/httpdocs/tmstatus/tmserver.php on line 118
‰PNG IHDR³–Û™ñáÕIDATxœíÁ1 õOm O €§ýZ½ÇÆòIEND®B`‚
Did I do something wrong or does it not work with all PHP Versions or what ?
Would appreciate any help on that matter.

Thanks.

Post Reply