2018-04-13 18:23:45 +02:00
|
|
|
/***
|
|
|
|
*
|
|
|
|
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
2021-01-03 02:28:45 +01:00
|
|
|
*
|
|
|
|
* This product contains software technology licensed from Id
|
|
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
2018-04-13 18:23:45 +02:00
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use, distribution, and modification of this source code and/or resulting
|
|
|
|
* object code is restricted to non-commercial enhancements to products from
|
|
|
|
* Valve LLC. All other use, distribution, or modification is prohibited
|
|
|
|
* without written permission from Valve LLC.
|
|
|
|
*
|
|
|
|
****/
|
|
|
|
#ifndef ENTITY_STATE_H
|
|
|
|
#define ENTITY_STATE_H
|
|
|
|
|
|
|
|
// For entityType below
|
|
|
|
#define ENTITY_NORMAL (1<<0)
|
|
|
|
#define ENTITY_BEAM (1<<1)
|
|
|
|
|
2021-01-03 02:28:45 +01:00
|
|
|
// Entity state is used for the baseline and for delta compression of a packet of
|
2018-04-13 18:23:45 +02:00
|
|
|
// entities that is sent to a client.
|
|
|
|
typedef struct entity_state_s entity_state_t;
|
|
|
|
|
|
|
|
struct entity_state_s
|
|
|
|
{
|
|
|
|
// Fields which are filled in by routines outside of delta compression
|
|
|
|
int entityType;
|
|
|
|
// Index into cl_entities array for this entity.
|
2019-07-19 19:23:08 +02:00
|
|
|
int number;
|
2018-04-13 18:23:45 +02:00
|
|
|
float msg_time;
|
|
|
|
|
|
|
|
// Message number last time the player/entity state was updated.
|
|
|
|
int messagenum;
|
|
|
|
|
|
|
|
// Fields which can be transitted and reconstructed over the network stream
|
|
|
|
vec3_t origin;
|
|
|
|
vec3_t angles;
|
|
|
|
|
|
|
|
int modelindex;
|
|
|
|
int sequence;
|
|
|
|
float frame;
|
|
|
|
int colormap;
|
|
|
|
short skin;
|
|
|
|
short solid;
|
|
|
|
int effects;
|
|
|
|
float scale;
|
|
|
|
byte eflags;
|
|
|
|
|
|
|
|
// Render information
|
|
|
|
int rendermode;
|
|
|
|
int renderamt;
|
|
|
|
color24 rendercolor;
|
|
|
|
int renderfx;
|
|
|
|
|
|
|
|
int movetype;
|
|
|
|
float animtime;
|
|
|
|
float framerate;
|
|
|
|
int body;
|
|
|
|
byte controller[4];
|
|
|
|
byte blending[4];
|
|
|
|
vec3_t velocity;
|
|
|
|
|
|
|
|
// Send bbox down to client for use during prediction.
|
2021-01-03 02:28:45 +01:00
|
|
|
vec3_t mins;
|
2018-04-13 18:23:45 +02:00
|
|
|
vec3_t maxs;
|
|
|
|
|
|
|
|
int aiment;
|
|
|
|
// If owned by a player, the index of that player ( for projectiles ).
|
2021-01-03 02:28:45 +01:00
|
|
|
int owner;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
// Friction, for prediction.
|
2019-07-19 19:23:08 +02:00
|
|
|
float friction;
|
2018-04-13 18:23:45 +02:00
|
|
|
// Gravity multiplier
|
2021-01-03 02:28:45 +01:00
|
|
|
float gravity;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
// PLAYER SPECIFIC
|
|
|
|
int team;
|
|
|
|
int playerclass;
|
|
|
|
int health;
|
2021-01-03 02:28:45 +01:00
|
|
|
qboolean spectator;
|
2018-04-13 18:23:45 +02:00
|
|
|
int weaponmodel;
|
|
|
|
int gaitsequence;
|
|
|
|
// If standing on conveyor, e.g.
|
2021-01-03 02:28:45 +01:00
|
|
|
vec3_t basevelocity;
|
2018-04-13 18:23:45 +02:00
|
|
|
// Use the crouched hull, or the regular player hull.
|
2021-01-03 02:28:45 +01:00
|
|
|
int usehull;
|
2018-04-13 18:23:45 +02:00
|
|
|
// Latched buttons last time state updated.
|
2019-07-19 19:23:08 +02:00
|
|
|
int oldbuttons;
|
2018-04-13 18:23:45 +02:00
|
|
|
// -1 = in air, else pmove entity number
|
2021-01-03 02:28:45 +01:00
|
|
|
int onground;
|
2018-04-13 18:23:45 +02:00
|
|
|
int iStepLeft;
|
|
|
|
// How fast we are falling
|
2021-01-03 02:28:45 +01:00
|
|
|
float flFallVelocity;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
float fov;
|
|
|
|
int weaponanim;
|
|
|
|
|
|
|
|
// Parametric movement overrides
|
|
|
|
vec3_t startpos;
|
|
|
|
vec3_t endpos;
|
|
|
|
float impacttime;
|
|
|
|
float starttime;
|
|
|
|
|
|
|
|
// For mods
|
|
|
|
int iuser1;
|
|
|
|
int iuser2;
|
|
|
|
int iuser3;
|
|
|
|
int iuser4;
|
|
|
|
float fuser1;
|
|
|
|
float fuser2;
|
|
|
|
float fuser3;
|
|
|
|
float fuser4;
|
|
|
|
vec3_t vuser1;
|
|
|
|
vec3_t vuser2;
|
|
|
|
vec3_t vuser3;
|
|
|
|
vec3_t vuser4;
|
|
|
|
};
|
|
|
|
|
|
|
|
#include "pm_info.h"
|
|
|
|
|
|
|
|
typedef struct clientdata_s
|
|
|
|
{
|
|
|
|
vec3_t origin;
|
|
|
|
vec3_t velocity;
|
|
|
|
|
|
|
|
int viewmodel;
|
|
|
|
vec3_t punchangle;
|
|
|
|
int flags;
|
|
|
|
int waterlevel;
|
|
|
|
int watertype;
|
|
|
|
vec3_t view_ofs;
|
|
|
|
float health;
|
|
|
|
|
|
|
|
int bInDuck;
|
|
|
|
int weapons; // remove?
|
2021-01-03 02:28:45 +01:00
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
int flTimeStepSound;
|
|
|
|
int flDuckTime;
|
|
|
|
int flSwimTime;
|
|
|
|
int waterjumptime;
|
|
|
|
|
|
|
|
float maxspeed;
|
|
|
|
|
|
|
|
float fov;
|
|
|
|
int weaponanim;
|
|
|
|
|
|
|
|
int m_iId;
|
|
|
|
int ammo_shells;
|
|
|
|
int ammo_nails;
|
|
|
|
int ammo_cells;
|
|
|
|
int ammo_rockets;
|
|
|
|
float m_flNextAttack;
|
2021-01-03 02:28:45 +01:00
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
int tfstate;
|
|
|
|
int pushmsec;
|
|
|
|
int deadflag;
|
|
|
|
char physinfo[MAX_PHYSINFO_STRING];
|
|
|
|
|
|
|
|
// For mods
|
|
|
|
int iuser1;
|
|
|
|
int iuser2;
|
|
|
|
int iuser3;
|
|
|
|
int iuser4;
|
|
|
|
float fuser1;
|
|
|
|
float fuser2;
|
|
|
|
float fuser3;
|
|
|
|
float fuser4;
|
|
|
|
vec3_t vuser1;
|
|
|
|
vec3_t vuser2;
|
|
|
|
vec3_t vuser3;
|
|
|
|
vec3_t vuser4;
|
|
|
|
|
|
|
|
} clientdata_t;
|
|
|
|
|
|
|
|
#include "weaponinfo.h"
|
|
|
|
|
|
|
|
#define MAX_LOCAL_WEAPONS 64 // max weapons that can be predicted on the client
|
|
|
|
|
|
|
|
typedef struct local_state_s
|
|
|
|
{
|
|
|
|
entity_state_t playerstate;
|
|
|
|
clientdata_t client;
|
|
|
|
weapon_data_t weapondata[MAX_LOCAL_WEAPONS];
|
|
|
|
} local_state_t;
|
|
|
|
|
2019-07-19 19:23:08 +02:00
|
|
|
#endif//ENTITY_STATE_H
|