```
refactor(controller): 重构控制器函数命名和代码注释 - 重命名 EGG 函数为 EggGamePlay,更新宠物生成逻辑 - 重命名 Leiyi 函数为 GetLeiyiTrainStatus - 重命名 Cacthpet 函数为 CatchPet,添加详细函数注释 - 为 ArenaSetOwner、ArenaFightOwner、ArenaGetInfo、ArenaUpfight、ArenaOwnerAcce 等擂台相关函数添加注释前缀 - 重命名 PETKing 函数为 PetKing - 重命名 FRESH_CHOICE_FIGHT_LEVEL 函数为 FreshChoiceFightLevel,添加详细参数说明 - 重命名 BuyMItem 函数为 BuyMultipleItems - 重命名 ITEM_S
This commit is contained in:
@@ -12,19 +12,19 @@ import (
|
||||
"github.com/panjf2000/gnet/v2"
|
||||
)
|
||||
|
||||
// 处理命令: 1001
|
||||
func (h *Controller) CreatePlayer(data *user.CreatePlayerInboundInfo, c gnet.Conn) (result *user.CreatePlayerOutInfo, err errorcode.ErrorCode) {
|
||||
// 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")
|
||||
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"), '*')
|
||||
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 = newnice
|
||||
c.Info.Nick = newNickname
|
||||
result = &user.ChangePlayerNameOutboundInfo{
|
||||
Nickname: newnice,
|
||||
Nickname: newNickname,
|
||||
UserID: c.Info.UserID,
|
||||
}
|
||||
c.GetSpace().Broadcast(c, data.Head.CMD, result)
|
||||
|
||||
Reference in New Issue
Block a user