aboutsummaryrefslogtreecommitdiff
path: root/server/client-lib/src/network/sync.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/client-lib/src/network/sync.rs')
-rw-r--r--server/client-lib/src/network/sync.rs41
1 files changed, 21 insertions, 20 deletions
diff --git a/server/client-lib/src/network/sync.rs b/server/client-lib/src/network/sync.rs
index eaee72c4..4d6919c9 100644
--- a/server/client-lib/src/network/sync.rs
+++ b/server/client-lib/src/network/sync.rs
@@ -16,7 +16,7 @@
*/
use anyhow::Result;
-use hurrycurry_protocol::{PacketC, PacketS, BINCODE_CONFIG, VERSION};
+use hurrycurry_protocol::{PacketC, PacketS, VERSION};
use log::{debug, info, warn};
use std::{collections::VecDeque, net::TcpStream};
use tungstenite::{
@@ -104,17 +104,18 @@ impl Network {
None
}
},
- Ok(Message::Binary(packet)) => {
- match bincode::decode_from_slice(&packet, BINCODE_CONFIG) {
- Ok((packet, _)) => {
- debug!("<- {packet:?}");
- Some(packet)
- }
- Err(e) => {
- warn!("invalid bincode packet: {e:?}");
- None
- }
- }
+ Ok(Message::Binary(_packet)) => {
+ // match bincode::decode_from_slice(&packet, BINCODE_CONFIG) {
+ // Ok((packet, _)) => {
+ // debug!("<- {packet:?}");
+ // Some(packet)
+ // }
+ // Err(e) => {
+ // warn!("invalid bincode packet: {e:?}");
+ // None
+ // }
+ // }
+ None
}
Ok(_) => None,
Err(e) => {
@@ -130,14 +131,14 @@ impl Network {
for packet in self.queue_out.drain(..) {
debug!("-> {packet:?}");
- if self.use_bincode {
- self.sock.write(Message::Binary(
- bincode::encode_to_vec(&packet, BINCODE_CONFIG)?.into(),
- ))?;
- } else {
- self.sock
- .write(Message::Text(serde_json::to_string(&packet)?.into()))?;
- }
+ // if self.use_bincode {
+ // self.sock.write(Message::Binary(
+ // bincode::encode_to_vec(&packet, BINCODE_CONFIG)?.into(),
+ // ))?;
+ // } else {
+ self.sock
+ .write(Message::Text(serde_json::to_string(&packet)?.into()))?;
+ // }
}
self.sock.flush()?;