mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
feat(gameplay): add player logout and disconnect handling
This commit is contained in:
@@ -99,13 +99,19 @@ asio::awaitable<void> NetworkClient::read_loop() {
|
||||
if (rsp.ParseFromArray(body_data.data(), body_data.size())) {
|
||||
m_world.receive_time(rsp);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case to_num(PacketEnum::PLAYER_INFO_RSP): {
|
||||
PlayerInfoRsp rsp;
|
||||
if (rsp.ParseFromArray(body_data.data(), body_data.size())) {
|
||||
m_world.receive_other_player(rsp);
|
||||
}
|
||||
} break;
|
||||
case to_num(PacketEnum::LOGOUT_RSP): {
|
||||
LogoutRsp rsp;
|
||||
if (rsp.ParseFromArray(body_data.data(), body_data.size())) {
|
||||
m_world.receive_player_logout(rsp);
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
} catch (const asio::system_error& e) {
|
||||
|
||||
Reference in New Issue
Block a user