1
This commit is contained in:
parent
c22f7b1c7d
commit
ef58abcb27
@ -14,15 +14,20 @@ void Player::Init()
|
|||||||
|
|
||||||
void Player::CoNet(f8::Coroutine* co)
|
void Player::CoNet(f8::Coroutine* co)
|
||||||
{
|
{
|
||||||
|
co->Await(CoLogin);
|
||||||
|
co->Await(CoGame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::CoLogin(f8::Coroutine* co)
|
void Player::CoLogin(f8::Coroutine* co)
|
||||||
{
|
{
|
||||||
|
while (NetConnected()) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Player::CoGame(f8::Coroutine* co)
|
void Player::CoGame(f8::Coroutine* co)
|
||||||
{
|
{
|
||||||
|
while (NetConnected()) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -24,6 +24,7 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
int GetSocketId() { return socket_id_; }
|
int GetSocketId() { return socket_id_; }
|
||||||
|
bool NetConnected() { return net_connected_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -39,6 +40,8 @@ private:
|
|||||||
std::string remote_ip_;
|
std::string remote_ip_;
|
||||||
int remote_port_ = 0;
|
int remote_port_ = 0;
|
||||||
|
|
||||||
|
bool net_connected_ = false;
|
||||||
|
|
||||||
std::shared_ptr<a8::WebSocketClient> web_socket_;
|
std::shared_ptr<a8::WebSocketClient> web_socket_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user