bugfixes
This commit is contained in:
parent
c6a64d1778
commit
074d1dfd8c
@ -216,7 +216,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
*
|
*
|
||||||
* @param array $callback
|
* @param array $callback
|
||||||
*/
|
*/
|
||||||
public function updateWidget(array $callback) {
|
public function updateWidget(Player $player) {
|
||||||
foreach($this->adminListShown as $login => $shown) {
|
foreach($this->adminListShown as $login => $shown) {
|
||||||
if ($shown) {
|
if ($shown) {
|
||||||
$player = $this->maniaControl->playerManager->getPlayer($login);
|
$player = $this->maniaControl->playerManager->getPlayer($login);
|
||||||
|
@ -174,7 +174,7 @@ class AuthenticationManager implements CallbackListener {
|
|||||||
$authStatement->close();
|
$authStatement->close();
|
||||||
|
|
||||||
$player->authLevel = $authLevel;
|
$player->authLevel = $authLevel;
|
||||||
$this->maniaControl->callbackManager->triggerCallback($player);
|
$this->maniaControl->callbackManager->triggerCallback(self::CB_AUTH_LEVEL_CHANGED, $player);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -253,6 +253,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
|
|||||||
* @param $callback
|
* @param $callback
|
||||||
*/
|
*/
|
||||||
public function handleBeginMap($callback) {
|
public function handleBeginMap($callback) {
|
||||||
|
unset($this->dedimaniaData->records);
|
||||||
$this->fetchDedimaniaRecords(true);
|
$this->fetchDedimaniaRecords(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,6 +274,10 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
|
|||||||
$replays = array();
|
$replays = array();
|
||||||
foreach($this->dedimaniaData->records as $record) {
|
foreach($this->dedimaniaData->records as $record) {
|
||||||
/** @var RecordData $record */
|
/** @var RecordData $record */
|
||||||
|
if($record->rank > $this->dedimaniaData->serverMaxRank){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ($record->newRecord == false) {
|
if ($record->newRecord == false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -321,7 +326,9 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
|
|||||||
// Warnings and TTR
|
// Warnings and TTR
|
||||||
$errors = $methodResponse[0]['methods'][0]['errors'];
|
$errors = $methodResponse[0]['methods'][0]['errors'];
|
||||||
if ($errors) {
|
if ($errors) {
|
||||||
trigger_error($errors);
|
//TODO just temporary
|
||||||
|
$this->maniaControl->errorHandler->triggerDebugNotice("Dedimania Notice on SetChallengeTimes: " . $errors);
|
||||||
|
//trigger_error($errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -406,14 +413,15 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
|
|||||||
|
|
||||||
|
|
||||||
$oldRecord = $this->getDedimaniaRecord($login);
|
$oldRecord = $this->getDedimaniaRecord($login);
|
||||||
|
|
||||||
if ($oldRecord->nullRecord || $oldRecord && $oldRecord->best > $time) {
|
if ($oldRecord->nullRecord || $oldRecord && $oldRecord->best > $time) {
|
||||||
$player = $this->maniaControl->playerManager->getPlayer($login);
|
$player = $this->maniaControl->playerManager->getPlayer($login);
|
||||||
|
|
||||||
// Save time
|
// Save time
|
||||||
$newRecord = new RecordData(null);
|
$newRecord = new RecordData(null);
|
||||||
$newRecord->constructNewRecord($login, $player->nickname, $data[2], $this->getCheckpoints($login), true);
|
$newRecord->constructNewRecord($login, $player->nickname, $data[2], $this->getCheckpoints($login), true);
|
||||||
|
var_dump($oldRecord, $newRecord); //TODO remvoe
|
||||||
if ($this->insertDedimaniaRecord($newRecord, $oldRecord)) {
|
if ($this->insertDedimaniaRecord($newRecord, $oldRecord)) {
|
||||||
|
var_dump("test1234");
|
||||||
// Get newly saved record
|
// Get newly saved record
|
||||||
foreach($this->dedimaniaData->records as &$record) {
|
foreach($this->dedimaniaData->records as &$record) {
|
||||||
/** @var RecordData $record */
|
/** @var RecordData $record */
|
||||||
@ -455,6 +463,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
|
|||||||
$this->dedimaniaData->records = array();
|
$this->dedimaniaData->records = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$serverInfo = $this->getServerInfo();
|
$serverInfo = $this->getServerInfo();
|
||||||
$playerInfo = $this->getPlayerList();
|
$playerInfo = $this->getPlayerList();
|
||||||
$mapInfo = $this->getMapInfo();
|
$mapInfo = $this->getMapInfo();
|
||||||
@ -463,6 +472,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
|
|||||||
if (!$serverInfo || !$playerInfo || !$mapInfo || !$gameMode) {
|
if (!$serverInfo || !$playerInfo || !$mapInfo || !$gameMode) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = array($this->dedimaniaData->sessionId, $mapInfo, $gameMode, $serverInfo, $playerInfo);
|
$data = array($this->dedimaniaData->sessionId, $mapInfo, $gameMode, $serverInfo, $playerInfo);
|
||||||
$content = $this->encode_request(self::DEDIMANIA_GETRECORDS, $data);
|
$content = $this->encode_request(self::DEDIMANIA_GETRECORDS, $data);
|
||||||
|
|
||||||
@ -542,8 +552,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function insertDedimaniaRecord(RecordData &$newRecord, RecordData $oldRecord) {
|
private function insertDedimaniaRecord(RecordData &$newRecord, RecordData $oldRecord) {
|
||||||
//if (!$newRecord || !$this->dedimaniaData->records || !isset($this->dedimaniaData->records['Records'])) {
|
if ($newRecord->nullRecord) {
|
||||||
if ($newRecord->nullRecord || $this->dedimaniaData->getRecordCount() == 0) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user