mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-23 12:22:26 +00:00
server: QII97 protocol version check unification
This commit is contained in:
parent
f7dc2777c5
commit
6aa0b2a92b
5 changed files with 14 additions and 23 deletions
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue