Page 1 of 2

ManiaLive r194

Posted: 24 Feb 2011, 16:06
by farfa
Here is a new version of ManiaLive which is compatible with the latest Release of the Dedicated server (http://www.tm-forum.com/viewtopic.php?f ... 67#p191667)
Image

Upgrade
This version should work well again with the update script.
Find it in the /update directory. Windows users execute the update.bat where Linux users will have to pass the file to the php executeable.

Download
If you want to upgrade from any older version or this is your first install, go to http://www.manialive.com.
See the download tab for the latest release, download and extract it.

Plugins
As always you can download just the core, but that won't do much :-)
Download the new plugin package on: http://code.google.com/p/manialive/downloads/list
Extract it to the ManiaLive folder. After that you need to add the plugins in your config file so that they are loaded (read the wiki on the google project on how to do that).

Features you should know about
Thanks to the latest release, there is now a currentVote property in the Storage class. this property contain an object if there is a vote in progress. The object stay in the Storage class until the end of the loop of the end of the vote. If there is no vote, the property is set to null.
We also add a Cache system. In this class you can store data you want to share with other plugins. You have 4 methods to know to use it

Code: Select all

//To store some data
//The timeToLive value is optionnal, if set, the value will be destoyed once the time in second will be reached
$this->store('mySuperKey',$mySuperData, $timeToLive);
//To get some data stored by the plugin itself
$mySuperData = $this->fetchOwn('mySuperKey');
//To get some data stored by an other plugin
if($this->exists($pluginId,'mySuperKey'))
{
     $mySuperData = $this->fetch('$pluginId, 'mySuperKey');
}
If you try to fetch a data that does not exists in the cache it will throw an exception

Changes
+ add compatibility with server build of 21st feb 2011
+ add the currentVote to the storage class
+ add Cache system to ManiaLive to store data to be share between classes
* bug fixes

Re: ManiaLive r194

Posted: 24 Feb 2011, 18:00
by aseco
There are just three more changes in the new version you should know about:
- plugin errors in onLoad won't crash whole manialive anymore.
- version checks are failsafe now.
+ implemented onPlayerFinishLap event in storage class.

Also, I want to mention, that for the new Dedimania version it is necessary ( :roll: ) to run the latest Dedicated Server version!

Re: ManiaLive r194

Posted: 24 Feb 2011, 19:24
by Xymph
aseco wrote:Also, I want to mention, that for the new Dedimania version it is inevitable to run the latest Dedicated Server version!
Out of curiosity, which specific feature of the new dedicated is necessary (not inevitable ;) ) for your Dedi plugin?

Re: ManiaLive r194

Posted: 24 Feb 2011, 22:02
by 4lturbo
aseco wrote: + implemented onPlayerFinishLap event in storage class.
\o/, very nice, thanks, tested and approved

Re: ManiaLive r194

Posted: 25 Feb 2011, 10:52
by aseco
Xymph wrote:
aseco wrote:Also, I want to mention, that for the new Dedimania version it is inevitable to run the latest Dedicated Server version!
Out of curiosity, which specific feature of the new dedicated is necessary (not inevitable ;) ) for your Dedi plugin?
xbx wrote:new method GetCurrentRankingForLogin(), which is like GetCurrentRankings(), but for a specific login or list of logins. (useful for teammode as GetCurrentRankings() just returns the score for the 2 teams and not for the individual players)
In the end it was not totally necessary, but it has been the nicest way to do it.

EDIT:
Finally we succeeded in tracking the Fatal error: Exception thrown without stack frame in Unknown on line 0:
Before I explain the reason, I will just post a link to our wiki where it is explained how you can fix this.
Ok, the reason is not so obvious: I think this is related to the CRT-bug (http://bugs.php.net/bug.php?id=49948) which throws an exception right at the start of manialive and as manialive is trying to parse that exception, the date() method throws another one just within the exception handler. Now php can't provide a stack frame anymore and is unable to tell the exact reason ... :roll:
4lturbo wrote:\o/, very nice, thanks, tested and approved
:-) yup, this really took some time of testing and debugging ...

Re: ManiaLive r194

Posted: 17 Mar 2011, 16:15
by 4lturbo
The event ON_PLAYER_FINISH_LAP is sent even if the track isn't a lap challenge you must add a test if challenge is multilap or not (in Data\Storage.php onPlayerCheckpoint() method ) ;)

Re: ManiaLive r194

Posted: 17 Mar 2011, 16:34
by farfa
Just like the endRound callback, it's send even if I'm not in round mod. You can consider a track in timeAttack like a track of 1 lap ;)

Re: ManiaLive r194

Posted: 17 Mar 2011, 17:11
by 4lturbo
Yes, but i use this event to get top lap, and this isn't good to see "Best Lap" in a challenge which it isn't multilap ;)
You already have onPlayerBestTime (for no multilap challenge)

Think about this "little bug" in the next release 8-)
Only add this at the end of onPlayercheckpoint() method in Storage.php

Code: Select all

if ($this->currentChallenge->lapRace) 
{
   Dispatcher::dispatch(new Event($this, Event::ON_PLAYER_NEW_BEST_TIME, array($player, $old_best, $timeOrScore)));
}

Posted: 24 Mar 2011, 23:48
by 4lturbo
I have the same trouble with this version than with r189 (Link)

Code: Select all

DOMElement::setAttribute(): string is not in UTF-8
I have this error today with the nickname ( $£$524adm$£$265intzt , and the other time was $z$o$000Kryw$ffà~$90CH )
So i look to my plugin source, with this nick as mine, this happens when i call String::stripAllTmStyle, in this two nick there is $ with a no valid char (for tmn syntax), so there is, may be, an error in the preg_match pattern.

PS: Farfa, do you have read my MP ?

Re: ManiaLive r194

Posted: 25 Mar 2011, 17:02
by weerwolf
Fatal Crash:
and Note: I allready adjusted php limit to 50Mb

Code: Select all

Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 71 bytes) in /LYNX1server/LYNX1manialive/libraries/ManiaLive/Gui/Handler/IDGenerator.php on line 71