Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ec-/Quake3e
Browse files Browse the repository at this point in the history
  • Loading branch information
Chomenor committed Sep 8, 2024
2 parents 9f44f62 + d3dd892 commit ffd08b8
Show file tree
Hide file tree
Showing 30 changed files with 712 additions and 397 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
rule: install

- btype: Debug
rule: debug install
rule: debug

defaults:
run:
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:

- btype: Debug
if: ${{ github.event_name != 'release' }}
rule: debug install
rule: debug

- arch: x86
use_sdl: USE_SDL=0
Expand Down Expand Up @@ -175,25 +175,25 @@ jobs:
retention-days: 5

macos-x86:
name: ${{ matrix.btype }} macOS x86_64
name: ${{ matrix.btype }} macOS ${{ matrix.arch }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64]
arch: [x86_64, aarch64]
cc: [clang]
btype: [Release, Debug]
include:
- btype: Release
rule: install

- btype: Debug
rule: debug install
rule: debug

steps:

- name: Install tools
run: brew install coreutils pkg-config sdl2
run: brew install coreutils sdl2 # pkg-config

- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
7z a -r cmod-macos-x86_64.zip ./macos-x86_64/*
- name: Create latest build
uses: marvinpinto/action-automatic-releases@latest
uses: czietz/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "latest"
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,12 @@ ifeq ($(USE_SYSTEM_VORBIS),1)
endif

# extract version info
ifneq ($(COMPILE_PLATFORM),darwin)
VERSION=$(shell grep ".\+define[ \t]\+Q3_VERSION[ \t]\+\+" $(CMDIR)/q_shared.h | \
sed -e 's/.*".* \([^ ]*\)"/\1/')
else
VERSION=1.32e
endif

# common qvm definition
ifeq ($(ARCH),x86_64)
Expand Down
10 changes: 4 additions & 6 deletions code/client/cl_curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,7 @@ void CL_cURL_BeginDownload( const char *localName, const char *remoteURL )
!clc.cURLDisconnected) {

CL_AddReliableCommand("disconnect", qtrue);
CL_WritePacket();
CL_WritePacket();
CL_WritePacket();
CL_WritePacket( 2 );
clc.cURLDisconnected = qtrue;
}
}
Expand Down Expand Up @@ -767,8 +765,8 @@ static int Com_DL_CallbackProgress( void *data, double dltotal, double dlnow, do
Com_Printf( "%s: aborted\n", dl->Name );
return -1;
}
Cvar_Set( "cl_downloadSize", va( "%i", dl->Size ) );
Cvar_Set( "cl_downloadCount", va( "%i", dl->Count ) );
Cvar_SetIntegerValue( "cl_downloadSize", dl->Size );
Cvar_SetIntegerValue( "cl_downloadCount", dl->Count );
}

if ( dl->Size ) {
Expand Down Expand Up @@ -1062,7 +1060,7 @@ qboolean Com_DL_Begin( download_t *dl, const char *localName, const char *remote
Cvar_Set( "cl_downloadName", dl->Name );
Cvar_Set( "cl_downloadSize", "0" );
Cvar_Set( "cl_downloadCount", "0" );
Cvar_Set( "cl_downloadTime", va( "%i", cls.realtime ) );
Cvar_SetIntegerValue( "cl_downloadTime", cls.realtime );
}

return qtrue;
Expand Down
30 changes: 23 additions & 7 deletions code/client/cl_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ During normal gameplay, a client packet will contain something like:
===================
*/
void CL_WritePacket( void ) {
void CL_WritePacket( int repeat ) {
msg_t buf;
byte data[ MAX_MSGLEN_BUF ];
int i, j, n;
Expand Down Expand Up @@ -826,11 +826,10 @@ void CL_WritePacket( void ) {
}

// begin a client move command
if ( cl_nodelta->integer || !cl.snap.valid || clc.demowaiting
|| clc.serverMessageSequence != cl.snap.messageNum ) {
MSG_WriteByte (&buf, clc_moveNoDelta);
if ( cl_nodelta->integer || !cl.snap.valid || clc.demowaiting || clc.serverMessageSequence != cl.snap.messageNum ) {
MSG_WriteByte( &buf, clc_moveNoDelta );
} else {
MSG_WriteByte (&buf, clc_move);
MSG_WriteByte( &buf, clc_move );
}

// write the command count
Expand Down Expand Up @@ -871,7 +870,24 @@ void CL_WritePacket( void ) {
Com_Printf( "%i ", buf.cursize );
}

CL_Netchan_Transmit( &clc.netchan, &buf );
#ifdef ELITEFORCE
if( !clc.compat )
#endif
MSG_WriteByte( &buf, clc_EOF );

if ( buf.overflowed ) {
if ( cls.state >= CA_CONNECTED && cls.state != CA_CINEMATIC ) {
cls.state = CA_CONNECTING; // to avoid recursive error
}
Com_Error( ERR_DROP, "%s: message overflowed", __func__ );
}

if ( repeat == 0 || clc.netchan.remoteAddress.type == NA_LOOPBACK ) {
CL_Netchan_Transmit( &clc.netchan, &buf );
} else {
CL_Netchan_Enqueue( &clc.netchan, &buf, repeat + 1 );
NET_FlushPacketQueue( 0 );
}
}


Expand Down Expand Up @@ -904,7 +920,7 @@ void CL_SendCmd( void ) {
return;
}

CL_WritePacket();
CL_WritePacket( 0 );
}


Expand Down
14 changes: 5 additions & 9 deletions code/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ void CL_MapLoading( void ) {
Com_Memset( cls.updateInfoString, 0, sizeof( cls.updateInfoString ) );
Com_Memset( clc.serverMessage, 0, sizeof( clc.serverMessage ) );
Com_Memset( &cl.gameState, 0, sizeof( cl.gameState ) );
clc.lastPacketSentTime = -9999;
clc.lastPacketSentTime = cls.realtime - 9999; // send packet immediately
cls.framecount++;
SCR_UpdateScreen();
} else {
Expand Down Expand Up @@ -1400,9 +1400,7 @@ qboolean CL_Disconnect( qboolean showMainMenu ) {
// send it a few times in case one is dropped
if ( cls.state >= CA_CONNECTED && cls.state != CA_CINEMATIC && !clc.demoplaying ) {
CL_AddReliableCommand( "disconnect", qtrue );
CL_WritePacket();
CL_WritePacket();
CL_WritePacket();
CL_WritePacket( 2 );
}

CL_ClearState();
Expand Down Expand Up @@ -2228,9 +2226,7 @@ static void CL_DownloadsComplete( void ) {
// set pure checksums
CL_SendPureChecksums();

CL_WritePacket();
CL_WritePacket();
CL_WritePacket();
CL_WritePacket( 2 );
}


Expand Down Expand Up @@ -2386,7 +2382,7 @@ void CL_NextDownload( void )
Com_Error(ERR_DROP, "Incorrect checksum for file: %s", clc.downloadName);
}

*clc.downloadTempName = *clc.downloadName = 0;
*clc.downloadTempName = *clc.downloadName = '\0';
Cvar_Set("cl_downloadName", "");

// We are looking to start a download here
Expand Down Expand Up @@ -3088,7 +3084,7 @@ static qboolean CL_ConnectionlessPacket( const netadr_t *from, msg_t *msg ) {
clc.netchan.compat = clc.compat;
#endif
cls.state = CA_CONNECTED;
clc.lastPacketSentTime = -9999; // send first packet immediately
clc.lastPacketSentTime = cls.realtime - 9999; // send first packet immediately
return qtrue;
}

Expand Down
38 changes: 27 additions & 11 deletions code/client/cl_net_chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,6 @@ CL_Netchan_Transmit
================
*/
void CL_Netchan_Transmit( netchan_t *chan, msg_t* msg ) {
#ifdef ELITEFORCE
if( !chan->compat )
#endif
MSG_WriteByte( msg, clc_EOF );

if ( msg->overflowed ) {
if ( cls.state >= CA_CONNECTED && cls.state != CA_CINEMATIC ) {
cls.state = CA_CONNECTING; // to avoid recursive error
}
Com_Error( ERR_DROP, "%s: message overflowed", __func__ );
}

#ifndef ELITEFORCE
if ( chan->compat )
Expand All @@ -182,6 +171,33 @@ void CL_Netchan_Transmit( netchan_t *chan, msg_t* msg ) {
}


/*
===============
CL_Netchan_Enqueue
================
*/
void CL_Netchan_Enqueue( netchan_t *chan, msg_t* msg, int times ) {
int i;

// make sure we send all pending fragments to get correct chan->outgoingSequence
while ( CL_Netchan_TransmitNextFragment( chan ) ) {
;
}

#ifndef ELITEFORCE
if ( chan->compat ) {
CL_Netchan_Encode( msg );
}
#endif

for ( i = 0; i < times; i++ ) {
Netchan_Enqueue( chan, msg->cursize, msg->data );
}

chan->outgoingSequence++;
}


/*
=================
CL_Netchan_Process
Expand Down
5 changes: 2 additions & 3 deletions code/client/cl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ static void CL_ParseDownload( msg_t *msg ) {
// So UI gets access to it
Cvar_SetIntegerValue( "cl_downloadCount", clc.downloadCount );

if (!size) { // A zero length block means EOF
if ( size == 0 ) { // A zero length block means EOF
if ( clc.download != FS_INVALID_HANDLE ) {
FS_FCloseFile( clc.download );
clc.download = FS_INVALID_HANDLE;
Expand All @@ -849,8 +849,7 @@ static void CL_ParseDownload( msg_t *msg ) {
// loading right away. If we take a while to load, the server is happily trying
// to send us that last block over and over.
// Write it twice to help make sure we acknowledge the download
CL_WritePacket();
CL_WritePacket();
CL_WritePacket( 1 );

// get another file if needed
CL_NextDownload();
Expand Down
3 changes: 2 additions & 1 deletion code/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ qboolean CL_GetModeInfo( int *width, int *height, float *windowAspect, int mode,
void CL_InitInput( void );
void CL_ClearInput( void );
void CL_SendCmd( void );
void CL_WritePacket( void );
void CL_WritePacket( int repeat );

//
// cl_keys.c
Expand Down Expand Up @@ -588,6 +588,7 @@ void Key_SetCatcher( int catcher );
// cl_net_chan.c
//
void CL_Netchan_Transmit( netchan_t *chan, msg_t *msg );
void CL_Netchan_Enqueue( netchan_t *chan, msg_t *msg, int times );
qboolean CL_Netchan_Process( netchan_t *chan, msg_t *msg );

//
Expand Down
4 changes: 2 additions & 2 deletions code/eliteforce/server/stef_sv_record_spectator.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ static void Record_Spectator_ProcessMessage( spectator_t *spectator, msg_t *msg
cl->reliableAcknowledge = cl->reliableSequence;
}

if ( serverId < sv.restartedServerId || serverId > sv.serverId ) {
// Pre map change serverID, or invalid high serverID
if ( serverId != sv.serverId ) {
// Invalid serverID
if ( cl->messageAcknowledge > cl->gamestateMessageNum ) {
// No previous gamestate waiting to be acknowledged - send new one
Record_SendSpectatorGamestate( spectator );
Expand Down
13 changes: 0 additions & 13 deletions code/eliteforce/stef_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,10 @@
// coordinated with game module fixes in order to work consistently.
#define STEF_SHIELD_EFFECT_FIX

// [BUGFIX] Disable force-spawning loading players into game during map restart.
// Fixes freezing after UDP download due to CS_ACTIVE check in SV_DoneDownload_f.
#define STEF_MAP_RESTART_NO_LOADING_SPAWN

// [BUGFIX] Set players to CS_CONNECTED during UDP downloads, preventing server commands
// being added in SV_AddServerCommand which can accumulate without being sent properly.
#define STEF_DOWNLOAD_CONNECTION_STATE_FIX

// [BUGFIX] Fix for "Delta parseEntitiesNum too old" errors in certain cases.
// (40+ sv_fps value + 1.20 client + high ping/bad connection)
#define STEF_SNAPSHOT_DELTA_BUFFER_FIX

// [BUGFIX] Use alternative to changing serverid during map restarts.
// This avoids the need for a systeminfo update during map restarts and potentially fixes
// some intermittent buggy behavior seen in the EF 1.20 client.
#define STEF_MAP_RESTART_STATIC_SERVERID

// [BUGFIX] Prevent gamestate overflows by dropping entity baselines.
// Fixes errors on certain maps under certain conditions.
#define STEF_GAMESTATE_OVERFLOW_FIX
Expand Down
7 changes: 4 additions & 3 deletions code/qcommon/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ void Cbuf_Execute( void )

if ( cmd_wait > 0 ) {
// delay command buffer execution
cmd_wait--;
return;
}

Expand Down Expand Up @@ -357,9 +356,11 @@ void Cbuf_Execute( void )
Cbuf_Wait
============
*/
qboolean Cbuf_Wait( void )
void Cbuf_Wait( void )
{
return (cmd_wait > 0) ? qtrue : qfalse;
if ( cmd_wait > 0 ) {
--cmd_wait;
}
}


Expand Down
Loading

0 comments on commit ffd08b8

Please sign in to comment.