feat(cache): 添加复合键缓存操作支持

添加了基于 uint32+string 组合键的缓存操作方法,包括
GetByCompoundKey、SetByCompoundKey、DelByCompoundKey 和
ContainsByCompoundKey 方法,用于处理用户ID和会话ID的组合缓存场景

fix(vscode): 添加 cSpell 配置支持 struc 词汇

refactor(session): 移除过时的会话管理方法

移除了基于单一字符串键的会话管理方法,因为已迁移到使用
复合键的缓存操作方式
```
This commit is contained in:
昔念
2026-01-19 18:51:56 +08:00
parent 08ebf849eb
commit 026689f3ed
120 changed files with 1428 additions and 629 deletions

View File

@@ -3,7 +3,6 @@ package controller
import (
"blazing/common/data/share"
"blazing/cool"
"fmt"
"blazing/common/socket/errorcode"
@@ -11,7 +10,7 @@ import (
"blazing/logic/service/player"
"blazing/logic/service/space"
blservice "blazing/modules/blazing/service"
"blazing/modules/player/service"
"context"
"time"
@@ -27,13 +26,6 @@ func (h Controller) Login(data *user.MAIN_LOGIN_IN, c gnet.Conn) (result *user.L
return
}
kickErr := h.RPCClient.Kick(data.Head.UserID) //先踢人
if kickErr != nil {
fmt.Println("踢人失败", err)
}
cool.Logger.Info(context.TODO(), "踢人请求完成,继续登录流程")
share.ShareManager.SetUserOnline(data.Head.UserID, h.Port) //设置用户登录服务器
currentPlayer := player.GetPlayer(c, data.Head.UserID)
if currentPlayer == nil {
@@ -42,9 +34,9 @@ func (h Controller) Login(data *user.MAIN_LOGIN_IN, c gnet.Conn) (result *user.L
defer c.Close()
return
}
currentPlayer.Service = blservice.NewUserService(data.Head.UserID)
currentPlayer.Service = service.NewUserService(data.Head.UserID)
currentPlayer.Info = currentPlayer.Service.Info.Personself()
currentPlayer.Info = currentPlayer.Service.Info.GetCache()
if currentPlayer.Info == nil {
defer c.Close()