Skip to content

Commit

Permalink
Fix client integrity due to neo_version_info.h change (#540)
Browse files Browse the repository at this point in the history
* It can no longer use sizeof(GIT_LONGHASH) as that turned from an array
  into a pointer now so it returns 8 instead of ~40
  • Loading branch information
nullsystem committed Aug 3, 2024
1 parent 4e3cf9e commit 273dbf3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mp/src/game/shared/neo/neo_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ bool CNEORules::ClientConnected(edict_t *pEntity, const char *pszName, const cha
DevWarning("Client debug build integrity check bypass! Client: %s | Server: %s\n", clientGitHash, GIT_LONGHASH);
}
// NEO NOTE (nullsystem): Due to debug builds, if we're to match exactly, we'll have to mask out final bit first
char cmpClientGitHash[sizeof(GIT_LONGHASH) + 1];
char cmpClientGitHash[GIT_LONGHASH_SIZE + 1];
V_strcpy_safe(cmpClientGitHash, clientGitHash);
cmpClientGitHash[0] &= 0b0111'1111;
if (!dbgBuildSkip && V_strcmp(cmpClientGitHash, GIT_LONGHASH))
Expand Down
2 changes: 1 addition & 1 deletion mp/src/game/shared/neo/neo_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ConVar __neo_cl_git_hash("__neo_cl_git_hash", GIT_LONGHASH,
#if defined(CLIENT_DLL) && defined(DEBUG)
void InitializeDbgNeoClGitHashEdit()
{
static char static_dbgHash[sizeof(GIT_LONGHASH) + 1];
static char static_dbgHash[GIT_LONGHASH_SIZE];
V_strcpy_safe(static_dbgHash, GIT_LONGHASH);
static_dbgHash[0] = static_dbgHash[0] | 0b1000'0000;
__neo_cl_git_hash.SetDefault(static_dbgHash);
Expand Down
1 change: 1 addition & 0 deletions mp/src/game/shared/neo/neo_version_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern const char* BUILD_DATE_SHORT;
extern const char* BUILD_DATE_LONG;
extern const char* GIT_HASH;
extern const char* GIT_LONGHASH;
static constexpr int GIT_LONGHASH_SIZE = 41;
extern const char* OS_BUILD;
extern const char* COMPILER_ID;
extern const char* COMPILER_VERSION;

0 comments on commit 273dbf3

Please sign in to comment.