Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/server/StarServerRconClient.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-27 20:23:44 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-27 20:23:44 +1000
commit332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch)
treefd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/server/StarServerRconClient.cpp
parent14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff)
The Formatting String Catastrophe
Diffstat (limited to 'source/server/StarServerRconClient.cpp')
-rw-r--r--source/server/StarServerRconClient.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/server/StarServerRconClient.cpp b/source/server/StarServerRconClient.cpp
index a42a8ea..91e651b 100644
--- a/source/server/StarServerRconClient.cpp
+++ b/source/server/StarServerRconClient.cpp
@@ -36,12 +36,12 @@ String ServerRconClient::handleCommand(String commandLine) {
return commandLine;
} else if (command == "broadcast" || command == "say") {
m_universe->adminBroadcast(commandLine);
- return strf("OK: said %s", commandLine);
+ return strf("OK: said {}", commandLine);
} else if (command == "stop") {
m_universe->stop();
return "OK: shutting down";
} else {
- return m_universe->adminCommand(strf("%s %s", command, commandLine));
+ return m_universe->adminCommand(strf("{} {}", command, commandLine));
}
}
@@ -118,17 +118,17 @@ void ServerRconClient::processRequest() {
String command;
m_packetBuffer >> command;
try {
- Logger::info("RCON %s: %s", m_socket->remoteAddress(), command);
+ Logger::info("RCON {}: {}", m_socket->remoteAddress(), command);
sendCmdResponse(requestId, handleCommand(command));
} catch (std::exception const& e) {
- sendCmdResponse(requestId, strf("RCON: Error executing: %s: %s", command, outputException(e, true)));
+ sendCmdResponse(requestId, strf("RCON: Error executing: {}: {}", command, outputException(e, true)));
}
} else {
sendAuthFailure();
}
break;
default:
- sendCmdResponse(requestId, strf("Unknown request %06x", cmd));
+ sendCmdResponse(requestId, strf("Unknown request {:06x}", cmd));
}
}
@@ -138,7 +138,7 @@ void ServerRconClient::run() {
processRequest();
} catch (NoMoreRequests const&) {
} catch (std::exception const& e) {
- Logger::error("ServerRconClient exception caught: %s", outputException(e, false));
+ Logger::error("ServerRconClient exception caught: {}", outputException(e, false));
}
}