Expand character customization assets

This commit is contained in:
Voyager 2026-09-02 17:20:50 -04:00
parent 23cf53fa14
commit df2a4d7d77
31 changed files with 2423 additions and 215 deletions

View file

@ -3,7 +3,7 @@ extends RefCounted
const WorldLayoutType = preload("res://world/world_layout.gd")
const PROTOCOL_VERSION: int = 13
const PROTOCOL_VERSION: int = 14
const GAME_BUILD: String = "prealpha"
const MAX_GAME_VERSION_LENGTH: int = 64
const MAX_DISPLAY_NAME_LENGTH: int = 24
@ -274,6 +274,13 @@ static func validate_client_hello(data: Variant) -> String:
return "Capabilities are invalid."
if typeof(payload["cosmetic_snapshot"]) != TYPE_DICTIONARY:
return "Cosmetic snapshot is invalid."
var cosmetic_snapshot: Dictionary = payload["cosmetic_snapshot"]
if (
not CharacterCustomizationCatalog.validate_snapshot(cosmetic_snapshot)
or CharacterCustomizationCatalog.sanitized_snapshot(cosmetic_snapshot)
!= cosmetic_snapshot
):
return "Cosmetic snapshot is invalid."
if (
not NetworkIdentityCrypto.valid_fingerprint(
payload["identity_fingerprint"]

View file

@ -299,6 +299,23 @@ static func _valid_owned_data(filename: String, data: Dictionary) -> bool:
and typeof(data.get("active_slot_id")) == TYPE_STRING
and typeof(data.get("slots")) == TYPE_ARRAY
)
if filename == "player_appearance.json":
var version_value: Variant = data.get("format_version")
if typeof(version_value) not in [TYPE_INT, TYPE_FLOAT]:
return false
var version: int = int(version_value)
if (
version < 1
or version > PlayerAppearanceStore.FORMAT_VERSION
or typeof(data.get("appearance")) != TYPE_DICTIONARY
):
return false
var appearance: Dictionary = data["appearance"]
if version < PlayerAppearanceStore.FORMAT_VERSION:
appearance = CharacterCustomizationCatalog.sanitized_snapshot(
appearance
)
return CharacterCustomizationCatalog.validate_snapshot(appearance)
return (
filename not in LEGACY_FILES
or int(data.get("format_version", -1)) == 1