aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/game/client.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-29 03:44:10 +0900
committernsfisis <nsfisis@gmail.com>2024-07-29 19:38:39 +0900
commitd73fd8bf5bf589a4a391c867e980761fadb647ce (patch)
tree15f2454b48cae461a6d8acc7edb2c2111d445d3e /backend/game/client.go
parent3f95e0e6d62267cf8863e98f3ab7de8971a91000 (diff)
downloadiosdc-japan-2024-albatross-d73fd8bf5bf589a4a391c867e980761fadb647ce.tar.gz
iosdc-japan-2024-albatross-d73fd8bf5bf589a4a391c867e980761fadb647ce.tar.zst
iosdc-japan-2024-albatross-d73fd8bf5bf589a4a391c867e980761fadb647ce.zip
feat: partially implement watching
Diffstat (limited to 'backend/game/client.go')
-rw-r--r--backend/game/client.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/backend/game/client.go b/backend/game/client.go
index 7cd66a4..fa699ce 100644
--- a/backend/game/client.go
+++ b/backend/game/client.go
@@ -12,12 +12,13 @@ type playerClient struct {
hub *gameHub
conn *websocket.Conn
s2cMessages chan playerMessageS2C
+ playerID int
}
// Receives messages from the client and sends them to the hub.
func (c *playerClient) readPump() {
defer func() {
- log.Printf("closing client")
+ log.Printf("closing player client")
c.hub.unregisterPlayer <- c
c.conn.Close()
}()
@@ -87,7 +88,7 @@ func (c *watcherClient) writePump() {
defer func() {
ticker.Stop()
c.conn.Close()
- log.Printf("closing watcher")
+ log.Printf("closing watcher client")
c.hub.unregisterWatcher <- c
}()
for {