1
0
cuberite-2a/source/cClientHandle.h
faketruth b5b920deda You can now run multiple worlds by defining them in settings.ini . However there's no way to change worlds on the fly yet
Players are now stored in separate folder /players instead of in the world folder (!so move the folder!)
Fixed a memory leak/error in cPickup.cpp
Multiple worlds are stored in cRoot
cClientHandle lists are taken out of cWorld and now stored in cServer
Worlds now have names to distinguish them by
Some functions in the Core plugin now distinguish between worlds

git-svn-id: http://mc-server.googlecode.com/svn/trunk@40 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-01 21:57:08 +00:00

72 lines
1.6 KiB
C++

#pragma once
class cSocket;
class cSemaphore;
class cEvent;
class Game;
class cPacket;
class cChunk;
class cPlayer;
class cClientHandle // tolua_export
{ // tolua_export
public:
enum ENUM_PRIORITY
{
E_PRIORITY_LOW,
E_PRIORITY_NORMAL
};
cClientHandle(const cSocket & a_Socket);
~cClientHandle();
static const int VIEWDISTANCE = 13;
const cSocket & GetSocket();
cPlayer* GetPlayer() { return m_Player; } // tolua_export
void Kick( const char* a_Reason ); //tolua_export
void AddPacket( cPacket * a_Packet );
void HandlePendingPackets();
void StreamChunks();
void StreamChunksSmart( cChunk** a_Chunks, unsigned int a_NumChunks );
inline void SetLoggedIn( bool a_bLoggedIn ) { m_bLoggedIn = a_bLoggedIn; }
inline bool IsLoggedIn() { return m_bLoggedIn; }
void Tick(float a_Dt);
bool IsDestroyed() { return m_bDestroyed; }
void Destroy();
cChunk* m_LoadedChunks[VIEWDISTANCE*VIEWDISTANCE];
void Send( const cPacket & a_Packet, ENUM_PRIORITY a_Priority = E_PRIORITY_NORMAL );
static void SendThread( void *lpParam );
static void ReceiveThread( void *lpParam );
static void AuthenticateThread( void* a_Param );
const char* GetUsername();
private:
void HandlePacket( cPacket* a_Packet );
void RemovePacket( cPacket * a_Packet );
void SendLoginResponse();
struct sClientHandleState;
sClientHandleState* m_pState;
bool m_bDestroyed;
cPlayer* m_Player;
bool m_bKicking;
float m_TimeLastPacket;
bool m_bLoggedIn;
bool m_bSendLoginResponse;
bool m_bKeepThreadGoing;
}; // tolua_export