From afe1de0536f9b4fcf83e73c38c477fe111923ca2 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 31 Dec 2019 00:01:49 -0400 Subject: [PATCH] move padding logic from elseware into here --- src/packet/ship.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/packet/ship.rs b/src/packet/ship.rs index 885d007..c1f6a31 100644 --- a/src/packet/ship.rs +++ b/src/packet/ship.rs @@ -257,7 +257,12 @@ pub struct PlayerChat { } impl PlayerChat { - pub fn new(padding: u32, guildcard: u32, message: String) -> PlayerChat { + pub fn new(padding: u32, guildcard: u32, mut message: String) -> PlayerChat { + let mut mlen = (message.len() * 2) + 0x12; + while mlen & 0x07 != 0 { + message.push('\0'); + mlen += 1; + } PlayerChat { padding: padding, guildcard: guildcard,