mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-03 16:37:11 +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);
|
handle_session_setup(packet);
|
||||||
break;
|
break;
|
||||||
case bmp::State::Playing:
|
case bmp::State::Playing:
|
||||||
|
handle_playing(packet);
|
||||||
break;
|
break;
|
||||||
case bmp::State::Leaving:
|
case bmp::State::Leaving:
|
||||||
break;
|
break;
|
||||||
@ -274,7 +275,7 @@ void ServerNetwork::handle_session_setup(const bmp::Packet& packet) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case bmp::Purpose::StateChangePlaying: {
|
case bmp::Purpose::StateChangePlaying: {
|
||||||
spdlog::debug("Playing!");
|
spdlog::info("Playing!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -283,3 +284,13 @@ void ServerNetwork::handle_session_setup(const bmp::Packet& packet) {
|
|||||||
break;
|
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_authentication(const bmp::Packet& packet);
|
||||||
void handle_mod_download(const bmp::Packet& packet);
|
void handle_mod_download(const bmp::Packet& packet);
|
||||||
void handle_session_setup(const bmp::Packet& packet);
|
void handle_session_setup(const bmp::Packet& packet);
|
||||||
|
void handle_playing(const bmp::Packet& packet);
|
||||||
|
|
||||||
io_context m_io {};
|
io_context m_io {};
|
||||||
ip::tcp::socket m_tcp_socket { m_io };
|
ip::tcp::socket m_tcp_socket { m_io };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user