3 #include <server/command/getreplies.qh>
5 void Inventory_new(PlayerState this);
6 void Inventory_delete(entity this);
8 void PlayerState_attach(entity this)
10 if (PS(this) && PS(this).m_client == this)
13 this._ps = NEW(PlayerState, this);
15 Inventory_new(PS(this));
18 void PlayerState_detach(entity this)
20 PlayerState ps = PS(this);
21 if (!ps) return; // initial connect
24 if (ps.m_client != this) return; // don't own state, spectator
28 FOREACH_CLIENT(PS(it) == ps, { PS(it) = NULL; });
32 void DecodeLevelParms(entity this);
33 void PlayerScore_Attach(entity this);
34 void ClientData_Attach(entity this);
35 void accuracy_init(entity this);
36 void entcs_attach(entity this);
37 void anticheat_init(entity this);
38 void W_HitPlotOpen(entity this);
39 void bot_clientconnect(entity this);
41 void ClientState_attach(entity this)
43 this._cs = NEW(ClientState, this);
45 // TODO: fold all of these into ClientState
47 DecodeLevelParms(this);
49 PlayerScore_Attach(this);
50 PlayerStats_PlayerBasic_CheckUpdate(this);
51 ClientData_Attach(this);
58 void bot_clientdisconnect(entity this);
59 void W_HitPlotClose(entity this);
60 void anticheat_report_to_eventlog(entity this);
61 void entcs_detach(entity this);
62 void accuracy_free(entity this);
63 void ClientData_Detach(entity this);
64 void PlayerScore_Detach(entity this);
66 void ClientState_detach(entity this)
68 GetCvars(this, CS(this), -1); // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
69 accuracy_free(this); // TODO: needs to be before CS() is deleted!
70 PlayerScore_Detach(this); // what ^they^ said
72 ClientData_Detach(this);
77 bot_clientdisconnect(this);
79 anticheat_report_to_eventlog(this);