From 95ae37fa0afbf3633f76266884ab3962b744d175 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 31 Aug 2023 18:15:52 -0700 Subject: [PATCH] Various fixes to let release builds compile - Fixed followers.pk3 asset hash checking. - Moved asset hashes from config.h to d_main.c directly. - Changes to config.h.in require building the game twice and having it in d_main.c is just more contained. - Removed old reset on holepunchserver if it was set to the wrong address. This was only relevant for a short period of time during development. - Fixed cv_kartencoremap being used outside of DEVELOP. - Fixed unused variable warning in GotOurIP. --- src/config.h.in | 16 ---------------- src/cvars.cpp | 3 +-- src/d_clisrv.c | 4 +++- src/d_main.c | 25 +++++++++++++++++++++---- src/mserv.c | 13 ------------- src/p_setup.c | 6 +++++- src/p_spec.c | 6 +++++- 7 files changed, 35 insertions(+), 38 deletions(-) diff --git a/src/config.h.in b/src/config.h.in index 1dd4da57d..77c1e08f9 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -26,20 +26,4 @@ #endif -/* Manually defined asset hashes for non-CMake builds - * Last updated 2019 / 01 / 18 - Kart v1.0.2 - Main assets - * Last updated 2020 / 08 / 30 - Kart v1.3 - patch.kart - */ - -#define ASSET_HASH_BIOS_PK3 "00000000000000000000000000000000" -#define ASSET_HASH_GFX_PK3 "00000000000000000000000000000000" -#define ASSET_HASH_TEXTURES_GENERAL_PK3 "00000000000000000000000000000000" -#define ASSET_HASH_TEXTURES_SEGA_PK3 "00000000000000000000000000000000" -#define ASSET_HASH_TEXTURES_ORIGINAL_PK3 "00000000000000000000000000000000" -#define ASSET_HASH_CHARS_PK3 "00000000000000000000000000000000" -#define ASSET_HASH_MAPS_PK3 "00000000000000000000000000000000" -#ifdef USE_PATCH_FILE -#define ASSET_HASH_PATCH_PK3 "00000000000000000000000000000000" -#endif - #endif diff --git a/src/cvars.cpp b/src/cvars.cpp index 6f7e3e812..211c8b681 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -532,8 +532,7 @@ consvar_t cv_playbackspeed = Server("playbackspeed", "1").min_max(1, 10).dont_sa consvar_t cv_reducevfx = Server("reducevfx", "No").yes_no(); -void RendezvousServer_OnChange(void); -consvar_t cv_rendezvousserver = Server("holepunchserver", "relay.kartkrew.org").onchange(RendezvousServer_OnChange); +consvar_t cv_rendezvousserver = Server("holepunchserver", "relay.kartkrew.org"); void Update_parameters (void); consvar_t cv_server_contact = Server("server_contact", "").onchange_noinit(Update_parameters); diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 92d67f224..08520d813 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4147,9 +4147,11 @@ void CL_RemoveSplitscreenPlayer(UINT8 p) #ifndef TESTERS static void GotOurIP(UINT32 address) { - const unsigned char * p = (const unsigned char *)&address; #ifdef DEVELOP + { + const unsigned char * p = (const unsigned char *)&address; CONS_Printf("Got IP of %u.%u.%u.%u\n", p[0], p[1], p[2], p[3]); + } #endif ourIP = address; } diff --git a/src/d_main.c b/src/d_main.c index 0d80071dc..a0fe48c30 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -96,6 +96,23 @@ #include "lua_script.h" +/* Manually defined asset hashes + * Last updated 2019 / 01 / 18 - Kart v1.0.2 - Main assets + * Last updated 2020 / 08 / 30 - Kart v1.3 - patch.kart + */ + +#define ASSET_HASH_BIOS_PK3 "00000000000000000000000000000000" +#define ASSET_HASH_GFX_PK3 "00000000000000000000000000000000" +#define ASSET_HASH_TEXTURES_GENERAL_PK3 "00000000000000000000000000000000" +#define ASSET_HASH_TEXTURES_SEGA_PK3 "00000000000000000000000000000000" +#define ASSET_HASH_TEXTURES_ORIGINAL_PK3 "00000000000000000000000000000000" +#define ASSET_HASH_CHARS_PK3 "00000000000000000000000000000000" +#define ASSET_HASH_FOLLOWERS_PK3 "00000000000000000000000000000000" +#define ASSET_HASH_MAPS_PK3 "00000000000000000000000000000000" +#ifdef USE_PATCH_FILE +#define ASSET_HASH_PATCH_PK3 "00000000000000000000000000000000" +#endif + // Version numbers for netplay :upside_down_face: int VERSION; int SUBVERSION; @@ -1479,18 +1496,18 @@ void D_SRB2Main(void) mainwads = 0; #ifndef DEVELOP -#ifdef USE_PATCH_FILE - mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_PK3); // patch.pk3 -#endif // Check MD5s of autoloaded files // Note: Do not add any files that ignore MD5! W_VerifyFileMD5(mainwads, ASSET_HASH_BIOS_PK3); // bios.pk3 +#ifdef USE_PATCH_FILE + mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_PK3); // patch.pk3 +#endif mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_GFX_PK3); // gfx.pk3 mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_TEXTURES_GENERAL_PK3); // textures_general.pk3 mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_TEXTURES_SEGA_PK3); // textures_segazones.pk3 mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_TEXTURES_ORIGINAL_PK3); // textures_originalzones.pk3 mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_CHARS_PK3); // chars.pk3 - mainwads++; W_VerifyFileMd5(mainwads, ASSET_HASH_FOLLOWERS_PK3); // followers.pk3 + mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_FOLLOWERS_PK3); // followers.pk3 mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_MAPS_PK3); // maps.pk3 #else #ifdef USE_PATCH_FILE diff --git a/src/mserv.c b/src/mserv.c index e1f2b9820..8bbd4861d 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -522,16 +522,3 @@ void Advertise_OnChange(void) DRPC_UpdatePresence(); #endif } - -#ifdef DEVELOP -void RendezvousServer_OnChange (void); -void RendezvousServer_OnChange (void) -{ - consvar_t *cvar = &cv_rendezvousserver; - - if (!strcmp(cvar->string, "jart-dev.jameds.org")) - CV_StealthSet(cvar, cvar->defaultvalue); -} -#else -#error "This was an indev thing, remove at release." -#endif diff --git a/src/p_setup.c b/src/p_setup.c index 8c57bace8..3b8590e55 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8336,7 +8336,11 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) if (mapheaderinfo[gamemap-1]) { - if (encoremode && cv_kartencoremap.value) + if (encoremode +#ifdef DEVELOP + && cv_kartencoremap.value +#endif + ) { encoreLump = vres_Find(curmapvirt, "ENCORE"); } diff --git a/src/p_spec.c b/src/p_spec.c index d3efd7ae5..b61a2d71d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6636,7 +6636,11 @@ void P_InitSpecials(void) { mapheader_lighting_t *lighting = &mapheaderinfo[gamemap-1]->lighting; - if (encoremode && cv_kartencoremap.value && mapheaderinfo[gamemap-1]->use_encore_lighting) + if (encoremode +#ifdef DEVELOP + && cv_kartencoremap.value +#endif + && mapheaderinfo[gamemap-1]->use_encore_lighting) { lighting = &mapheaderinfo[gamemap-1]->lighting_encore; }