diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-07-29 03:44:10 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-07-29 19:38:39 +0900 |
| commit | d73fd8bf5bf589a4a391c867e980761fadb647ce (patch) | |
| tree | 15f2454b48cae461a6d8acc7edb2c2111d445d3e /backend/game/client.go | |
| parent | 3f95e0e6d62267cf8863e98f3ab7de8971a91000 (diff) | |
| download | iosdc-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.go | 5 |
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 { |
