3 #include <server/command/getreplies.qh>
5 void Inventory_new(PlayerState this);
6 void Inventory_delete(entity this);
7 void Inventory_clear(PlayerState this);
8 void InventoryStorage_attach(PlayerState this);
9 void InventoryStorage_delete(PlayerState this);
11 void PlayerState_attach(entity this)
13 if (PS(this) && PS(this).m_client == this)
16 this._ps = NEW(PlayerState, this);
18 Inventory_new(PS(this));
21 void PlayerState_detach(entity this)
23 PlayerState ps = PS(this);
24 if (!ps) return; // initial connect
26 Inventory_clear(this.inventory_store); // no need to network updates, as there is no inventory attached
28 if (ps.m_client != this) return; // don't own state, spectator
32 FOREACH_CLIENT(PS(it) == ps, { PS(it) = NULL; });
36 void DecodeLevelParms(entity this);
37 void PlayerScore_Attach(entity this);
38 void ClientData_Attach(entity this);
39 void accuracy_init(entity this);
40 void entcs_attach(entity this);
41 void anticheat_init(entity this);
42 void W_HitPlotOpen(entity this);
43 void bot_clientconnect(entity this);
45 void ClientState_attach(entity this)
47 this._cs = NEW(ClientState, this);
49 // TODO: fold all of these into ClientState
51 DecodeLevelParms(this);
53 PlayerScore_Attach(this);
54 PlayerStats_PlayerBasic_CheckUpdate(this);
55 ClientData_Attach(this);
60 InventoryStorage_attach(this);
63 void bot_clientdisconnect(entity this);
64 void W_HitPlotClose(entity this);
65 void anticheat_report_to_eventlog(entity this);
66 void entcs_detach(entity this);
67 void accuracy_free(entity this);
68 void ClientData_Detach(entity this);
69 void PlayerScore_Detach(entity this);
71 void ClientState_detach(entity this)
73 GetCvars(this, CS_CVAR(this), -1); // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
74 accuracy_free(this); // TODO: needs to be before CS() is deleted!
75 PlayerScore_Detach(this); // what ^they^ said
77 ClientData_Detach(this);
79 InventoryStorage_delete(this);
83 bot_clientdisconnect(this);
85 anticheat_report_to_eventlog(this);