Refine shop, online sessions, and player feedback

This commit is contained in:
Alexander Sellite 2026-08-11 16:35:33 -04:00
parent 2ffcbf51ac
commit c038eeadea
47 changed files with 1208 additions and 189 deletions

View file

@ -46,6 +46,10 @@ func _run() -> void:
assert(not invalid.is_valid())
var discovery := DiscoveryClient.new()
assert(
str(discovery.call("_default_room_name", "River"))
== "River's Server"
)
assert(
DiscoveryClient.UPNP_RENEW_INTERVAL_SECONDS
< float(DiscoveryClient.UPNP_MAPPING_DURATION_SECONDS)
@ -62,7 +66,12 @@ func _run() -> void:
discovery.get_public_join_state()
== DiscoveryClient.PublicJoinState.IDLE
)
assert(bool(discovery.call("_valid_public_room", {
discovery.set("_lease_room_id", "local-room")
assert(discovery.is_own_room({"room_id": "local-room"}))
assert(not discovery.is_own_room({"room_id": "another-room"}))
discovery.set("_lease_room_id", "")
assert(not discovery.is_own_room({"room_id": "local-room"}))
var listed_room := {
"room_id": "empty-dedicated-room",
"room_name": "Empty Dedicated Room",
"address": "203.0.113.10",
@ -73,7 +82,31 @@ func _run() -> void:
"application/config/version", "unknown"
)),
"protocol_version": NetworkProtocol.PROTOCOL_VERSION,
})))
}
assert(bool(discovery.call("_valid_public_room", listed_room)))
var incompatible_room: Dictionary = listed_room.duplicate(true)
incompatible_room["game_version"] = "0.0.0-alpha"
assert(not bool(discovery.call("_valid_public_room", incompatible_room)))
assert(
NetworkProtocol.game_version_rejection(
"0.6.4-alpha", "0.6.5-alpha"
) == NetworkProtocol.RejectionCode.CLIENT_OUTDATED
)
assert(
NetworkProtocol.game_version_rejection(
"0.6.6-alpha", "0.6.5-alpha"
) == NetworkProtocol.RejectionCode.SERVER_OUTDATED
)
assert(
NetworkProtocol.game_version_rejection(
"0.6.5-alpha", "0.6.5-alpha"
) == NetworkProtocol.RejectionCode.NONE
)
assert(
NetworkProtocol.game_version_rejection(
"0.6.5-beta", "0.6.5-alpha"
) == NetworkProtocol.RejectionCode.SERVER_OUTDATED
)
discovery.free()
print("DEDICATED_SERVER_CONFIG_VALIDATION_OK")
quit()

View file

@ -552,9 +552,11 @@ func _test_fishing_shop_sale_ui(
var shop_panel_style := shop_panel.get_theme_stylebox("panel") as StyleBoxFlat
assert(shop_panel_style != null)
assert(shop_panel_style.corner_radius_top_left == 24)
var buy_mode := shop.get_node("%BuyModeButton") as Button
var sell_mode := shop.get_node("%SellModeButton") as Button
assert(buy_mode.visible and sell_mode.visible)
assert(not shop.has_node("ShopPanel/Margin/Layout/ModeTabs"))
var shop_tabs: Array = shop.get("_shop_tabs") as Array
assert(shop_tabs.size() == 6)
var sell_mode := shop_tabs[5] as Button
assert(sell_mode != null and sell_mode.text == "Sell Fish")
var stock_sections: Array[String] = []
for child: Node in shop.get_node("%SuppliesList").get_children():
if child is Label:
@ -605,8 +607,7 @@ func _test_fishing_shop_sale_ui(
assert(player.wallet.get_balance() == balance_before + fish_catch.sale_value)
assert(not sale_service.is_local_sale_pending())
assert(reservations.release(reservation_id))
var back_button := shop.get_node("%BackToShopButton") as Button
await _activate_focused_button(back_button, ui_viewport)
await _activate_focused_button(shop_tabs[0] as Button, ui_viewport)
await process_frame
assert(shop.visible and (shop.get_node("%ShopPanel") as Control).visible)
assert(not (shop.get_node("%ShopCoolerPage") as Control).visible)

View file

@ -1,5 +1,11 @@
extends SceneTree
const FEATURE_ASSET_ROOTS: Dictionary = {
"eyes": "res://art/exported/characters/faces/eyes",
"mouth": "res://art/exported/characters/faces/mouth",
"nose": "res://art/exported/characters/faces/noses",
}
func _initialize() -> void:
call_deferred("_run")
@ -27,10 +33,10 @@ func _run() -> void:
).is_empty()
)
var expected_counts := {"eyes": 22, "mouth": 17, "nose": 17}
for category_id: String in expected_counts:
for category_id: String in FEATURE_ASSET_ROOTS:
var options := CharacterCustomizationCatalog.options_for(category_id)
assert(options.size() == int(expected_counts[category_id]) + 1)
var expected_ids: Dictionary = _feature_ids_on_disk(category_id)
assert(options.size() == expected_ids.size() + 1)
var seen_ids: Dictionary = {}
for option: Dictionary in options:
var option_id := str(option.get("id", ""))
@ -42,6 +48,30 @@ func _run() -> void:
category_id, option_id
) != null
)
for expected_id: String in expected_ids:
assert(seen_ids.has(expected_id))
for mouth_id: String in ["open_ah", "open_oh", "open_smile"]:
assert(CharacterCustomizationCatalog.texture_for(
"mouth", mouth_id
) != null)
print("Exported decal hotfix validation: PASS")
quit()
func _feature_ids_on_disk(category_id: String) -> Dictionary:
var result: Dictionary = {}
var root_path: String = str(FEATURE_ASSET_ROOTS[category_id])
var directory := DirAccess.open(root_path)
assert(directory != null)
for file_name: String in directory.get_files():
if not file_name.to_lower().ends_with(".png"):
continue
var option_id: String = (
CharacterCustomizationCatalog._feature_id_from_filename(
category_id, file_name
)
)
if not option_id.is_empty():
result[option_id] = true
return result

View file

@ -166,6 +166,9 @@ func _run() -> void:
var session_summary := (
join_page.get_node("%SessionSummary") as Label
)
assert(not join_page.has_node(
"Paper/Margin/Layout/Actions/OpenCloseButton"
))
assert("UDP 18138" in session_summary.text)
assert(session.set_host_open(true))
await process_frame