We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 13 | public function build(SmrAccount $account): never { |
||
| 14 | $db = Database::getInstance(); |
||
| 15 | |||
| 16 | $action = Request::get('action'); |
||
| 17 | if ($action == 'Close') { |
||
| 18 | $reason = Request::get('close_reason'); |
||
| 19 | $db->replace('game_disable', [ |
||
| 20 | 'reason' => $db->escapeString($reason), |
||
| 21 | ]); |
||
| 22 | $db->write('DELETE FROM active_session;'); |
||
| 23 | $msg = '<span class="green">SUCCESS: </span>You have closed the server. You will now be logged out!'; |
||
| 24 | } elseif ($action == 'Open') { |
||
| 25 | $db->write('DELETE FROM game_disable;'); |
||
| 26 | $msg = '<span class="green">SUCCESS: </span>You have opened the server.'; |
||
| 27 | } else { |
||
| 28 | throw new Exception('Unknown action: ' . $action); |
||
| 29 | } |
||
| 30 | |||
| 31 | $container = new AdminTools($msg); |
||
| 32 | $container->go(); |
||
| 33 | } |
||
| 36 |