refactor: 重构入参类型引用
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -6,19 +6,20 @@ import (
|
||||
"blazing/modules/player/model"
|
||||
"sync/atomic"
|
||||
|
||||
"blazing/logic/service/common"
|
||||
"blazing/logic/service/fight"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/player"
|
||||
"blazing/logic/service/space"
|
||||
)
|
||||
|
||||
type ARENA_SET_OWENR struct {
|
||||
Head common.TomeeHeader `cmd:"2417" struc:"skip"`
|
||||
}
|
||||
|
||||
// ArenaSetOwner 处理玩家占据擂台的请求
|
||||
// public static const ARENA_SET_OWENR:uint = 2417;
|
||||
// 如果星际擂台上无人,站到星际擂台的包
|
||||
// 前端到后端无数据内容 空包
|
||||
// 后端到前端无数据内容 空包
|
||||
// ArenaSetOwner 都需要通过2419包广播更新擂台状态
|
||||
func (h Controller) ArenaSetOwner(data *fight.ARENA_SET_OWENR, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) ArenaSetOwner(data *ARENA_SET_OWENR, c *player.Player) (result *struct{}, err errorcode.ErrorCode) {
|
||||
r := c.CanFight()
|
||||
if r != 0 {
|
||||
return nil, r
|
||||
@@ -34,13 +35,13 @@ func (h Controller) ArenaSetOwner(data *fight.ARENA_SET_OWENR, c *player.Player)
|
||||
|
||||
return nil, errorcode.ErrorCodes.ErrChampionExists
|
||||
}
|
||||
|
||||
type ARENA_FIGHT_OWENR struct {
|
||||
Head common.TomeeHeader `cmd:"2418" struc:"skip"`
|
||||
}
|
||||
// ArenaFightOwner 挑战擂台的包
|
||||
// 前端到后端无数据内容 空包
|
||||
// 后端到前端无数据内容 空包
|
||||
// 还是后端主动发送2503的包给双方前端后 等待前端加载完毕 主动发送2404包通知后端开始战斗
|
||||
// ArenaFightOwner 并不会通知对方是否接受挑战。只要有人挑战就直接进入对战
|
||||
func (h Controller) ArenaFightOwner(data1 *fight.ARENA_FIGHT_OWENR, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) ArenaFightOwner(data1 *ARENA_FIGHT_OWENR, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
|
||||
r := c.CanFight()
|
||||
if r != 0 {
|
||||
@@ -141,17 +142,15 @@ func (h Controller) ArenaFightOwner(data1 *fight.ARENA_FIGHT_OWENR, c *player.Pl
|
||||
// ArenaGetInfo 获取星际擂台信息的包 进入空间站地图前端会发送请求包 或者 有人站到星际擂台上后 广播回包
|
||||
// 前端到后端无数据内容
|
||||
// ArenaGetInfo 后端到前端
|
||||
func (h Controller) ArenaGetInfo(data *fight.ARENA_GET_INFO, c *player.Player) (result *space.ARENA, err errorcode.ErrorCode) {
|
||||
func (h Controller) ArenaGetInfo(data *ARENA_GET_INFO, c *player.Player) (result *space.ARENA, err errorcode.ErrorCode) {
|
||||
|
||||
result = &c.GetSpace().Owner
|
||||
return
|
||||
}
|
||||
|
||||
// ArenaUpfight 放弃擂台挑战的包
|
||||
// 前端到后端无数据内容
|
||||
// 后端到前端无数据内容
|
||||
// ArenaUpfight 都需要通过2419包广播更新擂台状态
|
||||
func (h Controller) ArenaUpfight(data *fight.ARENA_UPFIGHT, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) ArenaUpfight(data *ARENA_UPFIGHT, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
//原子操作,修改擂台状态
|
||||
if atomic.LoadUint32(&c.GetSpace().Owner.UserID) != c.GetInfo().UserID { //说明已经有人了
|
||||
return nil, errorcode.ErrorCodes.ErrChampionCannotCancel
|
||||
@@ -173,7 +172,7 @@ func (h Controller) ArenaUpfight(data *fight.ARENA_UPFIGHT, c *player.Player) (r
|
||||
// 后端到前端无数据内容
|
||||
// public static const ARENA_OWENR_OUT:uint = 2423;
|
||||
// ArenaOwnerAcce 此包不清楚具体怎么触发 但已知此包为后端主动发送。不清楚什么情况下回用到
|
||||
func (h Controller) ArenaOwnerAcce(data *fight.ARENA_OWENR_ACCE, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) ArenaOwnerAcce(data *ARENA_OWENR_ACCE, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
|
||||
s := c.GetSpace()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user