From 4b09682ab6749b71552db04a0123402b9219e3f5 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 3 Aug 2022 02:35:39 +0200 Subject: Netconsole cleanup --- NetConsole/netconsole.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/NetConsole/netconsole.cpp b/NetConsole/netconsole.cpp index 7dfec29b..892f6192 100644 --- a/NetConsole/netconsole.cpp +++ b/NetConsole/netconsole.cpp @@ -99,14 +99,14 @@ void CNetCon::UserInput(void) if (std::getline(std::cin, svInput)) { - if (strcmp(svInput.c_str(), "nquit") == 0) + if (svInput.compare("nquit") == 0) { m_bQuitApplication = true; return; } if (m_abConnEstablished) { - if (strcmp(svInput.c_str(), "disconnect") == 0) + if (svInput.compare("disconnect") == 0) { this->Disconnect(); return; @@ -115,12 +115,12 @@ void CNetCon::UserInput(void) std::vector vSubStrings = StringSplit(svInput, ' ', 2); if (vSubStrings.size() > 1) { - if (strcmp(vSubStrings[0].c_str(), "PASS") == 0) // Auth with RCON server. + if (vSubStrings[0].compare("PASS") == 0) // Auth with RCON server. { std::string svSerialized = this->Serialize(vSubStrings[1], "", cl_rcon::request_t::SERVERDATA_REQUEST_AUTH); this->Send(svSerialized); } - else if (strcmp(vSubStrings[0].c_str(), "SET") == 0) // Set value query. + else if (vSubStrings[0].compare("SET") == 0) // Set value query. { if (vSubStrings.size() > 2) { @@ -131,13 +131,13 @@ void CNetCon::UserInput(void) } else // Execute command query. { - std::string svSerialized = this->Serialize(svInput.c_str(), "", cl_rcon::request_t::SERVERDATA_REQUEST_EXECCOMMAND); + std::string svSerialized = this->Serialize(svInput, "", cl_rcon::request_t::SERVERDATA_REQUEST_EXECCOMMAND); this->Send(svSerialized); } } else if (!svInput.empty()) // Single arg command query. { - std::string svSerialized = this->Serialize(svInput.c_str(), "", cl_rcon::request_t::SERVERDATA_REQUEST_EXECCOMMAND); + std::string svSerialized = this->Serialize(svInput, "", cl_rcon::request_t::SERVERDATA_REQUEST_EXECCOMMAND); this->Send(svSerialized); } } -- cgit v1.2.3