summaryrefslogtreecommitdiff
path: root/src/dashboard.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2018-02-21 06:27:02 -0600
committertom barrett <spalf0@gmail.com>2018-02-21 06:27:02 -0600
commitd42a28c46057c386d161bfe438302e2314f0a6f6 (patch)
tree9802462761e4e41bc4419b700e4a42b06919f5b5 /src/dashboard.rs
parent6fb01a0cb228b1aa08e47e8dbcd6b46c43bde06b (diff)
-got engine and dashboard data sending
Diffstat (limited to 'src/dashboard.rs')
-rw-r--r--src/dashboard.rs18
1 files changed, 18 insertions, 0 deletions
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<TcpStream>) {
+ 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);
+ }
+}