b0c83af092
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>
62 lines
1.6 KiB
GDScript
62 lines
1.6 KiB
GDScript
extends VestTest
|
|
|
|
func get_suite_name() -> String:
|
|
return "NetworkHistoryServer"
|
|
|
|
var idx := 0
|
|
|
|
func suite():
|
|
for count in [16, 1024, 16384]:
|
|
# register / record / restore / deregister
|
|
# *2.06us/235.37us/*46.01us/*1.37us, 14.05us/14.73ms/1.08ms/6.56us, 207.84us/234.73ms/23.18ms/88.84us
|
|
# *2.19us/77.97us/*23.46us/*3.07us, 1.73us/ 4.55ms/1.83ms/1.48us, 2.15us/ 81.64ms/45.45ms/ 1.57us
|
|
test("%d nodes" % count, func():
|
|
# Create nodes
|
|
var nodes := await get_nodes(count)
|
|
|
|
# Register nodes
|
|
idx = 0
|
|
benchmark("register()", func(__):
|
|
NetworkHistoryServer.register_rollback_state(nodes[idx], "name")
|
|
idx += 1
|
|
).with_iterations(count).with_batch_size(count).run()
|
|
|
|
# Record
|
|
benchmark("record()", func(__):
|
|
NetworkHistoryServer._record_rollback_state(0)
|
|
).with_duration(1.).with_batch_size(16).run()
|
|
|
|
# Restore
|
|
benchmark("restore()", func(__):
|
|
NetworkHistoryServer._restore_rollback_state(0)
|
|
).with_duration(1.).with_batch_size(16).run()
|
|
|
|
# Deregister nodes
|
|
idx = 0
|
|
benchmark("deregister()", func(__):
|
|
NetworkHistoryServer.deregister_rollback_state(nodes[idx], "name")
|
|
idx += 1
|
|
).with_iterations(count).with_batch_size(count).run()
|
|
|
|
# Free nodes
|
|
free_nodes(nodes)
|
|
)
|
|
|
|
func get_nodes(count: int) -> Array[Node]:
|
|
var nodes := [] as Array[Node]
|
|
|
|
for i in count:
|
|
var node := Node.new()
|
|
node.name = "Node %d" % i
|
|
nodes.append(node)
|
|
Vest.get_tree().root.add_child.call_deferred(node)
|
|
|
|
for node in nodes:
|
|
await node.ready
|
|
|
|
return nodes
|
|
|
|
func free_nodes(nodes: Array[Node]) -> void:
|
|
for node in nodes:
|
|
node.queue_free()
|