From f227784b55e0ba06aef28b26a50ce5ca5bc9740a Mon Sep 17 00:00:00 2001 From: DESTROYGIRL <170364626+DESTROYGIRL@users.noreply.github.com> Date: Sun, 14 Dec 2025 14:49:41 +0000 Subject: [PATCH 1/3] initial --- src/game/server/neo/neo_player.cpp | 18 ++++++------ src/game/shared/neo/neo_gamerules.cpp | 32 ++++++++++----------- src/game/shared/neo/neo_gamerules.h | 2 ++ src/game/shared/neo/neo_ghost_cap_point.cpp | 4 +-- src/game/shared/neo/neo_player_shared.h | 3 ++ src/public/dt_common.h | 8 ++++++ 6 files changed, 40 insertions(+), 27 deletions(-) diff --git a/src/game/server/neo/neo_player.cpp b/src/game/server/neo/neo_player.cpp index 8cd228af13..bfecf4daa5 100644 --- a/src/game/server/neo/neo_player.cpp +++ b/src/game/server/neo/neo_player.cpp @@ -45,14 +45,14 @@ LINK_ENTITY_TO_CLASS(player, CNEO_Player); IMPLEMENT_SERVERCLASS_ST(CNEO_Player, DT_NEO_Player) -SendPropInt(SENDINFO(m_iNeoClass)), -SendPropInt(SENDINFO(m_iNeoSkin)), -SendPropInt(SENDINFO(m_iNeoStar)), -SendPropInt(SENDINFO(m_iClassBeforeTakeover)), -SendPropInt(SENDINFO(m_iXP)), -SendPropInt(SENDINFO(m_iLoadoutWepChoice)), -SendPropInt(SENDINFO(m_iNextSpawnClassChoice)), -SendPropInt(SENDINFO(m_bInLean)), +SendPropInt(SENDINFO(m_iNeoClass), NumBitsForRange(NEO_CLASS_RANDOM, NEO_CLASS_ENUM_COUNT)), +SendPropInt(SENDINFO(m_iNeoSkin), NumBitsForCount(NEO_SKIN_ENUM_COUNT), SPROP_UNSIGNED), +SendPropInt(SENDINFO(m_iNeoStar), NumBitsForCount(STAR__TOTAL), SPROP_UNSIGNED), +SendPropInt(SENDINFO(m_iClassBeforeTakeover), NumBitsForRange(NEO_CLASS_RANDOM, NEO_CLASS_ENUM_COUNT)), +SendPropInt(SENDINFO(m_iXP), NumBitsForRange(XP_ANY, XP_EMPTY)), +SendPropInt(SENDINFO(m_iLoadoutWepChoice), NumBitsForCount(MAX_WEAPON_LOADOUTS), SPROP_UNSIGNED), +SendPropInt(SENDINFO(m_iNextSpawnClassChoice), NumBitsForRange(NEO_CLASS_RANDOM, NEO_CLASS_ENUM_COUNT)), +SendPropInt(SENDINFO(m_bInLean), NumBitsForCount(NEO_LEAN_ENUM_COUNT), SPROP_UNSIGNED), SendPropEHandle(SENDINFO(m_hServerRagdoll)), SendPropBool(SENDINFO(m_bInThermOpticCamo)), @@ -65,7 +65,7 @@ SendPropBool(SENDINFO(m_bIneligibleForLoadoutPick)), SendPropBool(SENDINFO(m_bCarryingGhost)), SendPropTime(SENDINFO(m_flCamoAuxLastTime)), -SendPropInt(SENDINFO(m_nVisionLastTick)), +SendPropInt(SENDINFO(m_nVisionLastTick), -1, SPROP_UNSIGNED), SendPropTime(SENDINFO(m_flJumpLastTime)), SendPropTime(SENDINFO(m_flNextPingTime)), diff --git a/src/game/shared/neo/neo_gamerules.cpp b/src/game/shared/neo/neo_gamerules.cpp index d35d1de56a..4a93b14889 100644 --- a/src/game/shared/neo/neo_gamerules.cpp +++ b/src/game/shared/neo/neo_gamerules.cpp @@ -223,9 +223,9 @@ REGISTER_GAMERULES_CLASS( CNEORules ); BEGIN_NETWORK_TABLE_NOBASE( CNEORules, DT_NEORules ) // NEO TODO (Rain): NEO specific game modes var (CTG/TDM/...) #ifdef CLIENT_DLL - RecvPropFloat(RECVINFO(m_flNeoNextRoundStartTime)), - RecvPropFloat(RECVINFO(m_flNeoRoundStartTime)), - RecvPropFloat(RECVINFO(m_flPauseEnd)), + RecvPropTime(RECVINFO(m_flNeoNextRoundStartTime)), + RecvPropTime(RECVINFO(m_flNeoRoundStartTime)), + RecvPropTime(RECVINFO(m_flPauseEnd)), RecvPropInt(RECVINFO(m_nRoundStatus)), RecvPropInt(RECVINFO(m_nGameTypeSelected)), RecvPropInt(RECVINFO(m_iRoundNumber)), @@ -241,35 +241,35 @@ BEGIN_NETWORK_TABLE_NOBASE( CNEORules, DT_NEORules ) RecvPropInt(RECVINFO(m_iGhosterPlayer)), RecvPropInt(RECVINFO(m_iEscortingTeam)), RecvPropBool(RECVINFO(m_bGhostExists)), - RecvPropFloat(RECVINFO(m_flGhostLastHeld)), + RecvPropTime(RECVINFO(m_flGhostLastHeld)), RecvPropVector(RECVINFO(m_vecGhostMarkerPos)), RecvPropEHandle(RECVINFO(m_hGhost)), RecvPropInt(RECVINFO(m_iJuggernautPlayerIndex)), RecvPropBool(RECVINFO(m_bJuggernautItemExists)), RecvPropEHandle(RECVINFO(m_hJuggernaut)), #else - SendPropFloat(SENDINFO(m_flNeoNextRoundStartTime)), - SendPropFloat(SENDINFO(m_flNeoRoundStartTime)), - SendPropFloat(SENDINFO(m_flPauseEnd)), - SendPropInt(SENDINFO(m_nRoundStatus)), - SendPropInt(SENDINFO(m_nGameTypeSelected)), + SendPropTime(SENDINFO(m_flNeoNextRoundStartTime)), + SendPropTime(SENDINFO(m_flNeoRoundStartTime)), + SendPropTime(SENDINFO(m_flPauseEnd)), + SendPropInt(SENDINFO(m_nRoundStatus), NumBitsForCount(RoundStatusTotal), SPROP_UNSIGNED), + SendPropInt(SENDINFO(m_nGameTypeSelected), NumBitsForCount(NEO_GAME_TYPE__TOTAL), SPROP_UNSIGNED), SendPropInt(SENDINFO(m_iRoundNumber)), SendPropInt(SENDINFO(m_iHiddenHudElements)), - SendPropInt(SENDINFO(m_iForcedTeam)), - SendPropInt(SENDINFO(m_iForcedClass)), - SendPropInt(SENDINFO(m_iForcedSkin)), + SendPropInt(SENDINFO(m_iForcedTeam), NumBitsForRange(-1, TEAM__TOTAL)), + SendPropInt(SENDINFO(m_iForcedClass), NumBitsForRange(-1, NEO_CLASS_ENUM_COUNT)), + SendPropInt(SENDINFO(m_iForcedSkin), NumBitsForRange(-1, NEO_SKIN_ENUM_COUNT)), SendPropInt(SENDINFO(m_iForcedWeapon)), SendPropBool(SENDINFO(m_bCyberspaceLevel)), SendPropString(SENDINFO(m_szNeoJinraiClantag)), SendPropString(SENDINFO(m_szNeoNSFClantag)), - SendPropInt(SENDINFO(m_iGhosterTeam)), - SendPropInt(SENDINFO(m_iGhosterPlayer)), + SendPropInt(SENDINFO(m_iGhosterTeam), NumBitsForCount(TEAM__TOTAL), SPROP_UNSIGNED), + SendPropInt(SENDINFO(m_iGhosterPlayer), NumBitsForCount(MAX_PLAYERS), SPROP_UNSIGNED), SendPropInt(SENDINFO(m_iEscortingTeam)), SendPropBool(SENDINFO(m_bGhostExists)), - SendPropFloat(SENDINFO(m_flGhostLastHeld)), + SendPropTime(SENDINFO(m_flGhostLastHeld)), SendPropVector(SENDINFO(m_vecGhostMarkerPos), -1, SPROP_COORD_MP_LOWPRECISION | SPROP_CHANGES_OFTEN, MIN_COORD_FLOAT, MAX_COORD_FLOAT), SendPropEHandle(SENDINFO(m_hGhost)), - SendPropInt(SENDINFO(m_iJuggernautPlayerIndex)), + SendPropInt(SENDINFO(m_iJuggernautPlayerIndex), NumBitsForCount(MAX_PLAYERS), SPROP_UNSIGNED), SendPropBool(SENDINFO(m_bJuggernautItemExists)), SendPropEHandle(SENDINFO(m_hJuggernaut)), #endif diff --git a/src/game/shared/neo/neo_gamerules.h b/src/game/shared/neo/neo_gamerules.h index a26dd1b2d7..550ddaffc7 100644 --- a/src/game/shared/neo/neo_gamerules.h +++ b/src/game/shared/neo/neo_gamerules.h @@ -111,6 +111,8 @@ enum NeoRoundStatus { PostRound, Pause, Countdown, + + RoundStatusTotal }; enum NeoWinReason { diff --git a/src/game/shared/neo/neo_ghost_cap_point.cpp b/src/game/shared/neo/neo_ghost_cap_point.cpp index 55f5f6bfde..a7edb5d968 100644 --- a/src/game/shared/neo/neo_ghost_cap_point.cpp +++ b/src/game/shared/neo/neo_ghost_cap_point.cpp @@ -39,8 +39,8 @@ LINK_ENTITY_TO_CLASS(neo_ghost_retrieval_point, CNEOGhostCapturePoint); IMPLEMENT_SERVERCLASS_ST(CNEOGhostCapturePoint, DT_NEOGhostCapturePoint) SendPropFloat(SENDINFO(m_flCapzoneRadius)), - SendPropInt(SENDINFO(m_iOwningTeam)), - SendPropInt(SENDINFO(m_iSuccessfulCaptorClientIndex)), + SendPropInt(SENDINFO(m_iOwningTeam), NumBitsForCount(TEAM__TOTAL), SPROP_UNSIGNED), + SendPropInt(SENDINFO(m_iSuccessfulCaptorClientIndex), NumBitsForCount(MAX_PLAYERS), SPROP_UNSIGNED), SendPropBool(SENDINFO(m_bGhostHasBeenCaptured)), SendPropBool(SENDINFO(m_bIsActive)), diff --git a/src/game/shared/neo/neo_player_shared.h b/src/game/shared/neo/neo_player_shared.h index cbbc1d5e97..ea4eb3617d 100644 --- a/src/game/shared/neo/neo_player_shared.h +++ b/src/game/shared/neo/neo_player_shared.h @@ -244,7 +244,10 @@ enum NeoLeanDirectionE { NEO_LEAN_NONE = 0, NEO_LEAN_LEFT, NEO_LEAN_RIGHT, + + NEO_LEAN__ENUM_COUNT }; +static constexpr int NEO_LEAN_ENUM_COUNT = NEO_LEAN__ENUM_COUNT; enum NeoWeponAimToggleE { NEO_TOGGLE_NIL = 0, diff --git a/src/public/dt_common.h b/src/public/dt_common.h index 996300a5a6..041aa9bea7 100644 --- a/src/public/dt_common.h +++ b/src/public/dt_common.h @@ -214,5 +214,13 @@ inline int NumBitsForCount( int nMaxElements ) return nBits; } +#ifdef NEO +// nMinElements should be the minimum value in the range, nMaxElements the count aka largest value parsed +1 +inline int NumBitsForRange( int nMinElements, int nMaxElements ) +{ + Assert( nMinElements < nMaxElements ); + return NumBitsForCount( nMaxElements - nMinElements ); +} +#endif #endif // DATATABLE_COMMON_H From a4546c0b6b5943152bf0a702f8b04f6c6c2fc2f6 Mon Sep 17 00:00:00 2001 From: DESTROYGIRL <170364626+DESTROYGIRL@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:05:29 +0000 Subject: [PATCH 2/3] do not attempt signed ints --- src/game/server/neo/neo_player.cpp | 8 ++++---- src/game/shared/neo/neo_gamerules.cpp | 6 +++--- src/public/dt_common.h | 8 -------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/game/server/neo/neo_player.cpp b/src/game/server/neo/neo_player.cpp index bfecf4daa5..3389b239c9 100644 --- a/src/game/server/neo/neo_player.cpp +++ b/src/game/server/neo/neo_player.cpp @@ -45,13 +45,13 @@ LINK_ENTITY_TO_CLASS(player, CNEO_Player); IMPLEMENT_SERVERCLASS_ST(CNEO_Player, DT_NEO_Player) -SendPropInt(SENDINFO(m_iNeoClass), NumBitsForRange(NEO_CLASS_RANDOM, NEO_CLASS_ENUM_COUNT)), +SendPropInt(SENDINFO(m_iNeoClass)), SendPropInt(SENDINFO(m_iNeoSkin), NumBitsForCount(NEO_SKIN_ENUM_COUNT), SPROP_UNSIGNED), SendPropInt(SENDINFO(m_iNeoStar), NumBitsForCount(STAR__TOTAL), SPROP_UNSIGNED), -SendPropInt(SENDINFO(m_iClassBeforeTakeover), NumBitsForRange(NEO_CLASS_RANDOM, NEO_CLASS_ENUM_COUNT)), -SendPropInt(SENDINFO(m_iXP), NumBitsForRange(XP_ANY, XP_EMPTY)), +SendPropInt(SENDINFO(m_iClassBeforeTakeover)), +SendPropInt(SENDINFO(m_iXP)), SendPropInt(SENDINFO(m_iLoadoutWepChoice), NumBitsForCount(MAX_WEAPON_LOADOUTS), SPROP_UNSIGNED), -SendPropInt(SENDINFO(m_iNextSpawnClassChoice), NumBitsForRange(NEO_CLASS_RANDOM, NEO_CLASS_ENUM_COUNT)), +SendPropInt(SENDINFO(m_iNextSpawnClassChoice)), SendPropInt(SENDINFO(m_bInLean), NumBitsForCount(NEO_LEAN_ENUM_COUNT), SPROP_UNSIGNED), SendPropEHandle(SENDINFO(m_hServerRagdoll)), diff --git a/src/game/shared/neo/neo_gamerules.cpp b/src/game/shared/neo/neo_gamerules.cpp index 4a93b14889..ed0ff9add5 100644 --- a/src/game/shared/neo/neo_gamerules.cpp +++ b/src/game/shared/neo/neo_gamerules.cpp @@ -255,9 +255,9 @@ BEGIN_NETWORK_TABLE_NOBASE( CNEORules, DT_NEORules ) SendPropInt(SENDINFO(m_nGameTypeSelected), NumBitsForCount(NEO_GAME_TYPE__TOTAL), SPROP_UNSIGNED), SendPropInt(SENDINFO(m_iRoundNumber)), SendPropInt(SENDINFO(m_iHiddenHudElements)), - SendPropInt(SENDINFO(m_iForcedTeam), NumBitsForRange(-1, TEAM__TOTAL)), - SendPropInt(SENDINFO(m_iForcedClass), NumBitsForRange(-1, NEO_CLASS_ENUM_COUNT)), - SendPropInt(SENDINFO(m_iForcedSkin), NumBitsForRange(-1, NEO_SKIN_ENUM_COUNT)), + SendPropInt(SENDINFO(m_iForcedTeam)), + SendPropInt(SENDINFO(m_iForcedClass)), + SendPropInt(SENDINFO(m_iForcedSkin)), SendPropInt(SENDINFO(m_iForcedWeapon)), SendPropBool(SENDINFO(m_bCyberspaceLevel)), SendPropString(SENDINFO(m_szNeoJinraiClantag)), diff --git a/src/public/dt_common.h b/src/public/dt_common.h index 041aa9bea7..996300a5a6 100644 --- a/src/public/dt_common.h +++ b/src/public/dt_common.h @@ -214,13 +214,5 @@ inline int NumBitsForCount( int nMaxElements ) return nBits; } -#ifdef NEO -// nMinElements should be the minimum value in the range, nMaxElements the count aka largest value parsed +1 -inline int NumBitsForRange( int nMinElements, int nMaxElements ) -{ - Assert( nMinElements < nMaxElements ); - return NumBitsForCount( nMaxElements - nMinElements ); -} -#endif #endif // DATATABLE_COMMON_H From 3e21e04ebb0c0b1f5413629241ce0c5e46e396ac Mon Sep 17 00:00:00 2001 From: DESTROYGIRL <170364626+DESTROYGIRL@users.noreply.github.com> Date: Wed, 14 Jan 2026 14:37:32 +0000 Subject: [PATCH 3/3] safe --- src/game/shared/neo/neo_gamerules.cpp | 4 ++-- src/game/shared/neo/neo_ghost_cap_point.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/shared/neo/neo_gamerules.cpp b/src/game/shared/neo/neo_gamerules.cpp index e425506572..d9c799b070 100644 --- a/src/game/shared/neo/neo_gamerules.cpp +++ b/src/game/shared/neo/neo_gamerules.cpp @@ -263,13 +263,13 @@ BEGIN_NETWORK_TABLE_NOBASE( CNEORules, DT_NEORules ) SendPropString(SENDINFO(m_szNeoJinraiClantag)), SendPropString(SENDINFO(m_szNeoNSFClantag)), SendPropInt(SENDINFO(m_iGhosterTeam), NumBitsForCount(TEAM__TOTAL), SPROP_UNSIGNED), - SendPropInt(SENDINFO(m_iGhosterPlayer), NumBitsForCount(MAX_PLAYERS), SPROP_UNSIGNED), + SendPropInt(SENDINFO(m_iGhosterPlayer), NumBitsForCount(MAX_PLAYERS_ARRAY_SAFE), SPROP_UNSIGNED), SendPropInt(SENDINFO(m_iEscortingTeam)), SendPropBool(SENDINFO(m_bGhostExists)), SendPropTime(SENDINFO(m_flGhostLastHeld)), SendPropVector(SENDINFO(m_vecGhostMarkerPos), -1, SPROP_COORD_MP_LOWPRECISION | SPROP_CHANGES_OFTEN, MIN_COORD_FLOAT, MAX_COORD_FLOAT), SendPropEHandle(SENDINFO(m_hGhost)), - SendPropInt(SENDINFO(m_iJuggernautPlayerIndex), NumBitsForCount(MAX_PLAYERS), SPROP_UNSIGNED), + SendPropInt(SENDINFO(m_iJuggernautPlayerIndex), NumBitsForCount(MAX_PLAYERS_ARRAY_SAFE), SPROP_UNSIGNED), SendPropBool(SENDINFO(m_bJuggernautItemExists)), SendPropEHandle(SENDINFO(m_hJuggernaut)), #endif diff --git a/src/game/shared/neo/neo_ghost_cap_point.cpp b/src/game/shared/neo/neo_ghost_cap_point.cpp index e38d757e3e..5bbb7a5e57 100644 --- a/src/game/shared/neo/neo_ghost_cap_point.cpp +++ b/src/game/shared/neo/neo_ghost_cap_point.cpp @@ -41,7 +41,7 @@ IMPLEMENT_SERVERCLASS_ST(CNEOGhostCapturePoint, DT_NEOGhostCapturePoint) SendPropFloat(SENDINFO(m_flCapzoneRadius)), SendPropInt(SENDINFO(m_iOwningTeam), NumBitsForCount(TEAM__TOTAL), SPROP_UNSIGNED), - SendPropInt(SENDINFO(m_iSuccessfulCaptorClientIndex), NumBitsForCount(MAX_PLAYERS), SPROP_UNSIGNED), + SendPropInt(SENDINFO(m_iSuccessfulCaptorClientIndex), NumBitsForCount(MAX_PLAYERS_ARRAY_SAFE), SPROP_UNSIGNED), SendPropBool(SENDINFO(m_bGhostHasBeenCaptured)), SendPropBool(SENDINFO(m_bIsActive)),