[XASECO2] Plugin: ManiaRecords v1.1.7 Beta (Disabled!)

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
User avatar
jimpower
road tourist
road tourist
Posts: 80
Joined: 24 Dec 2008 09:30
Owned TM-games: TMNF, TMUF, TMC
Location: Germany
Contact:

[XASECO2] Plugin: ManiaRecords v1.1.7 Beta (Disabled!)

Post by jimpower » 29 Sep 2011 19:56

Image

Maniarecords was finally disabled!
ManiaRecords was always an interim solution until Dedimania came to TM2. That's why we disable our service now - More than 1 WR-Database does not make sense. Thanks to everyone who spent time on coding and maintaining the Database - Especially uBm and undef.de.
Cheerio,
jimpower


About this ManiaRecords-Plugin
An Online World-Record Database Plugin. The world records that you drive on servers that use this plugin are stored in a centralized database. The records of ManiaRecords are displayed on MX.

Features
  • Global, server-independent World-Record Logging
  • Cross-Servertool compatible (XAseco2, FoxControl, Manialive)
  • Database and statistics on the web
  • Records are displayed on MX
  • High configurable
  • Records-Eyepiece integration
  • Compatible to undef's Info-Widget
Download: Plugin ManiaRecords v1.1.7 Beta

Help: Frequently Asked Questions

ManiaRecords on the Web: http://maniarecords.org

Updating to v1.1.7: Make sure to replace the worldrecords.xml with the new one!

It's quiet simple to install:
  • Extract the files to the Xaseco2-Folder
  • Put this into your plugins.xml: <plugin>plugin.worldrecords.php</plugin>
  • Edit the worldrecords.xml to set the position a.s.o.
Updated Screen

ImageImage

If you experience problems...

Please connect as Master-Admin to your server and type /maniarecords debugon into the chat. Then drive 1 or 2 rounds and send the XAseco2-Logfile, the Server-Account and a detailed description of the problem to the E-Mail that you see after typing the command above. Make sure to remove all private data from the log, before sending the mail. Thank you!

Changelog
Changes v1.1.6
* Bugfix

Changes v1.1.5
* Optimized performance by Transmission-Queue
* Reduced amount of data thats transferred

Changes v1.1.4
* Position of the detail window can be changed
* Info-Widget support can be disabled
* Banlist support

Changes v1.1.3
* Added <ForcePanelDisplay> to the config. Enable this if you see no panel during race.

Changes v1.1.2
* Added a check if Records-Eyepiece is active to hide the panel automatically
* Added <DisableRacePanel> and <DisableScorePanel> to the config
* Disabled the <debug>-Tag in the config. Start debugging by /maniarecords debugon
* Update messages are now displayed on important updates only

Changes v1.1.1
* Interim Release, no big changes

Changes v1.1.0
* Bugfix. Now everything seems to be stable

Changes v1.0.9
* Prepared for the upcoming Records-Eyepiece Version
* Full support for the Info-Widget
* Fixed Mania Link Tags
* Added a new debug feature
* Fixed a bug in the network code
* Updated the XML
* Renamed the window title to ManiaRecords

Changes v1.0.8
* More configuration options
* Fixed bug during API-Initialization
* Improved Security
* Added links to the Web-Database


Changes v1.0.7
* Fixed last rank position showing false values
* Fixed window position on restart

Changes v1.0.6
* Style configuration via the worldrecords.xml
* Fixed a ranking bug

Changes v1.0.5
* Chat messages

Changes v1.0.4
* Bugfix

Changes v1.0.3:
* Record-List is updating instantly
* Fixed PHP-Warnings

Changes v1.0.2:
* Window Layout optimized
* Clickable Recordlist

Hope this helps for the moment!

Cheers,
vni aka jimpower
Last edited by jimpower on 05 Feb 2012 18:15, edited 39 times in total.
www.ManiaRecords.org - Tm² World Record Database

uBm
wheelbarrow operator
wheelbarrow operator
Posts: 21
Joined: 02 Aug 2010 04:26
Owned TM-games: TMUF

Re: [XASECO2] Plugin: Worldrecords v1.0.0 Beta

Post by uBm » 30 Sep 2011 02:33

hi jimpower,

i would like to ask u if i am allowed to adapt your plugin for fox control :) - as long as dedimania is not available.. (if u like i can send u the adapted version for verifying it)

thanks for your answer & best regards

User avatar
jimpower
road tourist
road tourist
Posts: 80
Joined: 24 Dec 2008 09:30
Owned TM-games: TMNF, TMUF, TMC
Location: Germany
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.2 Beta

Post by jimpower » 30 Sep 2011 08:12

Sure, that's what I made it for. Just send me a PM.
www.ManiaRecords.org - Tm² World Record Database

HexenMeister
wheelbarrow operator
wheelbarrow operator
Posts: 24
Joined: 18 Apr 2008 10:05
Owned TM-games: TMU
Location: Germany, BW
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.2 Beta

Post by HexenMeister » 30 Sep 2011 14:07

Nice plugin but i get an error:

Code: Select all

Undefined index: info online 306 in file ......plugin.worldrecords.php
this is in line 306:

Code: Select all

if ($ret['info']) $aseco->client->query('ChatSendServerMessage', '$f00'.$ret['info']);
after begin a round then get an error like this:

Code: Select all

Trying to get property of non-object on line 89 in file.....plugin.worldrecords.php
this is line 89:

Code: Select all

if ($challenge->uid && $challenge->name)

User avatar
jimpower
road tourist
road tourist
Posts: 80
Joined: 24 Dec 2008 09:30
Owned TM-games: TMNF, TMUF, TMC
Location: Germany
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.2 Beta

Post by jimpower » 30 Sep 2011 15:38

Hi,

thanks for your advice, it's not an error, it is just a warning because of an unset array index. You can use the plugin, ignoring this.

I will upload 1.0.3 tonight where this is fixed and where the Record-List is updating instantly.
www.ManiaRecords.org - Tm² World Record Database

User avatar
jimpower
road tourist
road tourist
Posts: 80
Joined: 24 Dec 2008 09:30
Owned TM-games: TMNF, TMUF, TMC
Location: Germany
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.3 Beta

Post by jimpower » 30 Sep 2011 16:04

Update 1.0.3 avail, see first post.
www.ManiaRecords.org - Tm² World Record Database

kremsy
road tourist
road tourist
Posts: 81
Joined: 29 Jun 2011 17:03
Owned TM-games: TMF, TM2
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.4 Beta

Post by kremsy » 01 Oct 2011 09:33

nice but i dont like the mousover color change :(

and it always said i have a modificated version of WORLDRECORDS, but i havent changed anything
You need a TM2 Server? Look on: http://www.tm2-server.net :)

New Shootmania Server available, check out: http://www.mania-server.net

User avatar
jimpower
road tourist
road tourist
Posts: 80
Joined: 24 Dec 2008 09:30
Owned TM-games: TMNF, TMUF, TMC
Location: Germany
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.4 Beta

Post by jimpower » 01 Oct 2011 11:15

Do you already use 1.0.5? Give me your serverlink pls
www.ManiaRecords.org - Tm² World Record Database

jeanpisq
highway camper
highway camper
Posts: 3
Joined: 01 Oct 2011 11:53
Owned TM-games: pix

Re: [XASECO2] Plugin: Worldrecords v1.0.4 Beta

Post by jeanpisq » 01 Oct 2011 12:00

message in chat
Attention you are using a thmodified version of worldrecord this is not allowed
rec no fonctioned ...
version 1.04 ok
version 1.05 bad bugs

my serveur
france/centre/loir et cher /golden lol/mini
france/centre/loir et cher /golden canyon
france/centre/loir et cher /golden nadeo
Thanks^^

User avatar
McRobert
cyclist
cyclist
Posts: 36
Joined: 19 Jun 2008 23:28
Owned TM-games: TMFU, TM²
Location: Cremona, Italy
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.4 Beta

Post by McRobert » 01 Oct 2011 12:35

Hello and thanks for this useful plugin, I'm allowed to change the configuration of your graphic work, and make it editable from the configuration file, you place your files modified by me.

Image

Image

worldrecords.xml

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<settings>
	<!-- 
	Worldrecords Configuration
	by Bullracing!vni
	-->
	
	<!-- The font size -->
	<fontSize>1.5</fontSize>
	
	
	<!-- RACE -->
	<!-- Records-Window during RACE -->
	<MaxWRsRace>10</MaxWRsRace>
	<PosXRace>-64</PosXRace>
	<PosYRace>20</PosYRace>
	
	<!-- Records-Window Color Title RACE -->
	<Race_Color_Title>FFFF</Race_Color_Title>
	
	<!-- Records-Window Style during RACE -->
	<Race_Stylewr>BgsPlayerCard</Race_Stylewr>
	<Race_SubStylewr>BgRacePlayerName</Race_SubStylewr>
	
	<!-- Records-Window Title Style during RACE -->
	<Race_StyleTitlewr>BgsPlayerCard</Race_StyleTitlewr>
	<Race_SubStyleTitlewr>BgPlayerName</Race_SubStyleTitlewr>
	
	<!-- Records-Window Icon Style during RACE -->
	<Race_Stylewr_Icon>Icons128x128_1</Race_Stylewr_Icon>
	<Race_SubStylewr_Icon>Rankings</Race_SubStylewr_Icon>
	
	
	
	<!-- SCORE -->
	<!-- Records-Window during SCOREBOARD -->
	<MaxWRsScore>5</MaxWRsScore>
	<PosXScore>47.8</PosXScore>
	<PosYScore>-12</PosYScore>
	
	<!-- Records-Window Color Title SCORE -->
	<Score_Color_Title>FFFF</Score_Color_Title>
	
	<!-- Records-Window Style during SCORE -->
	<Score_Stylewr>BgsPlayerCard</Score_Stylewr>
	<Score_SubStylewr>ProgressBar</Score_SubStylewr>
	
	<!-- Records-Window Title Style during SCORE -->
	<Score_StyleTitlewr>BgsPlayerCard</Score_StyleTitlewr>
	<Score_SubStyleTitlewr>BgRacePlayerName</Score_SubStyleTitlewr>
	
	<!-- Records-Window Icon Style during Score -->
	<Score_Stylewr_Icon>Icons128x128_1</Score_Stylewr_Icon>
	<Score_SubStylewr_Icon>Rankings</Score_SubStylewr_Icon>
	
	<!-- DO NOT CHANGE THESE DATA -->
	<api_host>api.trackmaniaserver.org</api_host>
	<api_path>/api_v_2_0_0.php</api_path>
	<api_timeout>30</api_timeout>
	<api_version>1</api_version>
</settings>

plugin.worldrecords.php

Code: Select all

<?php
/* Worldrecords v1.0.5 Beta for TM2
 *
 * Plugin by Bullracing!vni
 * Visit www.bullracing.org or trackmaniaserver.org
 * Thanks to Xymph & Co for the quick Xaseco2
 *
 *
 *
 * DO NOT EDIT THIS FILE !!!!!!!!!!!!!!!!!!!!!!!
 * EDIT THE worldrecords.xml !!!!
 *
 *
 *
 */


 
Aseco::registerEvent('onPlayerConnect', 	'event_Connect');
Aseco::registerEvent('onPlayerDisconnect',	'event_Disconnect');

Aseco::registerEvent('onNewChallenge',	 	'event_StartRace');
Aseco::registerEvent('onBeginRound', 		'event_StartRace');
Aseco::registerEvent('onBeginMap', 			'event_StartRace');
Aseco::registerEvent('onBeginMap2',			'event_StartRace');

Aseco::registerEvent('onEndRace', 			'event_EndRace');
Aseco::registerEvent('onEndRound', 			'event_EndRace');
Aseco::registerEvent('onRestartMap2', 		'event_EndRace');
Aseco::registerEvent('onEndMap1', 			'event_EndRace');

Aseco::registerEvent('onEverySecond',		'event_TimerTick');
Aseco::registerEvent('onPlayerFinish1',		'event_PlayerFinish');
Aseco::registerEvent('onSync',				'event_Sync');
Aseco::registerEvent('onPlayerManialinkPageAnswer',	'showDetailedWRs');

$settingsXML = simplexml_load_file('worldrecords.xml');
global $wr, $wrcache, $datacache, $wrlastrec, $wrdbcount;

$wr['config']['fontsize'] = (float)$settingsXML->fontSize; //1.5;

$wr['config']['fontsize'] = 1;

$wr['config']['maxwrs_race'] = (float)$settingsXML->MaxWRsRace; //10;
$wr['config']['posX_race'] = (float)$settingsXML->PosXRace; //-63.8;
$wr['config']['posY_race'] = (float)$settingsXML->PosYRace; //20;

$wr['config']['maxwrs_score'] = (float)$settingsXML->MaxWRsScore;//5;
$wr['config']['posX_scores'] = (float)$settingsXML->PosXScore; //43.2;
$wr['config']['posY_scores'] = (float)$settingsXML->PosYScore; //-12;


$wr['config']['style_Racewr'] = (string)$settingsXML->Race_Stylewr; //Race_Style_Window;
$wr['config']['substyle_Racewr'] = (string)$settingsXML->Race_SubStylewr; //Race_SubStyle_Window;
$wr['config']['style_RaceTitlewr'] = (string)$settingsXML->Race_StyleTitlewr; //Race_Style_Title;
$wr['config']['substyle_RaceTitlewr'] = (string)$settingsXML->Race_SubStyleTitlewr; //Race_SubStyle_Title;
$wr['config']['style_Color_TitlewrRace'] = (string)$settingsXML->Race_Color_Title; //Race_Color_Title;
$wr['config']['style_Icon_Racewr'] = (string)$settingsXML->Race_Stylewr_Icon; //Race_Style_Icon;
$wr['config']['substyle_Icon_Racewr'] = (string)$settingsXML->Race_SubStylewr_Icon; //Race_SubStyle_Icon;

$wr['config']['style_Scorewr'] = (string)$settingsXML->Score_Stylewr; //Score_Style_Window;
$wr['config']['substyle_Scorewr'] = (string)$settingsXML->Score_SubStylewr; //Score_SubStyle_Window;
$wr['config']['style_ScoreTitlewr'] = (string)$settingsXML->Score_StyleTitlewr; //Score_Style_Title;
$wr['config']['substyle_ScoreTitlewr'] = (string)$settingsXML->Score_SubStyleTitlewr; //Score_SubStyle_Title;
$wr['config']['style_Color_TitlewrScore'] = (string)$settingsXML->Score_Color_Title; //Score_Color_Title;
$wr['config']['style_Icon_Scorewr'] = (string)$settingsXML->Score_Stylewr_Icon; //Score_Style_Icon;
$wr['config']['substyle_Icon_Scorewr'] = (string)$settingsXML->Score_SubStylewr_Icon; //Score_SubStyle_Icon;

$wr['config']['api_host'] = (string)$settingsXML->api_host; //'api.trackmaniaserver.org';
$wr['config']['api_path'] = (string)$settingsXML->api_path; //'/api_v_2_0_0.php';
$wr['config']['api_timeout'] = (int)$settingsXML->api_timeout; //30;
$wr['config']['api_version'] = (int)$settingsXML->api_version; //1;

$wr['version'] = 1;
$wr['version_string'] = '1.0.5';

$wr['lastaction'] = '';

function event_Sync($aseco)
{
	global $wr;
	if ($aseco->server->getGame() != 'MP') die('############## Worldrecords-Plugin is for TM2 only! ###################'); 
	$wr['serverlogin'] = $aseco->server->serverlogin;
	$wr['servername'] = stripColors(removespecchars($aseco->server->name));
	$wr['serverhash'] = contribute();
	$aseco->console('##################################');
	$aseco->console('# WorldRecords v'.$wr['version_string']);
	$aseco->console('# by Bullracing!vni');
	$aseco->console('# STR: '.$wr['serverhash']);
	$aseco->console('##################################');
}

function event_Connect($aseco, $player)
{
	global $wr,$wrcache;
	$aseco->client->query('SendDisplayManialinkPageToLogin', $player->login, $wrcache, 0, false);
}

function event_Disconnect($aseco, $player)
{
	global $wr;
}

function event_StartRace($aseco, $challenge)
{
	global $wr;
	if (!isset($challenge)) return;
	if ($challenge->uid && $challenge->name)
	{
		wrPanel_hide($aseco);
		if ($wr['lastaction'] == 'STARTRACE') return;
		
		$wr['data'] = array();
		$wr['lastaction'] = 'STARTRACE';
		$wr['challenge']['uid'] = removespecchars($challenge->uid);
		$wr['challenge']['name'] = removespecchars($challenge->name);
		$wr['challenge']['gamemode'] = $aseco->server->gameinfo->mode;
		$wr['method'] = 'request';
		
		$response = mm_request($wr);
		if (!isset($response['wrs'])) 
		{
			$response['wrs'] = array();
			$wrlastrec = 0;
			$wrdbcount = 0;
			$aseco->client->query('ChatSendServerMessage', '$F90[WR] $F00No WRs on this track!');

		}
		else
		{
			$wrlastrec = $response['wrs'][count($response['wrs'])-1]['record'];
			$wrdbcount = count($response['wrs']);
			$aseco->client->query('ChatSendServerMessage', '$F90[WR] $F00First WR: $FF0'.formatTime($response['wrs'][0]['record']).' $F00- Last WR: $FF0'.formatTime($wrlastrec).' $F00on $FFF'.$challenge->name);
			
		}
		wrPanel($aseco,$response['wrs']);
	}
}

function event_EndRace($aseco)
{
	global $wr;
	wrPanel_hide($aseco);
	if ($wr['lastaction'] == 'ENDRACE') return;
	
	$wr['lastaction'] = 'ENDRACE';
	
	$wr['method'] = 'submit';
	$response = mm_request($wr);
	wrPanel($aseco,$response['wrs']);
}

function event_PlayerFinish($aseco, $data)
{
	global $wr,$wrcache,$datacache;
	
	
	$login =  $data->player->login;
	$score =  $data->score;
	$nickname =  $data->player->nickname;

	if ($score)
	{
		if (!isset($wr['data'][$login]) || (!$wr['data'][$login]['best']) || ($wr['data'][$login]['best'] > $score))
		{
			$wr['data'][$login]['best'] = $score;
			$wr['data'][$login]['nickname'] = removespecchars($nickname);
			$wr['data'][$login]['nicknameclean'] = stripColors(removespecchars($nickname));
			$wr['data'][$login]['timestamp'] = time();
			
			$addnew=true;
			$showchat=false;
			$inranks=false;
			if ($datacache['wrs'])
			{
				$k=0;
				foreach($datacache['wrs'] as $record)
				{
					if (($record['login'] == $login) && ($record['record'] > $score)) 
					{
						unset($datacache['wrs'][$k]);
						$addnew=true;
						$showchat=true;
						$inranks=true;
					}
					
					if (($record['login'] == $login) && ($record['record'] <= $score)) 
					{
						$addnew=false;
						$showchat=false;
						$inranks=true;
					}
					
					$k++;
				}
				$datacache['wrs'] = array_values($datacache['wrs']);
			}
			
			if ($addnew==true)
			{
				$datacache['wrs'][] = array('login' => $login, 
								   'nickname' => removespecchars($nickname), 
								   'record' => $score);
				wrPanel($aseco,$datacache['wrs']);
			}
			
			if ($inranks && $showchat)
			{
				$newrecords = array_sort_int($datacache['wrs'], 'record');
				for($ranking = 0; $ranking < count($newrecords); $ranking++)
				{
					if ($newrecords[$ranking]['login'] == $login)
					{
						$aseco->client->query('ChatSendServerMessageToLogin', '$F90[WR] $F00Congratulations! You claimed the '.($ranking+1).'. world record ('.formatTime($newrecords[$ranking]['record']).')', $login);
						break;
					}
				}			
			}
			elseif(!$inranks && !$showchat)
			{
				$newrecords = array_sort_int($datacache['wrs'], 'record');
				for($ranking = 0; $ranking < count($newrecords); $ranking++)
				{
					if ($ranking < 30)
					{
						if ($newrecords[$ranking]['login'] == $login)
						{
							$aseco->client->query('ChatSendServerMessageToLogin', '$F90[WR] $F00Congratulations! You claimed the '.($ranking+1).'. world record ('.formatTime($newrecords[$ranking]['record']).')', $login);
							break;
						}
					}
				}			
			}
		}
	}
}

function wrPanel_hide($aseco)
{
	global $wr;
	$xml = '<manialink id="90120002"></manialink>';
	$aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
}

function wrPanel($aseco,$table)
{
	global $wr, $wrcache;

	if ($wr['lastaction'] == 'STARTRACE')
	{
		$posx = $wr['config']['posX_race'];
		$posy = $wr['config']['posY_race'];
		$maxwrs = $wr['config']['maxwrs_race'];
		$stylewr = $wr['config']['style_Racewr'];
		$substylewr = $wr['config']['substyle_Racewr'];
		$styleTitlewr = $wr['config']['style_RaceTitlewr'];
		$substyleTitlewr = $wr['config']['substyle_RaceTitlewr'];
		$TextColorwr = $wr['config']['style_Color_TitlewrRace'];
		$styleIconwr = $wr['config']['style_Icon_Racewr'];
		$substyleIconwr = $wr['config']['substyle_Icon_Racewr'];
	}
	else
	{
		$posx = $wr['config']['posX_scores'];
		$posy = $wr['config']['posY_scores'];
		$maxwrs = $wr['config']['maxwrs_score'];
		$stylewr = $wr['config']['style_Scorewr'];
		$substylewr = $wr['config']['substyle_Scorewr'];
		$styleTitlewr = $wr['config']['style_ScoreTitlewr'];
		$substyleTitlewr = $wr['config']['substyle_ScoreTitlewr'];
		$TextColorwr = $wr['config']['style_Color_TitlewrScore'];
		$styleIconwr = $wr['config']['style_Icon_Scorewr'];
		$substyleIconwr = $wr['config']['substyle_Icon_Scorewr'];
	}

	$table = array_sort_int($table, 'record');

	$height_head = -3;
	$height_recs = $maxwrs*($wr['config']['fontsize']+0.5);
	
	if (count($table)>$maxwrs) $maxwrs -= 1;
	
	$xml = '<manialink id="90120001">
	<frame posn="'.$posx.' '.$posy.' 0">
		<quad posn="0 0 0" sizen="15.5 '.(abs($height_head) + $height_recs).'" style="'.$stylewr.'" substyle="'.$substylewr.'" action="76426932" ></quad>
		<quad posn="0.4 -0.36 3" sizen="14.7 2" style="'.$styleTitlewr.'" substyle="'.$substyleTitlewr.'" ></quad>';
		$xml .= '<quad posn="0.4 -0.36 3.1" sizen="2.6 2.6" style="'.$styleIconwr.'" substyle="'.$substyleIconwr.'"/>';
		$xml .= '<label posn="1 -0.8 3.2" sizen="15.5 '.(abs($height_head)).'" halign="left" valign="top" textsize="1" scale="0.9" textcolor="'.$TextColorwr.'" text="        World-Records v'.$wr['version_string'].'"></label>';
		$y=$height_head;
		if ($wr['challenge']['uid'])
		{
			if ($table)
			{
				$count=0;
				foreach ($table as $record)
				{
					if ($count++ >= $maxwrs) break;
					$xml .= '<label posn="0.5 '.$y.' 0" sizen="2 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="'.$count.'."></label>';
					$xml .= '<label posn="1.9 '.$y.' 0" sizen="5 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="08FF" text="'.formatTime($record['record']).'"></label>';
					$xml .= '<label posn="6 '.$y.' 0" sizen="10.4 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="'.$record['nickname'].'"></label>';
					$y -= ($wr['config']['fontsize']+0.5);
				}
				if (count($table)>$maxwrs)
				{
					$record = $table[count($table)-1];
					$xml .= '<label posn="0.5 '.$y.' 0" sizen="2 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="'.count($table).'."></label>';
					$xml .= '<label posn="1.9 '.$y.' 0" sizen="5 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="08FF" text="'.formatTime($record['record']).'"></label>';
					$xml .= '<label posn="6 '.$y.' 0" sizen="10.4 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="'.$record['nickname'].'"></label>';
					$y -= ($wr['config']['fontsize']+0.5);
				}
			}
			else
			{
					$xml .= '<label posn="0.5 '.$y.' 0" sizen="2 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="--."></label>';
					$xml .= '<label posn="1.9 '.$y.' 0" sizen="5 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="0F0F" text="-:--.---"></label>';
					$xml .= '<label posn="6 '.$y.' 0" sizen="10.4 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="--"></label>';
				
			}
		}
		else
		{
			$xml .= '<label posn="1 '.$y.' 0" sizen="20 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="WRs will be visible on the next track!"></label>';
		}
		$xml.='
	</frame>
	</manialink>';
	$aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
	$wrcache = $xml;
}

function showDetailedWRs($aseco, $answer)
{
	global $wr,$datacache;
	
	$table = array_sort_int($datacache['wrs'], 'record');
	
	$player = $aseco->server->players->player_list[$answer[1]];
	if ($answer[2] == '76426932')
	{
		$xml = '<manialink id="90120002">
		<frame posn="-12 25 0">
			<quad posn="0 0 0" sizen="25 56" style="BgsPlayerCard" substyle="BgCardSystem" action="76426933" >
			</quad>
			<quad posn="0.4 -0.36 0.04" sizen="24.2 2" style="BgsPlayerCard" substyle="ProgressBar" ></quad>
			';
			
		$xml .= '<label posn="1 -0.8 0" sizen="15.5 2" halign="left" valign="top" textsize="1" scale="0.9" textcolor="FFFF" text="Complete World-Ranking"></label>';
			
		$y=-4;
		if ($table)
		{
			$count=0;
		foreach ($table as $record)
		{
					$count++;
					$xml .= '<label posn="0.5 '.$y.' 0" sizen="2 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="'.$count.'."></label>';
					$xml .= '<label posn="1.9 '.$y.' 0" sizen="5 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="08FF" text="'.formatTime($record['record']).'"></label>';
					$xml .= '<label posn="6 '.$y.' 0" sizen="10.4 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="'.$record['nickname'].'"></label>';
					$y -= ($wr['config']['fontsize']+0.5);
					if ($count == 30) break;
		}
		}
		else
		{
					$xml .= '<label posn="0.5 '.$y.' 0" sizen="2 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="--."></label>';
					$xml .= '<label posn="1.9 '.$y.' 0" sizen="5 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="08FF" text="-:--.---"></label>';
					$xml .= '<label posn="6 '.$y.' 0" sizen="10.4 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FFFF" text="--"></label>';
					$y -= ($wr['config']['fontsize']+0.5);
		}
		$xml .= '<label posn="0.5 '.($y-1).' 0" sizen="25 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="999F" text="$CCCWORLDRECORD Plugin v'.$wr['version_string'].' by vni"></label>';
		$xml .= '<label posn="0.5 '.($y-3).' 0" sizen="25 '.($wr['config']['fontsize']+0.5).'" halign="left" valign="top" scale="0.9" textsize="'.$wr['config']['fontsize'].'" textcolor="FF0F" text="[Get the plugin here]" url="http://tinyurl.com/6yhvhq5"></label>';
		$xml.='
		</frame>
		</manialink>';
		$aseco->client->query('SendDisplayManialinkPageToLogin', $player->login, $xml, 0, false);
		
	}
	
	if ($answer[2] == '76426933')
	{
		$xml = '<manialink id="90120002">
		</manialink>';
		$aseco->client->query('SendDisplayManialinkPageToLogin', $player->login, $xml, 0, false);
	}
}

function event_TimerTick($aseco)
{
}


function removespecchars($text)
{
	$rem = array("'",'\\','"',"\\",'/',':','{','}');
	return str_replace($rem,'',$text);
}
function array_sort_int($array_unsorted, $item)
{
	if (!is_array($array_unsorted)) return;
	global $itemholderint;
	$itemholderint=$item;
	if (!function_exists("cmpint"))
	{
		function cmpint($a, $b)
		{
			global $itemholderint;
			if ((int)$a[$itemholderint] == (int)$b[$itemholderint]) {
				return 0;
			}
			return ((int)$a[$itemholderint] < (int)$b[$itemholderint]) ? -1 : 1;
		}		
	}
	
	usort($array_unsorted, "cmpint");
	return $array_unsorted;
}
function contribute() {return md5(filesize(__FILE__));}
function mm_request($data) 
{
	global $aseco, $wr, $datacache;
	
	$data_to_send = 'data='.build_request($data);
	$fp = fsockopen($wr['config']['api_host'], 80, $errno, $errstr, $wr['config']['api_timeout']);
	fputs($fp, "POST /api_v_3_0_0.php HTTP/1.1\r\n");
	fputs($fp, "Host: ".$wr['config']['api_host']."\r\n");
	fputs($fp, "Referer: ".$aseco->server->serverlogin."\r\n");
	fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
	fputs($fp, "Content-length: ". strlen($data_to_send) ."\r\n");
	fputs($fp, "Connection: close\r\n\r\n");
	fputs($fp, $data_to_send);
	$res="";
	while(!feof($fp)) {
	  $res .= fgets($fp, 1024);
	}
	$result = explode("\r\n\r\n", $res, 2);
    $header = isset($result[0]) ? $result[0] : '';
    $content = isset($result[1]) ? $result[1] : '';
	fclose($fp);
	$ret = unserialize(($content));
	$datacache = $ret;
	if (isset($ret['info'])) $aseco->client->query('ChatSendServerMessage', '$f00'.$ret['info']);
	return $ret;
}

function build_request($data)
{
	global $wrlastrec, $wrdbcount;
	
	$reqdata = array();
	
	//Method
	$reqdata['method']			= $data['method'];
	
	//Serverdata
	$reqdata['svr']['login'] 	= $data['serverlogin'];
	$reqdata['svr']['name']		= $data['servername'];
	$reqdata['svr']['hash']		= $data['serverhash'];

	//Challengedata
	$reqdata['cha']['uid']		= $data['challenge']['uid'];
	$reqdata['cha']['name']		= $data['challenge']['name'];
	$reqdata['cha']['gamemode']	= $data['challenge']['gamemode'];
	
	//Playerdata
	$reqdata['pla'] = array();
	foreach ($data['data'] as $login => $values)
	{
		$item = array();
		$item['login'] = $login;
		$item['nickname'] = base64_encode($values['nickname']);
		$item['score'] = $values['best'];
		
		if ($wrdbcount >= 30)
		{
			if ($values['best'] <= $wrlastrec)
			{
				$reqdata['pla'][] = $item;
			}
		}
		else
		{
			$reqdata['pla'][] = $item;
		}
	}
	
	return urlencode(base64_encode(serialize($reqdata)));
}

?>
Ciaoooo and thanks
BaMcRober
Image
Image

User avatar
jimpower
road tourist
road tourist
Posts: 80
Joined: 24 Dec 2008 09:30
Owned TM-games: TMNF, TMUF, TMC
Location: Germany
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.4 Beta

Post by jimpower » 01 Oct 2011 12:53

jeanpisq wrote:message in chat
Attention you are using a thmodified version of worldrecord this is not allowed
Did you make any changes on the plugin.worldrecords.php? Please post the startup sequence of your aseco logfile

@McRobert
Thanks, I will port that into the upcoming version
www.ManiaRecords.org - Tm² World Record Database

jeanpisq
highway camper
highway camper
Posts: 3
Joined: 01 Oct 2011 11:53
Owned TM-games: pix

Re: [XASECO2] Plugin: Worldrecords v1.0.4 Beta

Post by jeanpisq » 01 Oct 2011 13:51

End Map
[10/01,14:39:10] [RASP] Calculating ranks...
[10/01,14:39:10] [RASP] ...Done!
[10/01,14:39:10] set min timelimit for [TM2 --> goes to Wallstreet]: 4:00. (Auth
or time: 0:15.060)
Begin Map
[10/01,14:39:14] map changed [The Great Jump] >> [TM2 --> goes to Wallstreet]
[10/01,14:39:14] current record on TM2 --> goes to Wallstreet is 0:13.527 and he
ld by ─Á─®─Á─½91ÊéÊä Êà┬¿
Begin Round
End Round
[PHP Notice] Undefined index: wrs on line 133 in file C:\Users\jeanpix\Desktop\s
erveur golden lol mini\xaseco2\plugins\plugin.worldrecords.php
End Map
[10/01,14:43:21] [RASP] Calculating ranks...
[10/01,14:43:21] [RASP] ...Done!
[10/01,14:43:22] set min timelimit for [Track #6]: 4:00. (Author time: 0:16.611)

Begin Map
[10/01,14:43:27] map changed [TM2 --> goes to Wallstreet] >> [Track #6]
[10/01,14:43:27] current record on Track #6 is 0:16.477 and held by Ó©┐ÒÇÆÓ╣ô` ┼
×┼º─øÒâñÒéä─ôÐؤëÐ╗lÊÆ
Begin Round
[10/01,14:45:13] << player 238 joined the game [phenni : the^$5fcsag'/"\ : Germa

THX^^ :wink:

User avatar
McRobert
cyclist
cyclist
Posts: 36
Joined: 19 Jun 2008 23:28
Owned TM-games: TMFU, TM²
Location: Cremona, Italy
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.4 Beta

Post by McRobert » 01 Oct 2011 14:24

jimpower wrote: @McRobert
Thanks, I will port that into the upcoming version
Thanks to you and your work:)
BaMcRober
Image
Image

User avatar
jimpower
road tourist
road tourist
Posts: 80
Joined: 24 Dec 2008 09:30
Owned TM-games: TMNF, TMUF, TMC
Location: Germany
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.4 Beta

Post by jimpower » 01 Oct 2011 14:29

New version 1.0.6 is up, see 1st post.
www.ManiaRecords.org - Tm² World Record Database

User avatar
McRobert
cyclist
cyclist
Posts: 36
Joined: 19 Jun 2008 23:28
Owned TM-games: TMFU, TM²
Location: Cremona, Italy
Contact:

Re: [XASECO2] Plugin: Worldrecords v1.0.6 Beta

Post by McRobert » 01 Oct 2011 15:02

Excuse me, but to me this message, and I'm not charging times.

Code: Select all

Attention you are using a thmodified version of worldrecord this is not allowed
BaMcRober
Image
Image

Post Reply