server: QII97 protocol version check unification

This commit is contained in:
Denis Pauk 2024-03-24 13:22:42 +02:00
parent f7dc2777c5
commit 6aa0b2a92b
5 changed files with 14 additions and 23 deletions

View file

@ -143,10 +143,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
VectorCopy(from->origin, to->old_origin);
to->number = number;
if ((cls.serverProtocol == PROTOCOL_RELEASE_VERSION) ||
(cls.serverProtocol == PROTOCOL_DEMO_VERSION) ||
(cls.serverProtocol == PROTOCOL_XATRIX_VERSION) ||
(cls.serverProtocol == PROTOCOL_RR97_VERSION))
if (IS_QII97_PROTOCOL(cls.serverProtocol))
{
if (bits & U_MODEL)
{
@ -882,10 +879,7 @@ CL_ParseServerData(void)
/* another demo hack */
if (Com_ServerState() && (
(i == PROTOCOL_RELEASE_VERSION) ||
(i == PROTOCOL_DEMO_VERSION) ||
(i == PROTOCOL_XATRIX_VERSION) ||
(i == PROTOCOL_RR97_VERSION) ||
IS_QII97_PROTOCOL(i) ||
(i == PROTOCOL_RR22_VERSION) ||
(i == PROTOCOL_RR23_VERSION) ||
(i == PROTOCOL_VERSION)))
@ -903,7 +897,7 @@ CL_ParseServerData(void)
Com_Printf("Quake 2 Release Demo\n");
break;
/* Network protocol */
case PROTOCOL_RR97_VERSION:
case PROTOCOL_R97_VERSION:
Com_Printf("Quake 2\n");
break;
/* ReRelease Demo */

View file

@ -182,7 +182,7 @@ void Info_Print(char *s);
/* Quake 2 Xatrix Demo */
#define PROTOCOL_XATRIX_VERSION 32
/* Quake 2 Network Release */
#define PROTOCOL_RR97_VERSION 34
#define PROTOCOL_R97_VERSION 34
/* ReRelease demo files */
#define PROTOCOL_RR22_VERSION 2022
/* ReRelease network protocol */
@ -190,6 +190,12 @@ void Info_Print(char *s);
/* Quake 2 Customized Network Release */
#define PROTOCOL_VERSION 2024
#define IS_QII97_PROTOCOL(x) ( \
((x) == PROTOCOL_RELEASE_VERSION) || \
((x) == PROTOCOL_DEMO_VERSION) || \
((x) == PROTOCOL_XATRIX_VERSION) || \
((x) == PROTOCOL_R97_VERSION))
/* ========================================= */
#define PORT_MASTER 27900

View file

@ -645,10 +645,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
MSG_WriteByte(msg, to->number);
}
if ((protocol == PROTOCOL_RELEASE_VERSION) ||
(protocol == PROTOCOL_DEMO_VERSION) ||
(protocol == PROTOCOL_XATRIX_VERSION) ||
(protocol == PROTOCOL_RR97_VERSION))
if (IS_QII97_PROTOCOL(protocol))
{
if (bits & U_MODEL)
{

View file

@ -51,10 +51,7 @@
int
P_ConvertConfigStringFrom(int i, int protocol)
{
if (protocol == PROTOCOL_RELEASE_VERSION ||
protocol == PROTOCOL_DEMO_VERSION ||
protocol == PROTOCOL_XATRIX_VERSION ||
protocol == PROTOCOL_RR97_VERSION)
if (IS_QII97_PROTOCOL(protocol))
{
if (i >= CS_MODELS_Q2DEMO && i < CS_SOUNDS_Q2DEMO)
{
@ -93,10 +90,7 @@ P_ConvertConfigStringFrom(int i, int protocol)
int
P_ConvertConfigStringTo(int i, int protocol)
{
if (protocol == PROTOCOL_RELEASE_VERSION ||
protocol == PROTOCOL_DEMO_VERSION ||
protocol == PROTOCOL_XATRIX_VERSION ||
protocol == PROTOCOL_RR97_VERSION)
if (IS_QII97_PROTOCOL(protocol))
{
if (i >= CS_MODELS && i < CS_SOUNDS)
{

View file

@ -78,7 +78,7 @@ SV_New_f(void)
if (ge->apiversion == GAME_API_R97_VERSION)
{
/* backward compatibility */
sv_client->protocol = PROTOCOL_RR97_VERSION;
sv_client->protocol = PROTOCOL_R97_VERSION;
}
else
{