network: send player velocity

This commit is contained in:
2024-08-21 10:29:42 +02:00
parent 538e9fa8b9
commit bcc0e0095a
6 changed files with 12 additions and 19 deletions

View File

@@ -195,21 +195,10 @@ void Deserializer::DeserializePacketData(data::PlayerLeave& a_Packet) {
void Serializer::SerializePacketData(const data::PlayerList& a_Packet) {
m_Buffer << a_Packet.m_Players;
// m_Buffer << static_cast<std::uint8_t>(a_Packet.m_Players.size());
// for (auto player : a_Packet.m_Players) {
// m_Buffer << player.m_PlayerId << player.m_PlayerName;
// }
}
void Deserializer::DeserializePacketData(data::PlayerList& a_Packet) {
m_Buffer >> a_Packet.m_Players;
// std::uint8_t playerCount;
// m_Buffer >> playerCount;
// for (std::uint8_t i = 0; i < playerCount; i++) {
// PlayerInfo player;
// m_Buffer >> player.m_PlayerId >> player.m_PlayerName;
// a_Packet.m_Players.push_back(player);
// }
}
@@ -273,11 +262,11 @@ void Deserializer::DeserializePacketData(data::ChatMessage& a_Packet) {
void Serializer::SerializePacketData(const data::PlayerPositionAndRotation& a_Packet) {
m_Buffer << a_Packet.m_Player << a_Packet.m_Position << a_Packet.m_Rotation;
m_Buffer << a_Packet.m_Player << a_Packet.m_Position << a_Packet.m_Rotation << a_Packet.m_Velocity;
}
void Deserializer::DeserializePacketData(data::PlayerPositionAndRotation& a_Packet) {
m_Buffer >> a_Packet.m_Player >> a_Packet.m_Position >> a_Packet.m_Rotation;
m_Buffer >> a_Packet.m_Player >> a_Packet.m_Position >> a_Packet.m_Rotation >> a_Packet.m_Velocity;
}