@@ -172,7 +172,7 @@ |
||
| 172 | 172 | $this->fuelChannel = $this->toDiscordChannel; |
| 173 | 173 | } |
| 174 | 174 | //Set timer for next key based on number of keys |
| 175 | - $nextKey = (1900 / (int)$this->numberOfKeys) + time(); |
|
| 175 | + $nextKey = (1900 / (int) $this->numberOfKeys) + time(); |
|
| 176 | 176 | $nextKeyTime = gmdate("Y-m-d H:i:s", $nextKey); |
| 177 | 177 | setPermCache("notificationsLastChecked", $nextKey); |
| 178 | 178 | //Set cache timer for api key |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | $cacheClr = $baseUnix - 13500; |
| 147 | 147 | |
| 148 | 148 | //Set timer for next key based on number of keys |
| 149 | - $nextKey = (1900 / (int)$this->numberOfKeys) + time(); |
|
| 149 | + $nextKey = (1900 / (int) $this->numberOfKeys) + time(); |
|
| 150 | 150 | $nextKeyTime = gmdate("Y-m-d H:i:s", $nextKey); |
| 151 | 151 | setPermCache("mailLastChecked", $nextKey); |
| 152 | 152 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | $discord->on( |
| 134 | 134 | 'ready', |
| 135 | - function ($discord) use ($logger, $config, $plugins, $pluginsT, $discord) { |
|
| 135 | + function($discord) use ($logger, $config, $plugins, $pluginsT, $discord) { |
|
| 136 | 136 | // In here we can access any of the WebSocket events. |
| 137 | 137 | // |
| 138 | 138 | // There is a list of event constants that you can |
@@ -152,21 +152,21 @@ discard block |
||
| 152 | 152 | $discord->updatePresence($game); |
| 153 | 153 | |
| 154 | 154 | // Server Status Check (tick plugins will not run if eve is offline) |
| 155 | - $discord->loop->addPeriodicTimer(60, function () use ($logger) { |
|
| 155 | + $discord->loop->addPeriodicTimer(60, function() use ($logger) { |
|
| 156 | 156 | $crestData = json_decode(downloadData("https://crest-tq.eveonline.com/"), true); |
| 157 | 157 | $crestStatus = isset($crestData["serviceStatus"]) ? $crestData["serviceStatus"] : "offline"; |
| 158 | 158 | setPermCache("serverState", $crestStatus); |
| 159 | 159 | }); |
| 160 | 160 | |
| 161 | 161 | // Run the Tick plugins |
| 162 | - $discord->loop->addPeriodicTimer(3, function () use ($pluginsT) { |
|
| 162 | + $discord->loop->addPeriodicTimer(3, function() use ($pluginsT) { |
|
| 163 | 163 | foreach ($pluginsT as $plugin) { |
| 164 | 164 | $plugin->tick(); |
| 165 | 165 | } |
| 166 | 166 | }); |
| 167 | 167 | |
| 168 | 168 | // Message queue |
| 169 | - $discord->loop->addPeriodicTimer(7, function () use ($discord, $logger) { |
|
| 169 | + $discord->loop->addPeriodicTimer(7, function() use ($discord, $logger) { |
|
| 170 | 170 | $x = 0; |
| 171 | 171 | while ($x < 3) { |
| 172 | 172 | $id = getOldestMessage(); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | }); |
| 198 | 198 | |
| 199 | 199 | // Rename queue |
| 200 | - $discord->loop->addPeriodicTimer(10, function () use ($discord, $logger) { |
|
| 200 | + $discord->loop->addPeriodicTimer(10, function() use ($discord, $logger) { |
|
| 201 | 201 | $x = 0; |
| 202 | 202 | while ($x < 4) { |
| 203 | 203 | $id = getOldestRename(); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | }); |
| 223 | 223 | |
| 224 | 224 | // Mem cleanup every 30 minutes |
| 225 | - $discord->loop->addPeriodicTimer(1800, function () use ($logger) { |
|
| 225 | + $discord->loop->addPeriodicTimer(1800, function() use ($logger) { |
|
| 226 | 226 | $logger->addInfo("Memory in use: " . memory_get_usage() / 1024 / 1024 . "MB"); |
| 227 | 227 | gc_collect_cycles(); // Collect garbage |
| 228 | 228 | $logger->addInfo("Memory in use after garbage collection: " . memory_get_usage() / 1024 / 1024 . "MB"); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | $discord->on( |
| 232 | 232 | Event::MESSAGE_CREATE, |
| 233 | - function ($message) use ($logger, $config, $plugins) { |
|
| 233 | + function($message) use ($logger, $config, $plugins) { |
|
| 234 | 234 | |
| 235 | 235 | $msgData = array( |
| 236 | 236 | "message" => array( |
@@ -267,19 +267,19 @@ discard block |
||
| 267 | 267 | ); |
| 268 | 268 | $discord->on( |
| 269 | 269 | 'error', |
| 270 | - function ($error) use ($logger) { |
|
| 270 | + function($error) use ($logger) { |
|
| 271 | 271 | $logger->addError($error); |
| 272 | 272 | exit(1); |
| 273 | 273 | } |
| 274 | 274 | ); |
| 275 | 275 | $discord->on( |
| 276 | 276 | 'reconnecting', |
| 277 | - function () use ($logger) { |
|
| 277 | + function() use ($logger) { |
|
| 278 | 278 | $logger->addInfo('Websocket is reconnecting..'); |
| 279 | 279 | }); |
| 280 | 280 | $discord->on( |
| 281 | 281 | 'reconnected', |
| 282 | - function () use ($logger) { |
|
| 282 | + function() use ($logger) { |
|
| 283 | 283 | $logger->addInfo('Websocket was reconnected..'); |
| 284 | 284 | }); |
| 285 | 285 | // Now we will run the ReactPHP Event Loop! |
@@ -182,10 +182,10 @@ discard block |
||
| 182 | 182 | //Set corp/ally id arrays |
| 183 | 183 | foreach ($this->authGroups as $authGroup) { |
| 184 | 184 | if ($authGroup["corpID"] != 0) { |
| 185 | - array_push($corpArray, (int)$authGroup["corpID"]); |
|
| 185 | + array_push($corpArray, (int) $authGroup["corpID"]); |
|
| 186 | 186 | } |
| 187 | 187 | if ($authGroup["allianceID"] != 0) { |
| 188 | - array_push($allianceArray, (int)$authGroup["allianceID"]); |
|
| 188 | + array_push($allianceArray, (int) $authGroup["allianceID"]); |
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | //Auth things |
| 213 | 213 | if ($xml->result->rowset->row[0]) { |
| 214 | 214 | foreach ($xml->result->rowset->row as $character) { |
| 215 | - if (!in_array((int)$character->attributes()->allianceID, $allianceArray) && !in_array((int)$character->attributes()->corporationID, $corpArray)) { |
|
| 215 | + if (!in_array((int) $character->attributes()->allianceID, $allianceArray) && !in_array((int) $character->attributes()->corporationID, $corpArray)) { |
|
| 216 | 216 | // Deactivate user in database |
| 217 | 217 | $sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'"; |
| 218 | 218 | $this->logger->addInfo("AuthCheck: {$eveName} account has been deactivated as they are no longer in a correct corp/alliance."); |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | $guild = $this->discord->guilds->get('id', $this->guildID); |
| 321 | 321 | |
| 322 | 322 | //Get name queue status |
| 323 | - $x = (int)getPermCache("nameQueueState"); |
|
| 323 | + $x = (int) getPermCache("nameQueueState"); |
|
| 324 | 324 | |
| 325 | 325 | //Establish connection to mysql |
| 326 | 326 | $conn = new mysqli($this->db, $this->dbUser, $this->dbPass, $this->dbName); |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | //Crest |
| 98 | 98 | $crestData = json_decode(downloadData('https://crest-tq.eveonline.com/'), true); |
| 99 | 99 | $crestStatus = isset($crestData['serviceStatus']) ? $crestData['serviceStatus'] : 'offline'; |
| 100 | - $tqOnline = (int)$crestData['userCount']; |
|
| 100 | + $tqOnline = (int) $crestData['userCount']; |
|
| 101 | 101 | |
| 102 | 102 | if (!isset($xml->result)) { |
| 103 | 103 | $this->logger->addInfo('statusCheck: TQ Status check canceled, API Error.'); |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | */ |
| 93 | 93 | function onMessage($msgData, $message) |
| 94 | 94 | { |
| 95 | - $channelID = (int)$msgData['message']['channelID']; |
|
| 95 | + $channelID = (int) $msgData['message']['channelID']; |
|
| 96 | 96 | |
| 97 | 97 | if (in_array($channelID, $this->excludeChannel, true)) { |
| 98 | 98 | return null; |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | { |
| 77 | 77 | $this->message = $message; |
| 78 | 78 | $info['guilds'] = $this->discord->guilds->count(); |
| 79 | - $channelID = (int)$msgData['message']['channelID']; |
|
| 79 | + $channelID = (int) $msgData['message']['channelID']; |
|
| 80 | 80 | |
| 81 | 81 | if (in_array($channelID, $this->excludeChannel, true)) |
| 82 | 82 | { |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | */ |
| 73 | 73 | function onMessage($msgData, $message) |
| 74 | 74 | { |
| 75 | - $channelID = (int)$msgData['message']['channelID']; |
|
| 75 | + $channelID = (int) $msgData['message']['channelID']; |
|
| 76 | 76 | |
| 77 | 77 | if (in_array($channelID, $this->excludeChannel, true)) |
| 78 | 78 | { |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | { |
| 89 | 89 | $this->message = $message; |
| 90 | 90 | $user = $msgData['message']['from']; |
| 91 | - $channelID = (int)$msgData['message']['channelID']; |
|
| 91 | + $channelID = (int) $msgData['message']['channelID']; |
|
| 92 | 92 | |
| 93 | 93 | if (in_array($channelID, $this->excludeChannel, true)) |
| 94 | 94 | { |