2021-09-29 16:25:56 +08:00
|
|
|
package account
|
|
|
|
|
|
|
|
import (
|
|
|
|
"SciencesServer/app/service"
|
|
|
|
"SciencesServer/config"
|
|
|
|
"SciencesServer/utils"
|
|
|
|
)
|
|
|
|
|
2021-10-13 11:23:55 +08:00
|
|
|
type Logout struct {
|
|
|
|
*service.SessionEnterprise
|
|
|
|
local uint64
|
|
|
|
}
|
2021-09-29 16:25:56 +08:00
|
|
|
|
2021-10-13 11:23:55 +08:00
|
|
|
type LogoutHandle func(enterprise *service.SessionEnterprise, local uint64) *Logout
|
2021-09-29 16:25:56 +08:00
|
|
|
|
|
|
|
func (c *Logout) Launch() error {
|
|
|
|
service.Publish(config.EventForRedisHashDestroy, config.RedisKeyForAccount, utils.UintToString(c.UID))
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewLogout() LogoutHandle {
|
2021-10-13 11:23:55 +08:00
|
|
|
return func(enterprise *service.SessionEnterprise, local uint64) *Logout {
|
|
|
|
return &Logout{enterprise, local}
|
2021-09-29 16:25:56 +08:00
|
|
|
}
|
|
|
|
}
|