feat(chat): 删除无用的包声明

移除了 chat.go 文件中多余的 package controller 声明,该文件目前不包含任何逻辑实现。

feat(user): 新增瞄准功能接口及数据结构

在用户控制器中增加了 Aimat 方法,用于处理玩家的瞄准操作,并广播给同地图其他玩家。
同时在 user 包中添加了与瞄准相关的入参和出参结构体定义,包括 ItemId、ShootType 和 Point 等字段。
```
This commit is contained in:
2025-10-20 01:39:07 +08:00
parent d673ee4776
commit f53028d1fc
3 changed files with 37 additions and 1 deletions

View File

@@ -2,7 +2,9 @@ package controller
import (
"blazing/common/socket/errorcode"
"blazing/logic/service/common"
"blazing/logic/service/player"
"blazing/logic/service/space"
"blazing/logic/service/user"
"github.com/jinzhu/copier"
@@ -31,3 +33,20 @@ func (h Controller) UserMoreInfo(data *user.MoreUserInfoInboundInfo, c *player.P
//todo 待实现
return ret, 0
}
func (h Controller) Aimat(data *user.AimatInboundInfo, c *player.Player) (result *user.AimatOutboundInfo, err errorcode.ErrorCode) {
ret := &user.AimatOutboundInfo{
ItemId: data.ItemId,
Point: data.Point,
ShootType: data.ShootType,
UserId: c.Info.UserID,
}
defer space.GetSpace(c.Info.MapID).User.IterCb(func(playerID uint32, player common.PlayerI) {
data.Head.Result = 0
player.SendPack(data.Head.Pack(ret))
})
return ret, -1
}