ManiaLive 1.0 r223

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

Moderator: NADEO

oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: ManiaLive 1.0 r223

Post by oliverde8 »

farfa wrote:There is a chat command to open the pluginManager ;) it's pluginmanager
I know that :D I want to add a button to my menu that will do the same.

but as openWindow metho isn't set as public :

Code: Select all

$this->setPublicMethod('openWindow');
The menu can't use it, It would be nice if you add thaty line for the next version.
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
Fadden
Posts: 181
Joined: 10 May 2011, 18:21

Re: ManiaLive 1.0 r223

Post by Fadden »

Hello !

I try to create my first manialive plugin but I have a problem... :?
Is there a bug with the onPlayerNewBestTime event ?

My code (for test) is :

Code: Select all

class Test extends \ManiaLive\PluginHandler\Plugin
{	
	function onInit()
	{
		$this->setVersion(1.0);
	}
	
	function onLoad()
	{
		$this->enableStorageEvents();
		$this->enableDedicatedEvents();
	}
	
	function onPlayerFinish($playerid, $login, $time)
	{
		if($time != 0)
			$this->connection->chatSendServerMessage($login." finish. Time : ".Time::fromTM($time));
	}
	
	function onPlayerNewBestTime($player, $best_old, $best_new)
	{
		$this->connection->chatSendServerMessage($player->login." : New best time : ".Time::fromTM($best_new).". (Old was ".Time::fromTM($best_old).")");
	}
	
	function onBeginRace($challenge)
	{
		$this->connection->chatSendServerMessage("\$FF0Challenge is now : ".$challenge['Name']);
	}
}
I think it should be run as (for onPlayerNewBestTime) :
- When a player finish a track, if it's his best time on the track since the start of it, onPlayerNewBestTime trigger.

But I have that :
Image

I feel that the best time is not reset between the tracks. But as we can see at the before-last line, the best time of the last track was stored but the onPlayerNewBestTime was not triggered.
Is it a bug or there is something I didn't understand ?
Elle est où la poulette ?
User avatar
4lturbo
Posts: 106
Joined: 13 Jan 2011, 18:26

Re: ManiaLive 1.0 r223

Post by 4lturbo »

Yes, there is a bug, add this code in ManiaLive/Data/Storage.php -> onBeginChallenge() (line 312):

Code: Select all

foreach($this->players as $player)
{
  $player->bestTime = 0;
  $player->score = 0;
}
foreach($this->spectators as $spectator)
{
  $spectator->bestTime = 0;
  $spectator->score = 0;
}
or download the last ML version in google code project.
The next release will be out soon
CT*ImHoTep
ModLap Championship
Image
Le jour où l'on mettra les cons sur orbite, y en a qui n'ont pas fini de tourner ...
Fadden
Posts: 181
Joined: 10 May 2011, 18:21

Re: ManiaLive 1.0 r223

Post by Fadden »

Ok thanks :)
Elle est où la poulette ?
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: ManiaLive 1.0 r223

Post by oliverde8 »

It seems thre is a problem wit the PHP Memory Limit in the Profiler, The value shown shoudl be divised by 1024.

I didn't look at the code but on my Linux server as well as on my Windows test server the values in the window is false.
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: ManiaLive 1.0 r223

Post by oliverde8 »

Hi again,

I just wanted to make a widget for Dedimania and saw that it was impossible, ot at least think it is.

There is no event Dispatching on newDediRecord for exemple or an event letting us know dedimania records has been loaded. And I couldn't see any way to get the dedimania Record list, there isn't any public method I can call.

Can we hope an update?
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
nouseforname
Posts: 32
Joined: 30 Dec 2010, 19:03

Re: ManiaLive 1.0 r223

Post by nouseforname »

lot of this error in log:

Code: Select all

 -> ManiaLive\DedicatedApi\Xmlrpc\Exception with code -1000
    Login unknown.
long time known, but no change yet....


need mroe info? just ask
User avatar
Knutselmaaster
Posts: 1206
Joined: 15 Jun 2010, 18:03
Location: Somewhere between Paris and Disney in France.
Contact:

Re: ManiaLive 1.0 r223

Post by Knutselmaaster »

It has been fixed.
Before the error was playeruid unknown.
See it more as an announcement in stead of an error :)
It is a player that has left, and ml says that it can't find the login.
We don't even want that login so why should we worry :lol:
nouseforname
Posts: 32
Joined: 30 Dec 2010, 19:03

Re: ManiaLive 1.0 r223

Post by nouseforname »

Knutselmaaster wrote:It has been fixed.
Before the error was playeruid unknown.
See it more as an announcement in stead of an error :)
It is a player that has left, and ml says that it can't find the login.
We don't even want that login so why should we worry :lol:

well than avoid the output :) if its not an error there is no need to print it into the error log.
User avatar
w1lla
Posts: 2287
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: ManiaLive 1.0 r223

Post by w1lla »

A better explanation:

Code: Select all

function onPlayerConnect($login, $isSpectator)
    {
           try
           {
                  $playerInfos = Connection::getInstance()->getPlayerInfo($login, 1);
                  $details = Connection::getInstance()->getDetailedPlayerInfo($login);

                  foreach($details as $key => $value)
                  {
                         if($value)
                         {
                                $param = lcfirst($key);
                                $playerInfos->$param = $value;
                         }
                  }

                  if($isSpectator)
                  {
                         $this->spectators[$login] = $playerInfos;
                  }
                  else
                  {
                         $this->players[$login] = $playerInfos;
                  }
           }

           // if player can not be added to array, then we stop the onPlayerConnect event!
           catch(\Exception $e)
           {
                  if($e->getCode() == -1000 && $e->getMessage() == 'Login unknown.')
                  {
                         throw new SilentCriticalEventException($e->getMessage());
                  }
                  else
                  {
                         throw new CriticalEventException($e->getMessage());
                  }
           }
    }
File:

libraries/ManiaLive/Data/Storage.php
Line 228 downwards.
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
Post Reply

Return to “Dedicated Server Tools”

Who is online

Users browsing this forum: No registered users and 1 guest