user

package
v0.0.0-...-620f6c9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 8 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCharacter

func NewCharacter() (c *Character)

func NewUserInfo

func NewUserInfo(userName string) (u *UserInfo)

Types

type User

type User struct {
	UserInfo *UserInfo
	sync.RWMutex
}

func (*User) GetInfo

func (u *User) GetInfo() *UserInfo

func (*User) Login

func (u *User) Login(userInfo *UserInfo)

func (*User) SetCharacter

func (u *User) SetCharacter(setting *CharacterSetting) bool

type UserManager

type UserManager struct {
	sync.RWMutex
	UserOnline map[int64]*User
	Db         storage.Db
}
var Manager *UserManager

func NewUserManager

func NewUserManager(db storage.Db) *UserManager

func (*UserManager) GetUserInfo

func (um *UserManager) GetUserInfo(id int64) *UserInfo

func (*UserManager) Login

func (um *UserManager) Login(in *LoginInput) (*UserInfo, error)

func (*UserManager) Logout

func (um *UserManager) Logout(userId int64)

func (*UserManager) Regist

func (um *UserManager) Regist(in *RegistInput) (*Error, error)

Jump to

Keyboard shortcuts

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