X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=server.h;h=761321d7a638f9960dd29af93b20463d79576630;hb=fab85f5a2f069a880e192fb941bef8fd29f2d41f;hp=d62a736683683a5591059b0a0b72331d1812c1a2;hpb=27b75893ba46058b5ca680f3c2aaae7233fe4270;p=xonotic%2Fdarkplaces.git diff --git a/server.h b/server.h index d62a7366..761321d7 100644 --- a/server.h +++ b/server.h @@ -66,12 +66,13 @@ typedef struct server_static_s typedef enum server_state_e {ss_loading, ss_active} server_state_t; #define MAX_CONNECTFLOODADDRESSES 16 -typedef struct server_connectfloodaddress_s +#define MAX_GETSTATUSFLOODADDRESSES 128 +typedef struct server_floodaddress_s { double lasttime; lhnetaddress_t address; } -server_connectfloodaddress_t; +server_floodaddress_t; typedef struct server_s { @@ -137,7 +138,8 @@ typedef struct server_s /// connection flood blocking /// note this is in server_t rather than server_static_t so that it is /// reset on each map command (such as New Game in singleplayer) - server_connectfloodaddress_t connectfloodaddresses[MAX_CONNECTFLOODADDRESSES]; + server_floodaddress_t connectfloodaddresses[MAX_CONNECTFLOODADDRESSES]; + server_floodaddress_t getstatusfloodaddresses[MAX_GETSTATUSFLOODADDRESSES]; #define SV_MAX_PARTICLEEFFECTNAME 256 qboolean particleeffectnamesloaded; @@ -231,7 +233,7 @@ typedef struct client_s float clmovement_inputtimeout; /// spawn parms are carried from level to level - float spawn_parms[NUM_SPAWN_PARMS]; + prvm_vec_t spawn_parms[NUM_SPAWN_PARMS]; // properties that are sent across the network only when changed char name[MAX_SCOREBOARDNAME], old_name[MAX_SCOREBOARDNAME]; @@ -302,6 +304,10 @@ typedef struct client_s // number of skipped entity frames // if it exceeds a limit, an empty entity frame is sent int num_skippedentityframes; + + // last sent move sequence + // if the move sequence changed, an empty entity frame is sent + int lastmovesequence; } client_t; @@ -334,6 +340,7 @@ typedef struct client_s // LordHavoc: corpse code #define SOLID_CORPSE 5 ///< same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters) // LordHavoc: physics +// VorteX: now these fields are deprecated, as geomtype is more flexible #define SOLID_PHYSICS_BOX 32 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity) #define SOLID_PHYSICS_SPHERE 33 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity) #define SOLID_PHYSICS_CAPSULE 34 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity) @@ -509,7 +516,7 @@ void SV_StartPointSound (vec3_t origin, const char *sample, int volume, float at void SV_ConnectClient (int clientnum, netconn_t *netconnection); void SV_DropClient (qboolean crash); -void SV_SendClientMessages (void); +void SV_SendClientMessages(void); void SV_ReadClientMessage(void); @@ -572,7 +579,7 @@ 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); -void SV_MoveToGoal (void); +void VM_SV_MoveToGoal(prvm_prog_t *prog); void SV_ApplyClientMove (void); void SV_SaveSpawnparms (void); @@ -582,18 +589,20 @@ void SV_CheckVelocity (prvm_edict_t *ent); void SV_SetupVM(void); -void SV_VM_Begin(void); -void SV_VM_End(void); - -const char *Host_TimingReport(void); ///< for output in Host_Status_f +const char *Host_TimingReport(char *buf, size_t buflen); ///< for output in Host_Status_f -int SV_GetPitchSign(prvm_edict_t *ent); -void SV_GetEntityMatrix (prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatrix); +int SV_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent); +void SV_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatrix); void SV_StartThread(void); void SV_StopThread(void); -void SV_LockThreadMutex(void); -void SV_UnlockThreadMutex(void); +#define SV_LockThreadMutex() (void)(svs.threaded ? Thread_LockMutex(svs.threadmutex) : 0) +#define SV_UnlockThreadMutex() (void)(svs.threaded ? Thread_UnlockMutex(svs.threadmutex) : 0) + +void VM_CustomStats_Clear(void); +void VM_SV_UpdateCustomStats(client_t *client, prvm_edict_t *ent, sizebuf_t *msg, int *stats); +void Host_Savegame_to(prvm_prog_t *prog, const char *name); +void SV_SendServerinfo(client_t *client); #endif