Browse Source

clean up

pbs
andy 5 years ago
parent
commit
bbd7aeff2a
  1. 5
      src/ship/ship.rs

5
src/ship/ship.rs

@ -317,11 +317,8 @@ impl<EG: EntityGateway> ShipServerState<EG> {
} }
fn player_chat(&mut self, id: ClientId, msg: &PlayerChat) -> Box<dyn Iterator<Item = (ClientId, SendShipPacket)>> { fn player_chat(&mut self, id: ClientId, msg: &PlayerChat) -> Box<dyn Iterator<Item = (ClientId, SendShipPacket)>> {
let mut cmsg = PlayerChat::new(0, 0, String::new());
let client = self.clients.get_mut(&id).ok_or(ShipError::ClientNotFound(id)).unwrap(); let client = self.clients.get_mut(&id).ok_or(ShipError::ClientNotFound(id)).unwrap();
cmsg.padding = 0x00010000;
cmsg.guildcard = client.user.guildcard.unwrap();
cmsg.message.push_str(msg.message.as_str());
let mut cmsg = PlayerChat::new(0x00010000, client.user.guildcard.unwrap(), msg.message.clone());
let mut mlen = (cmsg.message.len() * 2) + 0x12; let mut mlen = (cmsg.message.len() * 2) + 0x12;
while mlen & 0x07 != 0 { while mlen & 0x07 != 0 {
cmsg.message.push('\0'); cmsg.message.push('\0');

Loading…
Cancel
Save