blob: 82f73f94920fac145b347558723f058518ff1861 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
extern crate serde_json;
use std::io::Write;
use std::collections::HashMap;
use mass::Mass;
use connection::Connection;
impl Connection {
pub fn server_dashboard(&mut self, masses : &mut HashMap<String, Mass>) -> bool {
let ship = masses.get(&self.name).unwrap();
let send = serde_json::to_string(&ship).unwrap();
match self.stream.write(send.as_bytes()) {
Ok(_result) => true,
Err(_error) => false,
}
}
}
|