refactor(common): 重构 common 模块
- 移除 global.go 文件 - 更新 player.go 中的玩家数据存储方式 - 删除 session.go 文件 - 调整 rpc.go 中的 RPC 客户端方法 - 更新 ServerEvent.go 中的会话管理 - 调整 controller 中的 Maincontroller 结构 - 更新 login.go 中的用户登录逻辑 - 调整 service 中的玩家数据获取方式 - 更新 admin/login.go 和 login.go 中的会话管理
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"blazing/common/data/cache"
|
||||
"blazing/common/data/entity"
|
||||
|
||||
"github.com/gogf/gf/v2/os/glog"
|
||||
@@ -48,7 +49,7 @@ func (s *Server) OnClose(c gnet.Conn, _ error) (action gnet.Action) {
|
||||
t := v.GetPlayer()
|
||||
if t != nil {
|
||||
glog.Debug(context.Background(), t.UserID, "断开连接")
|
||||
|
||||
cache.NewSessionManager().DeleteUserOnline(t.UserID) //设置用户登录服务器
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user