fix(controller): 移除重复的昵称空字符过滤,仅在控制器层处理
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user