Merge branch 'zesterer/net-fixes' into 'master'

Network fix for 32-bit

See merge request veloren/veloren!238
This commit is contained in:
Joshua Barretto 2019-06-16 22:01:18 +00:00
commit 121d9e0d61

View File

@ -204,7 +204,8 @@ impl<S: PostMsg, R: PostMsg> PostBox<S, R> {
*/
// Assemble into packet.
let mut packet_bytes = msg_bytes.len().to_le_bytes().as_ref().to_vec();
let mut packet_bytes =
(msg_bytes.len() as u64).to_le_bytes().as_ref().to_vec();
packet_bytes.push(msg_bytes.iter().fold(0, |a, x| a ^ *x));
packet_bytes.append(&mut msg_bytes);