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

@@ -7,7 +7,8 @@ import (
"blazing/logic/service/item"
"blazing/logic/service/player"
"blazing/logic/service/user"
"blazing/modules/blazing/model"
"blazing/modules/player/model"
"strings"
)
// PlayerAim 玩家射击操作
@@ -160,3 +161,34 @@ func (h Controller) ChangePlayerCloth(data *item.ChangePlayerClothInboundInfo, p
return
}
func (h Controller) ChangePlayerName(data *user.ChangePlayerNameInboundInfo, c *player.Player) (result *user.ChangePlayerNameOutboundInfo, err errorcode.ErrorCode) {
newNickname := cool.Filter.Replace(strings.Trim(data.Nickname, "\x00"), '*')
c.Info.Nick = newNickname
result = &user.ChangePlayerNameOutboundInfo{
Nickname: newNickname,
UserID: c.Info.UserID,
}
c.GetSpace().Broadcast(c, data.Head.CMD, result)
return result, 0
}
func (h Controller) ChangeTile(data *user.ChangeTitleInboundInfo, c *player.Player) (result *user.ChangeTitleOutboundInfo, err errorcode.ErrorCode) {
result = &user.ChangeTitleOutboundInfo{
UserID: c.Info.UserID,
}
if data.TileID == 0 {
return result, 0
}
if !c.Service.Title.Can(data.TileID) {
return nil, errorcode.ErrorCodes.ErrSystemError
}
c.Info.Title = data.TileID
result.TileID = data.TileID
c.GetSpace().Broadcast(c, data.Head.CMD, result)
return result, 0
}