MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / handleCommand

Method handleCommand

source/server/StarServerRconClient.cpp:32–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32String 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
48void ServerRconClient::receive(size_t size) {
49 m_packetBuffer.reset(size);

Callers

nothing calls this directly

Calls 5

strfFunction · 0.85
extractMethod · 0.80
adminBroadcastMethod · 0.45
stopMethod · 0.45
adminCommandMethod · 0.45

Tested by

no test coverage detected