|
@ -200,6 +200,7 @@ pub enum RecvShipPacket { |
|
|
KeyboardConfig(KeyboardConfig),
|
|
|
KeyboardConfig(KeyboardConfig),
|
|
|
GamepadConfig(GamepadConfig),
|
|
|
GamepadConfig(GamepadConfig),
|
|
|
UpdateConfig(UpdateConfig),
|
|
|
UpdateConfig(UpdateConfig),
|
|
|
|
|
|
UpdateTechMenu(UpdateTechMenu),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
impl RecvServerPacket for RecvShipPacket {
|
|
|
impl RecvServerPacket for RecvShipPacket {
|
|
@ -242,6 +243,7 @@ impl RecvServerPacket for RecvShipPacket { |
|
|
0x1ED => Ok(RecvShipPacket::SaveOptions(SaveOptions::from_bytes(data)?)),
|
|
|
0x1ED => Ok(RecvShipPacket::SaveOptions(SaveOptions::from_bytes(data)?)),
|
|
|
0x4ED => Ok(RecvShipPacket::KeyboardConfig(KeyboardConfig::from_bytes(data)?)),
|
|
|
0x4ED => Ok(RecvShipPacket::KeyboardConfig(KeyboardConfig::from_bytes(data)?)),
|
|
|
0x5ED => Ok(RecvShipPacket::GamepadConfig(GamepadConfig::from_bytes(data)?)),
|
|
|
0x5ED => Ok(RecvShipPacket::GamepadConfig(GamepadConfig::from_bytes(data)?)),
|
|
|
|
|
|
0x6ED => Ok(RecvShipPacket::UpdateTechMenu(UpdateTechMenu::from_bytes(data)?)),
|
|
|
0x7ED => Ok(RecvShipPacket::UpdateConfig(UpdateConfig::from_bytes(data)?)),
|
|
|
0x7ED => Ok(RecvShipPacket::UpdateConfig(UpdateConfig::from_bytes(data)?)),
|
|
|
_ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]), data.to_vec()))
|
|
|
_ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]), data.to_vec()))
|
|
|
}
|
|
|
}
|
|
@ -742,6 +744,9 @@ impl<EG: EntityGateway + Clone> ServerState for ShipServerState<EG> { |
|
|
let block = self.blocks.get_from_client(id, &self.clients).await?;
|
|
|
let block = self.blocks.get_from_client(id, &self.clients).await?;
|
|
|
handler::room::room_name_request(id, &block.client_location, &block.rooms).await?
|
|
|
handler::room::room_name_request(id, &block.client_location, &block.rooms).await?
|
|
|
},
|
|
|
},
|
|
|
|
|
|
RecvShipPacket::UpdateTechMenu(pkt) => {
|
|
|
|
|
|
handler::settings::update_tech_menu(id, pkt, &self.clients, &mut self.entity_gateway).await?
|
|
|
|
|
|
},
|
|
|
RecvShipPacket::UpdateConfig(pkt) => {
|
|
|
RecvShipPacket::UpdateConfig(pkt) => {
|
|
|
handler::settings::update_config(id, pkt, &self.clients, &mut self.entity_gateway).await?
|
|
|
handler::settings::update_config(id, pkt, &self.clients, &mut self.entity_gateway).await?
|
|
|
},
|
|
|
},
|
|
|