ManiaLive 2 r273

Discuss the Dedicated Server Tools developed by Nadeo Live such as ManiaLive, Trust Circles, Dedicated Manager, Competition Manager and Lobbies

Moderator: NADEO

nocturne
Posts: 208
Joined: 23 Jun 2010, 21:31

Re: ManiaLive 2 r273

Post by nocturne »

Bug report, I guess...

Not having any official info to look at regarding the changes to customUI, I can only assume... But..

/libraries/ManiaLive/Gui/Windowing/CustomUI.php

Code: Select all

public $challengeInfo = true;
should be:

Code: Select all

public $mapInfo = true;
/libraries/ManiaLive/Gui/Handler/Manialinks.php
Should be:

Code: Select all

<?php
/**
 * ManiaLive - TrackMania dedicated server manager in PHP
 * 
 * @copyright   Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
 * @license     http://www.gnu.org/licenses/lgpl.html LGPL License 3
 * @version     $Revision: 258 $:
 * @author      $Author: melot.philippe $:
 * @date        $Date: 2011-08-24 11:33:47 +0200 (mer., 24 août 2011) $:
 */

namespace ManiaLive\Gui\Handler;

use ManiaLib\Gui\Manialink;

/**
 * Represents the root elements for manialink element send to
 * the dedicated server
 * It contents manialink and Custom Ui data
 */
abstract class Manialinks
{
	public static $domDocument;
	public static $parentNodes;

	final public static function load()
	{
		self::$domDocument = new \DOMDocument;
		self::$parentNodes = array();

		$manialink = self::$domDocument->createElement('manialinks');
		self::$domDocument->appendChild($manialink);
		self::$parentNodes[] = $manialink;
	}

	final public static function getXml()
	{
		return self::$domDocument->saveXML(self::$domDocument);
	}

	final public static function beginManialink($x=0, $y=0, $z=0, $id=null, $version=1)
	{
		// Create DOM element
		$manialink = self::$domDocument->createElement('manialink');
		
		if ($x)
		{
			$manialink->setAttribute('posx', $x);
		}
		if ($y)
		{
			$manialink->setAttribute('posy', $y);
		}
		if ($z)
		{
			$manialink->setAttribute('posz', $z);
		}
		
		if($id)
		{
			$manialink->setAttribute('id', $id);
		}
		
		if($version)
		{
			$manialink->setAttribute('version', $version);
		}
		end(self::$parentNodes)->appendChild($manialink);

		// Update stacks
		self::$parentNodes[] = $manialink;

		// Update Manialink class
		Manialink::$domDocument = self::$domDocument;
		Manialink::$parentNodes = self::$parentNodes;
		Manialink::$parentLayouts = array();
	}

	final public static function endManialink()
	{
		if(!end(self::$parentNodes)->hasChildNodes())
		{
			end(self::$parentNodes)->nodeValue = ' ';
		}
		array_pop(self::$parentNodes);

		Manialink::$domDocument = null;
		Manialink::$parentNodes = null;
		Manialink::$parentLayouts = null;
	}

	final public static function beginCustomUi()
	{
		$customUi = self::$domDocument->createElement('custom_ui');
		end(self::$parentNodes)->appendChild($customUi);
		self::$parentNodes[] = $customUi;
	}

	final public static function endCustomUi()
	{
		array_pop(self::$parentNodes);
	}
	
	final protected static function setVisibility($parameter, $visibility)
	{
		$parameterNode = self::$domDocument->createElement($parameter);
		$parameterVisibility = self::$domDocument->createAttribute('visible');
		$parameterNode->appendChild($parameterVisibility);

		if($visibility)
		{
			$parameterVisibility->appendChild(self::$domDocument->createTextNode('true'));
		}
		else
		{
			$parameterVisibility->appendChild(self::$domDocument->createTextNode('false'));
		}

		end(self::$parentNodes)->appendChild($parameterNode);
	}

	final public static function setNoticeVisibility($visibility = true)
	{
		self::setVisibility('notice', $visibility);
	}

	final public static function setmapInfoVisibility($visibility = true)
	{
		self::setVisibility('mapInfo', $visibility);
	}

	final public static function setChatVisibility($visibility = true)
	{
		self::setVisibility('chat', $visibility);
	}

	final public static function setCheckpointListVisibility($visibility = true)
	{
		self::setVisibility('checkpointList', $visibility);
	}

	final public static function setRoundScoresVisibility($visibility = true)
	{
		self::setVisibility('roundScores', $visibility);
	}

	final public static function setScoretableVisibility($visibility = true)
	{
		self::setVisibility('scoretable', $visibility);
	}

	final public static function setGlobalVisibility($visibility = true)
	{
		self::setVisibility('global', $visibility);
	}

	static function appendXML($XML)
	{
		$doc = new DOMDocument();
		$doc->loadXML($XML);
		$node = self::$domDocument->importNode($doc->firstChild, true);
		end(self::$parentNodes)->appendChild($node);
	}
}
?>
(lot of naming problems here)

I'm still working out the kinks.. just did a code search/replace, but don't recall if there were any other codings that require changing.
User avatar
w1lla
Posts: 2287
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: ManiaLive 2 r273

Post by w1lla »

@ All people changing mapInfo is false as its still challenge_info for CustomUI.

The dedicated server still uses that so if you want to hide the challenge info use challenge_info and not mapInfo :P
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
nocturne
Posts: 208
Joined: 23 Jun 2010, 21:31

Re: ManiaLive 2 r273

Post by nocturne »

Yeah... I was wondering why I still had a problem with the default r273..

The window handler class needs fixed, but after that everything seems to be working fine.
nocturne
Posts: 208
Joined: 23 Jun 2010, 21:31

Re: ManiaLive 2 r273

Post by nocturne »

*bump*

This thread should still have a sticky.. The r284 release itself is labeled as beta (though it's more of a dev version), and as such, r273 should still be considered the 'main' release when it comes to the end user. Gazing across the forum, I can't see any 3rd party plugins that support r284 yet, a reservation I hope MLEPP maintains while we wait to see what other incovenient and redundant changes Nadeo comes up with next.

Likewise, when making available a test/dev/beta release download on the manialive site, it should also be labeled as such.

Come on guys.. :oops:
Post Reply

Return to “Dedicated Server Tools”

Who is online

Users browsing this forum: No registered users and 1 guest