Fresh start: replace with naxIO/netfox-cs-sample foundation
Complete replacement of the tactical-shooter project with the netfox-cs-sample (MIT) — a CS 1.6 inspired multiplayer FPS built with Godot 4 and netfox. ## What's new - Full CS-style gameplay: teams (T/CT), rounds, economy, buy menu - 6 weapons: Knife, Glock, USP, AK-47, M4A1, AWP - Bomb plant/defuse with 2 bombsites - Flashbang & smoke grenades - Proper netfox rollback netcode at 64 tick - Network popup UI for host/join - HUD, crosshair, round timer, scoreboard - All netfox singletons registered as autoloads (works in exported builds) ## Architecture - Listen-server (host from client, no dedicated server binary) - Multiplayer-fps game lives at examples/multiplayer-fps/ - Netfox addons registered as autoloads for exported build compat - Godot 4.7 with Forward+ renderer ## Removed - Old headless-server architecture (client_main, server_main, player.gd, etc.) - Custom netfox bootstrap with ENet fallback - Old ChaffGames FPS template (2,420 lines, 844 KB) - SimulationServer GDExtension stub - Godot-jolt physics (netfox sample uses default Godot physics) - Duplicate weapon_data.gd, anti_cheat.gd, round_manager.gd, etc. - Server browser API Python venv (87 MB) - test_range map and modular assets ## Preserved - Git history - Server config at config/default_server_config.cfg - Windows export preset - Build directory (gitignored) Co-authored-by: naxIO <naxIO@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cncdbq72u50j3"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_bioft"]
|
||||
|
||||
[sub_resource type="Sky" id="Sky_n7qj2"]
|
||||
sky_material = SubResource("ProceduralSkyMaterial_bioft")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_ge6yj"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_n7qj2")
|
||||
|
||||
[node name="Environment" type="Node"]
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(0.5, 0.612372, -0.612372, 0, 0.707107, 0.707107, 0.866025, -0.353553, 0.353553, -6.7361, 8.77817, 3.88909)
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 14.3564, 8.86602)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_ge6yj")
|
||||
@@ -0,0 +1,39 @@
|
||||
[gd_scene format=3 uid="uid://cngy6hs8ohodj"]
|
||||
|
||||
[node name="Square Map" type="Node3D"]
|
||||
|
||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
|
||||
use_collision = true
|
||||
collision_layer = 2
|
||||
|
||||
[node name="CSGFloor" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.25, 0)
|
||||
size = Vector3(16, 0.5, 16)
|
||||
|
||||
[node name="CSGWall" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 8)
|
||||
size = Vector3(16, 2, 1)
|
||||
|
||||
[node name="CSGWall2" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -8)
|
||||
size = Vector3(16, 2, 1)
|
||||
|
||||
[node name="CSGWall3" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8, 1, 0)
|
||||
size = Vector3(1, 2, 16)
|
||||
|
||||
[node name="CSGWall4" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8, 1, 0)
|
||||
size = Vector3(1, 2, 16)
|
||||
|
||||
[node name="CSGCorner" type="CSGCylinder3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8, 1, 8)
|
||||
|
||||
[node name="CSGCorner2" type="CSGCylinder3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8, 1, -8)
|
||||
|
||||
[node name="CSGCorner3" type="CSGCylinder3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8, 1, -8)
|
||||
|
||||
[node name="CSGCorner4" type="CSGCylinder3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8, 1, 8)
|
||||
@@ -0,0 +1,9 @@
|
||||
extends Node
|
||||
|
||||
func condition(cond: Callable, timeout: float = 10.0) -> Error:
|
||||
timeout = Time.get_ticks_msec() + timeout * 1000
|
||||
while not cond.call():
|
||||
await get_tree().process_frame
|
||||
if Time.get_ticks_msec() > timeout:
|
||||
return ERR_TIMEOUT
|
||||
return OK
|
||||
@@ -0,0 +1 @@
|
||||
uid://bb1cle7uin2wt
|
||||
@@ -0,0 +1,111 @@
|
||||
extends Node
|
||||
|
||||
@export_category("UI")
|
||||
@export var connect_ui: Control
|
||||
@export var address_input: LineEdit
|
||||
@export var port_input: LineEdit
|
||||
|
||||
func host_only():
|
||||
var brawler_spawner: BrawlerSpawner = %"Brawler Spawner"
|
||||
if brawler_spawner != null:
|
||||
brawler_spawner.spawn_host_avatar = false
|
||||
host()
|
||||
|
||||
func host():
|
||||
var host = _parse_input()
|
||||
if host.size() == 0:
|
||||
return ERR_CANT_RESOLVE
|
||||
|
||||
var port = host.port
|
||||
|
||||
# Start host
|
||||
print("Starting host on port %s" % port)
|
||||
|
||||
var peer = ENetMultiplayerPeer.new()
|
||||
if peer.create_server(port) != OK:
|
||||
print("Failed to listen on port %s" % port)
|
||||
|
||||
get_tree().get_multiplayer().multiplayer_peer = peer
|
||||
print("Listening on port %s" % port)
|
||||
|
||||
# Wait for server to start
|
||||
await Async.condition(
|
||||
func():
|
||||
return peer.get_connection_status() != MultiplayerPeer.CONNECTION_CONNECTING
|
||||
)
|
||||
|
||||
if peer.get_connection_status() != MultiplayerPeer.CONNECTION_CONNECTED:
|
||||
OS.alert("Failed to start server!")
|
||||
return
|
||||
|
||||
print("Server started")
|
||||
get_tree().get_multiplayer().server_relay = true
|
||||
|
||||
connect_ui.hide()
|
||||
|
||||
# Only start manually if NetworkEvents is not handling it (e.g. multiplayer-simple)
|
||||
if not NetworkEvents.enabled:
|
||||
NetworkTime.start()
|
||||
|
||||
func join():
|
||||
var host = _parse_input()
|
||||
if host.size() == 0:
|
||||
return ERR_CANT_RESOLVE
|
||||
|
||||
var address = host.address
|
||||
var port = host.port
|
||||
|
||||
# Connect
|
||||
print("Connecting to %s:%s" % [address, port])
|
||||
var peer = ENetMultiplayerPeer.new()
|
||||
var err = peer.create_client(address, port)
|
||||
if err != OK:
|
||||
OS.alert("Failed to create client, reason: %s" % error_string(err))
|
||||
return err
|
||||
|
||||
get_tree().get_multiplayer().multiplayer_peer = peer
|
||||
|
||||
# Wait for connection process to conclude
|
||||
await Async.condition(
|
||||
func():
|
||||
return peer.get_connection_status() != MultiplayerPeer.CONNECTION_CONNECTING
|
||||
)
|
||||
|
||||
if peer.get_connection_status() != MultiplayerPeer.CONNECTION_CONNECTED:
|
||||
OS.alert("Failed to connect to %s:%s" % [address, port])
|
||||
return
|
||||
|
||||
print("Client started")
|
||||
connect_ui.hide()
|
||||
|
||||
# Only start manually if NetworkEvents is not handling it (e.g. multiplayer-simple)
|
||||
if not NetworkEvents.enabled:
|
||||
NetworkTime.start()
|
||||
|
||||
func _enter_tree():
|
||||
# Hide and show UI as appropriate
|
||||
# These handlers are necessary, since the game could have started via
|
||||
# autoconnect, or any other method
|
||||
NetworkEvents.on_client_start.connect(func(__): connect_ui.hide())
|
||||
NetworkEvents.on_server_start.connect(func(): connect_ui.hide())
|
||||
NetworkEvents.on_client_stop.connect(func(): connect_ui.show())
|
||||
NetworkEvents.on_server_stop.connect(func(): connect_ui.show())
|
||||
|
||||
func _parse_input() -> Dictionary:
|
||||
# Validate inputs
|
||||
var address = address_input.text
|
||||
var port = port_input.text
|
||||
|
||||
if address == "":
|
||||
OS.alert("No host specified!")
|
||||
return {}
|
||||
|
||||
if not port.is_valid_int():
|
||||
OS.alert("Invalid port!")
|
||||
return {}
|
||||
port = port.to_int()
|
||||
|
||||
return {
|
||||
"address": address,
|
||||
"port": port
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://c4smm8wlkhagj
|
||||
@@ -0,0 +1,178 @@
|
||||
extends Node
|
||||
|
||||
enum Role { NONE, HOST, CLIENT }
|
||||
|
||||
@export_category("UI")
|
||||
@export var connect_ui: Control
|
||||
@export var noray_address_input: LineEdit
|
||||
@export var oid_input: LineEdit
|
||||
@export var host_oid_input: LineEdit
|
||||
@export var force_relay_check: CheckBox
|
||||
|
||||
var role = Role.NONE
|
||||
|
||||
func _ready():
|
||||
Noray.on_oid.connect(func(oid): oid_input.text = oid)
|
||||
Noray.on_connect_nat.connect(_handle_connect_nat)
|
||||
Noray.on_connect_relay.connect(_handle_connect_relay)
|
||||
|
||||
func connect_to_noray():
|
||||
# Connect to noray
|
||||
var err = OK
|
||||
var address = noray_address_input.text
|
||||
if address.contains(":"):
|
||||
var parts = address.split(":")
|
||||
var host = parts[0]
|
||||
var port = (parts[1] as String).to_int()
|
||||
err = await Noray.connect_to_host(host, port)
|
||||
else:
|
||||
err = await Noray.connect_to_host(address)
|
||||
|
||||
if err != OK:
|
||||
print("Failed to connect to Noray: %s" % error_string(err))
|
||||
return err
|
||||
|
||||
# Get IDs
|
||||
Noray.register_host()
|
||||
await Noray.on_pid
|
||||
|
||||
# Register remote address
|
||||
err = await Noray.register_remote()
|
||||
if err != OK:
|
||||
print("Failed to register remote address: %s" % error_string(err))
|
||||
return err
|
||||
|
||||
# Our local port is a remote port to Noray, hence the weird naming
|
||||
print("Registered local port: %d" % Noray.local_port)
|
||||
return OK
|
||||
|
||||
func disconnect_from_noray():
|
||||
Noray.disconnect_from_host()
|
||||
oid_input.clear()
|
||||
|
||||
func host_only():
|
||||
var brawler_spawner: BrawlerSpawner = %"Brawler Spawner"
|
||||
if brawler_spawner != null:
|
||||
brawler_spawner.spawn_host_avatar = false
|
||||
host()
|
||||
|
||||
func host():
|
||||
if Noray.local_port <= 0:
|
||||
return ERR_UNCONFIGURED
|
||||
|
||||
# Start host
|
||||
var err = OK
|
||||
var port = Noray.local_port
|
||||
print("Starting host on port %s" % port)
|
||||
|
||||
var peer = ENetMultiplayerPeer.new()
|
||||
err = peer.create_server(port)
|
||||
if err != OK:
|
||||
print("Failed to listen on port %s: %s" % [port, error_string(err)])
|
||||
return err
|
||||
|
||||
get_tree().get_multiplayer().multiplayer_peer = peer
|
||||
print("Listening on port %s" % port)
|
||||
|
||||
# Wait for server to start
|
||||
while peer.get_connection_status() == MultiplayerPeer.CONNECTION_CONNECTING:
|
||||
await get_tree().process_frame
|
||||
|
||||
if peer.get_connection_status() != MultiplayerPeer.CONNECTION_CONNECTED:
|
||||
OS.alert("Failed to start server!")
|
||||
return FAILED
|
||||
|
||||
get_tree().get_multiplayer().server_relay = true
|
||||
|
||||
role = Role.HOST
|
||||
connect_ui.hide()
|
||||
# Only start manually if NetworkEvents is not handling it (e.g. multiplayer-simple)
|
||||
if not NetworkEvents.enabled:
|
||||
NetworkTime.start()
|
||||
|
||||
func join():
|
||||
role = Role.CLIENT
|
||||
|
||||
if force_relay_check.button_pressed:
|
||||
Noray.connect_relay(host_oid_input.text)
|
||||
else:
|
||||
Noray.connect_nat(host_oid_input.text)
|
||||
|
||||
func _handle_connect_nat(address: String, port: int) -> Error:
|
||||
var err = await _handle_connect(address, port)
|
||||
|
||||
# If client failed to connect over NAT, try again over relay
|
||||
if err != OK and role != Role.HOST:
|
||||
print("NAT connect failed with reason %s, retrying with relay" % error_string(err))
|
||||
Noray.connect_relay(host_oid_input.text)
|
||||
err = OK
|
||||
|
||||
return err
|
||||
|
||||
func _handle_connect_relay(address: String, port: int) -> Error:
|
||||
return await _handle_connect(address, port)
|
||||
|
||||
func _handle_connect(address: String, port: int) -> Error:
|
||||
if not Noray.local_port:
|
||||
return ERR_UNCONFIGURED
|
||||
|
||||
var err = OK
|
||||
|
||||
if role == Role.NONE:
|
||||
push_warning("Refusing connection, not running as client nor host")
|
||||
err = ERR_UNAVAILABLE
|
||||
|
||||
if role == Role.CLIENT:
|
||||
var udp = PacketPeerUDP.new()
|
||||
udp.bind(Noray.local_port)
|
||||
udp.set_dest_address(address, port)
|
||||
|
||||
print("Attempting handshake with %s:%s" % [address, port])
|
||||
err = await PacketHandshake.over_packet_peer(udp)
|
||||
udp.close()
|
||||
|
||||
if err != OK:
|
||||
if err == ERR_BUSY:
|
||||
print("Handshake to %s:%s succeeded partially, attempting connection anyway" % [address, port])
|
||||
else:
|
||||
print("Handshake to %s:%s failed: %s" % [address, port, error_string(err)])
|
||||
return err
|
||||
else:
|
||||
print("Handshake to %s:%s succeeded" % [address, port])
|
||||
|
||||
# Connect
|
||||
var peer = ENetMultiplayerPeer.new()
|
||||
err = peer.create_client(address, port, 0, 0, 0, Noray.local_port)
|
||||
if err != OK:
|
||||
print("Failed to create client: %s" % error_string(err))
|
||||
return err
|
||||
|
||||
get_tree().get_multiplayer().multiplayer_peer = peer
|
||||
|
||||
# Wait for connection to succeed
|
||||
await Async.condition(
|
||||
func(): return peer.get_connection_status() != MultiplayerPeer.CONNECTION_CONNECTING
|
||||
)
|
||||
|
||||
if peer.get_connection_status() != MultiplayerPeer.CONNECTION_CONNECTED:
|
||||
print("Failed to connect to %s:%s with status %s" % [address, port, peer.get_connection_status()])
|
||||
get_tree().get_multiplayer().multiplayer_peer = null
|
||||
return ERR_CANT_CONNECT
|
||||
|
||||
connect_ui.hide()
|
||||
# Only start manually if NetworkEvents is not handling it (e.g. multiplayer-simple)
|
||||
if not NetworkEvents.enabled:
|
||||
NetworkTime.start()
|
||||
|
||||
if role == Role.HOST:
|
||||
# We should already have the connection configured, only thing to do is a handshake
|
||||
var peer = get_tree().get_multiplayer().multiplayer_peer as ENetMultiplayerPeer
|
||||
|
||||
err = await PacketHandshake.over_enet_peer(peer, address, port)
|
||||
|
||||
if err != OK:
|
||||
print("Handshake to %s:%s failed: %s" % [address, port, error_string(err)])
|
||||
return err
|
||||
print("Handshake to %s:%s concluded" % [address, port])
|
||||
|
||||
return err
|
||||
@@ -0,0 +1 @@
|
||||
uid://dbib5njqdsuc2
|
||||
@@ -0,0 +1,58 @@
|
||||
extends Node
|
||||
|
||||
@export var player_scene: PackedScene
|
||||
@export var spawn_root: Node
|
||||
|
||||
var avatars: Dictionary = {}
|
||||
|
||||
func _ready():
|
||||
NetworkEvents.on_client_start.connect(_handle_connected)
|
||||
NetworkEvents.on_server_start.connect(_handle_host)
|
||||
NetworkEvents.on_peer_join.connect(_handle_new_peer)
|
||||
NetworkEvents.on_peer_leave.connect(_handle_leave)
|
||||
NetworkEvents.on_client_stop.connect(_handle_stop)
|
||||
NetworkEvents.on_server_stop.connect(_handle_stop)
|
||||
|
||||
func _handle_connected(id: int):
|
||||
# Spawn an avatar for us
|
||||
_spawn(id)
|
||||
|
||||
func _handle_host():
|
||||
# Spawn own avatar on host machine
|
||||
_spawn(1)
|
||||
|
||||
func _handle_new_peer(id: int):
|
||||
# Spawn an avatar for new player
|
||||
_spawn(id)
|
||||
|
||||
func _handle_leave(id: int):
|
||||
if not avatars.has(id):
|
||||
return
|
||||
|
||||
var avatar = avatars[id] as Node
|
||||
avatar.queue_free()
|
||||
avatars.erase(id)
|
||||
|
||||
func _handle_stop():
|
||||
# Remove all avatars on game end
|
||||
for avatar in avatars.values():
|
||||
avatar.queue_free()
|
||||
avatars.clear()
|
||||
|
||||
func _spawn(id: int):
|
||||
var avatar = player_scene.instantiate() as Node
|
||||
avatars[id] = avatar
|
||||
avatar.name += " #%d" % id
|
||||
|
||||
# Avatar is always owned by server
|
||||
avatar.set_multiplayer_authority(1)
|
||||
|
||||
print("Spawned avatar %s at %s" % [avatar.name, multiplayer.get_unique_id()])
|
||||
|
||||
# Avatar's input object is owned by player
|
||||
var input = avatar.find_child("Input")
|
||||
if input != null:
|
||||
input.set_multiplayer_authority(id)
|
||||
print("Set input(%s) ownership to %s" % [input.name, id])
|
||||
|
||||
spawn_root.add_child(avatar)
|
||||
@@ -0,0 +1 @@
|
||||
uid://dpxlg4y45fgd1
|
||||
@@ -0,0 +1,21 @@
|
||||
extends Label
|
||||
|
||||
func _ready():
|
||||
NetworkTime.on_tick.connect(_tick)
|
||||
|
||||
func _tick(_delta: float, _tick: int):
|
||||
text = "Time: %.2f at tick #%d" % [NetworkTime.time, NetworkTime.tick]
|
||||
|
||||
if not get_tree().get_multiplayer().is_server():
|
||||
# Grab latency to server and display
|
||||
var enet = get_tree().get_multiplayer().multiplayer_peer as ENetMultiplayerPeer
|
||||
if enet == null:
|
||||
return
|
||||
|
||||
var server = enet.get_peer(1)
|
||||
var last_rtt = server.get_statistic(ENetPacketPeer.PEER_LAST_ROUND_TRIP_TIME)
|
||||
var last_variance = server.get_statistic(ENetPacketPeer.PEER_LAST_ROUND_TRIP_TIME_VARIANCE)
|
||||
var mean_rtt = server.get_statistic(ENetPacketPeer.PEER_ROUND_TRIP_TIME)
|
||||
var mean_variance = server.get_statistic(ENetPacketPeer.PEER_ROUND_TRIP_TIME_VARIANCE)
|
||||
|
||||
text += "\nLast RTT: %s +/- %s\nMean RTT: %s +/- %s" % [last_rtt, last_variance, mean_rtt, mean_variance]
|
||||
@@ -0,0 +1 @@
|
||||
uid://c3eokqjyc0bee
|
||||
@@ -0,0 +1,28 @@
|
||||
extends Label
|
||||
|
||||
func _process(_delta):
|
||||
text = "Time: %.2f at tick #%d, clock at %.2f%%" % [NetworkTime.time, NetworkTime.tick, NetworkTime.clock_stretch_factor * 100.]
|
||||
text += "\nClock offset: %.2fms, Remote offset: %.2fms" % [NetworkTime.clock_offset * 1000., NetworkTime.remote_clock_offset * 1000.]
|
||||
text += "\nRemote RTT: %.2fms +/- %.2fms" % [NetworkTimeSynchronizer.rtt * 1000., NetworkTimeSynchronizer.rtt_jitter * 1000.]
|
||||
text += "\nFactor: %.2f" % [NetworkTime.tick_factor]
|
||||
text += "\nFPS: %s" % [Engine.get_frames_per_second()]
|
||||
|
||||
var has_connection = multiplayer.has_multiplayer_peer() \
|
||||
and multiplayer.multiplayer_peer.get_connection_status() == MultiplayerPeer.CONNECTION_CONNECTED
|
||||
|
||||
if has_connection and not multiplayer.is_server():
|
||||
# Grab latency to server and display
|
||||
var enet = get_tree().get_multiplayer().multiplayer_peer as ENetMultiplayerPeer
|
||||
if enet == null or enet.get_peer(1) == null:
|
||||
return
|
||||
|
||||
var server = enet.get_peer(1)
|
||||
if server == null:
|
||||
return
|
||||
|
||||
var last_rtt = server.get_statistic(ENetPacketPeer.PEER_LAST_ROUND_TRIP_TIME)
|
||||
var last_variance = server.get_statistic(ENetPacketPeer.PEER_LAST_ROUND_TRIP_TIME_VARIANCE)
|
||||
var mean_rtt = server.get_statistic(ENetPacketPeer.PEER_ROUND_TRIP_TIME)
|
||||
var mean_variance = server.get_statistic(ENetPacketPeer.PEER_ROUND_TRIP_TIME_VARIANCE)
|
||||
|
||||
text += "\nLast RTT: %s +/- %s\nMean RTT: %s +/- %s" % [last_rtt, last_variance, mean_rtt, mean_variance]
|
||||
@@ -0,0 +1 @@
|
||||
uid://1jje4t4evf2s
|
||||
@@ -0,0 +1,153 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://badtpsxn5lago"]
|
||||
|
||||
[ext_resource type="Script" path="res://examples/shared/scripts/lan-bootstrapper.gd" id="1_dy86e"]
|
||||
[ext_resource type="Script" path="res://examples/shared/scripts/noray-bootstrapper.gd" id="2_fgck5"]
|
||||
|
||||
[node name="Network Popup" type="TabContainer"]
|
||||
custom_minimum_size = Vector2(360, 240)
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -125.5
|
||||
offset_top = -48.5
|
||||
offset_right = 125.5
|
||||
offset_bottom = 48.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="LAN" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Address Row" type="HBoxContainer" parent="LAN"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 2
|
||||
|
||||
[node name="Address Label" type="Label" parent="LAN/Address Row"]
|
||||
layout_mode = 2
|
||||
text = "Address:"
|
||||
|
||||
[node name="Address LineEdit" type="LineEdit" parent="LAN/Address Row"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
text = "localhost"
|
||||
|
||||
[node name="Port Label" type="Label" parent="LAN/Address Row"]
|
||||
layout_mode = 2
|
||||
text = "Port:"
|
||||
|
||||
[node name="Port LineEdit" type="LineEdit" parent="LAN/Address Row"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
text = "16384"
|
||||
|
||||
[node name="Actions Row" type="HBoxContainer" parent="LAN"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
|
||||
[node name="Host Button" type="Button" parent="LAN/Actions Row"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Host"
|
||||
|
||||
[node name="Join Button" type="Button" parent="LAN/Actions Row"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Join"
|
||||
|
||||
[node name="Noray" type="VBoxContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Noray Address Row" type="HBoxContainer" parent="Noray"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Address Label" type="Label" parent="Noray/Noray Address Row"]
|
||||
layout_mode = 2
|
||||
text = "noray host:"
|
||||
|
||||
[node name="Address LineEdit" type="LineEdit" parent="Noray/Noray Address Row"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "tomfol.io:8890"
|
||||
placeholder_text = "noray.example.com:8890"
|
||||
|
||||
[node name="OID Row" type="HBoxContainer" parent="Noray"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="OID Label" type="Label" parent="Noray/OID Row"]
|
||||
layout_mode = 2
|
||||
text = "Open ID: "
|
||||
|
||||
[node name="OID Value" type="LineEdit" parent="Noray/OID Row"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "123456789"
|
||||
editable = false
|
||||
|
||||
[node name="Noray Actions Row" type="HBoxContainer" parent="Noray"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Connect Button" type="Button" parent="Noray/Noray Actions Row"]
|
||||
layout_mode = 2
|
||||
text = "Connect"
|
||||
|
||||
[node name="Disconnect Button" type="Button" parent="Noray/Noray Actions Row"]
|
||||
layout_mode = 2
|
||||
text = "Disconnect"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="Noray"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Connect Host Row" type="HBoxContainer" parent="Noray"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Host Label" type="Label" parent="Noray/Connect Host Row"]
|
||||
layout_mode = 2
|
||||
text = "Target Host: "
|
||||
|
||||
[node name="Host LineEdit" type="LineEdit" parent="Noray/Connect Host Row"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Host OID"
|
||||
|
||||
[node name="Connect Actions Row" type="HBoxContainer" parent="Noray"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Host Button" type="Button" parent="Noray/Connect Actions Row"]
|
||||
layout_mode = 2
|
||||
text = "Host"
|
||||
|
||||
[node name="Join Button" type="Button" parent="Noray/Connect Actions Row"]
|
||||
layout_mode = 2
|
||||
text = "Join"
|
||||
|
||||
[node name="Force Relay Checkbox" type="CheckBox" parent="Noray/Connect Actions Row"]
|
||||
layout_mode = 2
|
||||
text = "Force Relay"
|
||||
|
||||
[node name="LAN Bootstrapper" type="Node" parent="." node_paths=PackedStringArray("connect_ui", "address_input", "port_input")]
|
||||
script = ExtResource("1_dy86e")
|
||||
connect_ui = NodePath("..")
|
||||
address_input = NodePath("../LAN/Address Row/Address LineEdit")
|
||||
port_input = NodePath("../LAN/Address Row/Port LineEdit")
|
||||
|
||||
[node name="Noray Bootstrapper" type="Node" parent="." node_paths=PackedStringArray("connect_ui", "noray_address_input", "oid_input", "host_oid_input", "force_relay_check")]
|
||||
script = ExtResource("2_fgck5")
|
||||
connect_ui = NodePath("..")
|
||||
noray_address_input = NodePath("../Noray/Noray Address Row/Address LineEdit")
|
||||
oid_input = NodePath("../Noray/OID Row/OID Value")
|
||||
host_oid_input = NodePath("../Noray/Connect Host Row/Host LineEdit")
|
||||
force_relay_check = NodePath("../Noray/Connect Actions Row/Force Relay Checkbox")
|
||||
|
||||
[connection signal="pressed" from="LAN/Actions Row/Host Button" to="LAN Bootstrapper" method="host"]
|
||||
[connection signal="pressed" from="LAN/Actions Row/Join Button" to="LAN Bootstrapper" method="join"]
|
||||
[connection signal="pressed" from="Noray/Noray Actions Row/Connect Button" to="Noray Bootstrapper" method="connect_to_noray"]
|
||||
[connection signal="pressed" from="Noray/Noray Actions Row/Disconnect Button" to="Noray Bootstrapper" method="disconnect_from_noray"]
|
||||
[connection signal="pressed" from="Noray/Connect Actions Row/Host Button" to="Noray Bootstrapper" method="host"]
|
||||
[connection signal="pressed" from="Noray/Connect Actions Row/Join Button" to="Noray Bootstrapper" method="join"]
|
||||
@@ -0,0 +1,11 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bpf1jdr255nr0"]
|
||||
|
||||
[ext_resource type="Script" path="res://examples/shared/scripts/time-display.gd" id="1_0i26b"]
|
||||
|
||||
[node name="Time Display" type="Label"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_0i26b")
|
||||
Reference in New Issue
Block a user