diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index a5729f8e..1a8f4721 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -843,8 +843,35 @@ CL_ParseServerData(void) cls.serverProtocol = i; /* another demo hack */ - if (Com_ServerState() && (PROTOCOL_VERSION == 34)) + if (Com_ServerState() && ( + (i == PROTOCOL_RELEASE_VERSION) || + (i == PROTOCOL_DEMO_VERSION) || + (i == PROTOCOL_VERSION) || + (i == PROTOCOL_RR22_VERSION) || + (i == PROTOCOL_RR23_VERSION))) { + Com_Printf("Network protocol: "); + switch (i) + { + case PROTOCOL_RELEASE_VERSION: + Com_Printf("Quake 2 Demo\n"); + break; + case PROTOCOL_DEMO_VERSION: + Com_Printf("Quake 2 Release Demo\n"); + break; + case PROTOCOL_VERSION: + Com_Printf("Quake 2\n"); + break; + case PROTOCOL_RR22_VERSION: + Com_Printf("ReRelease Quake 2 Demo\n"); + break; + case PROTOCOL_RR23_VERSION: + Com_Printf("ReRelease Quake 2\n"); + break; + default: + Com_Printf("Unknown protocol version\n"); + break; + }; } else if (i != PROTOCOL_VERSION) { @@ -1071,7 +1098,7 @@ CL_ParseConfigString(void) if ((i < 0) || (i >= MAX_CONFIGSTRINGS)) { - Com_Error(ERR_DROP, "configstring > MAX_CONFIGSTRINGS"); + Com_Error(ERR_DROP, "%s: configstring > MAX_CONFIGSTRINGS", __func__); } s = MSG_ReadString(&net_message); @@ -1081,7 +1108,7 @@ CL_ParseConfigString(void) length = strlen(s); if (length > sizeof(cl.configstrings) - sizeof(cl.configstrings[0])*i - 1) { - Com_Error(ERR_DROP, "CL_ParseConfigString: oversize configstring"); + Com_Error(ERR_DROP, "%s: oversize configstring", __func__); } strcpy(cl.configstrings[i], s); diff --git a/src/common/header/common.h b/src/common/header/common.h index eafd3f02..730aa557 100644 --- a/src/common/header/common.h +++ b/src/common/header/common.h @@ -175,7 +175,16 @@ void Info_Print(char *s); /* PROTOCOL */ +/* Quake 2 Release Demos */ +#define PROTOCOL_RELEASE_VERSION 26 +/* Quake 2 Demo */ +#define PROTOCOL_DEMO_VERSION 31 +/* Quake 2 Network Release */ #define PROTOCOL_VERSION 34 +/* ReRelease demo files */ +#define PROTOCOL_RR22_VERSION 2022 +/* ReRelease network protocol */ +#define PROTOCOL_RR23_VERSION 2023 /* ========================================= */ diff --git a/src/server/sv_send.c b/src/server/sv_send.c index 59d5c13f..a07ea4e4 100644 --- a/src/server/sv_send.c +++ b/src/server/sv_send.c @@ -559,7 +559,7 @@ SV_SendClientMessages(void) if (msglen > MAX_MSGLEN) { Com_Error(ERR_DROP, - "SV_SendClientMessages: msglen > MAX_MSGLEN"); + "%s: msglen > MAX_MSGLEN", __func__); } r = FS_FRead(msgbuf, msglen, 1, sv.demofile);