pre cw with probe and a bunch script to read game behavior

This commit is contained in:
CAtlas0784 committed 2026-10-21 20:40:13 +07:00
1 parent 5120219ae2
commit da8a32f60d
310 files changed
+219693 -872

No files matched your search

@@ -5,13 +5,41 @@ import (
"crypto/sha256"
"fmt"
"os"
"path/filepath"
"strings"
"testing"
goproto "gac-hkrpg-go/protocol/proto"
"google.golang.org/protobuf/encoding/protowire"
"google.golang.org/protobuf/proto"
)
func TestBattleResultCaptureRetainsObfuscatedAndUnknownStatistics(t *testing.T) {
t.Chdir(t.TempDir())
req := &goproto.PVEBattleResultCsReq{Stt: &goproto.BattleStatistics{NPFDEJPPPLI: 7, IEOGEFBLNEL: 3}}
unknown := protowire.AppendTag(nil, 100, protowire.VarintType)
unknown = protowire.AppendVarint(unknown, 9)
req.Stt.ProtoReflect().SetUnknown(unknown)
if err := saveBattleResultCapture(req); err != nil {
t.Fatal(err)
}
files, err := filepath.Glob("battle_diagnostics/*/battle_result.bin")
if err != nil || len(files) != 1 {
t.Fatalf("capture files=%v err=%v", files, err)
}
wire, err := os.ReadFile(files[0])
if err != nil {
t.Fatal(err)
}
var got goproto.PVEBattleResultCsReq
if err := proto.Unmarshal(wire, &got); err != nil {
t.Fatal(err)
}
if !proto.Equal(req, &got) {
t.Fatal("capture lost result statistics")
}
}
func TestCaptureUsesExactResponseBattleBytes(t *testing.T) {
t.Chdir(t.TempDir())
// Fixture values exercise zero-step affixes and map ordering on the wire.