1
This commit is contained in:
parent
2d8089254c
commit
749e0f19cb
@ -5,15 +5,29 @@ namespace a8
|
|||||||
class WebSocketClient;
|
class WebSocketClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
A8_DECLARE_ENUM(PlayerState_e,
|
||||||
|
INIT = 0,
|
||||||
|
);
|
||||||
|
|
||||||
class Player
|
class Player
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void SendNotifyMsg(T& msg)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
int GetSocketId() { return socket_id_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
int socket_id_ = 0;
|
||||||
|
PlayerState_e state_ = PlayerState_e::INIT;
|
||||||
std::string account_id_;
|
std::string account_id_;
|
||||||
std::string session_id_;
|
std::string session_id_;
|
||||||
|
std::string remote_ip_;
|
||||||
|
int remote_port_ = 0;
|
||||||
|
|
||||||
std::shared_ptr<a8::WebSocketClient> web_socket_;
|
std::shared_ptr<a8::WebSocketClient> web_socket_;
|
||||||
|
|
||||||
|
@ -22,5 +22,6 @@ class PlayerMgr : public a8::Singleton<PlayerMgr>
|
|||||||
void CoCreatePlayer(int idx, f8::Coroutine* co);
|
void CoCreatePlayer(int idx, f8::Coroutine* co);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::map<int, std::shared_ptr<Player>> socket_id_hash_;
|
||||||
std::map<std::string, std::shared_ptr<Player>> account_id_hash_;
|
std::map<std::string, std::shared_ptr<Player>> account_id_hash_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user