Version: v0.0.0-...-e366e6a Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2020 License: MIT Imports: 3 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type CharacterRace

type CharacterRace int

CharacterRace type

func (CharacterRace) String

func (cr CharacterRace) String() string

type Entity

type Entity struct {
	ID string `bson:"id,omitempty" json:"id"`
	// contains filtered or unexported fields

Entity ...

func NewEntity

func NewEntity() *Entity

NewEntity ...

type Party

type Party struct {
	*Entity    `bson:",inline"`
	Name       string               `json:"name"`
	Created    time.Time            `bson:"created,omitempty" json:"created,omitempty"`
	Characters []primitive.ObjectID `bson:"characters,omitempty" json:"characters,omitempty"`

Party data

type User

type User struct {
	*Entity `bson:",inline"`

	// main *unique* reference id, its additional to ID because it might be a list of reference ids in the future so a user
	// can merge multiple accounts (refids) into the same user object
	RefID string `json:"refid,omitempty"`

	// name and email should never be displayed in a game scenario
	Name  string `json:"name"`
	Email string `json:"email"`

	// nickname can be used to display a player/user in the case where character name is not applicable
	Nickname string `json:"nickname"`

	Created  time.Time `bson:"created" json:"created,omitempty"`
	LastSeen time.Time `bson:"lastSeen" json:"lastSeen,omitempty"`
	Picture  string    `json:"picture"`

	// every time the user logs in the last character is automatically loaded. When switched we track the last character in the user object while the
	// game server will switch completely to the new character
	LastCharacter string `bson:"lastCharacter" json:"lastCharacter"`

	// is set to false after the first PUT request
	IsNewUser bool `bson:"isNewUser" json:"isNewUser"`

	IsOnline bool `bson:"isOnline" json:"isOnline"`

User connects to login credentials to a user object

func NewUser

func NewUser() *User

NewUser creates a new user


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL