X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=server.h;h=86e07a764e3748eaa5770a8b88aa1dcc6890d32b;hb=49a0d411fae28787e20dc45a4906722a5e51b7bc;hp=e32c35500d4b5e0386afd50678ba797c905c41ef;hpb=148c1ff5b07d30c1faffbc8d71afc8849eafdbe6;p=xonotic%2Fdarkplaces.git diff --git a/server.h b/server.h index e32c3550..86e07a76 100644 --- a/server.h +++ b/server.h @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct server_static_s { // number of svs.clients slots (updated by maxplayers command) - int maxclients; + int maxclients, maxclients_next; // client slots struct client_s *clients; // episode completion information @@ -34,6 +34,26 @@ typedef struct server_static_s qboolean changelevel_issued; // server infostring char serverinfo[MAX_SERVERINFO_STRING]; + // performance data + float perf_cpuload; + float perf_lost; + float perf_offset_avg; + float perf_offset_max; + float perf_offset_sdev; + // temporary performance data accumulators + float perf_acc_realtime; + float perf_acc_sleeptime; + float perf_acc_lost; + float perf_acc_offset; + float perf_acc_offset_squared; + float perf_acc_offset_max; + int perf_acc_offset_samples; + + // csqc stuff + unsigned char *csqc_progdata; + size_t csqc_progsize_deflated; + unsigned char *csqc_progdata_deflated; + } server_static_t; //============================================================================= @@ -54,6 +74,7 @@ typedef struct server_s qboolean active; qboolean paused; + double pausedstart; // handle connections specially qboolean loadgame; @@ -125,8 +146,28 @@ typedef struct server_s int writeentitiestoclient_pvsbytes; unsigned char writeentitiestoclient_pvs[MAX_MAP_LEAFS/8]; entity_state_t writeentitiestoclient_sendstates[MAX_EDICTS]; + + int numsendentities; + entity_state_t sendentities[MAX_EDICTS]; + entity_state_t *sendentitiesindex[MAX_EDICTS]; + + int sententitiesmark; + int sententities[MAX_EDICTS]; + int sententitiesconsideration[MAX_EDICTS]; + + // legacy support for self.Version based csqc entity networking + unsigned char csqcentityversion[MAX_EDICTS]; // legacy } server_t; +#define NUM_CSQCENTITIES_PER_FRAME 1024 +typedef struct csqcentityframedb_s +{ + int framenum; + int num; + unsigned short entno[NUM_CSQCENTITIES_PER_FRAME]; + int sendflags[NUM_CSQCENTITIES_PER_FRAME]; +} csqcentityframedb_t; + // if defined this does ping smoothing, otherwise it does not //#define NUM_PING_TIMES 16 @@ -140,6 +181,8 @@ typedef struct client_s qboolean clientconnectcalled; // false = don't send datagrams qboolean spawned; + // 1 = send svc_serverinfo and advance to 2, 2 doesn't send, then advances to 0 (allowing unlimited sending) when prespawn is received + int sendsignon; // requested rate in bytes per second int rate; @@ -172,8 +215,8 @@ typedef struct client_s // this is used by sv_clmovement_minping code double clmovement_disabletimeout; - // this is used by sv_clmvoement_waitforinput code - int clmovement_skipphysicsframes; + // this is used by sv_clmovement_inputtimeout code + float clmovement_inputtimeout; // spawn parms are carried from level to level float spawn_parms[NUM_SPAWN_PARMS]; @@ -191,8 +234,17 @@ typedef struct client_s // visibility state float visibletime[MAX_EDICTS]; - // version number of csqc-based entity to decide whether to send it - unsigned char csqcentityversion[MAX_EDICTS]; + // scope is whether an entity is currently being networked to this client + // sendflags is what properties have changed on the entity since the last + // update that was sent + int csqcnumedicts; + unsigned char csqcentityscope[MAX_EDICTS]; + unsigned int csqcentitysendflags[MAX_EDICTS]; + +#define NUM_CSQCENTITYDB_FRAMES 64 + unsigned char csqcentityglobalhistory[MAX_EDICTS]; // set to 1 if the entity was ever csqc networked to the client, and never reset back to 0 + csqcentityframedb_t csqcentityframehistory[NUM_CSQCENTITYDB_FRAMES]; + int csqcentityframehistory_next; // prevent animated names float nametime; @@ -204,6 +256,9 @@ typedef struct client_s char weaponmodel[MAX_QPATH]; int weaponmodelindex; + // clientcamera (entity to use as camera) + int clientcamera; + entityframe_database_t *entitydatabase; entityframe4_database_t *entitydatabase4; entityframe5_database_t *entitydatabase5; @@ -222,10 +277,14 @@ typedef struct client_s int download_expectedposition; // next position the client should ack qboolean download_started; char download_name[MAX_QPATH]; + qboolean download_deflate; // fixangle data qboolean fixangle_angles_set; vec3_t fixangle_angles; + + // demo recording + qfile_t *sv_demo_file; } client_t; @@ -322,7 +381,8 @@ extern cvar_t sv_checkforpacketsduringsleep; extern cvar_t sv_clmovement_enable; extern cvar_t sv_clmovement_minping; extern cvar_t sv_clmovement_minping_disabletime; -extern cvar_t sv_clmovement_waitforinput; +extern cvar_t sv_clmovement_inputtimeout; +extern cvar_t sv_clmovement_maxnetfps; extern cvar_t sv_cullentities_nevercullbmodels; extern cvar_t sv_cullentities_pvs; extern cvar_t sv_cullentities_stats; @@ -340,16 +400,21 @@ extern cvar_t sv_fixedframeratesingleplayer; extern cvar_t sv_freezenonclients; extern cvar_t sv_friction; extern cvar_t sv_gameplayfix_blowupfallenzombies; +extern cvar_t sv_gameplayfix_delayprojectiles; extern cvar_t sv_gameplayfix_droptofloorstartsolid; +extern cvar_t sv_gameplayfix_droptofloorstartsolid_nudgetocorrect; +extern cvar_t sv_gameplayfix_easierwaterjump; extern cvar_t sv_gameplayfix_findradiusdistancetobox; extern cvar_t sv_gameplayfix_grenadebouncedownslopes; +extern cvar_t sv_gameplayfix_multiplethinksperframe; +extern cvar_t sv_gameplayfix_slidemoveprojectiles; extern cvar_t sv_gameplayfix_noairborncorpse; -extern cvar_t sv_gameplayfix_qwplayerphysics; extern cvar_t sv_gameplayfix_setmodelrealbox; extern cvar_t sv_gameplayfix_stepdown; extern cvar_t sv_gameplayfix_stepwhilejumping; extern cvar_t sv_gameplayfix_swiminbmodels; extern cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag; +extern cvar_t sv_gameplayfix_gravityunaffectedbyticrate; extern cvar_t sv_gravity; extern cvar_t sv_idealpitchscale; extern cvar_t sv_jumpstep; @@ -393,6 +458,7 @@ void SV_Init (void); void SV_StartParticle (vec3_t org, vec3_t dir, int color, int count); void SV_StartEffect (vec3_t org, int modelindex, int startframe, int framecount, int framerate); void SV_StartSound (prvm_edict_t *entity, int channel, const char *sample, int volume, float attenuation); +void SV_StartPointSound (vec3_t origin, const char *sample, int volume, float attenuation); void SV_ConnectClient (int clientnum, netconn_t *netconnection); void SV_DropClient (qboolean crash); @@ -434,12 +500,16 @@ qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean // if touchtriggers, calls prog functions for the intersected triggers void SV_LinkEdict (prvm_edict_t *ent, qboolean touch_triggers); +// move an entity that is stuck by small amounts in various directions to try to nudge it back into the collision hull +// returns true if it found a better place +qboolean SV_UnstickEntity (prvm_edict_t *ent); + // calculates hitsupercontentsmask for a generic qc entity int SV_GenericHitSuperContentsMask(const prvm_edict_t *edict); // traces a box move against worldmodel and all entities in the specified area trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask); -#define SV_PointSuperContents(point) (SV_Move((point), vec3_origin, vec3_origin, (point), sv_gameplayfix_swiminbmodels.integer ? MOVE_NOMONSTERS : MOVE_WORLDONLY, NULL, 0).startsupercontents) +int SV_PointSuperContents(const vec3_t point); void SV_FlushBroadcastMessages(void); void SV_WriteClientdataToMessage (client_t *client, prvm_edict_t *ent, sizebuf_t *msg, int *stats); @@ -457,5 +527,7 @@ void SV_SetupVM(void); void SV_VM_Begin(void); void SV_VM_End(void); +const char *Host_TimingReport(); // for output in Host_Status_f + #endif