aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorArne Dußin2021-02-03 16:26:59 +0100
committerArne Dußin2021-02-03 16:26:59 +0100
commit9ab689527b3ede7750579b1a926cf0cf88813463 (patch)
tree959894450512ebb10e86ed62058da1d7039614ef /src/net
parentd4c1c7ecb5688ef64f45425d9ac8e7ddeb8e8602 (diff)
downloadgraf_karto-9ab689527b3ede7750579b1a926cf0cf88813463.tar.gz
graf_karto-9ab689527b3ede7750579b1a926cf0cf88813463.zip
Add capability to draw rooms
Diffstat (limited to 'src/net')
-rw-r--r--src/net/cargo.rs9
-rw-r--r--src/net/server/connection_manager.rs2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/net/cargo.rs b/src/net/cargo.rs
index 34e6bb4..6e6ee41 100644
--- a/src/net/cargo.rs
+++ b/src/net/cargo.rs
@@ -16,11 +16,14 @@ pub enum Cargo {
/// Client -> Server: Request to add a wall to the map
AddWall(Wall),
/// Client <-> Server: Update the info of the icon with the given id.
- UpdateIcon((usize, Icon)),
+ /// Server -> Client can also create an item with this id.
+ SetIcon((usize, Icon)),
/// Client <-> Server: Update the info of the room with the given id.
- UpdateRoom((usize, Room)),
+ /// Server -> Client can also create an item with this id.
+ SetRoom((usize, Room)),
/// Client <-> Server: Update the info of the wall with the given id.
- UpdateWall((usize, Wall)),
+ /// Server -> Client can also create an item with this id.
+ SetWall((usize, Wall)),
/// Client -> Server: Request to apply the given matrix to the item with the provided id.
/// If the matrix cannot be applied to an item with the given id, it will do nothing.
ApplyMatrix((usize, Matrix3<f64>)),
diff --git a/src/net/server/connection_manager.rs b/src/net/server/connection_manager.rs
index c47aa32..b79ab2c 100644
--- a/src/net/server/connection_manager.rs
+++ b/src/net/server/connection_manager.rs
@@ -40,7 +40,7 @@ impl<'de, P: 'static + Send + Debug + DeserializeOwned + Serialize> ConnectionMa
};
let mut connections = connections.write().unwrap();
- let id = connections.next_free();
+ let id = dbg!(connections.next_free());
connections
.try_insert(id, Connection::start_rcv(id, stream, packet_tx.clone()))
.expect("Unable to insert client at supposedly valid id");