3 #include <server/command/getreplies.qh>
5 void Inventory_new(PlayerState this);
6 void Inventory_delete(entity this);
7 void InventoryStorage_attach(PlayerState this);
8 void InventoryStorage_detach(PlayerState this);
10 void PlayerState_attach(entity this)
12 if (PS(this) && PS(this).m_client == this)
15 this._ps = NEW(PlayerState, this);
17 Inventory_new(PS(this));
20 void PlayerState_detach(entity this)
22 PlayerState ps = PS(this);
23 if (!ps) return; // initial connect
26 if (ps.m_client != this) return; // don't own state, spectator
30 FOREACH_CLIENT(PS(it) == ps, { PS(it) = NULL; });
34 void DecodeLevelParms(entity this);
35 void PlayerScore_Attach(entity this);
36 void ClientData_Attach(entity this);
37 void accuracy_init(entity this);
38 void entcs_attach(entity this);
39 void anticheat_init(entity this);
40 void W_HitPlotOpen(entity this);
41 void bot_clientconnect(entity this);
43 void ClientState_attach(entity this)
45 this._cs = NEW(ClientState, this);
47 // TODO: fold all of these into ClientState
49 DecodeLevelParms(this);
51 PlayerScore_Attach(this);
52 PlayerStats_PlayerBasic_CheckUpdate(this);
53 ClientData_Attach(this);
58 InventoryStorage_attach(this);
61 void bot_clientdisconnect(entity this);
62 void W_HitPlotClose(entity this);
63 void anticheat_report_to_eventlog(entity this);
64 void entcs_detach(entity this);
65 void accuracy_free(entity this);
66 void ClientData_Detach(entity this);
67 void PlayerScore_Detach(entity this);
69 void ClientState_detach(entity this)
71 GetCvars(this, CS_CVAR(this), -1); // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
72 accuracy_free(this); // TODO: needs to be before CS() is deleted!
73 PlayerScore_Detach(this); // what ^they^ said
75 ClientData_Detach(this);
77 InventoryStorage_detach(this);
81 bot_clientdisconnect(this);
83 anticheat_report_to_eventlog(this);