From cf610b7d6b5d55be30d2354253200b2e8613b3c1 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 16 Apr 2023 00:22:21 +0200 Subject: [PATCH] Light improvements to client side RCON system --- r5dev/engine/client/cl_rcon.cpp | 4 ++-- r5dev/netconsole/netconsole.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/r5dev/engine/client/cl_rcon.cpp b/r5dev/engine/client/cl_rcon.cpp index b23e623e..a2e718db 100644 --- a/r5dev/engine/client/cl_rcon.cpp +++ b/r5dev/engine/client/cl_rcon.cpp @@ -88,7 +88,7 @@ bool CRConClient::Connect(const char* szInAdr) char szHostName[512]; if (!gethostname(szHostName, sizeof(szHostName))) { - svLocalHost = Format("[%s]:%s", szHostName, hostport->GetString()); + svLocalHost = Format("[%s]:%i", szHostName, hostport->GetInt()); szInAdr = svLocalHost.c_str(); } } @@ -101,7 +101,7 @@ bool CRConClient::Connect(const char* szInAdr) if (m_Socket.ConnectSocket(m_Address, true) == SOCKET_ERROR) { - Warning(eDLL_T::CLIENT, "Connection to RCON server failed: (%s)\n", "SOCKET_ERROR"); + Warning(eDLL_T::CLIENT, "Failed to connect to RCON server: (%s)\n", "SOCKET_ERROR"); return false; } DevMsg(eDLL_T::CLIENT, "Connected to: %s\n", m_Address.ToString()); diff --git a/r5dev/netconsole/netconsole.cpp b/r5dev/netconsole/netconsole.cpp index b13f92fc..b968e851 100644 --- a/r5dev/netconsole/netconsole.cpp +++ b/r5dev/netconsole/netconsole.cpp @@ -244,14 +244,14 @@ bool CNetCon::Connect(const std::string& svInAdr, const std::string& svInPort) const string svFull = Format("[%s]:%s", svLocalHost.empty() ? svInAdr.c_str() : svLocalHost.c_str(), svInPort.c_str()); if (!m_Address.SetFromString(svFull.c_str(), true)) { - Warning(eDLL_T::CLIENT, "Failed to set RCON address: %s\n", svFull.c_str()); + Warning(eDLL_T::NONE, "Failed to set RCON address: %s\n", svFull.c_str()); } } else if (!svInAdr.empty()) // construct from [ip]:port { if (!m_Address.SetFromString(svInAdr.c_str(), true)) { - Warning(eDLL_T::CLIENT, "Failed to set RCON address: %s\n", svInAdr.c_str()); + Warning(eDLL_T::NONE, "Failed to set RCON address: %s\n", svInAdr.c_str()); } } else