2022-12-14 21:19:47 +00:00
|
|
|
package server
|
|
|
|
|
2023-04-18 20:19:28 +00:00
|
|
|
import (
|
|
|
|
"github.com/google/uuid"
|
2023-04-22 19:41:24 +00:00
|
|
|
"nhooyr.io/websocket"
|
2023-04-18 20:19:28 +00:00
|
|
|
)
|
2022-12-14 21:19:47 +00:00
|
|
|
|
|
|
|
type Player struct {
|
2023-04-22 19:41:24 +00:00
|
|
|
Uuid uuid.UUID
|
|
|
|
Conn websocket.Conn
|
|
|
|
}
|
|
|
|
|
|
|
|
type PlayerInfo struct {
|
|
|
|
PlayerID uuid.UUID `json:"playerID"`
|
2022-12-14 21:19:47 +00:00
|
|
|
}
|
|
|
|
|
2023-04-18 20:19:28 +00:00
|
|
|
func NewPlayer(uuid uuid.UUID) *Player {
|
2022-12-14 21:19:47 +00:00
|
|
|
return &Player{
|
2023-04-22 19:41:24 +00:00
|
|
|
Uuid: uuid,
|
2022-12-14 21:19:47 +00:00
|
|
|
}
|
|
|
|
}
|