mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
Port old netsplit implementation
This commit is contained in:
@@ -84,6 +84,47 @@ GNU General Public License for more details.
|
||||
#define NUM_PACKET_ENTITIES 256 // 170 Mb for multiplayer with 32 players
|
||||
#define MAX_CUSTOM_BASELINES 64
|
||||
|
||||
#define NET_EXT_SPLIT (1U<<1)
|
||||
#define NETSPLIT_BACKUP 8
|
||||
#define NETSPLIT_BACKUP_MASK (NETSPLIT_BACKUP - 1)
|
||||
#define NETSPLIT_HEADER_SIZE 18
|
||||
|
||||
typedef struct netsplit_chain_packet_s
|
||||
{
|
||||
// bool vector
|
||||
unsigned int recieved_v[8];
|
||||
// serial number
|
||||
unsigned int id;
|
||||
byte data[NET_MAX_PAYLOAD];
|
||||
byte received;
|
||||
byte count;
|
||||
} netsplit_chain_packet_t;
|
||||
|
||||
// raw packet format
|
||||
typedef struct netsplit_packet_s
|
||||
{
|
||||
unsigned int signature; // 0xFFFFFFFE
|
||||
unsigned int length;
|
||||
unsigned int part;
|
||||
unsigned int id;
|
||||
// max 256 parts
|
||||
byte count;
|
||||
byte index;
|
||||
byte data[NET_MAX_PAYLOAD - NETSPLIT_HEADER_SIZE];
|
||||
} netsplit_packet_t;
|
||||
|
||||
|
||||
typedef struct netsplit_s
|
||||
{
|
||||
netsplit_chain_packet_t packets[NETSPLIT_BACKUP];
|
||||
integer64 total_received;
|
||||
integer64 total_received_uncompressed;
|
||||
} netsplit_t;
|
||||
|
||||
// packet splitting
|
||||
qboolean NetSplit_GetLong( netsplit_t *ns, netadr_t *from, byte *data, size_t *length );
|
||||
|
||||
|
||||
/*
|
||||
==============================================================
|
||||
|
||||
@@ -203,6 +244,10 @@ typedef struct netchan_s
|
||||
// added for net_speeds
|
||||
size_t total_sended;
|
||||
size_t total_received;
|
||||
qboolean split;
|
||||
unsigned int maxpacket;
|
||||
unsigned int splitid;
|
||||
netsplit_t netsplit;
|
||||
} netchan_t;
|
||||
|
||||
extern netadr_t net_from;
|
||||
|
||||
Reference in New Issue
Block a user