fix
This commit is contained in:
6
room.go
6
room.go
@@ -6,14 +6,14 @@ import (
|
||||
)
|
||||
|
||||
type Room struct {
|
||||
Players map[string]*Player
|
||||
Players map[int64]*Player
|
||||
Input chan InputMessage
|
||||
mu sync.Mutex
|
||||
}
|
||||
|
||||
func NewRoom() *Room {
|
||||
return &Room{
|
||||
Players: make(map[string]*Player),
|
||||
Players: make(map[int64]*Player),
|
||||
Input: make(chan InputMessage, 128),
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ DONE:
|
||||
func (r *Room) broadcast() {
|
||||
r.mu.Lock()
|
||||
|
||||
state := make(map[string]map[string]any, len(r.Players))
|
||||
state := make(map[int64]map[string]any, len(r.Players))
|
||||
for id, p := range r.Players {
|
||||
state[id] = map[string]any{
|
||||
"x": p.X,
|
||||
|
||||
Reference in New Issue
Block a user