3 void ClientState_attach(entity this);
5 IntrusiveList g_players;
6 STATIC_INIT(g_players) { g_players = IL_NEW(); }
10 ATTRIB(Client, netname, string, this.netname);
11 ATTRIB(Client, colormap, int, this.colormap);
12 ATTRIB(Client, team, int, this.team);
13 ATTRIB(Client, clientcolors, int, this.clientcolors);
15 ATTRIB(Client, netaddress, string, this.netaddress);
16 ATTRIB(Client, playermodel, string, this.playermodel);
17 ATTRIB(Client, playerskin, int, this.playerskin);
19 /** fingerprint of CA key the player used to authenticate */
20 ATTRIB(Client, crypto_keyfp, string, this.crypto_keyfp);
21 /** fingerprint of CA key the server used to authenticate to the player */
22 ATTRIB(Client, crypto_mykeyfp, string, this.crypto_mykeyfp);
23 /** fingerprint of ID used by the player entity, or string_null if not identified */
24 ATTRIB(Client, crypto_idfp, string, this.crypto_idfp);
25 /** set if the player's ID has been signed */
26 ATTRIB(Client, crypto_idfp_signed, bool, this.crypto_idfp_signed);
27 /** the string "AES128" if encrypting, and string_null if plaintext */
28 ATTRIB(Client, crypto_encryptmethod, string, this.crypto_encryptmethod);
29 /** the string "HMAC-SHA256" if signing, and string_null if plaintext */
30 ATTRIB(Client, crypto_signmethod, string, this.crypto_signmethod);
34 ATTRIB(Client, playerid, int, this.playerid);
36 METHOD(Client, m_unwind, bool(Client this));
38 STATIC_METHOD(Client, Add, void(Client this, int _team));
39 STATIC_METHOD(Client, Remove, void(Client this));
42 if (this.m_unwind(this)) return this;
44 this.classname = "player_joining";
45 static int playerid_last;
46 this.playerid = ++playerid_last;
47 ClientState_attach(this);
52 CONSTRUCTOR(Client, string name) {
55 this.netaddress = "local";
56 this.playermodel = "models/player/megaerebus.iqm";
60 CLASS(Observer, Client)
62 this.classname = STR_OBSERVER;
64 DESTRUCTOR(Observer) { }
67 CLASS(Spectator, Client)
69 this.classname = STR_SPECTATOR;
71 DESTRUCTOR(Spectator) { }
76 this.classname = STR_PLAYER;
77 IL_PUSH(g_players, this);
80 IL_REMOVE(g_players, this);
84 METHOD(Client, m_unwind, bool(Client this))
87 #define UNWIND(class) MACRO_BEGIN if (this.instanceOf##class) { METHOD_REFERENCE(class, dtorimpl)(this); } MACRO_END
88 switch (this.classname) {
106 float c1, c2, c3, c4;
108 void play_countdown(entity this, float finished, Sound samp);
110 float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit);
112 bool Spectate(entity this, entity pl);
114 #define SPECTATE_COPY() [[accumulate]] void SpectateCopy(entity this, entity spectatee)
115 #define SPECTATE_COPYFIELD(fld) SPECTATE_COPY() { this.(fld) = spectatee.(fld); }