Fix real scene collision + a real regression from removing the Server autoload
Two genuine bugs, found by reproducing rather than trusting the branch's own state: 1. scenes/player.tscn collided with PC2's client-side player scene at the exact same path (server-authoritative PlayerNode vs. the local single-player character) -- whichever merged last would silently overwrite the other. The branch's own last commit had literally committed unresolved <<<<<<< conflict markers into the file instead of resolving them. Renamed the server's version to scenes/server_player.tscn, restored scenes/player.tscn to match main's real client scene exactly, repointed scripts/server.gd's preload. 2. scenes/server.tscn's root Node had no script attached at all -- it only ever worked before because project.godot had `Server` registered as a project-wide autoload (the exact wholesale-overwrite this task was already asked to fix). Once that autoload was correctly removed, nothing attached server.gd to the scene tree anymore and the dedicated server silently did nothing. Attached scripts/server.gd directly to scenes/server.tscn's root node instead. Verified: godot --headless --import/--quit both clean, full 10-suite client smoke test all passing, and the dedicated server actually listens on UDP port 7777 when launched explicitly (`godot --path . scenes/server.tscn`) -- confirmed with `ss -ulnp`, not just trusting the startup print (first checked with `ss -tlnp`, which only shows TCP and falsely suggested it wasn't listening at all; ENet is UDP). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M6rUEynmv2QmweocAQYARN
This commit is contained in:
@@ -1,11 +1,3 @@
|
|||||||
<<<<<<< HEAD
|
|
||||||
[gd_scene load_steps=2 format=3]
|
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/player_spawner.gd" id="1"]
|
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody3D"]
|
|
||||||
script = ExtResource("1")
|
|
||||||
=======
|
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://player_scene_001"]
|
[gd_scene load_steps=3 format=3 uid="uid://player_scene_001"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/player.gd" id="1_player"]
|
[ext_resource type="Script" path="res://scripts/player.gd" id="1_player"]
|
||||||
@@ -30,4 +22,3 @@ mesh = SubResource("CapsuleMesh1")
|
|||||||
[node name="Camera3D" type="Camera3D" parent="."]
|
[node name="Camera3D" type="Camera3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0)
|
||||||
current = true
|
current = true
|
||||||
>>>>>>> origin/main
|
|
||||||
|
|||||||
+4
-1
@@ -1,3 +1,6 @@
|
|||||||
[gd_scene load_steps=1 format=3]
|
[gd_scene load_steps=2 format=3]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/server.gd" id="1_server"]
|
||||||
|
|
||||||
[node name="Server" type="Node"]
|
[node name="Server" type="Node"]
|
||||||
|
script = ExtResource("1_server")
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=3]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/player_spawner.gd" id="1"]
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody3D"]
|
||||||
|
script = ExtResource("1")
|
||||||
+1
-1
@@ -37,7 +37,7 @@ var _player_scene: PackedScene
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
# Preload the player scene once.
|
# Preload the player scene once.
|
||||||
_player_scene = preload("res://scenes/player.tscn")
|
_player_scene = preload("res://scenes/server_player.tscn")
|
||||||
|
|
||||||
# Create and assign the ENet server peer.
|
# Create and assign the ENet server peer.
|
||||||
network_peer = _create_server_peer()
|
network_peer = _create_server_peer()
|
||||||
|
|||||||
Reference in New Issue
Block a user