| 30 | } |
| 31 | |
| 32 | String ServerRconClient::handleCommand(String commandLine) { |
| 33 | String command = commandLine.extract(); |
| 34 | |
| 35 | if (command == "echo") { |
| 36 | return commandLine; |
| 37 | } else if (command == "broadcast" || command == "say") { |
| 38 | m_universe->adminBroadcast(commandLine); |
| 39 | return strf("OK: said {}", commandLine); |
| 40 | } else if (command == "stop") { |
| 41 | m_universe->stop(); |
| 42 | return "OK: shutting down"; |
| 43 | } else { |
| 44 | return m_universe->adminCommand(strf("{} {}", command, commandLine)); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | void ServerRconClient::receive(size_t size) { |
| 49 | m_packetBuffer.reset(size); |
nothing calls this directly
no test coverage detected