|
@ -64,6 +64,7 @@ pub enum RecvShipPacket { |
|
|
Like62ButCooler(Like62ButCooler),
|
|
|
Like62ButCooler(Like62ButCooler),
|
|
|
ClientCharacterData(ClientCharacterData),
|
|
|
ClientCharacterData(ClientCharacterData),
|
|
|
DoneBursting(DoneBursting),
|
|
|
DoneBursting(DoneBursting),
|
|
|
|
|
|
LobbySelect(LobbySelect),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
impl RecvServerPacket for RecvShipPacket {
|
|
|
impl RecvServerPacket for RecvShipPacket {
|
|
@ -84,6 +85,7 @@ impl RecvServerPacket for RecvShipPacket { |
|
|
0x6D => Ok(RecvShipPacket::Like62ButCooler(Like62ButCooler::from_bytes(data)?)),
|
|
|
0x6D => Ok(RecvShipPacket::Like62ButCooler(Like62ButCooler::from_bytes(data)?)),
|
|
|
0x98 => Ok(RecvShipPacket::ClientCharacterData(ClientCharacterData::from_bytes(data)?)),
|
|
|
0x98 => Ok(RecvShipPacket::ClientCharacterData(ClientCharacterData::from_bytes(data)?)),
|
|
|
0x6F => Ok(RecvShipPacket::DoneBursting(DoneBursting::from_bytes(data)?)),
|
|
|
0x6F => Ok(RecvShipPacket::DoneBursting(DoneBursting::from_bytes(data)?)),
|
|
|
|
|
|
0x84 => Ok(RecvShipPacket::LobbySelect(LobbySelect::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()))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -112,6 +114,7 @@ pub enum SendShipPacket { |
|
|
Like62ButCooler(Like62ButCooler),
|
|
|
Like62ButCooler(Like62ButCooler),
|
|
|
BurstDone72(BurstDone72),
|
|
|
BurstDone72(BurstDone72),
|
|
|
DoneBursting(DoneBursting),
|
|
|
DoneBursting(DoneBursting),
|
|
|
|
|
|
LobbyList(LobbyList),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
impl SendServerPacket for SendShipPacket {
|
|
|
impl SendServerPacket for SendShipPacket {
|
|
@ -138,6 +141,7 @@ impl SendServerPacket for SendShipPacket { |
|
|
SendShipPacket::Like62ButCooler(pkt) => pkt.as_bytes(),
|
|
|
SendShipPacket::Like62ButCooler(pkt) => pkt.as_bytes(),
|
|
|
SendShipPacket::BurstDone72(pkt) => pkt.as_bytes(),
|
|
|
SendShipPacket::BurstDone72(pkt) => pkt.as_bytes(),
|
|
|
SendShipPacket::DoneBursting(pkt) => pkt.as_bytes(),
|
|
|
SendShipPacket::DoneBursting(pkt) => pkt.as_bytes(),
|
|
|
|
|
|
SendShipPacket::LobbyList(pkt) => pkt.as_bytes(),
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -300,6 +304,9 @@ impl<EG: EntityGateway> ServerState for ShipServerState<EG> { |
|
|
},
|
|
|
},
|
|
|
RecvShipPacket::DoneBursting(_) => {
|
|
|
RecvShipPacket::DoneBursting(_) => {
|
|
|
handler::room::done_bursting(id, &self.client_location, &mut self.rooms)
|
|
|
handler::room::done_bursting(id, &self.client_location, &mut self.rooms)
|
|
|
|
|
|
},
|
|
|
|
|
|
RecvShipPacket::LobbySelect(pkt) => {
|
|
|
|
|
|
Box::new(handler::lobby::change_lobby(id, pkt.lobby, &mut self.client_location, &self.clients, &self.level_table)?.into_iter())
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|