feat(currency_wars): complete systems, settlement Rank SS, damage report, camera and recovery fixes

This commit is contained in:
CAtlas0784 committed 2026-10-31 20:47:36 +07:00
1 parent c008243f11
commit 0995055296
78 files changed
+33840 -9525

No files matched your search

+86 -19
View File
@@ -53,28 +53,72 @@ func cwUseOrbs(s *Session, req *pb.IKMOCJBMGOJ) error {
for _, component := range run.NAGDJGMMCBE {
if v := component.GetDBAGKJNPDOL(); v != nil {
bag = v
break
}
}
if bag == nil {
return fmt.Errorf("CW Orb component missing")
}
owned := make(map[uint32]*pb.IBPDPCOGDEP, len(bag.MDKGCIKOMLI))
for _, orb := range bag.MDKGCIKOMLI {
if orb == nil || orb.UniqueId == 0 || owned[orb.UniqueId] != nil {
return fmt.Errorf("CW Orb inventory identity invalid")
}
owned[orb.UniqueId] = orb
}
uids := slices.Clone(req.CBMGDBJHLHO)
var uids []uint32
if req.IsGetAll {
uids = nil
if bag != nil {
for _, orb := range bag.MDKGCIKOMLI {
if orb != nil && orb.UniqueId != 0 {
uids = append(uids, orb.UniqueId)
}
}
}
if len(uids) == 0 {
// All rewards already claimed; acknowledge cleanly without error.
return nil
}
} else {
uids = slices.Clone(req.CBMGDBJHLHO)
}
if len(uids) == 0 {
return nil
}
owned := make(map[uint32]*pb.IBPDPCOGDEP)
if bag != nil {
for _, orb := range bag.MDKGCIKOMLI {
uids = append(uids, orb.UniqueId)
if orb != nil && orb.UniqueId != 0 && owned[orb.UniqueId] == nil {
owned[orb.UniqueId] = orb
}
}
}
if len(uids) == 0 {
return fmt.Errorf("no owned Orbs selected")
var toConsume []uint32
var alreadyConsumed []uint32
seen := make(map[uint32]bool, len(uids))
for _, uid := range uids {
if uid == 0 || seen[uid] {
continue
}
seen[uid] = true
if owned[uid] != nil {
toConsume = append(toConsume, uid)
} else {
alreadyConsumed = append(alreadyConsumed, uid)
}
}
// If none of the requested orbs are currently owned, all of them were already
// consumed or despawned. Acknowledge idempotently and re-send removal notify
// so any lingering ghost entities disappear from the client board without 6900 error.
if len(toConsume) == 0 {
var removalUpdates []*pb.KFNCAIHIHCM
for _, uid := range alreadyConsumed {
removalUpdates = append(removalUpdates, &pb.KFNCAIHIHCM{
MNLCHEJKDHO: &pb.KFNCAIHIHCM_GOHHJLAPMBB{GOHHJLAPMBB: uid},
})
}
if len(removalUpdates) > 0 {
_ = cwSend(s, cwNotify(removalUpdates...))
}
PacketLog(fmt.Sprintf("CW_USE_ORB ghost/already consumed uids=%v (acknowledged with removal sync)", alreadyConsumed))
return nil
}
recipes, err := common.LoadCurrencyWarsOrbRecipes()
if err != nil {
return err
@@ -88,11 +132,11 @@ func cwUseOrbs(s *Session, req *pb.IKMOCJBMGOJ) error {
return fmt.Errorf("CW stage missing")
}
used := map[uint32]bool{}
payouts := make([]cwOrbPayout, 0, len(uids))
for _, uid := range uids {
payouts := make([]cwOrbPayout, 0, len(toConsume))
for _, uid := range toConsume {
orb := owned[uid]
if orb == nil || used[uid] {
return fmt.Errorf("Orb UID %d missing or duplicated", uid)
continue
}
used[uid] = true
row, ok := captured.Orbs[orb.LDBNOMPCOKK]
@@ -154,10 +198,33 @@ func cwUseOrbs(s *Session, req *pb.IKMOCJBMGOJ) error {
return err
}
// Native OrbSummarizer requires source1 and first context uint=OrbUID.
if err = cwSend(s, &pb.GridFightSyncUpdateResultScNotify{GCPNIHHBGGD: []*pb.ABPLALCHNFA{{GridUpdateSrc: pb.JJDFGMMMCMI_JJDFGMMMCMI_DBIEKOMKBIN, OOEOCGLLHFO: []uint32{payout.UID}, JKPJFKCBIEM: payout.Updates}}}); err != nil {
// Include both source1 group and general removal group for complete entity cleanup.
if err = cwSend(s, &pb.GridFightSyncUpdateResultScNotify{
GCPNIHHBGGD: []*pb.ABPLALCHNFA{
{
GridUpdateSrc: pb.JJDFGMMMCMI_JJDFGMMMCMI_DBIEKOMKBIN,
OOEOCGLLHFO: []uint32{payout.UID},
JKPJFKCBIEM: payout.Updates,
},
{
JKPJFKCBIEM: []*pb.KFNCAIHIHCM{
{MNLCHEJKDHO: &pb.KFNCAIHIHCM_GOHHJLAPMBB{GOHHJLAPMBB: payout.UID}},
},
},
},
}); err != nil {
return err
}
}
if len(alreadyConsumed) > 0 {
var removalUpdates []*pb.KFNCAIHIHCM
for _, uid := range alreadyConsumed {
removalUpdates = append(removalUpdates, &pb.KFNCAIHIHCM{
MNLCHEJKDHO: &pb.KFNCAIHIHCM_GOHHJLAPMBB{GOHHJLAPMBB: uid},
})
}
_ = cwSend(s, cwNotify(removalUpdates...))
}
PacketLog(fmt.Sprintf("CW_USE_ORB saved count=%d revision=%d", len(payouts), s.currencyWarsRevision))
return nil
}