From bc0fc9b05a23c6cf6e82778c003115caa2d5ed53 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 30 Sep 2022 05:49:26 -0700 Subject: [PATCH] Readd version and subversion to serverinfo Add commit field after those two so packet is identical up to that point and DEVELOP builds mismatch version online. blame d176aefd8 --- src/d_clisrv.c | 10 +++------- src/d_clisrv.h | 5 ++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index a5a8e126b..a6f18b1ab 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -896,12 +896,12 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo._255 = 255; netbuffer->u.serverinfo.packetversion = PACKETVERSION; + netbuffer->u.serverinfo.version = VERSION; + netbuffer->u.serverinfo.subversion = SUBVERSION; + #ifdef DEVELOP memcpy(netbuffer->u.serverinfo.commit, comprevision_abbrev_bin, GIT_SHA_ABBREV); -#else - netbuffer->u.serverinfo.version = VERSION; - netbuffer->u.serverinfo.subversion = SUBVERSION; #endif strncpy(netbuffer->u.serverinfo.application, SRB2APPLICATION, @@ -1411,13 +1411,11 @@ static void SL_InsertServer(serverinfo_pak* info, SINT8 node) if (info->packetversion != PACKETVERSION) return;/* old new packet format */ -#ifndef DEVELOP if (info->version != VERSION) return; // Not same version. if (info->subversion != SUBVERSION) return; // Close, but no cigar. -#endif if (strcmp(info->application, SRB2APPLICATION)) return;/* that's a different mod */ @@ -2052,10 +2050,8 @@ static void CL_ConnectToServer(void) gametypestr[sizeof serverlist[i].info.gametypename - 1] = '\0'; CON_LogMessage(va(M_GetText("Gametype: %s\n"), gametypestr)); -#ifndef DEVELOP CON_LogMessage(va(M_GetText("Version: %d.%d\n"), serverlist[i].info.version, serverlist[i].info.subversion)); -#endif } SL_ClearServerList(servernode); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index a7f56b78f..354e62486 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -266,11 +266,10 @@ typedef struct UINT8 _255; UINT8 packetversion; char application[MAXAPPLICATION]; -#ifdef DEVELOP - UINT8 commit[GIT_SHA_ABBREV]; -#else UINT8 version; UINT8 subversion; +#ifdef DEVELOP + UINT8 commit[GIT_SHA_ABBREV]; #endif UINT8 numberofplayer; UINT8 maxplayer;