From f86d796295c366d2715921797c2a153ed56728fd Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 2 Feb 2012 21:13:24 +0000 Subject: cClientHandle: gotten rid of the obnoxious m_pState, now using direct members instead git-svn-id: http://mc-server.googlecode.com/svn/trunk@228 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.h | 69 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 11 deletions(-) (limited to 'source/cClientHandle.h') diff --git a/source/cClientHandle.h b/source/cClientHandle.h index 4e7d8ce91..21f97f6c3 100644 --- a/source/cClientHandle.h +++ b/source/cClientHandle.h @@ -1,13 +1,32 @@ + +// cClientHandle.h + +// Interfaces to the cClientHandle class representing a client connected to this server. The client need not be a player yet + + + + + #pragma once +#ifndef CCLIENTHANDLE_H_INCLUDED +#define CCLIENTHANDLE_H_INCLUDED + +#include "Packets/cPacket.h" +#include "Vector3d.h" -class cSocket; -class cSemaphore; -class cEvent; -class Game; -class cPacket; + + + + +// class Game; class cChunk; class cPlayer; class cRedstone; + + + + + class cClientHandle // tolua_export { // tolua_export public: @@ -22,7 +41,7 @@ public: cClientHandle(const cSocket & a_Socket); ~cClientHandle(); - static const int VIEWDISTANCE = 15; // MUST be odd number or CRASH! + static const int VIEWDISTANCE = 17; // MUST be odd number or CRASH! static const int GENERATEDISTANCE = 2; // Server generates this many chunks AHEAD of player sight. const cSocket & GetSocket(); @@ -62,12 +81,31 @@ private: void SendLoginResponse(); - struct sClientHandleState; - sClientHandleState* m_pState; + int mProtocolVersion; + AString mUsername; + AString mPassword; + + PacketList mPendingParsePackets; + PacketList mPendingNrmSendPackets; + PacketList mPendingLowSendPackets; + + cThread* pReceiveThread; + cThread* pSendThread; + + cSocket mSocket; - bool m_bDestroyed; - cPlayer* m_Player; - bool m_bKicking; + cCriticalSection mCriticalSection; + cCriticalSection mSendCriticalSection; + cCriticalSection mSocketCriticalSection; + cSemaphore mSemaphore; + + Vector3d mConfirmPosition; + + cPacket * mPacketMap[256]; + + bool m_bDestroyed; + cPlayer * m_Player; + bool m_bKicking; float m_TimeLastPacket; @@ -83,3 +121,12 @@ private: bool m_bKeepThreadGoing; }; // tolua_export + + + + +#endif // CCLIENTHANDLE_H_INCLUDED + + + + -- cgit v1.2.3