blob: 491598d4fb8c4d39b9306ba2df71b63874691619 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#ifndef GAME_SERVER_PLAYER_H
#define GAME_SERVER_PLAYER_H
// this include should perhaps be removed
#include "entities/character.hpp"
// 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;
int64 last_setteam;
int64 last_changeinfo;
int64 last_emote;
int64 last_kill;
// 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();
};
#endif
|