Skip to content

Commit

Permalink
Fixed broken parts, reverted AQTION_EXTENSIONS exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
darkshade9 committed Sep 14, 2024
1 parent f9f1679 commit ae8f7c8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 46 deletions.
7 changes: 2 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ endif

if get_option('aqtion-build')
config.set10('USE_AQTION', true)
config.set10('AQTION_EXTENSION', true)
config.set10('AQTION_HUD', true)
action_src += ltk_src
action_src += botlib_src

Expand All @@ -561,11 +563,6 @@ if get_option('aqtion-build')
endif
endif

if get_option('aqtion-extensions')
config.set10('AQTION_EXTENSION', true)
config.set10('AQTION_HUD', true)
endif

if get_option('discord-sdk')
#if host_machine.system() == 'linux'
if host_machine.cpu_family() == 'aarch64' # I am Linux ARM 64-bit
Expand Down
5 changes: 0 additions & 5 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ option('aqtion-build',
value: true,
description: 'Build-specific for AQtion enhancements')

option('aqtion-extensions',
type: 'boolean',
value: true,
description: 'Build-specific for AQtion extensions')

option('anticheat-server',
type: 'boolean',
value: false,
Expand Down
4 changes: 3 additions & 1 deletion src/action/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ extern cvar_t *esp_debug; // Enable or disable debug mode (very spammy)

// 2023
extern cvar_t *use_killcounts; // Adjust how kill streaks are counted
extern cvar_t *am; // Enable or disable Attract Mode (ltk bots) (do not set this manually)
extern cvar_t *am; // Enable or disable Attract Mode (ltk bots)
extern cvar_t *zoom_comp; // Enable or disable zoom compensation
extern cvar_t *item_kit_mode; // Enable or disable item kit mode
extern cvar_t *gun_dualmk23_enhance; // Enable or disable enhanced dual mk23s (laser + silencer)
Expand Down Expand Up @@ -1701,12 +1701,14 @@ void StatBotCheck(void);
void G_RegisterScore(void);
int G_CalcRanks(gclient_t **ranks);
void G_LoadScores(void);
#if USE_AQTION
void LogKill(edict_t *self, edict_t *inflictor, edict_t *attacker);
void LogWorldKill(edict_t *self);
void LogCapture(edict_t *capturer);
void LogMatch(void);
void LogAward(edict_t *ent, int award);
void LogEndMatchStats(void);
#endif

//============================================================================

Expand Down
13 changes: 3 additions & 10 deletions src/client/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,23 +353,19 @@ static void CL_ParseFrame(int extrabits)
#endif
// parse clientNum
if (extraflags & EPS_CLIENTNUM) {
#if AQTION_EXTENSION
if (cls.protocolVersion < PROTOCOL_VERSION_AQTION_CLIENTNUM_SHORT) {
frame.clientNum = MSG_ReadByte();
} else {
frame.clientNum = MSG_ReadShort();
}
#else
frame.clientNum = MSG_ReadByte(); // Default behavior if AQTION_EXTENSION is not defined
#endif
if (!VALIDATE_CLIENTNUM(&cl.csr, frame.clientNum)) {
Com_Error(ERR_DROP, "%s: bad clientNum", __func__);
}
} else if (oldframe) {
frame.clientNum = oldframe->clientNum;
} else if (cls.serverProtocol > PROTOCOL_VERSION_DEFAULT) {
MSG_ParseDeltaPlayerstate_Enhanced(from, &frame.ps, bits, extraflags, cl.psFlags);
}
} else if (cls.serverProtocol > PROTOCOL_VERSION_DEFAULT) {
MSG_ParseDeltaPlayerstate_Enhanced(from, &frame.ps, bits, extraflags, cl.psFlags);
#if USE_DEBUG
if (cl_shownet->integer > 2 && (bits || extraflags)) {
Com_LPrintf(PRINT_DEVELOPER, " ");
Expand Down Expand Up @@ -673,7 +669,6 @@ static void CL_ParseServerData(void)
cl.serverstate = i;
cinematic = i == ss_pic || i == ss_cinematic;
}
#if AQTION_EXTENSION
if (cls.protocolVersion >= PROTOCOL_VERSION_AQTION_EXTENDED_LIMITS) {
i = MSG_ReadWord();
if (i & Q2PRO_PF_STRAFEJUMP_HACK) {
Expand All @@ -693,7 +688,6 @@ static void CL_ParseServerData(void)
cl.csr = cs_remap_new;
}
} else {
#endif
if (MSG_ReadByte()) {
Com_DPrintf("Q2PRO strafejump hack enabled\n");
cl.pmp.strafehack = true;
Expand All @@ -706,9 +700,8 @@ static void CL_ParseServerData(void)
Com_DPrintf("Q2PRO waterjump hack enabled\n");
cl.pmp.waterhack = true;
}
#if AQTION_EXTENSION
}
#endif

cl.esFlags |= MSG_ES_UMASK | MSG_ES_LONGSOLID;
if (cls.protocolVersion >= PROTOCOL_VERSION_Q2PRO_BEAM_ORIGIN) {
cl.esFlags |= MSG_ES_BEAMORIGIN;
Expand Down
4 changes: 1 addition & 3 deletions src/server/entities.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,7 @@ bool SV_WriteFrameToClient_Aqtion(client_t *client, unsigned maxsize)
MSG_WriteByte(svc_playerinfo);
extraflags = MSG_WriteDeltaPlayerstate_Aqtion(oldstate, &frame->ps, psFlags);

#if AQTION_EXTENSION
if (client->protocol == PROTOCOL_VERSION_AQTION) {
if (client->protocol == PROTOCOL_VERSION_AQTION) {
// delta encode the clientNum
if ((oldframe ? oldframe->clientNum : 0) != frame->clientNum) {
extraflags |= EPS_CLIENTNUM;
Expand All @@ -572,7 +571,6 @@ bool SV_WriteFrameToClient_Aqtion(client_t *client, unsigned maxsize)
}
}
}
#endif

// save 3 high bits of extraflags
*b1 = svc_frame | (((extraflags & 0x70) << 1));
Expand Down
26 changes: 4 additions & 22 deletions src/server/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,32 +430,19 @@ void SV_New_f(void)
}
break;
case PROTOCOL_VERSION_AQTION:
MSG_WriteShort(sv_client->version);

#if AQTION_EXTENSION
MSG_WriteShort(sv_client->version);
if (sv.state == ss_cinematic && sv_client->version < PROTOCOL_VERSION_AQTION_CINEMATICS)
MSG_WriteByte(ss_pic);
else
MSG_WriteByte(sv.state);
#else
MSG_WriteByte(sv.state); // Default behavior if AQTION_EXTENSION is not defined
#endif

#if AQTION_EXTENSION
if (sv_client->version >= PROTOCOL_VERSION_AQTION_EXTENDED_LIMITS) {
MSG_WriteShort(q2pro_protocol_flags());
} else {
MSG_WriteByte(sv_client->pmp.strafehack);
MSG_WriteByte(sv_client->pmp.qwmode);
MSG_WriteByte(sv_client->pmp.waterhack);
}
#else
MSG_WriteByte(sv_client->pmp.strafehack); // Default behavior if AQTION_EXTENSION is not defined
MSG_WriteByte(sv_client->pmp.qwmode);
MSG_WriteByte(sv_client->pmp.waterhack);
#endif

break;
break;
}

SV_ClientAddMessage(sv_client, MSG_RELIABLE | MSG_CLEAR);
Expand Down Expand Up @@ -506,11 +493,8 @@ void SV_New_f(void)
if (sv_client->netchan.type == NETCHAN_OLD) {
write_configstrings();
write_baselines();
} else if ((sv_client->protocol == PROTOCOL_VERSION_Q2PRO && sv_client->version >= PROTOCOL_VERSION_Q2PRO_EXTENDED_LIMITS)
#if AQTION_EXTENSION
|| (sv_client->protocol == PROTOCOL_VERSION_AQTION && sv_client->version >= PROTOCOL_VERSION_AQTION_EXTENDED_LIMITS)
#endif
) {
} else if ((sv_client->protocol == PROTOCOL_VERSION_Q2PRO && sv_client->version >= PROTOCOL_VERSION_Q2PRO_EXTENDED_LIMITS) ||
(sv_client->protocol == PROTOCOL_VERSION_AQTION && sv_client->version >= PROTOCOL_VERSION_AQTION_EXTENDED_LIMITS)) {
write_configstring_stream();
write_baseline_stream();
} else {
Expand Down Expand Up @@ -956,7 +940,6 @@ static void SV_PacketdupHack_f(void)
#endif

#if USE_AQTION
#if AQTION_EXTENSION
static void SV_CvarSync_f(void)
{
if (!sv_client->edict->client)
Expand Down Expand Up @@ -1009,7 +992,6 @@ static void SV_CvarSync_f(void)
}
}
#endif
#endif

static bool match_cvar_val(const char *s, const char *v)
{
Expand Down

0 comments on commit ae8f7c8

Please sign in to comment.