#pragma once #include #include #include #include class Player; class FCKlient; class NetworkMessage; class GameClient : public Framework::Thread { private: Player* zPlayer; FCKlient* client; Framework::Critical background; Framework::Critical foreground; Framework::Critical other; Framework::RCArray requests; Framework::RCArray backgroundQueue; Framework::RCArray foregroundQueue; Framework::Synchronizer foregroundQueueSync; Framework::Synchronizer backgroundQueueSync; Framework::Critical queueCs; Framework::Synchronizer emptyForegroundQueueSync; Framework::Synchronizer emptyBackgroundQueueSync; int viewDistance; bool first; bool online; bool finished; bool backgroundFinished; bool foregroundFinished; public: GameClient(Player* zPlayer, FCKlient* client); ~GameClient(); void thread() override; void reply(); void logout(); void addMessage(Framework::StreamReader* reader); bool isOnline() const; void sendResponse(NetworkMessage* response); Player* zEntity() const; void sendTypes(); class Message { public: inline static const unsigned char TERMINATE = 1; inline static const unsigned char WORLD_UPDATE = 2; inline static const unsigned char API_MESSAGE = 3; inline static const unsigned char POSITION_UPDATE = 4; }; };