diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-08-14 18:25:44 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-08-14 18:25:44 +0000 |
| commit | a420eb543f8206730aebb80e60a625f7204694e4 (patch) | |
| tree | 235971d38c917c1b97c512743db64c2fd23ffadc /src/game/server/player.hpp | |
| parent | 817f431377c7f1545621ff597c018b133651e991 (diff) | |
| download | zcatch-a420eb543f8206730aebb80e60a625f7204694e4.tar.gz zcatch-a420eb543f8206730aebb80e60a625f7204694e4.zip | |
moved alot of stuff to their own cpp/hpp files
Diffstat (limited to 'src/game/server/player.hpp')
| -rw-r--r-- | src/game/server/player.hpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/game/server/player.hpp b/src/game/server/player.hpp new file mode 100644 index 00000000..c1866f85 --- /dev/null +++ b/src/game/server/player.hpp @@ -0,0 +1,55 @@ + +// player object +class PLAYER +{ +public: + PLAYER(); + + // TODO: clean this up + char skin_name[64]; + int use_custom_color; + int color_body; + int color_feet; + + // + bool spawning; + int client_id; + int team; + int score; + + // + int64 last_chat; + + // network latency calculations + struct + { + int accum; + int accum_min; + int accum_max; + int avg; + int min; + int max; + } latency; + + CHARACTER character; + + // this is used for snapping so we know how we can clip the view for the player + vec2 view_pos; + + void init(int client_id); + + CHARACTER *get_character(); + + void kill_character(); + + void try_respawn(); + void respawn(); + void set_team(int team); + + void tick(); + void snap(int snaping_client); + + void on_direct_input(NETOBJ_PLAYER_INPUT *new_input); + void on_predicted_input(NETOBJ_PLAYER_INPUT *new_input); + void on_disconnect(); +}; |