#ifndef CLIENT_SOCKET_H_INCLUDED #define CLIENT_SOCKET_H_INCLUDED #include "UserInfo.h" #include "misc.h" #include "MessageSender.h" struct TClientSocket : public boost::enable_shared_from_this { boost::asio::ip::tcp::socket Socket; boost::asio::io_service& IoService; boost::shared_ptr ConnectionTimeoutTimer; int AutorizationCode; int AutorizationCodeResponce; std::string AutorizationCodeResult; float BaseLon; float BaseLat; int BaseZoom; int LastSignal; int ReadDataLenLong; std::vector ReadData; TUserInfo UserInfo; bool BlockCloseOnError; bool BlockForceCloseMessage; TClientSocket(boost::asio::io_service& io_service); void Open(std::string address, std::string port); void ConnectTimeout(const boost::system::error_code& e); void OnAddressNotResolved(); void HandleConnect(const boost::system::error_code& error); void HandleReadAutorizationCode(const boost::system::error_code& error); void HandleReadAutorizationResult(const boost::system::error_code& error); void HandleReadSignal(const boost::system::error_code& error); void HandleReadDataLen(const boost::system::error_code& error); void HandleReadData(const boost::system::error_code& error); void HandleWrite(const boost::system::error_code& error); void CloseImmediate(); void SendMessageImmediate(std::string msg); void SendUserinfoUpdateImmediate(); void SendHeartbeatImmediate(); void SendMapQueryImmediate(); void SendAlarmMapQueryImmediate(); void SendKickPlayerImmediate(std::string lastName, std::string firstName, std::string middleName); void CloseThreaded(); void SendMessageThreaded(std::string msg); void SendUserinfoUpdateThreaded(); void SendHeartbeatThreaded(); void SendMapQueryThreaded(); void SendAlarmMapQueryThreaded(); void SendKickPlayerThreaded(std::string lastName, std::string firstName, std::string middleName); boost::signal ReceiveMessageSignal; boost::signal userInfoArr)> ReceiveMapSignal; boost::signal userInfoArr)> ReceiveAlarmMapSignal; boost::signal ReceiveForceCloseSignal; boost::signal ReceiveAutorizationSentSignal; }; #endif