diff --git a/export_presets.cfg b/export_presets.cfg index 1df6f73..347829e 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -9,7 +9,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="builds/*,playtest/*,scripts/*" -export_path="builds/v0.6.6-alpha/windows-x86_64/NETfishing.exe" +export_path="builds/v0.6.7-alpha/windows-x86_64/NETfishing.exe" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" @@ -35,11 +35,11 @@ application/modify_resources=true application/icon="res://art/exported/system_icons/netfishing.ico" application/console_wrapper_icon="" application/icon_interpolation=4 -application/file_version="0.6.6.0" -application/product_version="0.6.6.0" +application/file_version="0.6.7.0" +application/product_version="0.6.7.0" application/company_name="" application/product_name="NETfishing" -application/file_description="NETfishing v0.6.6-alpha" +application/file_description="NETfishing v0.6.7-alpha" application/copyright="" application/trademarks="" application/export_angle=0 @@ -62,7 +62,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="builds/*,playtest/*,scripts/*" -export_path="builds/v0.6.6-alpha/linux-arm64/NETfishing.arm64" +export_path="builds/v0.6.7-alpha/linux-arm64/NETfishing.arm64" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" @@ -92,7 +92,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="builds/*,playtest/*,scripts/*" -export_path="builds/v0.6.6-alpha/macos/NETfishing.zip" +export_path="builds/v0.6.7-alpha/macos/NETfishing.zip" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" @@ -108,8 +108,8 @@ custom_template/release="" application/bundle_identifier="io.woofmeow.netfishing" application/icon="res://art/exported/system_icons/netfishing_1024.png" application/icon_interpolation=0 -application/short_version="0.6.6" -application/version="0.6.6" +application/short_version="0.6.7" +application/version="0.6.7" application/architecture="universal" codesign/enable=false notarization/enable=false @@ -125,7 +125,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="builds/*,playtest/*,scripts/*,tests/*" -export_path="builds/v0.6.6-alpha/server-linux-x86_64/NETfishingServer.x86_64" +export_path="builds/v0.6.7-alpha/server-linux-x86_64/NETfishingServer.x86_64" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" @@ -155,7 +155,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="builds/*,playtest/*,scripts/*" -export_path="builds/v0.6.6-alpha/android/NETfishing.apk" +export_path="builds/v0.6.7-alpha/android/NETfishing.apk" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" @@ -176,8 +176,8 @@ architectures/armeabi-v7a=false architectures/arm64-v8a=true architectures/x86=false architectures/x86_64=false -version/code=60600 -version/name="v0.6.6-alpha" +version/code=60700 +version/name="v0.6.7-alpha" package/unique_name="io.woofmeow.netfishing" package/name="NETfishing" package/signed=true @@ -214,7 +214,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="builds/*,playtest/*,scripts/*" -export_path="builds/v0.6.6-alpha/linux-x86_64/NETfishing.x86_64" +export_path="builds/v0.6.7-alpha/linux-x86_64/NETfishing.x86_64" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" diff --git a/network/discovery_client.gd b/network/discovery_client.gd index f2263e8..bdb7134 100644 --- a/network/discovery_client.gd +++ b/network/discovery_client.gd @@ -865,12 +865,46 @@ func _parse_response_dictionary(body: PackedByteArray) -> Dictionary: func _request_failure(response: Dictionary) -> String: var error: Variant = response.get("error", {}) if typeof(error) == TYPE_DICTIONARY: - var message: String = str((error as Dictionary).get("message", "")).strip_edges() + var details := error as Dictionary + if str(details.get("code", "")) == "game_version_mismatch": + var required_version: String = str( + details.get("required_game_version", "") + ).strip_edges() + if not required_version.is_empty(): + return _discovery_version_mismatch_message(required_version) + var message: String = str(details.get("message", "")).strip_edges() if not message.is_empty(): return message return "Room discovery is temporarily unavailable." +func _discovery_version_mismatch_message(required_version: String) -> String: + var local_version: String = NetworkProtocol.game_version() + var rejection: NetworkProtocol.RejectionCode = ( + NetworkProtocol.game_version_rejection( + local_version, + required_version, + ) + ) + match rejection: + NetworkProtocol.RejectionCode.CLIENT_OUTDATED: + return ( + "Your NETfishing version is out of date. Update to %s to " + + "enable public discovery. This room will not be listed " + + "until you update." + ) % required_version + NetworkProtocol.RejectionCode.SERVER_OUTDATED: + return ( + "Public discovery is still on NETfishing %s. This room " + + "will not be listed until discovery is updated for %s." + ) % [required_version, local_version] + _: + return ( + "Public discovery requires NETfishing %s. This room will " + + "not be listed until both versions match." + ) % required_version + + func _on_session_state_changed(state: NetworkSession.State) -> void: if state == NetworkSession.State.CONNECTING and not _pending_join_token.is_empty(): _set_public_join_state(PublicJoinState.CONNECTING) diff --git a/playtest/README-PLAYTEST.txt b/playtest/README-PLAYTEST.txt index 042898d..258ea6a 100644 --- a/playtest/README-PLAYTEST.txt +++ b/playtest/README-PLAYTEST.txt @@ -1,6 +1,6 @@ NETfishing -v0.6.6-alpha -Alpha 0.6.6 +v0.6.7-alpha +Alpha 0.6.7 Thank you for trying this early private playtest. diff --git a/project.godot b/project.godot index 3a76545..27fe914 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="NETFISHING" -config/version="0.6.6-alpha" +config/version="0.6.7-alpha" run/main_scene="res://main/main.tscn" config/features=PackedStringArray("4.7", "GL Compatibility") config/icon="res://art/exported/system_icons/netfishing_256.png" diff --git a/scripts/build_playtest.sh b/scripts/build_playtest.sh index c0cd14b..3a47661 100755 --- a/scripts/build_playtest.sh +++ b/scripts/build_playtest.sh @@ -4,12 +4,12 @@ set -euo pipefail readonly SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" readonly PROJECT_ROOT="$(cd -- "${SCRIPT_DIR}/.." && pwd)" -readonly BUILD_ROOT="${PROJECT_ROOT}/builds/v0.6.6-alpha" +readonly BUILD_ROOT="${PROJECT_ROOT}/builds/v0.6.7-alpha" readonly WINDOWS_DIR="${BUILD_ROOT}/windows-x86_64" readonly LINUX_DIR="${BUILD_ROOT}/linux-x86_64" readonly README_SOURCE="${PROJECT_ROOT}/playtest/README-PLAYTEST.txt" -readonly WINDOWS_ZIP="${BUILD_ROOT}/NETfishing-v0.6.6-alpha-windows-x86_64.zip" -readonly LINUX_ZIP="${BUILD_ROOT}/NETfishing-v0.6.6-alpha-linux-x86_64.zip" +readonly WINDOWS_ZIP="${BUILD_ROOT}/NETfishing-v0.6.7-alpha-windows-x86_64.zip" +readonly LINUX_ZIP="${BUILD_ROOT}/NETfishing-v0.6.7-alpha-linux-x86_64.zip" readonly GODOT_BIN="${GODOT_BIN:-godot}" if [[ ! -f "${PROJECT_ROOT}/project.godot" ]]; then diff --git a/tests/dedicated_server_config_validation.gd b/tests/dedicated_server_config_validation.gd index 7911f6d..ecc721c 100644 --- a/tests/dedicated_server_config_validation.gd +++ b/tests/dedicated_server_config_validation.gd @@ -107,6 +107,46 @@ func _run() -> void: "0.6.5-beta", "0.6.5-alpha" ) == NetworkProtocol.RejectionCode.SERVER_OUTDATED ) + var outdated_discovery_error := { + "error": { + "code": "game_version_mismatch", + "message": "generic mismatch", + "required_game_version": "0.6.8-alpha", + }, + } + var outdated_message: String = str( + discovery.call("_request_failure", outdated_discovery_error) + ) + assert("out of date" in outdated_message) + assert("0.6.8-alpha" in outdated_message) + assert("will not be listed" in outdated_message) + discovery.set( + "_host_request_kind", + DiscoveryClient.HostRequestKind.CREATE, + ) + discovery.set("_host_request_in_flight", true) + discovery.call( + "_on_host_request_completed", + HTTPRequest.RESULT_SUCCESS, + HTTPClient.RESPONSE_CONFLICT, + PackedStringArray(), + JSON.stringify(outdated_discovery_error).to_utf8_buffer(), + ) + assert(discovery.get_host_state() == DiscoveryClient.HostState.ERROR) + assert(discovery.host_status_is_error()) + assert(discovery.get_host_status_message() == outdated_message) + var newer_discovery_error := { + "error": { + "code": "game_version_mismatch", + "message": "generic mismatch", + "required_game_version": "0.6.6-alpha", + }, + } + var newer_message: String = str( + discovery.call("_request_failure", newer_discovery_error) + ) + assert("discovery is updated" in newer_message) + assert("will not be listed" in newer_message) discovery.free() print("DEDICATED_SERVER_CONFIG_VALIDATION_OK") quit() diff --git a/ui/title_screen.tscn b/ui/title_screen.tscn index d285ea9..285da68 100644 --- a/ui/title_screen.tscn +++ b/ui/title_screen.tscn @@ -209,7 +209,7 @@ unique_name_in_owner = true layout_mode = 2 theme_override_colors/font_color = Color(0.682, 0.733, 0.761, 1) theme_override_font_sizes/font_size = 22 -text = "v0.6.6-alpha" +text = "v0.6.7-alpha" horizontal_alignment = 1 [node name="Spacer" type="Control" parent="ResponsiveTitleStage/TitlePresentationScaleRoot/Center/MainContent"]