]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - server.h
increase MAX_PARTICLEEFFECTNAME and MAX_PARTICLEEFFECTINFO limits
[xonotic/darkplaces.git] / server.h
index 5d399607ca1ea7717ded40dce8dbd944f0e160a3..ae32cb24a4aa0120ef786708f467d50cdb1b3ae9 100644 (file)
--- 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,11 +138,11 @@ 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;
-       char particleeffectname[SV_MAX_PARTICLEEFFECTNAME][MAX_QPATH];
+       char particleeffectname[MAX_PARTICLEEFFECTNAME][MAX_QPATH];
 
        int writeentitiestoclient_stats_culled_pvs;
        int writeentitiestoclient_stats_culled_trace;
@@ -189,14 +190,21 @@ typedef struct client_s
        qboolean active;
        /// false = don't do ClientDisconnect on drop
        qboolean clientconnectcalled;
-       /// false = don't send datagrams
+       /// false = don't allow spawn
+       qboolean prespawned;
+       /// false = don't allow begin
        qboolean spawned;
+       /// false = don't send datagrams
+       qboolean begun;
        /// 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;
 
+       /// temporarily exceed rate by this amount of bytes
+       int rate_burstsize;
+
        /// realtime this client connected
        double connecttime;
 
@@ -231,7 +239,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];
@@ -254,7 +262,6 @@ typedef struct client_s
        unsigned int csqcentitysendflags[MAX_EDICTS];
 
 #define NUM_CSQCENTITYDB_FRAMES 256
-       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;
        int csqcentityframe_lastreset;
@@ -302,6 +309,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 +345,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)
@@ -451,7 +463,6 @@ extern cvar_t sv_gameplayfix_nogravityonground;
 extern cvar_t sv_gameplayfix_setmodelrealbox;
 extern cvar_t sv_gameplayfix_slidemoveprojectiles;
 extern cvar_t sv_gameplayfix_stepdown;
-extern cvar_t sv_gameplayfix_stepwhilejumping;
 extern cvar_t sv_gameplayfix_stepmultipletimes;
 extern cvar_t sv_gameplayfix_nostepmoveonsteepslopes;
 extern cvar_t sv_gameplayfix_swiminbmodels;
@@ -556,6 +567,10 @@ void SV_LinkEdict_TouchAreaGrid_Call(prvm_edict_t *touch, prvm_edict_t *ent); //
  * returns true if it found a better place
  */
 qboolean SV_UnstickEntity (prvm_edict_t *ent);
+/*! move an entity that is stuck out of the surface it is stuck in (can move large amounts)
+ * returns true if it found a better place
+ */
+qboolean SV_NudgeOutOfSolid(prvm_edict_t *ent);
 
 /// calculates hitsupercontentsmask for a generic qc entity
 int SV_GenericHitSuperContentsMask(const prvm_edict_t *edict);
@@ -589,8 +604,8 @@ void SV_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out,
 
 void SV_StartThread(void);
 void SV_StopThread(void);
-#define SV_LockThreadMutex() (svs.threaded ? Thread_LockMutex(svs.threadmutex),1 : 0)
-#define SV_UnlockThreadMutex() (svs.threaded ? Thread_UnlockMutex(svs.threadmutex),1 : 0)
+#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);