From 671f057ccc4a206e867bc4a0b40c68663bbafe18 Mon Sep 17 00:00:00 2001 From: kremsy Date: Sat, 1 Mar 2014 13:13:17 +0100 Subject: [PATCH] dedi bugfix --- application/plugins/Dedimania/Dedimania.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/plugins/Dedimania/Dedimania.php b/application/plugins/Dedimania/Dedimania.php index 90ad7e57..8619db86 100644 --- a/application/plugins/Dedimania/Dedimania.php +++ b/application/plugins/Dedimania/Dedimania.php @@ -197,6 +197,11 @@ class Dedimania implements CallbackListener, TimerListener, Plugin { } else if ($index <= 0) { $responseData = $methodResponse[0]; $this->dedimaniaData->addPlayer(new DedimaniaPlayer($responseData)); + + //Fetch records if he is the first who joined the server + if (count($this->maniaControl->playerManager->getPlayers()) == 1) { + $this->fetchDedimaniaRecords(true); + } } } } else { @@ -274,7 +279,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin { $replays = array(); foreach($this->dedimaniaData->records as $record) { /** @var RecordData $record */ - if($record->rank > $this->dedimaniaData->serverMaxRank){ + if ($record->rank > $this->dedimaniaData->serverMaxRank) { break; }