Adapt even more to new log system

This commit is contained in:
Amos 2022-03-07 11:32:12 +01:00
parent 84db6e73db
commit 16f2bbc45c
8 changed files with 32 additions and 17 deletions

View File

@ -66,7 +66,7 @@ bool CRConClient::Connect(void)
if (m_pSocket->ConnectSocket(*m_pNetAdr2, true) == SOCKET_ERROR)
{
DevMsg(eDLL_T::CLIENT, "Connection to RCON server failed: (SOCKET_ERROR)\n");
Warning(eDLL_T::CLIENT, "Connection to RCON server failed: (SOCKET_ERROR)\n");
return false;
}
DevMsg(eDLL_T::CLIENT, "Connected to: %s\n", m_pNetAdr2->GetIPAndPort().c_str());
@ -91,7 +91,7 @@ bool CRConClient::Connect(const std::string& svInAdr, const std::string& svInPor
if (m_pSocket->ConnectSocket(*m_pNetAdr2, true) == SOCKET_ERROR)
{
DevMsg(eDLL_T::CLIENT, "Connection to RCON server failed: (SOCKET_ERROR)\n");
Warning(eDLL_T::CLIENT, "Connection to RCON server failed: (SOCKET_ERROR)\n");
return false;
}
DevMsg(eDLL_T::CLIENT, "Connected to: %s\n", m_pNetAdr2->GetIPAndPort().c_str());
@ -118,7 +118,7 @@ void CRConClient::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)
{
DevMsg(eDLL_T::CLIENT, "Failed to send RCON message: (SOCKET_ERROR)\n");
Warning(eDLL_T::CLIENT, "Failed to send RCON message: (SOCKET_ERROR)\n");
}
}

View File

@ -14,8 +14,9 @@
//-----------------------------------------------------------------------------
// Purpose: loads required pakfile assets for specified BSP
// Input : svSetFile -
//-----------------------------------------------------------------------------
void MOD_PreloadPak(void)
void MOD_PreloadPak(const std::string& svSetFile)
{
std::ostringstream ostream;
ostream << "platform\\scripts\\levels\\settings\\" << g_pHostState->m_levelName << ".json";
@ -45,7 +46,7 @@ void MOD_PreloadPak(void)
if (nPakId == -1)
{
DevMsg(eDLL_T::RTECH, "RTech_AsyncLoad: failed read '%s' results '%u'\n", fsPath.string().c_str(), nPakId);
Error(eDLL_T::RTECH, "RTech_AsyncLoad: failed read '%s' results '%u'\n", fsPath.string().c_str(), nPakId);
}
else
{
@ -59,7 +60,7 @@ void MOD_PreloadPak(void)
}
catch (const std::exception& ex)
{
DevMsg(eDLL_T::RTECH, "Exception while parsing RPak load list: '%s'\n", ex.what());
Warning(eDLL_T::RTECH, "Exception while parsing RPak load list: '%s'\n", ex.what());
return;
}
}

View File

@ -7,7 +7,7 @@ namespace
// 0x140256480 // 48 89 5C 24 ? 48 89 6C 24 ? 57 48 81 EC ? ? ? ? 48 8B F9 33 ED //
}
void MOD_PreloadPak(void);
void MOD_PreloadPak(const std::string& svSetFile);
///////////////////////////////////////////////////////////////////////////////
class HModel_BSP : public IDetour
{

View File

@ -4,7 +4,7 @@ namespace
{
/* ==== COMMON ========================================================================================================================================================== */
ADDRESS p_COM_ExplainDisconnection = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\xC4\x48\x89\x50\x10\x4C\x89\x40\x18\x4C\x89\x48\x20\x48\x81\xEC\x00\x00\x00\x00", "xxxxxxxxxxxxxxxxxx????");
void* (*COM_ExplainDisconnection)(void* unused, const char* fmt, ...) = (void* (*)(void*, const char*, ...))p_COM_ExplainDisconnection.GetPtr(); /*48 8B C4 48 89 50 10 4C 89 40 18 4C 89 48 20 48 81 EC ? ? ? ?*/
void* (*COM_ExplainDisconnection)(std::uint64_t level, const char* fmt, ...) = (void* (*)(std::uint64_t, const char*, ...))p_COM_ExplainDisconnection.GetPtr(); /*48 8B C4 48 89 50 10 4C 89 40 18 4C 89 48 20 48 81 EC ? ? ? ?*/
}
///////////////////////////////////////////////////////////////////////////////

View File

@ -34,7 +34,7 @@ enum class OverlayType_t
struct OverlayBase_t
{
OverlayBase_t()
OverlayBase_t(void)
{
m_Type = OverlayType_t::OVERLAY_BOX;
m_nServerCount = -1;
@ -43,7 +43,7 @@ struct OverlayBase_t
m_pNextOverlay = NULL;
unk0 = NULL;
}
bool IsDead();
bool IsDead(void) const;
OverlayType_t m_Type {}; // What type of overlay is it?
int m_nCreationTick{}; // Duration -1 means go away after this frame #
@ -55,7 +55,7 @@ struct OverlayBase_t
struct OverlayLine_t : public OverlayBase_t
{
OverlayLine_t() { m_Type = OverlayType_t::OVERLAY_LINE; }
OverlayLine_t(void) { m_Type = OverlayType_t::OVERLAY_LINE; }
Vector3 origin{};
Vector3 dest{};
@ -68,7 +68,7 @@ struct OverlayLine_t : public OverlayBase_t
struct OverlayBox_t : public OverlayBase_t
{
OverlayBox_t() { m_Type = OverlayType_t::OVERLAY_BOX; }
OverlayBox_t(void) { m_Type = OverlayType_t::OVERLAY_BOX; }
Vector3 origin{};
Vector3 mins{};
@ -80,6 +80,20 @@ struct OverlayBox_t : public OverlayBase_t
int a{};
};
struct OverlaySphere_t : public OverlayBase_t
{
OverlaySphere_t(void) { m_Type = OverlayType_t::OVERLAY_SPHERE; }
Vector3 vOrigin{};
float flRadius{};
int nTheta{};
int nPhi{};
int r{};
int g{};
int b{};
int a{};
};
void HDestroyOverlay(OverlayBase_t* pOverlay);
void DrawOverlay(OverlayBase_t* pOverlay);
void DebugOverlays_Attach();

View File

@ -87,13 +87,13 @@ void HNET_GenerateKey()
BCRYPT_ALG_HANDLE hAlgorithm;
if (BCryptOpenAlgorithmProvider(&hAlgorithm, L"RNG", 0, 0) < 0)
{
DevMsg(eDLL_T::ENGINE, "Failed to open rng algorithm\n");
Error(eDLL_T::ENGINE, "Failed to open rng algorithm\n");
return;
}
unsigned char pBuffer[0x10u];
if (BCryptGenRandom(hAlgorithm, pBuffer, 0x10u, 0) < 0)
{
DevMsg(eDLL_T::ENGINE, "Failed to generate random data\n");
Error(eDLL_T::ENGINE, "Failed to generate random data\n");
return;
}

View File

@ -344,7 +344,7 @@ void* HSys_LoadAssetHelper(const CHAR* lpFileName, std::int64_t a2, LARGE_INTEGE
bBasePaksLoaded || !strcmp(std::string(lpFileName).erase(0, 11).c_str(), "mp_lobby.rpak"))
{
// Attempt to load level dependencies if they exist.
MOD_PreloadPak();
MOD_PreloadPak(svLevelName);
// By the time mp_lobby.rpak is loaded, all the base paks are loaded as well and we can load anything else.
bBasePaksLoaded = true;

View File

@ -45,12 +45,12 @@ void HRtech_AsyncLoad(std::string svPakFileName)
if (nPakId == 0xFFFFFFFF)
{
DevMsg(eDLL_T::RTECH, "RTech_AsyncLoad: Failed read '%s' results '%u'\n", svPakFileName.c_str(), nPakId);
Error(eDLL_T::RTECH, "RTech_AsyncLoad: Failed read '%s' results '%u'\n", svPakFileName.c_str(), nPakId);
}
}
else
{
DevMsg(eDLL_T::RTECH, "RTech_AsyncLoad: Failed. File '%s' doesn't exist\n", svPakFileName.c_str());
Error(eDLL_T::RTECH, "RTech_AsyncLoad: Failed. File '%s' doesn't exist\n", svPakFileName.c_str());
}
}