diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-02 22:13:24 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-02 22:13:24 +0100 |
commit | f86d796295c366d2715921797c2a153ed56728fd (patch) | |
tree | 29860b621d7bdb50fddedcadf19b5b2d1d56c413 /source/cClientHandle.h | |
parent | Socket-related assert fixes (diff) | |
download | cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.gz cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.bz2 cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.lz cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.xz cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.zst cuberite-f86d796295c366d2715921797c2a153ed56728fd.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cClientHandle.h | 69 |
1 files changed, 58 insertions, 11 deletions
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
+
+
+
+
|