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

@@ -0,0 +1,28 @@
package sdkserver
import (
"encoding/base64"
pb "gac-hkrpg-go/protocol/proto"
"google.golang.org/protobuf/proto"
"testing"
)
func TestLiveServantHydratesNativeCategories(t *testing.T) {
wire, _ := proto.Marshal(&pb.BattleAvatarServantInfo{AvatarId: 20, TotalDamage: 1000})
encoded := []string{base64.StdEncoding.EncodeToString(wire)}
stats := &pb.BattleStatistics{}
err := applyLiveServantStatistics(stats, encoded, []liveAvatarBreakdown{{Damage: map[string]float64{"BPSkill": 800}}})
if err != nil {
t.Fatal(err)
}
servant := stats.IAGKLJEKAOL.GFOAHHHNBJC[0]
if servant.AvatarId != 20 || servant.TotalDamage != 1000 || servant.AttackTypeDamage[0].Damage != 800 {
t.Fatalf("native servant aggregate/categories lost: %+v", servant)
}
if applyLiveServantStatistics(stats, encoded, nil) == nil {
t.Fatal("accepted two servant statistic sources")
}
if applyLiveServantStatistics(&pb.BattleStatistics{}, nil, []liveAvatarBreakdown{{}}) == nil {
t.Fatal("accepted unmatched breakdowns")
}
}