From 708bfedf71413bb2061a76c3ee4de5cbc8c56513 Mon Sep 17 00:00:00 2001 From: BobTheBob9 Date: Sat, 8 Oct 2022 18:30:44 +0100 Subject: avoid ptr decay when setting auth token --- NorthstarDLL/r2server.h | 8 ++++++-- NorthstarDLL/scriptserverbrowser.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'NorthstarDLL') diff --git a/NorthstarDLL/r2server.h b/NorthstarDLL/r2server.h index 58b39a05..1abe822d 100644 --- a/NorthstarDLL/r2server.h +++ b/NorthstarDLL/r2server.h @@ -10,8 +10,12 @@ namespace R2 #pragma pack(push, 1) struct CBasePlayer { - char pad[88]; - int m_nPlayerIndex; + char pad[0x58]; + uint32_t m_nPlayerIndex; + + // +0x5C + char pad1[0x1C75]; + char m_communityClanTag[16]; }; #pragma pack(pop) diff --git a/NorthstarDLL/scriptserverbrowser.cpp b/NorthstarDLL/scriptserverbrowser.cpp index e33406fc..5b2cf75f 100644 --- a/NorthstarDLL/scriptserverbrowser.cpp +++ b/NorthstarDLL/scriptserverbrowser.cpp @@ -367,7 +367,7 @@ SQRESULT SQ_ConnectToAuthedServer(HSquirrelVM* sqvm) return SQRESULT_ERROR; } - RemoteServerConnectionInfo info = g_pMasterServerManager->m_pendingConnectionInfo; + RemoteServerConnectionInfo& info = g_pMasterServerManager->m_pendingConnectionInfo; // set auth token, then try to connect // i'm honestly not entirely sure how silentconnect works regarding ports and encryption so using connect for now -- cgit v1.2.3