feat(cache): 添加复合键缓存操作支持 添加了基于 uint32+string 组合键的缓存操作方法,包括 GetByCompoundKey、SetByCompoundKey、DelByCompoundKey 和 ContainsByCompoundKey 方法,用于处理用户ID和会话ID的组合缓存场景 fix(vscode): 添加 cSpell 配置支持 struc 词汇 refactor(session): 移除过时的会话管理方法 移除了基于单一字符串键的会话管理方法,因为已迁移到使用 复合键的缓存操作方式 ```
21 lines
549 B
Go
21 lines
549 B
Go
package controller
|
|
|
|
import (
|
|
"blazing/common/socket/errorcode"
|
|
"blazing/cool"
|
|
"blazing/modules/player/service"
|
|
|
|
"blazing/logic/service/user"
|
|
"strings"
|
|
|
|
"github.com/panjf2000/gnet/v2"
|
|
)
|
|
|
|
// CreatePlayer 处理命令: 1001
|
|
func (h Controller) CreatePlayer(data *user.CreatePlayerInboundInfo, c gnet.Conn) (result *user.CreatePlayerOutInfo, err errorcode.ErrorCode) {
|
|
data.Nickname = strings.Trim(data.Nickname, "\x00")
|
|
service.NewUserService(data.Head.UserID).Info.Reg(cool.Filter.Replace(data.Nickname, '*'), data.Color)
|
|
|
|
return result, 0
|
|
}
|