From d42a28c46057c386d161bfe438302e2314f0a6f6 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Wed, 21 Feb 2018 06:27:02 -0600 Subject: -got engine and dashboard data sending --- src/dashboard.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/dashboard.rs (limited to 'src/dashboard.rs') diff --git a/src/dashboard.rs b/src/dashboard.rs new file mode 100644 index 0000000..3a3ec2b --- /dev/null +++ b/src/dashboard.rs @@ -0,0 +1,18 @@ +use std::io::BufReader; +use std::io::BufRead; +use std::net::TcpStream; + +extern crate serde_json; + +use ship::Ship; + +pub fn Dashboard(mut buff_r : BufReader) { + loop { + let mut data = String::new(); + buff_r.read_line(&mut data).unwrap(); + let ship : Ship = serde_json::from_str(&data).unwrap(); + println!("Location: ({},{},{})", ship.location.0, + ship.location.1, + ship.location.2); + } +} -- cgit v1.2.3