mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Unify/cleanup max snapshot entities on client and server
This commit is contained in:
parent
d815052df0
commit
ac621642ac
5 changed files with 8 additions and 7 deletions
|
@ -87,7 +87,7 @@ typedef struct {
|
|||
// the parseEntities array must be large enough to hold PACKET_BACKUP frames of
|
||||
// entities, so that when a delta compressed message arives from the server
|
||||
// it can be un-deltad from the original
|
||||
#define MAX_PARSE_ENTITIES 2048
|
||||
#define MAX_PARSE_ENTITIES ( PACKET_BACKUP * MAX_SNAPSHOT_ENTITIES )
|
||||
|
||||
extern int g_console_field_width;
|
||||
|
||||
|
|
|
@ -133,6 +133,8 @@ NET
|
|||
|
||||
#define MAX_PACKET_USERCMDS 32 // max number of usercmd_t in a packet
|
||||
|
||||
#define MAX_SNAPSHOT_ENTITIES 256
|
||||
|
||||
#define PORT_ANY -1
|
||||
|
||||
#define MAX_RELIABLE_COMMANDS 64 // max string commands buffered for restransmit
|
||||
|
|
|
@ -236,7 +236,7 @@ typedef struct {
|
|||
int snapFlagServerBit; // ^= SNAPFLAG_SERVERCOUNT every SV_SpawnServer()
|
||||
|
||||
client_t *clients; // [sv_maxclients->integer];
|
||||
int numSnapshotEntities; // sv_maxclients->integer*PACKET_BACKUP*MAX_PACKET_ENTITIES
|
||||
int numSnapshotEntities; // sv_maxclients->integer*PACKET_BACKUP*MAX_SNAPSHOT_ENTITIES
|
||||
int nextSnapshotEntities; // next snapshotEntities to use
|
||||
entityState_t *snapshotEntities; // [numSnapshotEntities]
|
||||
int nextHeartbeatTime;
|
||||
|
|
|
@ -271,10 +271,10 @@ static void SV_Startup( void ) {
|
|||
|
||||
svs.clients = Z_Malloc (sizeof(client_t) * sv_maxclients->integer );
|
||||
if ( com_dedicated->integer ) {
|
||||
svs.numSnapshotEntities = sv_maxclients->integer * PACKET_BACKUP * 64;
|
||||
svs.numSnapshotEntities = sv_maxclients->integer * PACKET_BACKUP * MAX_SNAPSHOT_ENTITIES;
|
||||
} else {
|
||||
// we don't need nearly as many when playing locally
|
||||
svs.numSnapshotEntities = sv_maxclients->integer * 4 * 64;
|
||||
svs.numSnapshotEntities = sv_maxclients->integer * 4 * MAX_SNAPSHOT_ENTITIES;
|
||||
}
|
||||
svs.initialized = qtrue;
|
||||
|
||||
|
@ -349,10 +349,10 @@ void SV_ChangeMaxClients( void ) {
|
|||
|
||||
// allocate new snapshot entities
|
||||
if ( com_dedicated->integer ) {
|
||||
svs.numSnapshotEntities = sv_maxclients->integer * PACKET_BACKUP * 64;
|
||||
svs.numSnapshotEntities = sv_maxclients->integer * PACKET_BACKUP * MAX_SNAPSHOT_ENTITIES;
|
||||
} else {
|
||||
// we don't need nearly as many when playing locally
|
||||
svs.numSnapshotEntities = sv_maxclients->integer * 4 * 64;
|
||||
svs.numSnapshotEntities = sv_maxclients->integer * 4 * MAX_SNAPSHOT_ENTITIES;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -235,7 +235,6 @@ Build a client snapshot structure
|
|||
=============================================================================
|
||||
*/
|
||||
|
||||
#define MAX_SNAPSHOT_ENTITIES 1024
|
||||
typedef struct {
|
||||
int numSnapshotEntities;
|
||||
int snapshotEntities[MAX_SNAPSHOT_ENTITIES];
|
||||
|
|
Loading…
Reference in a new issue