diff options
author | peterbell10 <peterbell10@live.co.uk> | 2020-05-15 00:15:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 00:15:35 +0200 |
commit | 13144a08e496b89b34093ffd3d810d3442df3c44 (patch) | |
tree | 406d79e17b69560564fdb0972a3c50542a3a96c6 /src/Server.cpp | |
parent | Generate "LuaState_Typedefs.inc" before running clang-tidy (diff) | |
download | cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.gz cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.bz2 cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.lz cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.xz cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.zst cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.zip |
Diffstat (limited to 'src/Server.cpp')
-rw-r--r-- | src/Server.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Server.cpp b/src/Server.cpp index ab45f6553..19a08cc65 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -289,10 +289,10 @@ const AStringMap & cServer::GetRegisteredForgeMods(const UInt32 a_Protocol) -bool cServer::IsPlayerInQueue(AString a_Username) +bool cServer::IsPlayerInQueue(const AString & a_Username) { cCSLock Lock(m_CSClients); - for (auto client : m_Clients) + for (const auto & client : m_Clients) { if ((client->GetUsername()).compare(a_Username) == 0) { @@ -403,7 +403,7 @@ void cServer::TickClients(float a_Dt) bool cServer::Start(void) { - for (auto port: m_Ports) + for (const auto & port: m_Ports) { UInt16 PortNum; if (!StringToInteger(port, PortNum)) @@ -422,11 +422,7 @@ bool cServer::Start(void) LOGERROR("Couldn't open any ports. Aborting the server"); return false; } - if (!m_TickThread.Start()) - { - return false; - } - return true; + return m_TickThread.Start(); } @@ -636,7 +632,7 @@ void cServer::BindBuiltInConsoleCommands(void) void cServer::Shutdown(void) { // Stop listening on all sockets: - for (auto srv: m_ServerHandles) + for (const auto & srv: m_ServerHandles) { srv->Close(); } |