persistence + proper disconnect
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
use openworm::net::Msg;
|
||||
|
||||
use crate::Client;
|
||||
|
||||
pub fn debug(_client: &mut Client) {
|
||||
pub fn debug(client: &mut Client) {
|
||||
client.ui.debug_layers();
|
||||
// let mut file = std::fs::OpenOptions::new()
|
||||
// .write(true)
|
||||
// .create(true)
|
||||
@@ -15,14 +14,14 @@ pub fn debug(_client: &mut Client) {
|
||||
// openworm::net::BINCODE_CONFIG,
|
||||
// )
|
||||
// .unwrap();
|
||||
let mut file = std::fs::OpenOptions::new()
|
||||
.read(true)
|
||||
.open("./old_msgs")
|
||||
.unwrap();
|
||||
let msgs: Vec<Msg> =
|
||||
bincode::decode_from_std_read(&mut file, openworm::net::BINCODE_CONFIG).unwrap();
|
||||
for msg in msgs {
|
||||
println!("{msg:?}");
|
||||
}
|
||||
// let mut file = std::fs::OpenOptions::new()
|
||||
// .read(true)
|
||||
// .open("./old_msgs")
|
||||
// .unwrap();
|
||||
// let msgs: Vec<NetMsg> =
|
||||
// bincode::decode_from_std_read(&mut file, openworm::net::BINCODE_CONFIG).unwrap();
|
||||
// for msg in msgs {
|
||||
// println!("{msg:?}");
|
||||
// }
|
||||
// client.ui.debug_layers();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user