From 1bc24055d595a136d6c6d8026a58b17706dc1543 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Sat, 28 Mar 2020 10:44:44 +0000 Subject: cClientHandle: Only allow m_State to increase (#4533) * cClientHandle: Only allow m_State to increase * WasAddedToWorld was incorrect if kicked * Rewrite cClient::Destroy with a guard clause --- src/ClientHandle.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 6dcf71a59..00f318191 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -591,6 +591,10 @@ private: /** Called right after the instance is created to store its SharedPtr inside. */ void SetSelf(cClientHandlePtr a_Self); + /** Called to update m_State. + Only succeeds if a_NewState > m_State, otherwise returns false. */ + bool SetState(eState a_NewState); + /** Processes the data in the network input and output buffers. Called by both Tick() and ServerTick(). */ void ProcessProtocolInOut(void); -- cgit v1.2.3