pre cw with probe and a bunch script to read game behavior
This commit is contained in:
1 parent
5120219ae2
commit
da8a32f60d
310 files changed
+219693
-872
No files matched your search
@@ -31,6 +31,31 @@ type battleCapture struct {
|
||||
StageID uint32 `json:"stage_id"`
|
||||
}
|
||||
|
||||
// Preserve every result field, including fields whose native names are still
|
||||
// obfuscated. The display report intentionally retains only aggregate stats.
|
||||
func saveBattleResultCapture(req *goproto.PVEBattleResultCsReq) error {
|
||||
if req == nil {
|
||||
return nil
|
||||
}
|
||||
wire, err := proto.Marshal(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pretty, err := (protojson.MarshalOptions{Indent: " ", EmitUnpopulated: true}).Marshal(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hash := sha256.Sum256(wire)
|
||||
dir := filepath.Join("battle_diagnostics", time.Now().UTC().Format("20060102T150405.000000000Z")+fmt.Sprintf("_result_%x", hash[:6]))
|
||||
if err := os.MkdirAll(dir, 0700); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(dir, "battle_result.bin"), wire, 0600); err != nil {
|
||||
return err
|
||||
}
|
||||
return os.WriteFile(filepath.Join(dir, "battle_result.json"), pretty, 0600)
|
||||
}
|
||||
|
||||
func saveBattleCapture(msg proto.Message, cmdID uint16, response []byte) ([]byte, *battleCapture, error) {
|
||||
carrier, ok := msg.(interface {
|
||||
GetBattleInfo() *goproto.SceneBattleInfo
|
||||
|
||||
Reference in new issue
Block a user