This commit is contained in:
kremsy 2014-02-24 09:49:29 +01:00 committed by Steffen Schröder
parent 80ccc1a838
commit c23ab78916
2 changed files with 7 additions and 9 deletions

View File

@ -66,9 +66,9 @@ class AsynchronousFileReader {
return false;
}
if($keepAlive){
if ($keepAlive) {
$header = array("Content-Type: " . $contentType, "Keep-Alive: " . $keepAlive, "Connection: Keep-Alive");
}else{
} else {
$header = array("Content-Type: " . $contentType);
}
@ -134,7 +134,7 @@ class AsynchronousFileReader {
$content = str_replace(array("\r", "\n"), '', $content);
if ($compression) {
$content = gzencode($content);
$content = zlib_encode($content, 31);
$header = array("Content-Type: " . $contentType, "Keep-Alive: 300", "Connection: Keep-Alive", "Content-Encoding: gzip");
} else {
$header = array("Content-Type: " . $contentType, "Keep-Alive: 300", "Connection: Keep-Alive");

View File

@ -326,7 +326,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
}
}
}
}, $content, true); //TODO compression
}, $content, false);
}
/**
@ -413,7 +413,6 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
// Save time
$newRecord = new RecordData(null);
$newRecord->constructNewRecord($login, $player->nickname, $data[2], $this->getCheckpoints($login), true);
if ($this->insertDedimaniaRecord($newRecord, $oldRecord)) {
// Get newly saved record
foreach($this->dedimaniaData->records as &$record) {
@ -544,7 +543,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
*/
private function insertDedimaniaRecord(RecordData &$newRecord, RecordData $oldRecord) {
//if (!$newRecord || !$this->dedimaniaData->records || !isset($this->dedimaniaData->records['Records'])) {
if ($newRecord->nullRecord || !$this->dedimaniaData->getRecordCount() == 0) {
if ($newRecord->nullRecord || $this->dedimaniaData->getRecordCount() == 0) {
return false;
}
@ -667,7 +666,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
*/
private function setRecordReplays(RecordData &$record) {
// Set validation replay
$validationReplay = $this->maniaControl->server->getValidationReplay($record['Login']);
$validationReplay = $this->maniaControl->server->getValidationReplay($record->login);
if ($validationReplay) {
$record->vReplay = $validationReplay;
}
@ -772,7 +771,6 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
if (!$this->dedimaniaData->records) {
return new RecordData(null);
}
//TODO
$records = $this->dedimaniaData->records;
foreach($records as &$record) {
/** @var RecordData $record */