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, flags, int, this.flags)
32 ATTRIB(Client, playerid, int, this.playerid)
34 METHOD(Client, m_unwind, bool(Client this));
37 if (this.m_unwind(this)) return this;
38 this.classname = "player_joining";
39 this.flags = FL_CLIENT;
40 static int playerid_last;
41 this.playerid = ++playerid_last;
42 ClientState_attach(this);
46 CLASS(Observer, Client)
48 this.classname = STR_OBSERVER;
50 DESTRUCTOR(Observer) { }
53 CLASS(Spectator, Client)
55 this.classname = STR_SPECTATOR;
57 DESTRUCTOR(Spectator) { }
62 this.classname = STR_PLAYER;
64 DESTRUCTOR(Player) { }
67 METHOD(Client, m_unwind, bool(Client this))
70 #define UNWIND(class) MACRO_BEGIN if (this.instanceOf##class) { METHOD_REFERENCE(class, dtorimpl)(this); } MACRO_END
71 switch (this.classname) {
91 void play_countdown(float finished, Sound samp);
93 float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit);
95 float Spectate(entity pl);
97 #define SPECTATE_COPY() [[accumulate]] void SpectateCopy(entity this, entity spectatee)
98 #define SPECTATE_COPYFIELD(fld) SPECTATE_COPY() { this.(fld) = spectatee.(fld); }