Update GaCy-GO
This commit is contained in:
1 parent
da8a32f60d
commit
0cbe460e49
345 files changed
+98202
-77559
No files matched your search
@@ -3,7 +3,6 @@ package gameserver
|
||||
import (
|
||||
"fmt"
|
||||
"gac-hkrpg-go/internal/common"
|
||||
pb "gac-hkrpg-go/protocol/proto"
|
||||
)
|
||||
|
||||
func (s *Session) applyCurrencyWarsCommands() error {
|
||||
@@ -43,27 +42,19 @@ func (s *Session) applyCurrencyWarsCommands() error {
|
||||
if player == nil {
|
||||
return fmt.Errorf("CW player missing")
|
||||
}
|
||||
var update *pb.KFNCAIHIHCM
|
||||
switch command.Field {
|
||||
case "gold":
|
||||
player.Gold = command.Value
|
||||
update = cwGoldSync(player.Gold)
|
||||
case "hp":
|
||||
if command.Value == 0 || command.Value > player.PPKKHHNEOHB {
|
||||
return fmt.Errorf("CW command HP exceeds run limit")
|
||||
notify, applyErr := cwApplyCommand(catalog, data.DHFOFLFCLAH, command)
|
||||
if applyErr != nil {
|
||||
PacketLog(fmt.Sprintf("CW_GM rejected request=%s: %v", command.ID, applyErr))
|
||||
if err = common.AcknowledgeCurrencyWarsCommand(command.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
player.GridFightLineupHp = command.Value
|
||||
update = &pb.KFNCAIHIHCM{MNLCHEJKDHO: &pb.KFNCAIHIHCM_GridFightLineupHp{GridFightLineupHp: &pb.FMJDDIHBELC{GridFightLineupHp: command.Value, PPKKHHNEOHB: player.PPKKHHNEOHB}}}
|
||||
default:
|
||||
return fmt.Errorf("unknown CW command field")
|
||||
continue
|
||||
}
|
||||
if err = s.saveCurrencyWarsData(data, catalog); err != nil {
|
||||
|
||||
if err = s.saveCurrencyWarsData(data, catalog, command.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = s.Send(cwNotify(update)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = common.AcknowledgeCurrencyWarsCommand(command.ID); err != nil {
|
||||
if err = s.Send(notify); err != nil {
|
||||
return err
|
||||
}
|
||||
PacketLog(fmt.Sprintf("CW_GM applied request=%s field=%s value=%d revision=%d", command.ID, command.Field, command.Value, s.currencyWarsRevision))
|
||||
|
||||
Reference in new issue
Block a user