| @@ 86-96 (lines=11) @@ | ||
| 83 | * @param int|null $user_id Optional username of the player to disconnect. |
|
| 84 | * @return JsonResponse |
|
| 85 | */ |
|
| 86 | public static function disconnect(string $username = null, int $user_id = null) |
|
| 87 | { |
|
| 88 | $response = [ |
|
| 89 | 'key' => 'disconnect', |
|
| 90 | 'data' => [], |
|
| 91 | ]; |
|
| 92 | ||
| 93 | ($username != null ? $response['data']['username'] = $username : $response['data']['user_id'] = $user_id); |
|
| 94 | ||
| 95 | return (new RCONSocket($response))->run(); |
|
| 96 | } |
|
| 97 | ||
| 98 | /** |
|
| 99 | * Execute a command through user id. |
|
| @@ 262-274 (lines=13) @@ | ||
| 259 | * @param string $url The link to include. |
|
| 260 | * @return JsonResponse |
|
| 261 | */ |
|
| 262 | public static function hotelAlert(string $message, string $url = null) |
|
| 263 | { |
|
| 264 | $response = [ |
|
| 265 | 'key' => 'hotelAlert', |
|
| 266 | 'data' => [ |
|
| 267 | 'message' => $message, |
|
| 268 | ], |
|
| 269 | ]; |
|
| 270 | ||
| 271 | ($url != null ? $response['data']['url'] = $url : $response); |
|
| 272 | ||
| 273 | return (new RCONSocket($response))->run(); |
|
| 274 | } |
|
| 275 | ||
| 276 | /** |
|
| 277 | * Ignore an user. |
|