This commit is contained in:
2026-01-12 18:42:34 -05:00
parent efb21705c3
commit 040b70e1c5
9 changed files with 517 additions and 196 deletions

View File

@@ -1,28 +1,30 @@
use crate::Client;
use iris::prelude::*;
use crate::{Client, Rsc};
use openworm::net::NetServerMsg;
pub fn debug(_client: &mut Client, ui: &mut Ui, _state: &UiState) {
ui.debug_layers();
// let mut file = std::fs::OpenOptions::new()
// .write(true)
// .create(true)
// .truncate(true)
// .open("./old_msgs")
// .unwrap();
// bincode::encode_into_std_write(
// self.msgs.clone(),
// &mut file,
// openworm::net::BINCODE_CONFIG,
// )
// .unwrap();
// 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();
impl Client {
pub fn debug(&mut self, rsc: &mut Rsc) {
rsc.ui.debug_layers();
// let mut file = std::fs::OpenOptions::new()
// .write(true)
// .create(true)
// .truncate(true)
// .open("./old_msgs")
// .unwrap();
// bincode::encode_into_std_write(
// self.msgs.clone(),
// &mut file,
// openworm::net::BINCODE_CONFIG,
// )
// .unwrap();
let mut file = std::fs::OpenOptions::new()
.read(true)
.open("/home/bryan/.local/share/openworm/old_msgs")
.unwrap();
let msgs: Vec<NetServerMsg> =
bincode::decode_from_std_read(&mut file, openworm::net::BINCODE_CONFIG).unwrap();
for msg in msgs {
println!("{msg:?}");
}
// client.ui.debug_layers();
}
}