aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/customer/mod.rs2
-rw-r--r--server/src/game.rs2
-rw-r--r--server/src/protocol.rs4
-rw-r--r--test-client/visual.ts10
4 files changed, 10 insertions, 8 deletions
diff --git a/server/src/customer/mod.rs b/server/src/customer/mod.rs
index 23770ef2..fa67de57 100644
--- a/server/src/customer/mod.rs
+++ b/server/src/customer/mod.rs
@@ -146,7 +146,7 @@ impl CustomerManager {
id,
PacketS::Join {
name: "George".to_string(),
- character: 0,
+ character: -2,
},
));
let chair = select_chair(&mut self.chairs);
diff --git a/server/src/game.rs b/server/src/game.rs
index 973b257b..b478c037 100644
--- a/server/src/game.rs
+++ b/server/src/game.rs
@@ -32,7 +32,7 @@ pub struct Tile {
pub struct Player {
pub name: String,
- pub character: usize,
+ pub character: i32,
pub position: Vec2,
pub interacting: Option<IVec2>,
pub item: Option<Item>,
diff --git a/server/src/protocol.rs b/server/src/protocol.rs
index a629ffbf..a82dad96 100644
--- a/server/src/protocol.rs
+++ b/server/src/protocol.rs
@@ -24,7 +24,7 @@ pub struct DemandIndex(pub usize);
pub enum PacketS {
Join {
name: String,
- character: usize,
+ character: i32,
},
Leave,
Position {
@@ -66,7 +66,7 @@ pub enum PacketC {
AddPlayer {
id: PlayerID,
position: Vec2,
- character: usize,
+ character: i32,
name: String,
},
RemovePlayer {
diff --git a/test-client/visual.ts b/test-client/visual.ts
index 4bbfac6c..37ae732d 100644
--- a/test-client/visual.ts
+++ b/test-client/visual.ts
@@ -133,10 +133,12 @@ function draw_character(character: number) {
ctx.arc(0, 0, PLAYER_SIZE, 0, Math.PI * 2)
ctx.fill()
- ctx.fillStyle = `hsl(${character}rad, 80%, 10%)`
- ctx.beginPath()
- ctx.arc(0, -0.2, PLAYER_SIZE, 0, Math.PI * 2)
- ctx.fill()
+ if (character > 0) {
+ ctx.fillStyle = `hsl(${character}rad, 80%, 10%)`
+ ctx.beginPath()
+ ctx.arc(0, -0.2, PLAYER_SIZE, 0, Math.PI * 2)
+ ctx.fill()
+ }
ctx.fillStyle = `hsl(${character}rad, 80%, 70%)`
ctx.beginPath()