Files
bl/logic/service/user/Login.go
昔念 fa928c9a48 ```
feat(common): 添加GlowFilter的Level字段

添加了GlowFilter结构体中的Level字段,用于表示等级信息,
对应JSON标签为"level,omitempty"

---

fix(utils): 修复concurrent_swiss_map中的panic处理

- 使用goroutine替代线程池来监听通道
- 添加panic恢复机制,当发生panic时记录错误日志
- 确保在异常情况下程序能够
2026-01-25 23:17:46 +08:00

52 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package user
import (
"blazing/cool"
"blazing/logic/service/common"
"fmt"
"blazing/modules/player/model"
"context"
"encoding/hex"
"github.com/gogf/gf/v2/os/glog"
)
// LoginSidInfo 登录携带的凭证结构体
type MAIN_LOGIN_IN struct { //这里直接使用组合来实现将传入的原始头部数据和结构体参数序列化
Head common.TomeeHeader `cmd:"1001" struc:"skip"` //玩家登录
Sid []byte `struc:"[16]byte"` // 登录会话ID固定长度16字节
}
func (l *MAIN_LOGIN_IN) CheakSession() bool {
// tt, _ := cool.CacheManager.Keys(context.Background())
//g.Dump(tt)
t1 := hex.EncodeToString(l.Sid)
r, err := cool.CacheManager.Get(context.Background(), fmt.Sprintf("session:%d", l.Head.UserID))
if err != nil {
return false
}
if r.String() != t1 {
return false
}
cool.CacheManager.Remove(context.Background(), fmt.Sprintf("session: %d", l.Head.UserID))
glog.Debug(context.Background(), "后端获取", t1, err)
return true
}
type LoginMSInfo struct {
model.PlayerInfo
}
func NewOutInfo(info *model.PlayerInfo) *LoginMSInfo {
l := &LoginMSInfo{
PlayerInfo: *info,
}
return l
}