typedef struct
{
- int maxclients;
- // [maxclients]
- struct client_s *clients;
+ // NULL pointers are non-existent clients
+ struct client_s *connectedclients[MAX_SCOREBOARD];
// episode completion information
int serverflags;
// cleared when at SV_SpawnServer
typedef struct client_s
{
- // false = client is free
- qboolean active;
// false = don't send datagrams
qboolean spawned;
// has been told to go to another level
qboolean dropasap;
// only valid before spawned
qboolean sendsignon;
+ // remove this client immediately
+ qboolean deadsocket;
+ // index of this client in the svs.connectedclients pointer array
+ int number;
// reliable messages must be sent periodically
double last_message;
// communications handle
- struct qsocket_s *netconnection;
+ netconn_t *netconnection;
// movement
usercmd_t cmd;
qbyte msgbuf[MAX_DATAGRAM];
// EDICT_NUM(clientnum+1)
edict_t *edict;
- // for printing to other people
- char name[32];
- int colors;
float ping_times[NUM_PING_TIMES];
// ping_times[num_pings%NUM_PING_TIMES]
int num_pings;
// LordHavoc: can be used for prediction or whatever...
float ping;
- // LordHavoc: specifically used for prediction, accounts for sys_ticrate too
- float latency;
// spawn parms are carried from level to level
float spawn_parms[NUM_SPAWN_PARMS];
-// client known data for deltas
- int old_frags;
+ // properties that are sent across the network only when changed
+ char name[64], old_name[64];
+ int colors, old_colors;
+ int frags, old_frags;
+ // other properties not sent across the network
int pmodel;
+ // visibility state
+ float visibletime[MAX_EDICTS];
#ifdef QUAKEENTITIES
// delta compression state
float nextfullupdate[MAX_EDICTS];
-#endif
- // visibility state
- float visibletime[MAX_EDICTS];
-
-#ifndef QUAKEENTITIES
+#elif 0
entity_database_t entitydatabase;
int entityframenumber; // incremented each time an entity frame is sent
+#else
+ entity_database4_t *entitydatabase4;
+ int entityframenumber; // incremented each time an entity frame is sent
#endif
} client_t;
extern cvar_t sv_accelerate;
extern cvar_t sv_idealpitchscale;
extern cvar_t sv_aim;
-extern cvar_t sv_predict;
extern cvar_t sv_stepheight;
extern cvar_t sv_jumpstep;
+extern cvar_t sv_maxplayers;
+
+extern mempool_t *sv_clients_mempool;
+extern mempool_t *sv_edicts_mempool;
// persistant server info
extern server_static_t svs;
void SV_SendClientMessages (void);
void SV_ClearDatagram (void);
+void SV_ReadClientMessage(void);
+
int SV_ModelIndex (const char *name);
void SV_SetIdealPitch (void);
void SV_AddUpdates (void);
void SV_ClientThink (void);
-void SV_AddClientToServer (struct qsocket_s *ret);
void SV_ClientPrintf (const char *fmt, ...);
void SV_BroadcastPrintf (const char *fmt, ...);
void SV_MoveToGoal (void);
-void SV_CheckForNewClients (void);
void SV_RunClients (void);
void SV_SaveSpawnparms (void);
void SV_SpawnServer (const char *server);
-void SV_SetMaxClients(int n);
-
void SV_CheckVelocity (edict_t *ent);
#endif