diff options
Diffstat (limited to 'NorthstarDLL/server')
-rw-r--r-- | NorthstarDLL/server/alltalk.cpp | 4 | ||||
-rw-r--r-- | NorthstarDLL/server/auth/bansystem.cpp | 8 | ||||
-rw-r--r-- | NorthstarDLL/server/auth/serverauthentication.cpp | 46 | ||||
-rw-r--r-- | NorthstarDLL/server/auth/serverauthentication.h | 16 | ||||
-rw-r--r-- | NorthstarDLL/server/buildainfile.cpp | 6 | ||||
-rw-r--r-- | NorthstarDLL/server/r2server.cpp | 10 | ||||
-rw-r--r-- | NorthstarDLL/server/r2server.h | 202 | ||||
-rw-r--r-- | NorthstarDLL/server/serverchathooks.cpp | 12 | ||||
-rw-r--r-- | NorthstarDLL/server/servernethooks.cpp | 6 |
9 files changed, 150 insertions, 160 deletions
diff --git a/NorthstarDLL/server/alltalk.cpp b/NorthstarDLL/server/alltalk.cpp index d71b0bae..74119309 100644 --- a/NorthstarDLL/server/alltalk.cpp +++ b/NorthstarDLL/server/alltalk.cpp @@ -4,12 +4,12 @@ size_t __fastcall ShouldAllowAlltalk() { // this needs to return a 64 bit integer where 0 = true and 1 = false - static ConVar* Cvar_sv_alltalk = R2::g_pCVar->FindVar("sv_alltalk"); + static ConVar* Cvar_sv_alltalk = g_pCVar->FindVar("sv_alltalk"); if (Cvar_sv_alltalk->GetBool()) return 0; // lobby should default to alltalk, otherwise don't allow it - return strcmp(R2::g_pGlobals->m_pMapName, "mp_lobby"); + return strcmp(g_pGlobals->m_pMapName, "mp_lobby"); } ON_DLL_LOAD_RELIESON("engine.dll", ServerAllTalk, ConVar, (CModule module)) diff --git a/NorthstarDLL/server/auth/bansystem.cpp b/NorthstarDLL/server/auth/bansystem.cpp index 9b9d24c4..a45cde93 100644 --- a/NorthstarDLL/server/auth/bansystem.cpp +++ b/NorthstarDLL/server/auth/bansystem.cpp @@ -173,7 +173,7 @@ void ServerBanSystem::UnbanUID(uint64_t uid) bool ServerBanSystem::IsUIDAllowed(uint64_t uid) { - uint64_t localPlayerUserID = strtoull(R2::g_pLocalPlayerUserID, nullptr, 10); + uint64_t localPlayerUserID = strtoull(g_pLocalPlayerUserID, nullptr, 10); if (localPlayerUserID == uid) return true; @@ -186,14 +186,14 @@ void ConCommand_ban(const CCommand& args) if (args.ArgC() < 2) return; - for (int i = 0; i < R2::g_pGlobals->m_nMaxClients; i++) + for (int i = 0; i < g_pGlobals->m_nMaxClients; i++) { - R2::CBaseClient* player = &R2::g_pClientArray[i]; + CBaseClient* player = &g_pClientArray[i]; if (!strcmp(player->m_Name, args.Arg(1)) || !strcmp(player->m_UID, args.Arg(1))) { g_pBanSystem->BanUID(strtoull(player->m_UID, nullptr, 10)); - R2::CBaseClient__Disconnect(player, 1, "Banned from server"); + CBaseClient__Disconnect(player, 1, "Banned from server"); break; } } diff --git a/NorthstarDLL/server/auth/serverauthentication.cpp b/NorthstarDLL/server/auth/serverauthentication.cpp index d5653dcc..0d46426f 100644 --- a/NorthstarDLL/server/auth/serverauthentication.cpp +++ b/NorthstarDLL/server/auth/serverauthentication.cpp @@ -40,7 +40,7 @@ void ServerAuthenticationManager::AddRemotePlayer(std::string token, uint64_t ui m_RemoteAuthenticationData[token] = newAuthData; } -void ServerAuthenticationManager::AddPlayer(R2::CBaseClient* pPlayer, const char* pToken) +void ServerAuthenticationManager::AddPlayer(CBaseClient* pPlayer, const char* pToken) { PlayerAuthenticationData additionalData; @@ -48,14 +48,14 @@ void ServerAuthenticationManager::AddPlayer(R2::CBaseClient* pPlayer, const char if (remoteAuthData != m_RemoteAuthenticationData.end()) additionalData.pdataSize = remoteAuthData->second.pdataSize; else - additionalData.pdataSize = R2::PERSISTENCE_MAX_SIZE; + additionalData.pdataSize = PERSISTENCE_MAX_SIZE; - additionalData.usingLocalPdata = pPlayer->m_iPersistenceReady == R2::ePersistenceReady::READY_INSECURE; + additionalData.usingLocalPdata = pPlayer->m_iPersistenceReady == ePersistenceReady::READY_INSECURE; m_PlayerAuthenticationData.insert(std::make_pair(pPlayer, additionalData)); } -void ServerAuthenticationManager::RemovePlayer(R2::CBaseClient* pPlayer) +void ServerAuthenticationManager::RemovePlayer(CBaseClient* pPlayer) { if (m_PlayerAuthenticationData.count(pPlayer)) m_PlayerAuthenticationData.erase(pPlayer); @@ -88,20 +88,20 @@ bool ServerAuthenticationManager::VerifyPlayerName(const char* pAuthToken, const return true; } -bool ServerAuthenticationManager::IsDuplicateAccount(R2::CBaseClient* pPlayer, const char* pPlayerUid) +bool ServerAuthenticationManager::IsDuplicateAccount(CBaseClient* pPlayer, const char* pPlayerUid) { if (m_bAllowDuplicateAccounts) return false; bool bHasUidPlayer = false; - for (int i = 0; i < R2::g_pGlobals->m_nMaxClients; i++) - if (&R2::g_pClientArray[i] != pPlayer && !strcmp(pPlayerUid, R2::g_pClientArray[i].m_UID)) + for (int i = 0; i < g_pGlobals->m_nMaxClients; i++) + if (&g_pClientArray[i] != pPlayer && !strcmp(pPlayerUid, g_pClientArray[i].m_UID)) return true; return false; } -bool ServerAuthenticationManager::CheckAuthentication(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken) +bool ServerAuthenticationManager::CheckAuthentication(CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken) { std::string sUid = std::to_string(iUid); @@ -111,7 +111,7 @@ bool ServerAuthenticationManager::CheckAuthentication(R2::CBaseClient* pPlayer, return true; // local server that doesn't need auth (probably sp) and local player - if (m_bStartingLocalSPGame && !strcmp(sUid.c_str(), R2::g_pLocalPlayerUserID)) + if (m_bStartingLocalSPGame && !strcmp(sUid.c_str(), g_pLocalPlayerUserID)) return true; // don't allow duplicate accounts @@ -126,7 +126,7 @@ bool ServerAuthenticationManager::CheckAuthentication(R2::CBaseClient* pPlayer, return false; } -void ServerAuthenticationManager::AuthenticatePlayer(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken) +void ServerAuthenticationManager::AuthenticatePlayer(CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken) { // for bot players, generate a new uid if (pPlayer->m_bFakePlayer) @@ -142,31 +142,31 @@ void ServerAuthenticationManager::AuthenticatePlayer(R2::CBaseClient* pPlayer, u if (authData != m_RemoteAuthenticationData.end()) { // if we're resetting let script handle the reset with InitPersistentData() on connect - if (!m_bForceResetLocalPlayerPersistence || strcmp(sUid.c_str(), R2::g_pLocalPlayerUserID)) + if (!m_bForceResetLocalPlayerPersistence || strcmp(sUid.c_str(), g_pLocalPlayerUserID)) { // copy pdata into buffer memcpy(pPlayer->m_PersistenceBuffer, authData->second.pdata, authData->second.pdataSize); } // set persistent data as ready - pPlayer->m_iPersistenceReady = R2::ePersistenceReady::READY_REMOTE; + pPlayer->m_iPersistenceReady = ePersistenceReady::READY_REMOTE; } // we probably allow insecure at this point, but make sure not to write anyway if not insecure else if (Cvar_ns_auth_allow_insecure->GetBool() || pPlayer->m_bFakePlayer) { // set persistent data as ready // note: actual placeholder persistent data is populated in script with InitPersistentData() - pPlayer->m_iPersistenceReady = R2::ePersistenceReady::READY_INSECURE; + pPlayer->m_iPersistenceReady = ePersistenceReady::READY_INSECURE; } } -bool ServerAuthenticationManager::RemovePlayerAuthData(R2::CBaseClient* pPlayer) +bool ServerAuthenticationManager::RemovePlayerAuthData(CBaseClient* pPlayer) { if (!Cvar_ns_erase_auth_info->GetBool()) // keep auth data forever return false; // hack for special case where we're on a local server, so we erase our own newly created auth data on disconnect - if (m_bNeedLocalAuthForNewgame && !strcmp(pPlayer->m_UID, R2::g_pLocalPlayerUserID)) + if (m_bNeedLocalAuthForNewgame && !strcmp(pPlayer->m_UID, g_pLocalPlayerUserID)) return false; // we don't have our auth token at this point, so lookup authdata by uid @@ -187,9 +187,9 @@ bool ServerAuthenticationManager::RemovePlayerAuthData(R2::CBaseClient* pPlayer) return false; } -void ServerAuthenticationManager::WritePersistentData(R2::CBaseClient* pPlayer) +void ServerAuthenticationManager::WritePersistentData(CBaseClient* pPlayer) { - if (pPlayer->m_iPersistenceReady == R2::ePersistenceReady::READY_REMOTE) + if (pPlayer->m_iPersistenceReady == ePersistenceReady::READY_REMOTE) { g_pMasterServerManager->WritePlayerPersistentData( pPlayer->m_UID, (const char*)pPlayer->m_PersistenceBuffer, m_PlayerAuthenticationData[pPlayer].pdataSize); @@ -240,7 +240,7 @@ ConVar* Cvar_ns_allowuserclantags; // clang-format off AUTOHOOK(CBaseClient__Connect, engine.dll + 0x101740, -bool,, (R2::CBaseClient* self, char* pName, void* pNetChannel, char bFakePlayer, void* a5, char pDisconnectReason[256], void* a7)) +bool,, (CBaseClient* self, char* pName, void* pNetChannel, char bFakePlayer, void* a5, char pDisconnectReason[256], void* a7)) // clang-format on { const char* pAuthenticationFailure = nullptr; @@ -281,13 +281,13 @@ bool,, (R2::CBaseClient* self, char* pName, void* pNetChannel, char bFakePlayer, // clang-format off AUTOHOOK(CBaseClient__ActivatePlayer, engine.dll + 0x100F80, -void,, (R2::CBaseClient* self)) +void,, (CBaseClient* self)) // clang-format on { // if we're authed, write our persistent data // RemovePlayerAuthData returns true if it removed successfully, i.e. on first call only, and we only want to write on >= second call // (since this func is called on map loads) - if (self->m_iPersistenceReady >= R2::ePersistenceReady::READY && !g_pServerAuthentication->RemovePlayerAuthData(self)) + if (self->m_iPersistenceReady >= ePersistenceReady::READY && !g_pServerAuthentication->RemovePlayerAuthData(self)) { g_pServerAuthentication->m_bForceResetLocalPlayerPersistence = false; g_pServerAuthentication->WritePersistentData(self); @@ -299,7 +299,7 @@ void,, (R2::CBaseClient* self)) // clang-format off AUTOHOOK(_CBaseClient__Disconnect, engine.dll + 0x1012C0, -void,, (R2::CBaseClient* self, uint32_t unknownButAlways1, const char* pReason, ...)) +void,, (CBaseClient* self, uint32_t unknownButAlways1, const char* pReason, ...)) // clang-format on { // have to manually format message because can't pass varargs to original func @@ -333,7 +333,7 @@ void,, (R2::CBaseClient* self, uint32_t unknownButAlways1, const char* pReason, void ConCommand_ns_resetpersistence(const CCommand& args) { - if (*R2::g_pServerState == R2::server_state_t::ss_active) + if (*g_pServerState == server_state_t::ss_active) { spdlog::error("ns_resetpersistence must be entered from the main menu"); return; @@ -370,7 +370,7 @@ ON_DLL_LOAD_RELIESON("engine.dll", ServerAuthentication, (ConCommand, ConVar), ( CBaseServer__RejectConnection = module.Offset(0x1182E0).RCast<CBaseServer__RejectConnectionType>(); - if (Tier0::CommandLine()->CheckParm("-allowdupeaccounts")) + if (CommandLine()->CheckParm("-allowdupeaccounts")) { // patch to allow same of multiple account module.Offset(0x114510).Patch("EB"); diff --git a/NorthstarDLL/server/auth/serverauthentication.h b/NorthstarDLL/server/auth/serverauthentication.h index dd0e13af..32e1d0a8 100644 --- a/NorthstarDLL/server/auth/serverauthentication.h +++ b/NorthstarDLL/server/auth/serverauthentication.h @@ -33,7 +33,7 @@ class ServerAuthenticationManager std::mutex m_AuthDataMutex; std::unordered_map<std::string, RemoteAuthData> m_RemoteAuthenticationData; - std::unordered_map<R2::CBaseClient*, PlayerAuthenticationData> m_PlayerAuthenticationData; + std::unordered_map<CBaseClient*, PlayerAuthenticationData> m_PlayerAuthenticationData; bool m_bAllowDuplicateAccounts = false; bool m_bNeedLocalAuthForNewgame = false; @@ -43,16 +43,16 @@ class ServerAuthenticationManager public: void AddRemotePlayer(std::string token, uint64_t uid, std::string username, std::string pdata); - void AddPlayer(R2::CBaseClient* pPlayer, const char* pAuthToken); - void RemovePlayer(R2::CBaseClient* pPlayer); + void AddPlayer(CBaseClient* pPlayer, const char* pAuthToken); + void RemovePlayer(CBaseClient* pPlayer); bool VerifyPlayerName(const char* pAuthToken, const char* pName, char pOutVerifiedName[64]); - bool IsDuplicateAccount(R2::CBaseClient* pPlayer, const char* pUid); - bool CheckAuthentication(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); + bool IsDuplicateAccount(CBaseClient* pPlayer, const char* pUid); + bool CheckAuthentication(CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); - void AuthenticatePlayer(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); - bool RemovePlayerAuthData(R2::CBaseClient* pPlayer); - void WritePersistentData(R2::CBaseClient* pPlayer); + void AuthenticatePlayer(CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); + bool RemovePlayerAuthData(CBaseClient* pPlayer); + void WritePersistentData(CBaseClient* pPlayer); }; extern ServerAuthenticationManager* g_pServerAuthentication; diff --git a/NorthstarDLL/server/buildainfile.cpp b/NorthstarDLL/server/buildainfile.cpp index d0143295..a7f59961 100644 --- a/NorthstarDLL/server/buildainfile.cpp +++ b/NorthstarDLL/server/buildainfile.cpp @@ -177,8 +177,8 @@ ConVar* Cvar_ns_ai_dumpAINfileFromLoad; void DumpAINInfo(CAI_Network* aiNetwork) { - fs::path writePath(fmt::format("{}/maps/graphs", R2::g_pModName)); - writePath /= R2::g_pGlobals->m_pMapName; + fs::path writePath(fmt::format("{}/maps/graphs", g_pModName)); + writePath /= g_pGlobals->m_pMapName; writePath += ".ain"; // dump from memory @@ -193,7 +193,7 @@ void DumpAINInfo(CAI_Network* aiNetwork) spdlog::info("writing ainet version: {}", AINET_VERSION_NUMBER); writeStream.write((char*)&AINET_VERSION_NUMBER, sizeof(int)); - int mapVersion = R2::g_pGlobals->m_nMapVersion; + int mapVersion = g_pGlobals->m_nMapVersion; spdlog::info("writing map version: {}", mapVersion); writeStream.write((char*)&mapVersion, sizeof(int)); spdlog::info("writing placeholder crc: {}", PLACEHOLDER_CRC); diff --git a/NorthstarDLL/server/r2server.cpp b/NorthstarDLL/server/r2server.cpp index cf7add0d..c52f396e 100644 --- a/NorthstarDLL/server/r2server.cpp +++ b/NorthstarDLL/server/r2server.cpp @@ -1,13 +1,7 @@ #include "r2server.h" -using namespace R2; - -// use the R2 namespace for game funcs -namespace R2 -{ - CBaseEntity* (*Server_GetEntityByIndex)(int index); - CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex); -} // namespace R2 +CBaseEntity* (*Server_GetEntityByIndex)(int index); +CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex); ON_DLL_LOAD("server.dll", R2GameServer, (CModule module)) { diff --git a/NorthstarDLL/server/r2server.h b/NorthstarDLL/server/r2server.h index 8fde7b9d..c40cdc1f 100644 --- a/NorthstarDLL/server/r2server.h +++ b/NorthstarDLL/server/r2server.h @@ -2,109 +2,105 @@ #include "core/math/vector.h" -// use the R2 namespace for game funcs -namespace R2 -{ - // server entity stuff - class CBaseEntity; - extern CBaseEntity* (*Server_GetEntityByIndex)(int index); +// server entity stuff +class CBaseEntity; +extern CBaseEntity* (*Server_GetEntityByIndex)(int index); - // clang-format off - OFFSET_STRUCT(CBasePlayer) - { - FIELD(0x58, uint32_t m_nPlayerIndex) +// clang-format off +OFFSET_STRUCT(CBasePlayer) +{ + FIELD(0x58, uint32_t m_nPlayerIndex) - FIELD(0x23E8, bool m_grappleActive) - FIELD(0x1D08, uint32_t m_platformUserId) - FIELD(0x1D10, int32_t m_classModsActive) - FIELD(0x1D8C, int32_t m_posClassModsActive) - FIELD(0x1DCC, bool m_passives) - FIELD(0x4948, int32_t m_selectedOffhand) - FIELD(0x1358, int32_t m_selectedOffhandPendingHybridAction) - FIELD(0x1E88, int32_t m_playerFlags) - FIELD(0x26A8, int32_t m_lastUCmdSimulationTicks) - FIELD(0x26AC, float m_lastUCmdSimulationRemainderTime) - FIELD(0x1F04, int32_t m_remoteTurret) - FIELD(0x414, int32_t m_hGroundEntity) - FIELD(0x13B8, int32_t m_titanSoul) - FIELD(0x2054, int32_t m_petTitan) - FIELD(0x4D4, int32_t m_iHealth) - FIELD(0x4D0, int32_t m_iMaxHealth) - FIELD(0x4F1, int32_t m_lifeState) - FIELD(0x50C, float m_flMaxspeed) - FIELD(0x298, int32_t m_fFlags) - FIELD(0x1F64, int32_t m_iObserverMode) - FIELD(0x1F6C, int32_t m_hObserverTarget) - FIELD(0x2098, int32_t m_hViewModel) - FIELD(0x27E4, int32_t m_ubEFNointerpParity) - FIELD(0x1FA4, int32_t m_activeBurnCardIndex) - FIELD(0x1B68, int32_t m_hColorCorrectionCtrl) - FIELD(0x19E0, int32_t m_PlayerFog__m_hCtrl) - FIELD(0x26BC, bool m_bShouldDrawPlayerWhileUsingViewEntity) - FIELD(0x2848, char m_title[32]) - FIELD(0x2964, bool m_useCredit) - FIELD(0x1F40, float m_damageImpulseNoDecelEndTime) - FIELD(0x1E8C, bool m_hasMic) - FIELD(0x1E8D, bool m_inPartyChat) - FIELD(0x1E90, float m_playerMoveSpeedScale) - FIELD(0x1F58, float m_flDeathTime) - FIELD(0x25A8, bool m_iSpawnParity) - FIELD(0x102284, Vector3 m_upDir) - FIELD(0x259C, float m_lastDodgeTime) - FIELD(0x22E0, bool m_wallHanging) - FIELD(0x22EC, int32_t m_traversalType) - FIELD(0x22F0, int32_t m_traversalState) - FIELD(0x2328, Vector3 m_traversalRefPos) - FIELD(0x231C, Vector3 m_traversalForwardDir) - FIELD(0x2354, float m_traversalYawDelta) - FIELD(0x2358, int32_t m_traversalYawPoseParameter) - FIELD(0x2050, int32_t m_grappleHook) - FIELD(0x27C0, int32_t m_autoSprintForced) - FIELD(0x27C4, bool m_fIsSprinting) - FIELD(0x27CC, float m_sprintStartedTime) - FIELD(0x27D0, float m_sprintStartedFrac) - FIELD(0x27D4, float m_sprintEndedTime) - FIELD(0x27D8, float m_sprintEndedFrac) - FIELD(0x27DC, float m_stickySprintStartTime) - FIELD(0x2998, float m_smartAmmoPreviousHighestLockOnMeFractionValue) - FIELD(0x23FC, int32_t m_activeZipline) - FIELD(0x2400, bool m_ziplineReverse) - FIELD(0x2410, int32_t m_ziplineState) - FIELD(0x2250, int32_t m_duckState) - FIELD(0x2254, Vector3 m_StandHullMin) - FIELD(0x2260, Vector3 m_StandHullMax) - FIELD(0x226C, Vector3 m_DuckHullMin) - FIELD(0x2278, Vector3 m_DuckHullMax) - FIELD(0x205C, int32_t m_xp) - FIELD(0x2060, int32_t m_generation) - FIELD(0x2064, int32_t m_rank) - FIELD(0x2068, int32_t m_serverForceIncreasePlayerListGenerationParity) - FIELD(0x206C, bool m_isPlayingRanked) - FIELD(0x2070, float m_skill_mu) - FIELD(0x1E80, int32_t m_titanSoulBeingRodeoed) - FIELD(0x1E84, int32_t m_entitySyncingWithMe) - FIELD(0x2078, float m_nextTitanRespawnAvailable) - FIELD(0x1C90, bool m_hasBadReputation) - FIELD(0x1C91, char m_communityName[64]) - FIELD(0x1CD1, char m_communityClanTag[16]) - FIELD(0x1CE1, char m_factionName[16]) - FIELD(0x1CF1, char m_hardwareIcon[16]) - FIELD(0x1D01, bool m_happyHourActive) - FIELD(0x1EF4, int32_t m_gestureAutoKillBitfield) - FIELD(0x2EA8, int32_t m_pilotClassIndex) - FIELD(0x100490, Vector3 m_vecAbsOrigin) - FIELD(0x25BE, bool m_isPerformingBoostAction) - FIELD(0x240C, bool m_ziplineValid3pWeaponLayerAnim) - FIELD(0x345C, int32_t m_playerScriptNetDataGlobal) - FIELD(0x1598, int32_t m_bZooming) - FIELD(0x1599, bool m_zoomToggleOn) - FIELD(0x159C, float m_zoomBaseFrac) - FIELD(0x15A0, float m_zoomBaseTime) - FIELD(0x15A4, float m_zoomFullStartTime) - FIELD(0xA04, int32_t m_camoIndex) - FIELD(0xA08, int32_t m_decalIndex) - }; - // clang-format on + FIELD(0x23E8, bool m_grappleActive) + FIELD(0x1D08, uint32_t m_platformUserId) + FIELD(0x1D10, int32_t m_classModsActive) + FIELD(0x1D8C, int32_t m_posClassModsActive) + FIELD(0x1DCC, bool m_passives) + FIELD(0x4948, int32_t m_selectedOffhand) + FIELD(0x1358, int32_t m_selectedOffhandPendingHybridAction) + FIELD(0x1E88, int32_t m_playerFlags) + FIELD(0x26A8, int32_t m_lastUCmdSimulationTicks) + FIELD(0x26AC, float m_lastUCmdSimulationRemainderTime) + FIELD(0x1F04, int32_t m_remoteTurret) + FIELD(0x414, int32_t m_hGroundEntity) + FIELD(0x13B8, int32_t m_titanSoul) + FIELD(0x2054, int32_t m_petTitan) + FIELD(0x4D4, int32_t m_iHealth) + FIELD(0x4D0, int32_t m_iMaxHealth) + FIELD(0x4F1, int32_t m_lifeState) + FIELD(0x50C, float m_flMaxspeed) + FIELD(0x298, int32_t m_fFlags) + FIELD(0x1F64, int32_t m_iObserverMode) + FIELD(0x1F6C, int32_t m_hObserverTarget) + FIELD(0x2098, int32_t m_hViewModel) + FIELD(0x27E4, int32_t m_ubEFNointerpParity) + FIELD(0x1FA4, int32_t m_activeBurnCardIndex) + FIELD(0x1B68, int32_t m_hColorCorrectionCtrl) + FIELD(0x19E0, int32_t m_PlayerFog__m_hCtrl) + FIELD(0x26BC, bool m_bShouldDrawPlayerWhileUsingViewEntity) + FIELD(0x2848, char m_title[32]) + FIELD(0x2964, bool m_useCredit) + FIELD(0x1F40, float m_damageImpulseNoDecelEndTime) + FIELD(0x1E8C, bool m_hasMic) + FIELD(0x1E8D, bool m_inPartyChat) + FIELD(0x1E90, float m_playerMoveSpeedScale) + FIELD(0x1F58, float m_flDeathTime) + FIELD(0x25A8, bool m_iSpawnParity) + FIELD(0x102284, Vector3 m_upDir) + FIELD(0x259C, float m_lastDodgeTime) + FIELD(0x22E0, bool m_wallHanging) + FIELD(0x22EC, int32_t m_traversalType) + FIELD(0x22F0, int32_t m_traversalState) + FIELD(0x2328, Vector3 m_traversalRefPos) + FIELD(0x231C, Vector3 m_traversalForwardDir) + FIELD(0x2354, float m_traversalYawDelta) + FIELD(0x2358, int32_t m_traversalYawPoseParameter) + FIELD(0x2050, int32_t m_grappleHook) + FIELD(0x27C0, int32_t m_autoSprintForced) + FIELD(0x27C4, bool m_fIsSprinting) + FIELD(0x27CC, float m_sprintStartedTime) + FIELD(0x27D0, float m_sprintStartedFrac) + FIELD(0x27D4, float m_sprintEndedTime) + FIELD(0x27D8, float m_sprintEndedFrac) + FIELD(0x27DC, float m_stickySprintStartTime) + FIELD(0x2998, float m_smartAmmoPreviousHighestLockOnMeFractionValue) + FIELD(0x23FC, int32_t m_activeZipline) + FIELD(0x2400, bool m_ziplineReverse) + FIELD(0x2410, int32_t m_ziplineState) + FIELD(0x2250, int32_t m_duckState) + FIELD(0x2254, Vector3 m_StandHullMin) + FIELD(0x2260, Vector3 m_StandHullMax) + FIELD(0x226C, Vector3 m_DuckHullMin) + FIELD(0x2278, Vector3 m_DuckHullMax) + FIELD(0x205C, int32_t m_xp) + FIELD(0x2060, int32_t m_generation) + FIELD(0x2064, int32_t m_rank) + FIELD(0x2068, int32_t m_serverForceIncreasePlayerListGenerationParity) + FIELD(0x206C, bool m_isPlayingRanked) + FIELD(0x2070, float m_skill_mu) + FIELD(0x1E80, int32_t m_titanSoulBeingRodeoed) + FIELD(0x1E84, int32_t m_entitySyncingWithMe) + FIELD(0x2078, float m_nextTitanRespawnAvailable) + FIELD(0x1C90, bool m_hasBadReputation) + FIELD(0x1C91, char m_communityName[64]) + FIELD(0x1CD1, char m_communityClanTag[16]) + FIELD(0x1CE1, char m_factionName[16]) + FIELD(0x1CF1, char m_hardwareIcon[16]) + FIELD(0x1D01, bool m_happyHourActive) + FIELD(0x1EF4, int32_t m_gestureAutoKillBitfield) + FIELD(0x2EA8, int32_t m_pilotClassIndex) + FIELD(0x100490, Vector3 m_vecAbsOrigin) + FIELD(0x25BE, bool m_isPerformingBoostAction) + FIELD(0x240C, bool m_ziplineValid3pWeaponLayerAnim) + FIELD(0x345C, int32_t m_playerScriptNetDataGlobal) + FIELD(0x1598, int32_t m_bZooming) + FIELD(0x1599, bool m_zoomToggleOn) + FIELD(0x159C, float m_zoomBaseFrac) + FIELD(0x15A0, float m_zoomBaseTime) + FIELD(0x15A4, float m_zoomFullStartTime) + FIELD(0xA04, int32_t m_camoIndex) + FIELD(0xA08, int32_t m_decalIndex) +}; +// clang-format on - extern CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex); -} // namespace R2 +extern CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex); diff --git a/NorthstarDLL/server/serverchathooks.cpp b/NorthstarDLL/server/serverchathooks.cpp index cb3af244..d3ac4776 100644 --- a/NorthstarDLL/server/serverchathooks.cpp +++ b/NorthstarDLL/server/serverchathooks.cpp @@ -25,7 +25,7 @@ void(__fastcall* CServerGameDLL__OnReceivedSayTextMessage)( void(__fastcall* CRecipientFilter__Construct)(CRecipientFilter* self); void(__fastcall* CRecipientFilter__Destruct)(CRecipientFilter* self); void(__fastcall* CRecipientFilter__AddAllPlayers)(CRecipientFilter* self); -void(__fastcall* CRecipientFilter__AddRecipient)(CRecipientFilter* self, const R2::CBasePlayer* player); +void(__fastcall* CRecipientFilter__AddRecipient)(CRecipientFilter* self, const CBasePlayer* player); void(__fastcall* CRecipientFilter__MakeReliable)(CRecipientFilter* self); void(__fastcall* UserMessageBegin)(CRecipientFilter* filter, const char* messagename); @@ -40,7 +40,7 @@ AUTOHOOK(_CServerGameDLL__OnReceivedSayTextMessage, server.dll + 0x1595C0, void, __fastcall, (CServerGameDLL* self, unsigned int senderPlayerId, const char* text, bool isTeam)) // clang-format on { - NS::Utils::RemoveAsciiControlSequences(const_cast<char*>(text), true); + RemoveAsciiControlSequences(const_cast<char*>(text), true); // MiniHook doesn't allow calling the base function outside of anywhere but the hook function. // To allow bypassing the hook, isSkippingHook can be set. @@ -52,7 +52,7 @@ void, __fastcall, (CServerGameDLL* self, unsigned int senderPlayerId, const char } // check chat ratelimits - if (!g_pServerLimits->CheckChatLimits(&R2::g_pClientArray[senderPlayerId - 1])) + if (!g_pServerLimits->CheckChatLimits(&g_pClientArray[senderPlayerId - 1])) return; SQRESULT result = g_pSquirrel<ScriptContext::SERVER>->Call( @@ -75,10 +75,10 @@ void ChatSendMessage(unsigned int playerIndex, const char* text, bool isTeam) void ChatBroadcastMessage(int fromPlayerIndex, int toPlayerIndex, const char* text, bool isTeam, bool isDead, CustomMessageType messageType) { - R2::CBasePlayer* toPlayer = NULL; + CBasePlayer* toPlayer = NULL; if (toPlayerIndex >= 0) { - toPlayer = R2::UTIL_PlayerByIndex(toPlayerIndex + 1); + toPlayer = UTIL_PlayerByIndex(toPlayerIndex + 1); if (toPlayer == NULL) return; } @@ -163,7 +163,7 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerChatHooks, ServerSquirrel, (CModule mod CRecipientFilter__Construct = module.Offset(0x1E9440).RCast<void(__fastcall*)(CRecipientFilter*)>(); CRecipientFilter__Destruct = module.Offset(0x1E9700).RCast<void(__fastcall*)(CRecipientFilter*)>(); CRecipientFilter__AddAllPlayers = module.Offset(0x1E9940).RCast<void(__fastcall*)(CRecipientFilter*)>(); - CRecipientFilter__AddRecipient = module.Offset(0x1E9B30).RCast<void(__fastcall*)(CRecipientFilter*, const R2::CBasePlayer*)>(); + CRecipientFilter__AddRecipient = module.Offset(0x1E9B30).RCast<void(__fastcall*)(CRecipientFilter*, const CBasePlayer*)>(); CRecipientFilter__MakeReliable = module.Offset(0x1EA4E0).RCast<void(__fastcall*)(CRecipientFilter*)>(); UserMessageBegin = module.Offset(0x15C520).RCast<void(__fastcall*)(CRecipientFilter*, const char*)>(); diff --git a/NorthstarDLL/server/servernethooks.cpp b/NorthstarDLL/server/servernethooks.cpp index f74f2d38..148b735f 100644 --- a/NorthstarDLL/server/servernethooks.cpp +++ b/NorthstarDLL/server/servernethooks.cpp @@ -84,7 +84,7 @@ cleanup: } // v1 HMACSHA256-signed masterserver request (HMAC-SHA256(JSONData, MasterServerToken) + JSONData) -static void ProcessAtlasConnectionlessPacketSigreq1(R2::netpacket_t* packet, bool dbg, std::string pType, std::string pData) +static void ProcessAtlasConnectionlessPacketSigreq1(netpacket_t* packet, bool dbg, std::string pType, std::string pData) { if (pData.length() < HMACSHA256_LEN) { @@ -135,7 +135,7 @@ static void ProcessAtlasConnectionlessPacketSigreq1(R2::netpacket_t* packet, boo return; } -static void ProcessAtlasConnectionlessPacket(R2::netpacket_t* packet) +static void ProcessAtlasConnectionlessPacket(netpacket_t* packet) { bool dbg = Cvar_net_debug_atlas_packet->GetBool(); @@ -168,7 +168,7 @@ static void ProcessAtlasConnectionlessPacket(R2::netpacket_t* packet) return; } -AUTOHOOK(ProcessConnectionlessPacket, engine.dll + 0x117800, bool, , (void* a1, R2::netpacket_t* packet)) +AUTOHOOK(ProcessConnectionlessPacket, engine.dll + 0x117800, bool, , (void* a1, netpacket_t* packet)) { // packet->data consists of 0xFFFFFFFF (int32 -1) to indicate packets aren't split, followed by a header consisting of a single // character, which is used to uniquely identify the packet kind. Most kinds follow this with a null-terminated string payload |