This repository has been archived on 2026-10-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Ananta-ps/internal/gameserver/routers/game_router_faction_invasion.go
T

64 lines
3.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package routers
import (
"context"
"sync"
)
var _ = sync.Mutex{}
var _ = context.Background
//
// 嘉姆入侵敌方地盘(Gangster Area / 势力地盘占领)。
// 官方这套玩法客户端是全的:MapSubSystem_Gangster.lua、GangsterAreaClientState.lua、
// BigMapComp_GangsterArea.lua,占领结果只是一个 S2C 推送
// SyncFactionInfluenceAreaOccupy(payload 只有 areaId + occupy 两个字段)。
// 服务端这边主线原本**一个字节都没有**,所以这是纯新增,不动任何既有琉轮。
// 一次入侵 = 三步,每步都能单独触发,方便蹚:
// 1. 传送到入侵点用现成的 TeleportWithLoadingAsync;
// 2. 两个随从用 SpawnAgentAsync(SpawnNpcAsync 那条走不通 —— 它们是 companion,没有自己的 FightSpirit);
// 3. 占领 = 推一个 Notify。
// ⛑ 本文件不负责把玩家变成嘉姆:切换角色是另一套琉轮,玩家自己在角色界面切到嘉姆后再用这里。
// 服务端只是「把人送到地方、把小弟放出来、tell 客户端这块地占了」。
//
//
// 推一次 SyncFactionInfluenceAreaOccupy(64830440):uint32 areaId + bool occupy。
// wire 已对着客户端 RPCDeserializeAuto.lua 的 midToReader[64830440] 核过 ——
// 它不是登录包,lua 那份是权威源(硬规则 239)。UxWriter.Bool 写 1 字节 0/1,
// 正好对 reader:ReadBoolean()。
//
func GameRouter_FactionInvasion_SyncAreaOccupyAsync(ctx context.Context, areaId uint32, occupy bool) any {
// Router implementation for GameRouter_FactionInvasion_SyncAreaOccupyAsync
var zero any; return zero
}
//
// 放一个随从。
// ⛑⛑ hostile 必须传 true:SpawnAgentAsync 开头就按
// AgentSummonCatalog 里登记的敌友属性对账,不一致直接拒
// (IsHostileClass(enemyClassType) => ect is 1 or 2 or 4 or 6 or 7,
// 而 40651920/40651921 的 EnemyClassType=1 ⇒ 在目录里算敌对单位)。
// 换来不被追打的是后面三个开关:engage=false 不给攻击 AI(也就不进敌人账本,
// 主线 EnemyAiActions 因此不会插手它),
// forceEnemyRelation=false 不标敌对关系(否则玩家能锁定自己人)。
// ⛑⛑ 2026-10-01:camp 原来是硬编码 0 ⇒ UnitCamp.MonsterDefault ⇒ 客户端把它当敌人
// (挂血条、可锁定、Companion 行为树不接管、空手出招)。而这两个模板在 AgentConfig 里
// 的 Camp 本来就是 1 = UnitCamp.PlayerDefault,它们的树分别是
// Companion_JiaMu_Shuangmawei(晴)/ Companion_Guys(盖斯)—— 战斗能力写在
// 行为树里、不在 AI 行为集里,所以服务端查不到攻击模组是正常的,别硬配。
// 现在读 gameplay.aether.companionCamp(默认 1)。
//
func GameRouter_FactionInvasion_SpawnCompanionAsync(ctx context.Context, agentId uint32, x float32, y float32, z float32, facing float32) any {
// Router implementation for GameRouter_FactionInvasion_SpawnCompanionAsync
var zero any; return zero
}
//
// 一次完整的入侵。三步都能单跑:对应布尔开关。返回给人看的多行明细。
//
func GameRouter_FactionInvasion_RunFactionInvasionAsync(ctx context.Context, eventId int32, teleport bool, summon bool, occupy bool) any {
// Router implementation for GameRouter_FactionInvasion_RunFactionInvasionAsync
var zero any; return zero
}