mchess-server/server/player.go
Marco eb946b4267 Many changes!
1. Use maintained websocket framework
2. Introduce function that allows to register a websocket connection per
   player
2023-04-22 21:41:24 +02:00

22 lines
281 B
Go

package server
import (
"github.com/google/uuid"
"nhooyr.io/websocket"
)
type Player struct {
Uuid uuid.UUID
Conn websocket.Conn
}
type PlayerInfo struct {
PlayerID uuid.UUID `json:"playerID"`
}
func NewPlayer(uuid uuid.UUID) *Player {
return &Player{
Uuid: uuid,
}
}