From 0dbf856685ace6b9745c1a17ab589e9f838ed3df Mon Sep 17 00:00:00 2001 From: Emma Miler <27428383+emma-miler@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:10:43 +0200 Subject: Fix debug builds (#150) Properly initializes AuthData structs where used. This does not get done automatically in debug mode because c++ is weird like that --- NorthstarDedicatedTest/masterserver.cpp | 2 +- NorthstarDedicatedTest/serverauthentication.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NorthstarDedicatedTest/masterserver.cpp b/NorthstarDedicatedTest/masterserver.cpp index 8cb4f9bb..38268e60 100644 --- a/NorthstarDedicatedTest/masterserver.cpp +++ b/NorthstarDedicatedTest/masterserver.cpp @@ -627,7 +627,7 @@ void MasterServerManager::AuthenticateWithOwnServer(char* uid, char* playerToken goto REQUEST_END_CLEANUP; } - AuthData newAuthData; + AuthData newAuthData {}; strncpy(newAuthData.uid, authInfoJson["id"].GetString(), sizeof(newAuthData.uid)); newAuthData.uid[sizeof(newAuthData.uid) - 1] = 0; diff --git a/NorthstarDedicatedTest/serverauthentication.cpp b/NorthstarDedicatedTest/serverauthentication.cpp index 3417b938..19253fdb 100644 --- a/NorthstarDedicatedTest/serverauthentication.cpp +++ b/NorthstarDedicatedTest/serverauthentication.cpp @@ -129,7 +129,7 @@ void ServerAuthenticationManager::StartPlayerAuthServer() return; } - AuthData newAuthData; + AuthData newAuthData {}; strncpy(newAuthData.uid, request.get_param_value("id").c_str(), sizeof(newAuthData.uid)); newAuthData.uid[sizeof(newAuthData.uid) - 1] = 0; -- cgit v1.2.3 From 90c123e6beabc833e8bbf0eae89653a522cc74bb Mon Sep 17 00:00:00 2001 From: Emma Miler <27428383+emma-miler@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:10:51 +0200 Subject: Make debugoverlay conform to clang-format (#151) --- NorthstarDedicatedTest/debugoverlay.cpp | 34 ++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/NorthstarDedicatedTest/debugoverlay.cpp b/NorthstarDedicatedTest/debugoverlay.cpp index 9620609f..e29da96b 100644 --- a/NorthstarDedicatedTest/debugoverlay.cpp +++ b/NorthstarDedicatedTest/debugoverlay.cpp @@ -36,16 +36,19 @@ struct OverlayBase_t } OverlayType_t m_Type; // What type of overlay is it? - int m_nCreationTick; // Duration -1 means go away after this frame # - int m_nServerCount; // Latch server count, too - float m_flEndTime; // When does this box go away + int m_nCreationTick; // Duration -1 means go away after this frame # + int m_nServerCount; // Latch server count, too + float m_flEndTime; // When does this box go away OverlayBase_t* m_pNextOverlay; __int64 m_pUnk; }; struct OverlayLine_t : public OverlayBase_t { - OverlayLine_t() { m_Type = OVERLAY_LINE; } + OverlayLine_t() + { + m_Type = OVERLAY_LINE; + } Vector3 origin; Vector3 dest; @@ -58,7 +61,10 @@ struct OverlayLine_t : public OverlayBase_t struct OverlayBox_t : public OverlayBase_t { - OverlayBox_t() { m_Type = OVERLAY_BOX; } + OverlayBox_t() + { + m_Type = OVERLAY_BOX; + } Vector3 origin; Vector3 mins; @@ -120,14 +126,24 @@ void __fastcall DrawOverlayHook(OverlayBase_t* pOverlay) if (pCurrBox->a > 0) { RenderBox( - pCurrBox->origin, pCurrBox->angles, pCurrBox->mins, pCurrBox->maxs, - Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, pCurrBox->a), false, false); + pCurrBox->origin, + pCurrBox->angles, + pCurrBox->mins, + pCurrBox->maxs, + Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, pCurrBox->a), + false, + false); } if (pCurrBox->a < 255) { RenderWireframeBox( - pCurrBox->origin, pCurrBox->angles, pCurrBox->mins, pCurrBox->maxs, Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, 255), - false, false); + pCurrBox->origin, + pCurrBox->angles, + pCurrBox->mins, + pCurrBox->maxs, + Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, 255), + false, + false); } } break; -- cgit v1.2.3