refactor: 重构战斗接口以分离控制器和绑定逻辑

This commit is contained in:
xinian
2026-04-29 04:01:45 +08:00
parent 6c76b050b3
commit 4f7f1b5072
32 changed files with 175 additions and 58 deletions

View File

@@ -85,7 +85,7 @@ func (h Controller) GroupEscape(data *GroupEscapeInboundInfo, c *player.Player)
if h.relayRemoteFightCommand(c, data.Head.CMD, data) {
return nil, -1
}
if fightC, ok := c.FightC.(*fight.FightC); ok && fightC != nil && fightC.LegacyGroupProtocol {
if fightC, ok := c.GetFightController().(*fight.FightC); ok && fightC != nil && fightC.LegacyGroupProtocol {
fightC.SendLegacyEscapeSuccess(c, int(data.ActorIndex))
}
h.dispatchFightActionEnvelope(c, fight.NewEscapeActionEnvelope())

View File

@@ -12,7 +12,7 @@ func (h Controller) relayRemoteFightCommand(c *player.Player, cmd uint32, data a
if c == nil || c.FightC == nil || cmd == 0 {
return false
}
remote, ok := c.FightC.(*pvp.RemoteFightProxy)
remote, ok := c.GetFightController().(*pvp.RemoteFightProxy)
if !ok || remote == nil {
return false
}