You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
hexmap/server/state/user.go

21 lines
574 B

package state
import "go.uber.org/zap/zapcore"
// UserData contains data about clients that is synced between client and server.
// Unlike the map, UserData is not persisted to disk, and all UserData is lost on shutdown.
type UserData struct {
ActiveColor HexColor `json:"activeColor"`
}
func (u UserData) MarshalLogObject(encoder zapcore.ObjectEncoder) error {
encoder.AddString("activeColor", u.ActiveColor.String())
return nil
}
// Copy creates a deep copy of this UserData.
func (u UserData) Copy() UserData {
return UserData{
ActiveColor: u.ActiveColor,
}
}