feat(currency_wars): complete systems, settlement Rank SS, damage report, camera and recovery fixes
This commit is contained in:
1 parent
c008243f11
commit
0995055296
78 files changed
+33840
-9525
No files matched your search
@@ -11,6 +11,27 @@ func cwEquipTrackSync(player *pb.NIHNGPKHEPC) *pb.GridFightSyncUpdateResultScNot
|
||||
return cwNotify(&pb.KFNCAIHIHCM{MNLCHEJKDHO: &pb.KFNCAIHIHCM_BMGFDIKDOBE{BMGFDIKDOBE: &pb.MDKHMNKAECP{MIIDIMOCPEB: player.MIIDIMOCPEB}}})
|
||||
}
|
||||
|
||||
func cwTraitTrackSync(player *pb.NIHNGPKHEPC) *pb.GridFightSyncUpdateResultScNotify {
|
||||
return cwNotify(&pb.KFNCAIHIHCM{
|
||||
MNLCHEJKDHO: &pb.KFNCAIHIHCM_HGNDMOODNKF{
|
||||
HGNDMOODNKF: &pb.FBCIJONDIJE{
|
||||
ONHDKLIMLNM: append([]uint32(nil), player.ONHDKLIMLNM...),
|
||||
GHJLDDEDJLI: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func cwSpotLightTrackSync(spot *pb.GNOBLNOCEHA) *pb.GridFightSyncUpdateResultScNotify {
|
||||
return cwNotify(&pb.KFNCAIHIHCM{
|
||||
MNLCHEJKDHO: &pb.KFNCAIHIHCM_POLBMPCKFDO{
|
||||
POLBMPCKFDO: &pb.FFECECBAEEH{
|
||||
DKEIDONNDCJ: append([]*pb.OGEIHMPCFKA(nil), spot.DKEIDONNDCJ...),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// This Client's CreateServerTrackUpdateInfo takes (roleID, enabled, desired,
|
||||
// equipped, priority, source). AddTrackToLastAndSend passes true; RemoveEquipTrack
|
||||
// passes false with empty lists and source None. The boolean is NOT a delete flag.
|
||||
@@ -117,4 +138,93 @@ func init() {
|
||||
rsp.Retcode = 0
|
||||
return nil
|
||||
})
|
||||
cwHandleNamed("MCDBJHOCGHI", "IIFPPBCFBBC", func(s *Session, req *pb.MCDBJHOCGHI, rsp *pb.IIFPPBCFBBC) error {
|
||||
rsp.Retcode = uint32(pb.Retcode_RET_GRID_FIGHT_PARAM_NOT_MATCH)
|
||||
if req == nil || req.TraitId == 0 {
|
||||
return nil
|
||||
}
|
||||
catalog, data, err := cwPreparingData(s)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
player, _, _ := cwComponents(data.DHFOFLFCLAH)
|
||||
if player == nil {
|
||||
return nil
|
||||
}
|
||||
traitsCatalog, err := common.LoadCurrencyWarsTraits(catalog)
|
||||
if err != nil {
|
||||
PacketLog("CW_TRAIT_TRACK rejected: " + err.Error())
|
||||
return nil
|
||||
}
|
||||
if _, ok := traitsCatalog.Trait(req.TraitId); !ok {
|
||||
PacketLog(fmt.Sprintf("CW_TRAIT_TRACK unknown trait=%d", req.TraitId))
|
||||
return nil
|
||||
}
|
||||
var updated []uint32
|
||||
found := false
|
||||
for _, id := range player.ONHDKLIMLNM {
|
||||
if id == req.TraitId {
|
||||
found = true
|
||||
if req.BJDOINAHDLN {
|
||||
updated = append(updated, id)
|
||||
}
|
||||
} else {
|
||||
updated = append(updated, id)
|
||||
}
|
||||
}
|
||||
if req.BJDOINAHDLN && !found {
|
||||
updated = append(updated, req.TraitId)
|
||||
}
|
||||
player.ONHDKLIMLNM = updated
|
||||
if err = s.saveCurrencyWarsData(data, catalog); err != nil {
|
||||
return nil
|
||||
}
|
||||
if err = cwSend(s, cwTraitTrackSync(player)); err != nil {
|
||||
return err
|
||||
}
|
||||
rsp.Retcode = 0
|
||||
PacketLog(fmt.Sprintf("CW_TRAIT_TRACK trait=%d enabled=%t total=%d revision=%d", req.TraitId, req.BJDOINAHDLN, len(player.ONHDKLIMLNM), s.currencyWarsRevision))
|
||||
return nil
|
||||
})
|
||||
cwHandle("GridFightUpdateSpotLightTrack", func(s *Session, req *pb.GridFightUpdateSpotLightTrackCsReq, rsp *pb.GridFightUpdateSpotLightTrackScRsp) error {
|
||||
rsp.Retcode = uint32(pb.Retcode_RET_GRID_FIGHT_PARAM_NOT_MATCH)
|
||||
if req == nil {
|
||||
return nil
|
||||
}
|
||||
catalog, data, err := cwPreparingData(s)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
cwEnsureSpotlights(data.DHFOFLFCLAH)
|
||||
spotlights := cwSpotlights(data.DHFOFLFCLAH)
|
||||
entries := append([]*pb.OGEIHMPCFKA(nil), spotlights.DKEIDONNDCJ...)
|
||||
for _, update := range req.ACCFJKBOJIJ {
|
||||
if update == nil || update.LDLDLHBCFCF == nil || update.LDLDLHBCFCF.RoleId == 0 {
|
||||
continue
|
||||
}
|
||||
track := update.LDLDLHBCFCF
|
||||
kept := make([]*pb.OGEIHMPCFKA, 0, len(entries)+1)
|
||||
for _, old := range entries {
|
||||
if old.RoleId == track.RoleId {
|
||||
continue
|
||||
}
|
||||
kept = append(kept, old)
|
||||
}
|
||||
if update.BJDOINAHDLN && len(track.DKEIDONNDCJ) > 0 {
|
||||
kept = append(kept, track)
|
||||
}
|
||||
entries = kept
|
||||
}
|
||||
sort.SliceStable(entries, func(i, j int) bool { return entries[i].NALMBOOCCIN < entries[j].NALMBOOCCIN })
|
||||
spotlights.DKEIDONNDCJ = entries
|
||||
if err = s.saveCurrencyWarsData(data, catalog); err != nil {
|
||||
return nil
|
||||
}
|
||||
if err = cwSend(s, cwSpotLightTrackSync(spotlights)); err != nil {
|
||||
return err
|
||||
}
|
||||
rsp.Retcode = 0
|
||||
PacketLog(fmt.Sprintf("CW_SPOTLIGHT_TRACK saved updates=%d tracks=%d revision=%d", len(req.ACCFJKBOJIJ), len(entries), s.currencyWarsRevision))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user