Update GaCy-GO
This commit is contained in:
1 parent
da8a32f60d
commit
0cbe460e49
345 files changed
+98202
-77559
No files matched your search
@@ -248,7 +248,13 @@ func cwNextRound(catalog *common.CurrencyWarsCatalog, run *pb.MPIMAEMCEFH) (*pb.
|
||||
}
|
||||
}
|
||||
}
|
||||
if pending == nil || pending.QueuePosition <= run.FMIGOKIDKJL.QueuePosition {
|
||||
if pending == nil {
|
||||
pending, err = cwGeneratedRoundPreparation(catalog, run)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if pending.QueuePosition <= run.FMIGOKIDKJL.QueuePosition {
|
||||
return nil, fmt.Errorf("CW next round recipe missing")
|
||||
}
|
||||
if err = cwRestockForNode(catalog, run); err != nil {
|
||||
@@ -257,12 +263,25 @@ func cwNextRound(catalog *common.CurrencyWarsCatalog, run *pb.MPIMAEMCEFH) (*pb.
|
||||
player, _, shop := cwComponents(run)
|
||||
queue := run.FMIGOKIDKJL.QueuePosition
|
||||
run.FMIGOKIDKJL = pending
|
||||
return cwNotify(cwShopSync(shop), cwFinish(queue), cwUnlock(), &pb.KFNCAIHIHCM{MNLCHEJKDHO: &pb.KFNCAIHIHCM_JOMFJHOCHJP{JOMFJHOCHJP: player.GAJGBBFELEL}}, &pb.KFNCAIHIHCM{MNLCHEJKDHO: &pb.KFNCAIHIHCM_FMIGOKIDKJL{FMIGOKIDKJL: pending}}), nil
|
||||
aligned, err := cwAlignEncounterCamp(catalog, run)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
updates := []*pb.KFNCAIHIHCM{cwShopSync(shop), cwFinish(queue), cwUnlock(), {MNLCHEJKDHO: &pb.KFNCAIHIHCM_JOMFJHOCHJP{JOMFJHOCHJP: player.GAJGBBFELEL}}}
|
||||
if aligned {
|
||||
updates = append(updates, &pb.KFNCAIHIHCM{MNLCHEJKDHO: &pb.KFNCAIHIHCM_OOICHLAMNIG{OOICHLAMNIG: &pb.AINFNFIDGFF{DCAHJELNJNP: stage.DCAHJELNJNP, SectionId: stage.SectionId, IMPNAHBCADN: stage.IMPNAHBCADN}}})
|
||||
}
|
||||
updates = append(updates, &pb.KFNCAIHIHCM{MNLCHEJKDHO: &pb.KFNCAIHIHCM_FMIGOKIDKJL{FMIGOKIDKJL: pending}})
|
||||
return cwNotify(updates...), nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
handle("GridFightUpdatePos", func(s *Session, req *pb.GridFightUpdatePosCsReq, rsp *pb.GridFightUpdatePosScRsp) error {
|
||||
cwHandle("GridFightUpdatePos", func(s *Session, req *pb.GridFightUpdatePosCsReq, rsp *pb.GridFightUpdatePosScRsp) error {
|
||||
rsp.Retcode = uint32(pb.Retcode_RET_GRID_FIGHT_PARAM_NOT_MATCH)
|
||||
if _, active := CURRENT_BATTLE.Load(s.Token); active {
|
||||
PacketLog("CW_UPDATE_POS rejected reason=battle_active")
|
||||
return nil
|
||||
}
|
||||
catalog, err := common.LoadCurrencyWarsCatalog()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -350,7 +369,7 @@ func init() {
|
||||
pos := forge.Pos
|
||||
if _, changed := changes[forge.UniqueId]; changed {
|
||||
return nil
|
||||
} // Forge movement needs its separately verified sync arm.
|
||||
} // Projection movement needs its separately verified sync arm.
|
||||
if pos != 0 {
|
||||
if occupied[pos] {
|
||||
rsp.Retcode = uint32(pb.Retcode_RET_GRID_FIGHT_POS_EXIST_ROLE)
|
||||
@@ -359,6 +378,21 @@ func init() {
|
||||
occupied[pos] = true
|
||||
}
|
||||
}
|
||||
for _, forge := range team.PMEOPPDAMLM {
|
||||
owned[forge.UniqueId] = true
|
||||
pos := forge.Pos
|
||||
if v, ok := changes[forge.UniqueId]; ok {
|
||||
pos = v
|
||||
}
|
||||
if pos == 0 || uint64(pos) <= activeEnd || uint64(pos) > benchEnd {
|
||||
return nil
|
||||
}
|
||||
if occupied[pos] {
|
||||
rsp.Retcode = uint32(pb.Retcode_RET_GRID_FIGHT_POS_EXIST_ROLE)
|
||||
return nil
|
||||
}
|
||||
occupied[pos] = true
|
||||
}
|
||||
for id := range changes {
|
||||
if !owned[id] {
|
||||
rsp.Retcode = uint32(pb.Retcode_RET_GRID_FIGHT_ROLE_NOT_EXIST)
|
||||
@@ -376,10 +410,16 @@ func init() {
|
||||
updates = append(updates, &pb.KFNCAIHIHCM{MNLCHEJKDHO: &pb.KFNCAIHIHCM_CFOCDALNCBP{CFOCDALNCBP: role}})
|
||||
}
|
||||
}
|
||||
for _, forge := range team.PMEOPPDAMLM {
|
||||
if pos, ok := changes[forge.UniqueId]; ok {
|
||||
forge.Pos = pos
|
||||
updates = append(updates, &pb.KFNCAIHIHCM{MNLCHEJKDHO: &pb.KFNCAIHIHCM_FEKCPKAPHHO{FEKCPKAPHHO: forge}})
|
||||
}
|
||||
}
|
||||
if err = s.saveCurrencyWarsData(data, catalog); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = s.Send(cwNotify(updates...)); err != nil {
|
||||
if err = cwSend(s, cwNotify(updates...)); err != nil {
|
||||
return err
|
||||
}
|
||||
rsp.AAKDHMHCMLP = req.AAKDHMHCMLP
|
||||
|
||||
Reference in new issue
Block a user