@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace eXpansion\Core\DataProviders; |
| 4 | 4 | |
| 5 | -use eXpansion\Core\Services\Console; |
|
| 6 | 5 | use eXpansion\Core\Storage\MapStorage; |
| 7 | 6 | use Maniaplanet\DedicatedServer\Connection; |
| 8 | 7 | use Maniaplanet\DedicatedServer\Xmlrpc\IndexOutOfBoundException; |
@@ -8,8 +8,6 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace eXpansion\Core\Storage\Data; |
| 10 | 10 | |
| 11 | -use eXpansion\Core\Exceptions\Storage\NotFoundException; |
|
| 12 | - |
|
| 13 | 11 | /** |
| 14 | 12 | * All data related to a player/spectator on the server. |
| 15 | 13 | * |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | public function getMapByIndex($index) |
| 66 | 66 | { |
| 67 | - $map = array_slice($this->maps, (int)$index, 1, false); |
|
| 67 | + $map = array_slice($this->maps, (int) $index, 1, false); |
|
| 68 | 68 | return end($map); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -104,9 +104,9 @@ |
||
| 104 | 104 | if (!empty($calls)) { |
| 105 | 105 | foreach ($calls as $call) { |
| 106 | 106 | $method = preg_replace('/^[[:alpha:]]+\./', '', $call[0]); // remove trailing "Whatever." |
| 107 | - $params = (array)$call[1]; |
|
| 108 | - $this->console->writeln('$fffCallback: $070' . $method); |
|
| 109 | - $this->console->writeln('$ff0Params: $777' . print_r($params, true)); |
|
| 107 | + $params = (array) $call[1]; |
|
| 108 | + $this->console->writeln('$fffCallback: $070'.$method); |
|
| 109 | + $this->console->writeln('$ff0Params: $777'.print_r($params, true)); |
|
| 110 | 110 | |
| 111 | 111 | $this->dataProviderManager->dispatch($method, $params); |
| 112 | 112 | } |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | foreach ($matches[0] as $i => $rgb) { |
| 122 | 122 | $code = $this->fixColors(hexdec($rgb[1]), hexdec($rgb[2]), hexdec($rgb[3])); |
| 123 | 123 | if (array_key_exists($code, $array)) { |
| 124 | - $out .= $array[$code] . $this->stripStyles($split[$i + 1]); |
|
| 124 | + $out .= $array[$code].$this->stripStyles($split[$i + 1]); |
|
| 125 | 125 | } else { |
| 126 | - $out .= self::white . $this->stripStyles($split[$i + 1]); |
|
| 126 | + $out .= self::white.$this->stripStyles($split[$i + 1]); |
|
| 127 | 127 | } |
| 128 | 128 | $end = $this->stripStyles($split[$i + 1]); |
| 129 | 129 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $end = ""; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - $out = self::white . $this->stripStyles(reset($split)) . $out . $end; |
|
| 140 | + $out = self::white.$this->stripStyles(reset($split)).$out.$end; |
|
| 141 | 141 | } else { |
| 142 | 142 | $out = $this->stripStyles($string); |
| 143 | 143 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $nl = ""; |
| 159 | 159 | if ($newline) $nl = "\n"; |
| 160 | 160 | |
| 161 | - echo $msg . self::normal . $nl; |
|
| 161 | + echo $msg.self::normal.$nl; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $out = "222"; |
| 199 | 199 | } |
| 200 | 200 | } else { |
| 201 | - $out = $this->convert($r) . $this->convert($g) . $this->convert($b); |
|
| 201 | + $out = $this->convert($r).$this->convert($g).$this->convert($b); |
|
| 202 | 202 | } |
| 203 | 203 | return $out; |
| 204 | 204 | } |
@@ -156,7 +156,9 @@ |
||
| 156 | 156 | { |
| 157 | 157 | // $this->consoleOutput->write($msg . self::normal, $newline, ConsoleOutputInterface::OUTPUT_RAW); |
| 158 | 158 | $nl = ""; |
| 159 | - if ($newline) $nl = "\n"; |
|
| 159 | + if ($newline) { |
|
| 160 | + $nl = "\n"; |
|
| 161 | + } |
|
| 160 | 162 | |
| 161 | 163 | echo $msg . self::normal . $nl; |
| 162 | 164 | } |
@@ -28,6 +28,6 @@ |
||
| 28 | 28 | if ($player->getPlayerId() === 0) { |
| 29 | 29 | $from = '$777Console'; |
| 30 | 30 | } |
| 31 | - $this->console->writeln('$ff0[' . $from . '$ff0] ' . $text); |
|
| 31 | + $this->console->writeln('$ff0['.$from.'$ff0] '.$text); |
|
| 32 | 32 | } |
| 33 | 33 | } |
@@ -45,12 +45,12 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | public function onBeginMap(Map $map) |
| 47 | 47 | { |
| 48 | - $this->console->writeln('$0f0Begin Map: $fff' . $map->name); |
|
| 48 | + $this->console->writeln('$0f0Begin Map: $fff'.$map->name); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function onEndMap(Map $map) |
| 52 | 52 | { |
| 53 | - $this->console->writeln('$0f0End Map: $fff' . $map->name); |
|
| 53 | + $this->console->writeln('$0f0End Map: $fff'.$map->name); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function onPlayerCheckpoint(Player $player, $time, $lap, $index) |
| 66 | 66 | { |
| 67 | - $this->console->writeln('$0f0Checkpoint $ff0' . $index . ': $fff' . Time::TMtoMS($time, true) . ' $777' . $player->getNickName()); |
|
| 67 | + $this->console->writeln('$0f0Checkpoint $ff0'.$index.': $fff'.Time::TMtoMS($time, true).' $777'.$player->getNickName()); |
|
| 68 | 68 | |
| 69 | 69 | } |
| 70 | 70 | |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | public function onPlayerFinish(Player $player, $time) |
| 78 | 78 | { |
| 79 | 79 | if ($time > 0) { |
| 80 | - $this->console->writeln('$777' . $player->getNickName() . ' $0f0Finished with time: $fff' . Time::TMtoMS($time, true)); |
|
| 80 | + $this->console->writeln('$777'.$player->getNickName().' $0f0Finished with time: $fff'.Time::TMtoMS($time, true)); |
|
| 81 | 81 | } else { |
| 82 | - $this->console->writeln('$777' . $player->getNickName() . ' $f00Retired'); |
|
| 82 | + $this->console->writeln('$777'.$player->getNickName().' $f00Retired'); |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
@@ -109,12 +109,12 @@ discard block |
||
| 109 | 109 | if ($this->previousMemoryValue != $mem) { |
| 110 | 110 | |
| 111 | 111 | $diff = ($mem - $this->previousMemoryValue); |
| 112 | - $msg = '$fff> Memory: $ff0' . $mem . "kb "; |
|
| 112 | + $msg = '$fff> Memory: $ff0'.$mem."kb "; |
|
| 113 | 113 | |
| 114 | 114 | if ($this->previousMemoryValue < $mem) { |
| 115 | - $msg .= ' $f00+' . $diff . "kb"; |
|
| 115 | + $msg .= ' $f00+'.$diff."kb"; |
|
| 116 | 116 | } else { |
| 117 | - $msg .= ' $0f0-' . $diff . "kb"; |
|
| 117 | + $msg .= ' $0f0-'.$diff."kb"; |
|
| 118 | 118 | } |
| 119 | 119 | $this->console->writeln($msg); |
| 120 | 120 | |
@@ -19,8 +19,8 @@ |
||
| 19 | 19 | $time = intval($time); |
| 20 | 20 | $ms = ""; |
| 21 | 21 | if ($milliseconds) { |
| 22 | - $ms = ":" . str_pad(($time % 1000), 3, '0', STR_PAD_LEFT); |
|
| 22 | + $ms = ":".str_pad(($time % 1000), 3, '0', STR_PAD_LEFT); |
|
| 23 | 23 | } |
| 24 | - return gmdate("i:s", $time / 1000) . $ms; |
|
| 24 | + return gmdate("i:s", $time / 1000).$ms; |
|
| 25 | 25 | } |
| 26 | 26 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function onPlayerFinish($uid, $login, $data) |
| 77 | 77 | { |
| 78 | - $this->dispatch(__FUNCTION__, [$this->playerStorage->getPlayerInfo($login), (float)$data]); |
|
| 78 | + $this->dispatch(__FUNCTION__, [$this->playerStorage->getPlayerInfo($login), (float) $data]); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function onPlayerCheckpoint($uid, $login, $time, $currentLap, $index) |
| 89 | 89 | { |
| 90 | - $this->dispatch(__FUNCTION__, [$this->playerStorage->getPlayerInfo($login), (float)$time, (int)$currentLap, (int)$index]); |
|
| 90 | + $this->dispatch(__FUNCTION__, [$this->playerStorage->getPlayerInfo($login), (float) $time, (int) $currentLap, (int) $index]); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |