improved player data ram storage read & write
This commit is contained in:
parent
8d7f6bc62b
commit
20f769c496
@ -209,11 +209,9 @@ class PlayerDataManager {
|
|||||||
|
|
||||||
$meta = $this->metaData[$className . $dataName];
|
$meta = $this->metaData[$className . $dataName];
|
||||||
|
|
||||||
//Check if data is already in the ram
|
// Check if data is already in the ram
|
||||||
if (isset($this->storedData[$player->index])) {
|
if (isset($this->storedData[$player->index]) && isset($this->storedData[$player->index][$meta->dataId])) {
|
||||||
if (isset($this->storedData[$player->index][$meta->dataId])) {
|
return $this->storedData[$player->index][$meta->dataId];
|
||||||
return $this->storedData[$player->index][$meta->dataId];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$mysqli = $this->maniaControl->database->mysqli;
|
$mysqli = $this->maniaControl->database->mysqli;
|
||||||
@ -296,10 +294,11 @@ class PlayerDataManager {
|
|||||||
}
|
}
|
||||||
$statement->close();
|
$statement->close();
|
||||||
|
|
||||||
//FIXME store changed value
|
// Store changed value
|
||||||
if (isset($this->storedData[$player->index]) && isset($this->storedData[$player->index][$dataId])) {
|
if (!isset($this->storedData[$player->index])) {
|
||||||
unset($this->storedData[$player->index][$dataId]);
|
$this->storedData[$player->index] = array();
|
||||||
}
|
}
|
||||||
|
$this->storedData[$player->index][$dataId] = $value;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user