2008-08-14 18:42:47 +00:00
|
|
|
#ifndef GAME_SERVER_PLAYER_H
|
|
|
|
#define GAME_SERVER_PLAYER_H
|
|
|
|
|
|
|
|
// this include should perhaps be removed
|
|
|
|
#include "entities/character.hpp"
|
2008-08-14 18:25:44 +00:00
|
|
|
|
|
|
|
// player object
|
|
|
|
class PLAYER
|
|
|
|
{
|
2008-09-24 09:03:49 +00:00
|
|
|
MACRO_ALLOC_POOL_ID()
|
|
|
|
private:
|
2008-09-23 18:08:19 +00:00
|
|
|
CHARACTER *character;
|
2008-08-14 18:25:44 +00:00
|
|
|
public:
|
2008-09-23 18:08:19 +00:00
|
|
|
PLAYER(int client_id);
|
2008-09-24 09:03:49 +00:00
|
|
|
~PLAYER();
|
2008-08-14 18:25:44 +00:00
|
|
|
|
|
|
|
// 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;
|
2008-09-07 08:10:56 +00:00
|
|
|
bool force_balanced;
|
2008-08-14 18:25:44 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
int64 last_chat;
|
2008-09-02 16:46:38 +00:00
|
|
|
int64 last_setteam;
|
|
|
|
int64 last_changeinfo;
|
|
|
|
int64 last_emote;
|
|
|
|
int64 last_kill;
|
2008-08-14 18:25:44 +00:00
|
|
|
|
|
|
|
// network latency calculations
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int accum;
|
|
|
|
int accum_min;
|
|
|
|
int accum_max;
|
|
|
|
int avg;
|
|
|
|
int min;
|
|
|
|
int max;
|
|
|
|
} latency;
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
};
|
2008-08-14 18:42:47 +00:00
|
|
|
|
|
|
|
#endif
|