``feat(item): 新增物品出售价格属性(SellPrice)并实现物品出售功能,优化宠物面板计算和时区判断逻辑``
This commit is contained in:
33
logic/controller/user_create.go
Normal file
33
logic/controller/user_create.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"blazing/common/socket/errorcode"
|
||||
"blazing/cool"
|
||||
|
||||
"blazing/logic/service/player"
|
||||
"blazing/logic/service/user"
|
||||
blservice "blazing/modules/blazing/service"
|
||||
"strings"
|
||||
|
||||
"github.com/panjf2000/gnet/v2"
|
||||
)
|
||||
|
||||
// 处理命令: 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).Info.Reg(cool.Filter.Replace(data.Nickname, '*'), data.Color)
|
||||
return result, 0
|
||||
}
|
||||
|
||||
func (h *Controller) ChangePlayerName(data *user.ChangePlayerNameInboundInfo, c *player.Player) (result *user.ChangePlayerNameOutboundInfo, err errorcode.ErrorCode) {
|
||||
newnice := cool.Filter.Replace(strings.Trim(data.Nickname, "\x00"), '*')
|
||||
|
||||
c.Info.Nick = newnice
|
||||
result = &user.ChangePlayerNameOutboundInfo{
|
||||
Nickname: newnice,
|
||||
UserID: c.Info.UserID,
|
||||
}
|
||||
c.GetSpace().Broadcast(c, data.Head.CMD, result)
|
||||
|
||||
return result, 0
|
||||
}
|
||||
Reference in New Issue
Block a user