Per-player resource pack filtering and merged translations #94
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
go
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pokebedrock/gobds!94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/split-res-packs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Per-player resource pack list, plus merged translations across packs. bds-manager writes
Resources.Packsfrompacks.json(index 0 = highest priority). This PR does not change session or protocol handling beyondListenConfig.Config
URLloads throughreadURLPack(empty DownloadURL, RakNet chunks).Pathusesresource.ReadPath. A failed pack is logged and skipped. LegacyURLResources/PathResourcesstay unfiltered and are loaded afterPacks.Filter
A pack is sent when both are true:
MinMemoryTier == 0orclientData.MemoryTier >= MinMemoryTierLanguage == ""or normalizedclientData.LanguageCodeequals normalizedLanguageNormalize = lowercase,
-replaced with_.FetchResourcePacksis set on the shared listen config, so both the RakNet and NetherNet listeners filter. Relative order of packs that match is preserved through the filter.Ordering
gophertunnel v1.62.0 copies
conn.resourcePacksin slice order intoResourcePackStack.TexturePacksand does not reverse it:minecraft/conn.go:1117(for _, pack := range conn.resourcePacks)minecraft/protocol/packet/resource_pack_stack.go:16("The first in the list will be applied first.")First-applied is lowest priority.
Resources.Packsis the opposite (index 0 highest, same aspacks.json), so that prefix is reversed before it is returned fromFetchResourcePacks.3d(beforecoreinPacks) therefore lands aftercoreon the wire and overrides it. Legacy URL/path entries keep today's load order and are placed beforePacks, so a config with onlyURLResources/PathResourcesis unchanged and a monolith stays below the split packs.Translations are set up in that same lowest-first order.
SetTranslationFormerges keys; a later pack wins per key, soPacks[0]overwrites. A pack with notexts/(languages.jsonmissing) makesSetupreturn nil instead of an error.Tests
TestFilterPackOffers/TestPackMatchesEdges: memory-tier edges (0, below, equal, above), language case and-/_, AND of both filters, unfiltered packs (including legacy) always sent, filter order preserved.TestStackOrder:Packs[0]last on the wire,3daftercore, legacy order unchanged.TestPackConfigTOML: contract tags.TestSetupMergesOverlappingKeys: two packs, overlapping keys, later wins.TestSetupSkipsPackWithoutTexts.TestReadURLPackHasNoDownloadURLstill passes.go test ./...andgo vet ./...clean.