3 void ClientState_attach(entity this);
7 ATTRIB(Client, netname, string, this.netname)
8 ATTRIB(Client, colormap, int, this.colormap)
9 ATTRIB(Client, team, int, this.team)
10 ATTRIB(Client, clientcolors, int, this.clientcolors)
12 ATTRIB(Client, netaddress, string, this.netaddress)
13 ATTRIB(Client, playermodel, string, this.playermodel)
14 ATTRIB(Client, playerskin, int, this.playerskin)
16 /** fingerprint of CA key the player used to authenticate */
17 ATTRIB(Client, crypto_keyfp, string, this.crypto_keyfp)
18 /** fingerprint of CA key the server used to authenticate to the player */
19 ATTRIB(Client, crypto_mykeyfp, string, this.crypto_mykeyfp)
20 /** fingerprint of ID used by the player entity, or string_null if not identified */
21 ATTRIB(Client, crypto_idfp, string, this.crypto_idfp)
22 /** set if the player's ID has been signed */
23 ATTRIB(Client, crypto_idfp_signed, bool, this.crypto_idfp_signed)
24 /** the string "AES128" if encrypting, and string_null if plaintext */
25 ATTRIB(Client, crypto_encryptmethod, string, this.crypto_encryptmethod)
26 /** the string "HMAC-SHA256" if signing, and string_null if plaintext */
27 ATTRIB(Client, crypto_signmethod, string, this.crypto_signmethod)
31 ATTRIB(Client, playerid, int, this.playerid)
33 METHOD(Client, m_unwind, bool(Client this));
35 STATIC_METHOD(Client, Add, void(Client this, int _team));
36 STATIC_METHOD(Client, Remove, void(Client this));
39 if (this.m_unwind(this)) return this;
41 this.classname = "player_joining";
42 static int playerid_last;
43 this.playerid = ++playerid_last;
44 ClientState_attach(this);
49 CONSTRUCTOR(Client, string name) {
52 this.netaddress = "local";
53 this.playermodel = "models/player/megaerebus.iqm";
57 CLASS(Observer, Client)
59 this.classname = STR_OBSERVER;
61 DESTRUCTOR(Observer) { }
64 CLASS(Spectator, Client)
66 this.classname = STR_SPECTATOR;
68 DESTRUCTOR(Spectator) { }
73 this.classname = STR_PLAYER;
75 DESTRUCTOR(Player) { }
78 METHOD(Client, m_unwind, bool(Client this))
81 #define UNWIND(class) MACRO_BEGIN if (this.instanceOf##class) { METHOD_REFERENCE(class, dtorimpl)(this); } MACRO_END
82 switch (this.classname) {
100 float c1, c2, c3, c4;
102 void play_countdown(float finished, Sound samp);
104 float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit);
106 float Spectate(entity pl);
108 #define SPECTATE_COPY() [[accumulate]] void SpectateCopy(entity this, entity spectatee)
109 #define SPECTATE_COPYFIELD(fld) SPECTATE_COPY() { this.(fld) = spectatee.(fld); }