mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-02 07:56:26 +00:00
add playing state
This commit is contained in:
parent
4dad60bc52
commit
6a7bf72df5
@ -77,6 +77,7 @@ void ServerNetwork::handle_packet(const bmp::Packet& packet) {
|
||||
handle_session_setup(packet);
|
||||
break;
|
||||
case bmp::State::Playing:
|
||||
handle_playing(packet);
|
||||
break;
|
||||
case bmp::State::Leaving:
|
||||
break;
|
||||
@ -274,7 +275,7 @@ void ServerNetwork::handle_session_setup(const bmp::Packet& packet) {
|
||||
break;
|
||||
}
|
||||
case bmp::Purpose::StateChangePlaying: {
|
||||
spdlog::debug("Playing!");
|
||||
spdlog::info("Playing!");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -283,3 +284,13 @@ void ServerNetwork::handle_session_setup(const bmp::Packet& packet) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ServerNetwork::handle_playing(const bmp::Packet& packet) {
|
||||
switch (packet.purpose) {
|
||||
default:
|
||||
spdlog::error("Got 0x{:x} in state {}. This is not allowed. Disconnecting", uint16_t(packet.purpose), int(m_state));
|
||||
// todo: disconnect gracefully
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ private:
|
||||
void handle_authentication(const bmp::Packet& packet);
|
||||
void handle_mod_download(const bmp::Packet& packet);
|
||||
void handle_session_setup(const bmp::Packet& packet);
|
||||
void handle_playing(const bmp::Packet& packet);
|
||||
|
||||
io_context m_io {};
|
||||
ip::tcp::socket m_tcp_socket { m_io };
|
||||
|
Loading…
x
Reference in New Issue
Block a user