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,34 @@
package gameserver
import "testing"
func TestExcludedSubMissionsAreScopedToClientVersion(t *testing.T) {
raw := []byte(`{"unsupported_sub_mission_ids_by_client_version":{"4.6.53":[103380210]}}`)
excluded, err := excludedSubMissionsForVersion(raw, "4.6.53")
if err != nil {
t.Fatal(err)
}
if _, ok := excluded[103380210]; !ok || len(excluded) != 1 {
t.Fatalf("expected the captured unsupported mission to be excluded: %v", excluded)
}
excluded, err = excludedSubMissionsForVersion(raw, "other-client")
if err != nil {
t.Fatal(err)
}
if len(excluded) != 0 {
t.Fatalf("mission exclusion leaked into another Client version: %v", excluded)
}
}
func TestExcludedSubMissionsRejectInvalidResource(t *testing.T) {
for _, raw := range [][]byte{
[]byte(`{"unsupported_sub_mission_ids_by_client_version":{"4.6.53":[0]}}`),
[]byte(`{"unsupported_sub_mission_ids_by_client_version":{"4.6.53":[103380210,103380210]}}`),
} {
if _, err := excludedSubMissionsForVersion(raw, "4.6.53"); err == nil {
t.Fatalf("invalid compatibility entry accepted: %s", raw)
}
}
}