fix(controller): 移除重复的昵称空字符过滤,仅在控制器层处理

This commit is contained in:
1
2025-10-23 06:06:28 +00:00
parent 3df38d5626
commit 0ccde910e5
2 changed files with 2 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ import (
// 处理命令: 1001
func (h *Controller) CreatePlayer(data *user.CreatePlayerInboundInfo, c gnet.Conn) (result *user.CreatePlayerOutInfo, err errorcode.ErrorCode) {
data.Nickname = strings.Trim(data.Nickname, "\x00")
blservice.NewUserService(data.Head.UserID).Reg(cool.Filter.Replace(data.Nickname, '*'), data.Color)
return result, 0
}

View File

@@ -31,7 +31,7 @@ func (s *UserService) Reg(nick string, color uint32) {
return
}
nick = strings.Trim(nick, "\x00")
t := model.NewPlayer()
t.PlayerID = uint64(s.userid)