From 67d8b291bb2f027119b5363c8ff8e1a1c0792fa1 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 6 Dec 2019 17:13:04 +0000 Subject: [PATCH 1/6] * Fix unintentional order-of-operations crash with non-DEVELOP executables (resolves #461). * Update md5s. * Update modversion. TODO: Should we change MODID, given 2.0 apparently had a different MODID to 2.1? --- src/config.h.in | 8 ++++---- src/d_main.c | 40 ++++++++++++++-------------------------- src/doomdef.h | 4 ++-- src/w_wad.c | 4 ++-- 4 files changed, 22 insertions(+), 34 deletions(-) diff --git a/src/config.h.in b/src/config.h.in index 58d07e26d..407d0565e 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -29,11 +29,11 @@ * Last updated 2015 / 05 / 03 - v2.1.15 - main assets * Last updated 2018 / ?? / ?? - v2.2 - patch.pk3 */ -#define ASSET_HASH_SRB2_PK3 "c1b9577687f8a795104aef4600720ea7" -#define ASSET_HASH_ZONES_PK3 "303838c6c534d9540288360fa49cca60" -#define ASSET_HASH_PLAYER_DTA "cfca0f1c73023cbbd8f844f45480f799" +#define ASSET_HASH_SRB2_PK3 "3944e92e74078145abb312ad0b736966" +#define ASSET_HASH_ZONES_PK3 "eeda723d16dc26a7450669b4c06d3ffc" +#define ASSET_HASH_PLAYER_DTA "56a247e074dd0dc794b6617efef1e918" #ifdef USE_PATCH_DTA -#define ASSET_HASH_PATCH_PK3 "dbbf8bc6121618ee3be2d5b14650429b" +#define ASSET_HASH_PATCH_PK3 "there is no patch.pk3, only zuul" #endif #endif diff --git a/src/d_main.c b/src/d_main.c index 5853fccf0..3132b6182 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1155,31 +1155,10 @@ void D_SRB2Main(void) // Have to be done here before files are loaded M_InitCharacterTables(); - mainwads = 0; - -#ifndef DEVELOP // md5s last updated 12/14/14 - - // Check MD5s of autoloaded files - W_VerifyFileMD5(mainwads++, ASSET_HASH_SRB2_PK3); // srb2.pk3 - W_VerifyFileMD5(mainwads++, ASSET_HASH_ZONES_PK3); // zones.pk3 - W_VerifyFileMD5(mainwads++, ASSET_HASH_PLAYER_DTA); // player.dta + mainwads = 3; // doesn't include music.dta #ifdef USE_PATCH_DTA - W_VerifyFileMD5(mainwads++, ASSET_HASH_PATCH_DTA); // patch.pk3 + mainwads++; #endif - // don't check music.dta because people like to modify it, and it doesn't matter if they do - // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. - //mainwads++; // music.dta does not increment mainwads (see <= 2.1.21) - //mainwads++; // neither does music_new.dta -#else - - mainwads++; // srb2.pk3 - mainwads++; // zones.pk3 - mainwads++; // player.dta -#ifdef USE_PATCH_DTA - mainwads++; // patch.dta -#endif - //mainwads++; // music.dta does not increment mainwads (see <= 2.1.21) - //mainwads++; // neither does music_new.dta // load wad, including the main wad file CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n"); @@ -1191,11 +1170,20 @@ void D_SRB2Main(void) #endif D_CleanFile(); +#ifndef DEVELOP // md5s last updated 06/12/19 (ddmmyy) + + // Check MD5s of autoloaded files + W_VerifyFileMD5(0, ASSET_HASH_SRB2_PK3); // srb2.pk3 + W_VerifyFileMD5(1, ASSET_HASH_ZONES_PK3); // zones.pk3 + W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta +#ifdef USE_PATCH_DTA + W_VerifyFileMD5(3, ASSET_HASH_PATCH_DTA); // patch.pk3 +#endif + // don't check music.dta because people like to modify it, and it doesn't matter if they do + // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. #endif //ifndef DEVELOP - mainwadstally = packetsizetally; - - mainwadstally = packetsizetally; + mainwadstally = packetsizetally; // technically not accurate atm, remember to port the two-stage -file process from kart in 2.2.x cht_Init(); diff --git a/src/doomdef.h b/src/doomdef.h index 511dad858..1f5752134 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -129,7 +129,7 @@ extern FILE *logstream; #endif -#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 +//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 #ifdef DEVELOP #define VERSION 0 // Game version #define SUBVERSION 0 // more precise version number @@ -206,7 +206,7 @@ extern FILE *logstream; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1". -#define MODVERSION 30 +#define MODVERSION 31 // To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically. // Increment MINOREXECVERSION whenever a config change is needed that does not correspond diff --git a/src/w_wad.c b/src/w_wad.c index 2690253e4..7534b8484 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1670,12 +1670,12 @@ void W_VerifyFileMD5(UINT16 wadfilenum, const char *matchmd5) { char actualmd5text[2*MD5_LEN+1]; PrintMD5String(wadfiles[wadfilenum]->md5sum, actualmd5text); -/*#ifdef _DEBUG +#ifdef _DEBUG CONS_Printf #else I_Error #endif - (M_GetText("File is corrupt or has been modified: %s (found md5: %s, wanted: %s)\n"), wadfiles[wadfilenum]->filename, actualmd5text, matchmd5);*/ + (M_GetText("File is corrupt or has been modified: %s (found md5: %s, wanted: %s)\n"), wadfiles[wadfilenum]->filename, actualmd5text, matchmd5); } #endif } From 419d6960724c44c023bb85a181d287df4e167c55 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 6 Dec 2019 17:19:42 +0000 Subject: [PATCH 2/6] Make modversion 40 to match Rob's work. --- src/doomdef.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 1f5752134..c820924d7 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -205,8 +205,8 @@ extern FILE *logstream; // The Modification Version, starting from 1. Do not follow your version string for this, // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. -// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1". -#define MODVERSION 31 +// Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1". +#define MODVERSION 40 // To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically. // Increment MINOREXECVERSION whenever a config change is needed that does not correspond From b36de5f6b5fa45cc0223c21484a7ce92e22f7572 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 6 Dec 2019 17:23:55 +0000 Subject: [PATCH 3/6] Make modid 18 to match Rob's work. --- src/doomdef.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index c820924d7..1b44c890f 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -199,8 +199,8 @@ extern FILE *logstream; // The Modification ID; must be obtained from Rob ( https://mb.srb2.org/private.php?do=newpm&u=546 ). // DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server. -// "12" is the default mod ID for version 2.1 -#define MODID 12 +// "18" is the default mod ID for version 2.2 +#define MODID 18 // The Modification Version, starting from 1. Do not follow your version string for this, // it's only for detection of the version the player is using so the MS can alert them of an update. From 9104fe85b9621d2688ad69a059b7f760d90e6fcf Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 6 Dec 2019 17:38:23 +0000 Subject: [PATCH 4/6] Update comments in the config on when main assets/patch.pk3 hashes have been updated (I know MS is going to update the hashes again later, but this'll still be valid to have done then). --- src/config.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.h.in b/src/config.h.in index 407d0565e..49300d649 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -26,8 +26,8 @@ #else /* Manually defined asset hashes for non-CMake builds - * Last updated 2015 / 05 / 03 - v2.1.15 - main assets - * Last updated 2018 / ?? / ?? - v2.2 - patch.pk3 + * Last updated 2019 / 12 / 06 - v2.2.0 - main assets + * Last updated 20?? / ?? / ?? - v2.2.? - patch.pk3 */ #define ASSET_HASH_SRB2_PK3 "3944e92e74078145abb312ad0b736966" #define ASSET_HASH_ZONES_PK3 "eeda723d16dc26a7450669b4c06d3ffc" From 7f0bb0686d33bf61987cc90c71277472fa7d4a94 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Fri, 6 Dec 2019 23:43:54 +0100 Subject: [PATCH 5/6] Updated MD5 hashes --- src/config.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.h.in b/src/config.h.in index 49300d649..60f2f7245 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -29,8 +29,8 @@ * Last updated 2019 / 12 / 06 - v2.2.0 - main assets * Last updated 20?? / ?? / ?? - v2.2.? - patch.pk3 */ -#define ASSET_HASH_SRB2_PK3 "3944e92e74078145abb312ad0b736966" -#define ASSET_HASH_ZONES_PK3 "eeda723d16dc26a7450669b4c06d3ffc" +#define ASSET_HASH_SRB2_PK3 "f31368d13c9cb73563475f201bac29d1" +#define ASSET_HASH_ZONES_PK3 "cd44b67b9f7e8798ed64ec8698531d8c" #define ASSET_HASH_PLAYER_DTA "56a247e074dd0dc794b6617efef1e918" #ifdef USE_PATCH_DTA #define ASSET_HASH_PATCH_PK3 "there is no patch.pk3, only zuul" From e31a10df309f537558c2c4dc8bdb92b2cd87c3ac Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Fri, 6 Dec 2019 23:47:05 +0100 Subject: [PATCH 6/6] Change versionstring to 2.2.0 --- src/doomdef.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 242038ed0..d13ff9bc0 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -140,8 +140,8 @@ extern FILE *logstream; #else #define VERSION 202 // Game version #define SUBVERSION 0 // more precise version number -#define VERSIONSTRING "v2.2" -#define VERSIONSTRINGW L"v2.2" +#define VERSIONSTRING "v2.2.0" +#define VERSIONSTRINGW L"v2.2.0" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif