mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Light improvements to client side RCON system
This commit is contained in:
parent
0b9e5f6e68
commit
cf610b7d6b
@ -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());
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user