Fix main scene, add checksum error

This commit is contained in:
Sofia 2026-08-09 21:52:15 +03:00
parent 03ddc0b454
commit edeb899f9c
5 changed files with 35 additions and 5 deletions

View File

@ -1,12 +1,29 @@
[gd_scene format=3 uid="uid://lahirbqfppvw"] [gd_scene format=3 uid="uid://lahirbqfppvw"]
[ext_resource type="PackedScene" uid="uid://bbmc2gmy7g8ag" path="res://scenes/player/menu_player.tscn" id="1_o5qli"] [ext_resource type="PackedScene" uid="uid://bbmc2gmy7g8ag" path="res://scenes/player/menu_player.tscn" id="1_o5qli"]
[ext_resource type="PackedScene" uid="uid://dsxu0y8pjbw3k" path="res://scenes/ui/credits.tscn" id="1_tefeu"]
[ext_resource type="PackedScene" uid="uid://n3u0jr4wiib1" path="res://scenes/ui/settings.tscn" id="2_0wfyh"] [ext_resource type="PackedScene" uid="uid://n3u0jr4wiib1" path="res://scenes/ui/settings.tscn" id="2_0wfyh"]
[ext_resource type="Theme" uid="uid://drydbnrcdv4pk" path="res://default_theme.tres" id="3_jscy8"] [ext_resource type="Theme" uid="uid://drydbnrcdv4pk" path="res://default_theme.tres" id="3_jscy8"]
[ext_resource type="Texture2D" uid="uid://3gpd2qpyw5eq" path="res://assets/title.png" id="4_pm3ni"] [ext_resource type="Texture2D" uid="uid://3gpd2qpyw5eq" path="res://assets/title.png" id="4_pm3ni"]
[ext_resource type="PackedScene" uid="uid://c62c5iq0w72ka" path="res://maps/precipice/precipice_static.scn" id="6_tefeu"] [ext_resource type="PackedScene" uid="uid://c62c5iq0w72ka" path="res://maps/precipice/precipice_static.scn" id="6_tefeu"]
[node name="menu" type="Node3D" unique_id=2036763876] [node name="menu" type="MainMenu" unique_id=1896387088 node_paths=PackedStringArray("camera", "main_position", "host_position", "main_panel", "host_panel", "join_panel", "host_port", "join_addr", "join_port", "recent_servers_button", "popup_panel", "popup_title", "popup_text", "popup_button", "open_replay_dialog")]
camera = NodePath("camera_3d")
main_position = NodePath("main_pos")
host_position = NodePath("host_pos")
main_panel = NodePath("menus/main_panel")
host_panel = NodePath("menus/host_panel")
join_panel = NodePath("menus/join_panel")
host_port = NodePath("menus/host_panel/v_box_container/host_port")
join_addr = NodePath("menus/join_panel/v_box_container/margin_container/v_box_container/address_text")
join_port = NodePath("menus/join_panel/v_box_container/margin_container/v_box_container/port_text")
recent_servers_button = NodePath("menus/join_panel/v_box_container/margin_container/v_box_container/recent_servers")
popup_panel = NodePath("menus/popup_panel")
popup_title = NodePath("menus/popup_panel/v_box_container/title")
popup_text = NodePath("menus/popup_panel/v_box_container/text")
popup_button = NodePath("menus/popup_panel/v_box_container/ok")
credits = ExtResource("1_tefeu")
open_replay_dialog = NodePath("open_replay_dialog")
[node name="camera_3d" type="Camera3D" parent="." unique_id=1513321931] [node name="camera_3d" type="Camera3D" parent="." unique_id=1513321931]
transform = Transform3D(0.98629165, -0.031186381, 0.16203775, -1.4054481e-08, 0.981978, 0.1889952, -0.16501158, -0.18640438, 0.9685167, 1.0974052, 1.7166122, 1.4909106) transform = Transform3D(0.98629165, -0.031186381, 0.16203775, -1.4054481e-08, 0.981978, 0.1889952, -0.16501158, -0.18640438, 0.9685167, 1.0974052, 1.7166122, 1.4909106)
@ -134,7 +151,7 @@ metadata/_edit_lock_ = true
[node name="label" type="CommitHashLabel" parent="menus/main_panel/v_box_container/margin_container/v_box_container" unique_id=1742881725] [node name="label" type="CommitHashLabel" parent="menus/main_panel/v_box_container/margin_container/v_box_container" unique_id=1742881725]
layout_mode = 2 layout_mode = 2
text = "Checksum: 33fbeb" text = "Checksum: 03ddc0"
[node name="host_panel" type="Panel" parent="menus" unique_id=1633876079] [node name="host_panel" type="Panel" parent="menus" unique_id=1633876079]
visible = false visible = false

View File

@ -336,7 +336,7 @@ impl NetworkManager {
} }
} }
fn identifier() -> String { pub fn identifier() -> String {
format!("{}@{}", env!("CARGO_PKG_NAME"), env!("GIT_HASH")) format!("{}@{}", env!("CARGO_PKG_NAME"), env!("GIT_HASH"))
} }
} }

View File

@ -53,7 +53,19 @@ impl NetworkManager {
} else { } else {
PopupQueue::singleton().bind_mut().queue(Popup { PopupQueue::singleton().bind_mut().queue(Popup {
title: "Disconnected".to_owned(), title: "Disconnected".to_owned(),
message: reason.to_string(), message: match reason {
teanet::package::CloseReason::InvalidIdentifier(ident) => {
format!(
"Checksum mismatch: {} != {}",
ident.chars().take(6).collect::<String>(),
NetworkManager::identifier()
.chars()
.take(6)
.collect::<String>()
)
}
_ => reason.to_string(),
},
ok: true, ok: true,
}); });
} }

View File

@ -249,6 +249,7 @@ impl MainMenu {
#[func] #[func]
pub fn go_to_host_game(&mut self) { pub fn go_to_host_game(&mut self) {
godot_print!("what?");
self.current_menu = Menu::HostMenu; self.current_menu = Menu::HostMenu;
} }

@ -1 +1 @@
Subproject commit e43a010704bf18b1a75b69d4d28ec3770238fd7a Subproject commit 93eeb7c740c55a269ad8032ca1a58e2e21d024f5