CacheService

package
v0.0.0-...-75e9581 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheGetFromALLUser = func(connectionID string) *userCache {
	if x, found := pCacheInstance.allUsers.Get(connectionID); found {
		return x.(*userCache)
	}
	user := userCache{}
	user.SaveUser(connectionID)
	return &user
}
View Source
var CacheGetUser = func(connectionID string) *LoginUser {
	if x, found := pCacheInstance.inLoginProcessUser.Get(connectionID); found {
		return x.(*LoginUser)
	}
	newcache := LoginUser{
		User:         Player.User{},
		Step:         0,
		connectionID: connectionID,
	}
	newcache.SaveUser()
	return &newcache
}

處理登入成功的User Cache

Functions

func RemoveAllCacheByConnectionID

func RemoveAllCacheByConnectionID(connectionID string)

新增一個Cache,也要加移除段落

Types

type LoginUser

type LoginUser struct {
	User        Player.User
	Step        int
	LoginFailed int
	// contains filtered or unexported fields
}

func (*LoginUser) RemoveUser

func (c *LoginUser) RemoveUser()

func (*LoginUser) SaveUser

func (c *LoginUser) SaveUser()

func (*LoginUser) SetLoginFailed

func (c *LoginUser) SetLoginFailed()

func (*LoginUser) SetStep

func (c *LoginUser) SetStep(step int)

Jump to

Keyboard shortcuts

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