Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ name: compile check
on: [push, pull_request]

jobs:
ezquake:
unezquake:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout qwprot
uses: actions/checkout@v4
- name: Checkout ezquake
- name: Checkout unezquake
uses: actions/checkout@v4
with:
repository: QW-Group/ezquake-source
path: ezquake
repository: dusty-qw/unezquake
path: unezquake
submodules: recursive
- name: Update qwprot in ezquake
- name: Update qwprot in unezquake
run: |
cp src/* ezquake/src/qwprot/src
shasum ezquake/src/qwprot/src/protocol.h > checksum
cp src/* unezquake/src/qwprot/src
shasum unezquake/src/qwprot/src/protocol.h > checksum
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq --no-install-recommends cmake ninja-build libsdl2-dev libjansson-dev libexpat1-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libspeex-dev libspeexdsp-dev libfreetype6-dev libsndfile1-dev libpcre2-dev libminizip-dev
- name: Run CMake
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: '${{ github.workspace }}/ezquake/CMakeLists.txt'
cmakeListsTxtPath: '${{ github.workspace }}/unezquake/CMakeLists.txt'
configurePreset: dynamic
buildPreset: dynamic-debug
- name: Verify that build didn't change protocol.h
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Checkout mvdsv
uses: actions/checkout@v4
with:
repository: QW-Group/mvdsv
repository: dusty-qw/mvdsv
path: mvdsv
submodules: recursive
- name: Update qwprot in mvdsv
Expand Down
76 changes: 57 additions & 19 deletions src/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#ifdef PROTOCOL_VERSION_FTE
# define FTE_PEXT_TRANS 0x00000008 // .alpha support
//#define FTE_PEXT_ACCURATETIMINGS 0x00000040 // qqshka: not actually used in ezquake.
# define FTE_PEXT_ACCURATETIMINGS 0x00000040 // qqshka: not actually used in ezquake.
// // I added it to ezquake in hope that someone made some
// // rockets(enitities) smoothing code...
# define FTE_PEXT_HLBSP 0x00000200 // stops fte servers from complaining
Expand All @@ -46,6 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# define FTE_PEXT_CHUNKEDDOWNLOADS 0x20000000 // alternate file download method. Hopefully it'll give
// quadroupled download speed, especially on higher pings.
# define FTE_PEXT_CSQC 0x40000000 //csqc additions
# define FTE_PEXT_DPFLAGS 0x80000000 //extra flags for viewmodel/externalmodel and possible other persistant style flags.
#endif // PROTOCOL_VERSION_FTE

#ifdef PROTOCOL_VERSION_FTE2
Expand All @@ -69,7 +70,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# define MVD_PEXT1_HIDDEN_MESSAGES (1 << 5) // dem_multiple(0) packets are in format (<length> <type-id>+ <packet-data>)*
//# define MVD_PEXT1_SERVERSIDEWEAPON2 (1 << 6) // Server-side weapon selection supports clc_mvd_weapon_full_impulse.
// Can be defined in a project Makefile
# define MVD_PEXT1_EZCSQC (1 << 7) // Marker extension for the hardcoded ezQuake side KTX CSQC code
# define MVD_PEXT1_WEAPONPREDICTION (1 << 7) // Weapon prediction
# define MVD_PEXT1_SIMPLEPROJECTILE (1 << 8) // Simple projectiles

# if defined(MVD_PEXT1_DEBUG_ANTILAG) || defined(MVD_PEXT1_DEBUG_WEAPON)
# define MVD_PEXT1_DEBUG
Expand Down Expand Up @@ -244,6 +246,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# define svc_fte_voicechat 84
#endif // FTE_PEXT2_VOICECHAT

#ifdef MVD_PEXT1_SIMPLEPROJECTILE
# define svc_packetsprojectiles 100 // [...]
# define svc_deltapacketsprojectiles 101 // [...]
#endif // MVD_PEXT1_SIMPLEPROJECTILE

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

// client to server
Expand All @@ -256,6 +263,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define clc_tmove 6 // teleport request, spectator only
#define clc_upload 7 // teleport request, spectator only

#ifdef MVD_PEXT1_SIMPLEPROJECTILE
# define clc_ackframe 50
#endif // MVD_PEXT1_SIMPLEPROJECTILE

#ifdef FTE_PEXT2_VOICECHAT
#define clc_voicechat 83 // FTE voice chat.
#endif // FTE_PEXT2_VOICECHAT
Expand Down Expand Up @@ -345,7 +356,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//==============================================

// the first 16 bits of a packetentities update holds 9 bits of entity number and 7 bits of flags
// of entity number and 7 bits of flags
#define U_ORIGIN1 (1 << 9)
#define U_ORIGIN2 (1 << 10)
#define U_ORIGIN3 (1 << 11)
Expand Down Expand Up @@ -400,10 +410,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# ifdef FTE_PEXT_COLOURMOD
# define U_FTE_COLOURMOD (1<<10) //rgb
# endif // FTE_PEXT_COLOURMOD
# define U_FTE_DPFLAGS (1<<11)
# define U_FTE_TAGINFO (1<<12)
# define U_FTE_LIGHT (1<<13)
# define U_FTE_EFFECTS16 (1<<14)
# ifdef FTE_PEXT_DPFLAGS
# define U_FTE_DPFLAGS (1<<11)
# endif // FTE_PEXT_DPFLAGS
# ifdef FTE_PEXT_SETATTACHMENT
# define U_FTE_TAGINFO (1<<12)
# endif // FTE_PEXT_SETATTACHMENT
# ifdef FTE_PEXT_DPFLAGS
# define U_FTE_LIGHT (1<<13)
# define U_FTE_EFFECTS16 (1<<14)
# endif // FTE_PEXT_DPFLAGS
# define U_FTE_FARMORE (1<<15)
#endif // PROTOCOL_VERSION_FTE

Expand Down Expand Up @@ -485,13 +501,34 @@ typedef struct entity_state_s {
#endif
} entity_state_t;

#ifdef MVD_PEXT1_SIMPLEPROJECTILE
#define MAX_SIMPLEPROJECTILES 64
typedef struct sprojectile_state_s {
int number; // edict index
int flags; // nolerp, etc
int sflag;
int owner;
int fproj_num;
float time_offset;
float time;
vec3_t origin;
vec3_t angles;
int modelindex;
vec3_t velocity;
} sprojectile_state_t;
#endif // MVD_PEXT1_SIMPLEPROJECTILE

#define MAX_PACKET_ENTITIES 64 // doesn't include nails
#define MAX_PEXT256_PACKET_ENTITIES 256 // up to 256 ents, look FTE_PEXT_256PACKETENTITIES
#define MAX_MVD_PACKET_ENTITIES 300 // !!! MUST not be less than any of above values!!!

typedef struct packet_entities_s {
int num_entities;
entity_state_t entities[MAX_MVD_PACKET_ENTITIES];
#ifdef MVD_PEXT1_SIMPLEPROJECTILE
int num_sprojectiles;
sprojectile_state_t sprojectiles[MAX_SIMPLEPROJECTILES];
#endif // MVD_PEXT1_SIMPLEPROJECTILE
} packet_entities_t;

typedef struct usercmd_s {
Expand All @@ -502,6 +539,7 @@ typedef struct usercmd_s {
short upmove;
byte buttons;
byte impulse;
byte impulse_pred; // for antilag 1
} usercmd_t;

//==============================================
Expand Down Expand Up @@ -551,18 +589,18 @@ typedef struct temp_entity_list_s {
// embedded in dem_multiple(0) - should be safely skipped in clients
// format is <int:length> <short:type>* where <type> is duplicated if 0xFFFF. <length> is length of the data packet, not the header
enum {
mvdhidden_antilag_position = 0x0000, // mvdhidden_antilag_position_header_t mvdhidden_antilag_position_t*
mvdhidden_usercmd = 0x0001, // <byte: playernum> <byte:dropnum> <byte: msec, vec3_t: angles, short[3]: forward side up> <byte: buttons> <byte: impulse>
mvdhidden_usercmd_weapons = 0x0002, // <byte: source playernum> <int: items> <byte[4]: ammo> <byte: result> <byte*: weapon priority (nul terminated)>
mvdhidden_demoinfo = 0x0003, // <short: block#> <byte[] content>
mvdhidden_commentary_track = 0x0004, // <byte: track#> [todo... <byte: audioformat> <string: short-name> <string: author(s)> <float: start-offset>?]
mvdhidden_commentary_data = 0x0005, // <byte: track#> [todo... format-specific]
mvdhidden_commentary_text_segment = 0x0006, // <byte: track#> [todo... <float: duration> <string: text (utf8)>]
mvdhidden_dmgdone = 0x0007, // <byte: type-flags> <short: damaged ent#> <short: damaged ent#> <short: damage>
mvdhidden_usercmd_weapons_ss = 0x0008, // (same format as mvdhidden_usercmd_weapons)
mvdhidden_usercmd_weapon_instruction = 0x0009, // <byte: playernum> <byte: flags> <int: sequence#> <int: mode> <byte[10]: weaponlist>
mvdhidden_paused_duration = 0x000A, // <byte: msec> ... actual time elapsed, not gametime (can be used to keep stream running) ... expected to be QTV only
mvdhidden_extended = 0xFFFF // doubt we'll ever get here: read next short...
mvdhidden_antilag_position = 0x0000, // mvdhidden_antilag_position_header_t mvdhidden_antilag_position_t*
mvdhidden_usercmd = 0x0001, // <byte: playernum> <byte:dropnum> <byte: msec, vec3_t: angles, short[3]: forward side up> <byte: buttons> <byte: impulse>
mvdhidden_usercmd_weapons = 0x0002, // <byte: source playernum> <int: items> <byte[4]: ammo> <byte: result> <byte*: weapon priority (nul terminated)>
mvdhidden_demoinfo = 0x0003, // <short: block#> <byte[] content>
mvdhidden_commentary_track = 0x0004, // <byte: track#> [todo... <byte: audioformat> <string: short-name> <string: author(s)> <float: start-offset>?]
mvdhidden_commentary_data = 0x0005, // <byte: track#> [todo... format-specific]
mvdhidden_commentary_text_segment = 0x0006, // <byte: track#> [todo... <float: duration> <string: text (utf8)>]
mvdhidden_dmgdone = 0x0007, // <byte: type-flags> <short: damaged ent#> <short: damaged ent#> <short: damage>
mvdhidden_usercmd_weapons_ss = 0x0008, // (same format as mvdhidden_usercmd_weapons)
mvdhidden_usercmd_weapon_instruction = 0x0009, // <byte: playernum> <byte: flags> <int: sequence#> <int: mode> <byte[10]: weaponlist>
mvdhidden_paused_duration = 0x000A, // <byte: msec> ... actual time elapsed, not gametime (can be used to keep stream running) ... expected to be QTV only
mvdhidden_extended = 0xFFFF // doubt we'll ever get here: read next short...
};

#define sizeof_mvdhidden_block_header_t_usercmd (1 + 1 + 1 + 3 * 4 + 3 * 2 + 1 + 1)
Expand Down