Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aad186552c | |||
| 5a1695e2ab |
@@ -11,8 +11,14 @@ func _init(p_history_size: int):
|
||||
_history_size = p_history_size
|
||||
|
||||
func subjects() -> Array[Object]:
|
||||
# Filter out freed objects — Godot 4.7 stricter typed arrays
|
||||
# reject invalid references and crash the engine.
|
||||
var valid := []
|
||||
for o in _data.keys():
|
||||
if is_instance_valid(o):
|
||||
valid.append(o)
|
||||
var result := [] as Array[Object]
|
||||
result.assign(_data.keys())
|
||||
result.assign(valid)
|
||||
return result
|
||||
|
||||
func is_auth(tick: int, subject: Object) -> bool:
|
||||
|
||||
@@ -49,8 +49,14 @@ func get_properties_of(subject: Object) -> Array[NodePath]:
|
||||
return properties
|
||||
|
||||
func get_subjects() -> Array[Object]:
|
||||
# Filter out freed objects — Godot 4.7 stricter typed arrays
|
||||
# reject invalid references and crash the engine.
|
||||
var valid := []
|
||||
for s in _properties_by_subject.keys():
|
||||
if is_instance_valid(s):
|
||||
valid.append(s)
|
||||
var subjects := [] as Array[Object]
|
||||
subjects.assign(_properties_by_subject.keys())
|
||||
subjects.assign(valid)
|
||||
return subjects
|
||||
|
||||
func is_empty() -> bool:
|
||||
|
||||
@@ -34,7 +34,7 @@ text = "Address:"
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
text = "localhost"
|
||||
text = "192.168.0.127"
|
||||
|
||||
[node name="Port Label" type="Label" parent="LAN/Address Row"]
|
||||
layout_mode = 2
|
||||
@@ -44,7 +44,7 @@ text = "Port:"
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
text = "16384"
|
||||
text = "34197"
|
||||
|
||||
[node name="Actions Row" type="HBoxContainer" parent="LAN"]
|
||||
layout_mode = 2
|
||||
|
||||
@@ -110,7 +110,14 @@ func _on_first_peer_join(_peer_id: int) -> void:
|
||||
return
|
||||
_first_client_connected = true
|
||||
|
||||
print("[HeadlessServer] First client connected — starting netfox tick loop...")
|
||||
print("[HeadlessServer] First client connected — letting avatar spawn...")
|
||||
|
||||
# Wait TWO frames so PlayerSpawner._handle_new_peer() creates the avatar
|
||||
# BEFORE NetworkTime starts. The tick loop needs at least one subject.
|
||||
await get_tree().process_frame
|
||||
await get_tree().process_frame
|
||||
|
||||
print("[HeadlessServer] Starting netfox tick loop with player subjects...")
|
||||
|
||||
# Start netfox tick loop now that we have at least one player
|
||||
if NetworkTime and NetworkTime.has_method("start"):
|
||||
|
||||
Reference in New Issue
Block a user