From 12266e0f85c8573995c320be31813e9decd885c0 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 9 Jun 2017 23:15:41 +0100 Subject: [PATCH 1/5] Set ack and ackreturn to 0 for local packets always This won't really have any in-game effect, this is just so the debugfile doesn't display the ack values of the PREVIOUS sent/got packet --- src/d_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/d_net.c b/src/d_net.c index 50b6c8cf..4b14e175 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -1028,6 +1028,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen #endif return false; } + netbuffer->ack = netbuffer->ackreturn = 0; // don't hold over values from last packet sent/received M_Memcpy(&reboundstore[rebound_head], netbuffer, doomcom->datalength); reboundsize[rebound_head] = doomcom->datalength; From b9828f78e8688ac416ba40f008f74d37cb1515a5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 9 Jun 2017 23:22:27 +0100 Subject: [PATCH 2/5] Fix stupid lack of newline with this message --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 312a308a..acaca1f6 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4077,7 +4077,7 @@ static INT16 Consistancy(void) mobj_t *mo; #endif - DEBFILE(va("TIC %u ", gametic)); + DEBFILE(va("TIC %u\n", gametic)); for (i = 0; i < MAXPLAYERS; i++) { From bae55a3af463f5ce6ecdc9af42aa4762eba25f4c Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 10 Jun 2017 16:36:52 +0100 Subject: [PATCH 3/5] Don't display "x set to y" messages twice in the debugfile for consvars with CV_SHOWMODIFONETIME/CV_SHOWMODIF (can't think offhand when those flags are actually used, but oh well) --- src/command.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/command.c b/src/command.c index a15471c8..f77fb5a4 100644 --- a/src/command.c +++ b/src/command.c @@ -1180,7 +1180,10 @@ finish: CONS_Printf(M_GetText("%s set to %s\n"), var->name, var->string); var->flags &= ~CV_SHOWMODIFONETIME; } - DEBFILE(va("%s set to %s\n", var->name, var->string)); + else // display message in debug file only + { + DEBFILE(va("%s set to %s\n", var->name, var->string)); + } var->flags |= CV_MODIFIED; // raise 'on change' code #ifdef HAVE_BLUA From 02c098574cc768cbb564c6a239289edaffea35e1 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 10 Jun 2017 17:09:08 +0100 Subject: [PATCH 4/5] ah, turns out the TIC n debugfile print is a remnant of when Doom Legacy printed the consistancy return value... which we'll do here now too, in that case --- src/d_clisrv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index acaca1f6..70631262 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4077,7 +4077,7 @@ static INT16 Consistancy(void) mobj_t *mo; #endif - DEBFILE(va("TIC %u\n", gametic)); + DEBFILE(va("TIC %u ", gametic)); for (i = 0; i < MAXPLAYERS; i++) { @@ -4099,7 +4099,10 @@ static INT16 Consistancy(void) #ifdef MOBJCONSISTANCY if (!thinkercap.next) + { + DEBFILE(va("Consistancy = %u\n", ret)); return ret; + } for (th = thinkercap.next; th != &thinkercap; th = th->next) { if (th->function.acp1 != (actionf_p1)P_MobjThinker) @@ -4168,6 +4171,8 @@ static INT16 Consistancy(void) } #endif + DEBFILE(va("Consistancy = %u\n", (ret & 0xFFFF))); + return (INT16)(ret & 0xFFFF); } From 318d5656b51a527309695caf6930726adb94b594 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 12 Jun 2017 17:55:15 +0100 Subject: [PATCH 5/5] Keeping a total of thinkers saved/loaded and print the total in netplay devmode Not a fix for anything, probably just useful for debugging --- src/p_saveg.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/p_saveg.c b/src/p_saveg.c index 75f7b3e5..d1ec8e5a 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1653,12 +1653,18 @@ static inline void SaveWhatThinker(const thinker_t *th, const UINT8 type) static void P_NetArchiveThinkers(void) { const thinker_t *th; + UINT32 numsaved = 0; WRITEUINT32(save_p, ARCHIVEBLOCK_THINKERS); // save off the current thinkers for (th = thinkercap.next; th != &thinkercap; th = th->next) { + if (!(th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed + || th->function.acp1 == (actionf_p1)P_RainThinker + || th->function.acp1 == (actionf_p1)P_SnowThinker)) + numsaved++; + if (th->function.acp1 == (actionf_p1)P_MobjThinker) { SaveMobjThinker(th, tc_mobj); @@ -1846,6 +1852,8 @@ static void P_NetArchiveThinkers(void) #endif } + CONS_Debug(DBG_NETPLAY, "%u thinkers saved\n", numsaved); + WRITEUINT8(save_p, tc_end); } @@ -2610,6 +2618,7 @@ static void P_NetUnArchiveThinkers(void) UINT8 tclass; UINT8 restoreNum = false; UINT32 i; + UINT32 numloaded = 0; if (READUINT32(save_p) != ARCHIVEBLOCK_THINKERS) I_Error("Bad $$$.sav at archive block Thinkers"); @@ -2643,6 +2652,7 @@ static void P_NetUnArchiveThinkers(void) if (tclass == tc_end) break; // leave the saved thinker reading loop + numloaded++; switch (tclass) { @@ -2794,6 +2804,8 @@ static void P_NetUnArchiveThinkers(void) } } + CONS_Debug(DBG_NETPLAY, "%u thinkers loaded\n", numloaded); + if (restoreNum) { executor_t *delay = NULL;