diff --git a/r5dev/core/init.cpp b/r5dev/core/init.cpp index ba6419b4..da7cb126 100644 --- a/r5dev/core/init.cpp +++ b/r5dev/core/init.cpp @@ -42,6 +42,7 @@ #include "engine/baseclient.h" #include "engine/host_cmd.h" #include "engine/host_state.h" +#include "engine/net.h" #include "engine/net_chan.h" #include "engine/sv_main.h" #include "engine/sys_dll.h" @@ -73,7 +74,7 @@ void Systems_Init() int nError = ::WSAStartup(MAKEWORD(2, 2), &wsaData); if (nError != 0) { - std::cerr << "Failed to start Winsock via WSAStartup. Error: " << nError << std::endl; + std::cerr << "Failed to start Winsock via WSAStartup: (" << NET_ErrorString(WSAGetLastError()) << ")." << std::endl; } // Begin the detour transaction to hook the the process @@ -149,7 +150,7 @@ void Systems_Shutdown() int nError = ::WSACleanup(); if (nError != 0) { - std::cerr << "Failed to stop winsock via WSACleanup. Error: " << nError << std::endl; + std::cerr << "Failed to stop winsock via WSACleanup: (" << NET_ErrorString(WSAGetLastError()) << ")." << std::endl; } // Begin the detour transaction to unhook the the process diff --git a/r5dev/engine/net.cpp b/r5dev/engine/net.cpp index 3f66e06e..74a05f2c 100644 --- a/r5dev/engine/net.cpp +++ b/r5dev/engine/net.cpp @@ -51,6 +51,7 @@ const char* NET_ErrorString(int iCode) case WSAELOOP : return "WSAELOOP"; case WSAENAMETOOLONG : return "WSAENAMETOOLONG"; case WSAEHOSTDOWN : return "WSAEHOSTDOWN"; + case WSAEPROCLIM : return "WSAEPROCLIM"; case WSASYSNOTREADY : return "WSASYSNOTREADY"; case WSAVERNOTSUPPORTED: return "WSAVERNOTSUPPORTED"; case WSANOTINITIALISED : return "WSANOTINITIALISED"; diff --git a/r5dev/netconsole/netconsole.cpp b/r5dev/netconsole/netconsole.cpp index 32d84f5e..ef185590 100644 --- a/r5dev/netconsole/netconsole.cpp +++ b/r5dev/netconsole/netconsole.cpp @@ -10,6 +10,7 @@ #include "tier2/socketcreator.h" #include "protoc/sv_rcon.pb.h" #include "protoc/cl_rcon.pb.h" +#include "engine/net.h" #include "netconsole/netconsole.h" //----------------------------------------------------------------------------- @@ -23,7 +24,7 @@ bool CNetCon::Init(void) if (nError != 0) { - std::cerr << "Failed to start Winsock via WSAStartup. Error: " << nError << std::endl; + std::cerr << "Failed to start Winsock via WSAStartup: (" << NET_ErrorString(WSAGetLastError()) << ")." << std::endl; return false; } @@ -47,7 +48,7 @@ bool CNetCon::Shutdown(void) int nError = ::WSACleanup(); if (nError != 0) { - std::cerr << "Failed to stop winsock via WSACleanup. Error: " << nError << std::endl; + std::cerr << "Failed to stop winsock via WSACleanup: (" << NET_ErrorString(WSAGetLastError()) << ")." << std::endl; return false; } return true; @@ -212,7 +213,7 @@ bool CNetCon::Connect(const std::string& svInAdr, const std::string& svInPort) if (m_pSocket->ConnectSocket(*m_pNetAdr2, true) == SOCKET_ERROR) { - std::cerr << "Failed to connect. Error: 'SOCKET_ERROR'. Verify IP and PORT." << std::endl; + std::cerr << "Failed to connect. Error: (SOCKET_ERROR). Verify IP and PORT." << std::endl; return false; } std::cout << "Connected to: " << m_pNetAdr2->GetIPAndPort() << std::endl; @@ -240,7 +241,7 @@ void CNetCon::Send(const std::string& svMessage) const int nSendResult = ::send(m_pSocket->GetAcceptedSocketData(0)->m_hSocket, svMessage.c_str(), svMessage.size(), MSG_NOSIGNAL); if (nSendResult == SOCKET_ERROR) { - std::cout << "Failed to send message: SOCKET_ERROR." << std::endl; + std::cout << "Failed to send message: (SOCKET_ERROR)." << std::endl; } }