add option to dump raw saves

This commit is contained in:
wish
2023-12-03 17:57:23 +11:00
parent 4ce65e47e6
commit 5662564842
3 changed files with 7 additions and 2 deletions

View File

@@ -34,6 +34,7 @@
"EarthMonsterOverride": [0, 0, 0, 0], "EarthMonsterOverride": [0, 0, 0, 0],
"SaveDumps": { "SaveDumps": {
"Enabled": true, "Enabled": true,
"RawEnabled": false,
"OutputDir": "save-backups" "OutputDir": "save-backups"
} }
}, },

View File

@@ -118,6 +118,7 @@ type DevModeOptions struct {
type SaveDumpOptions struct { type SaveDumpOptions struct {
Enabled bool Enabled bool
RawEnabled bool
OutputDir string OutputDir string
} }

View File

@@ -45,6 +45,9 @@ func handleMsgMhfSavedata(s *Session, p mhfpacket.MHFPacket) {
doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
return return
} }
if s.server.erupeConfig.DevModeOptions.SaveDumps.RawEnabled {
dumpSaveData(s, saveData, "raw-savedata")
}
s.logger.Info("Updating save with blob") s.logger.Info("Updating save with blob")
characterSaveData.decompSave = saveData characterSaveData.decompSave = saveData
} }