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>
53 lines
1.7 KiB
GDScript
53 lines
1.7 KiB
GDScript
extends Node
|
|
class_name TestingServers
|
|
|
|
var _command_server: CommandServer
|
|
var _identity_server: _NetworkIdentityServer
|
|
var _history_server: _NetworkHistoryServer
|
|
var _synchronization_server: _NetworkSynchronizationServer
|
|
var _simulation_server: _RollbackSimulationServer
|
|
|
|
static func create() -> TestingServers:
|
|
var servers := TestingServers.new()
|
|
|
|
Vest.get_tree().root.add_child.call_deferred(servers)
|
|
await servers.ready
|
|
|
|
return servers
|
|
|
|
func _ready():
|
|
_command_server = CommandServer.new()
|
|
_history_server = _NetworkHistoryServer.new()
|
|
_identity_server = _NetworkIdentityServer.new(_command_server)
|
|
_synchronization_server = _NetworkSynchronizationServer.new(_command_server, _history_server, _identity_server, _simulation_server)
|
|
_simulation_server = _RollbackSimulationServer.new(_history_server)
|
|
var servers := [_command_server, _history_server, _identity_server, _synchronization_server, _simulation_server]
|
|
|
|
for server in servers:
|
|
add_child.call_deferred(server)
|
|
|
|
for server in servers:
|
|
await server.ready
|
|
|
|
func command_server() -> CommandServer:
|
|
return _command_server
|
|
|
|
func identity_server() -> _NetworkIdentityServer:
|
|
return _identity_server
|
|
|
|
func history_server() -> _NetworkHistoryServer:
|
|
return _history_server
|
|
|
|
func synchronization_server() -> _NetworkSynchronizationServer:
|
|
return _synchronization_server
|
|
|
|
func simulation_server() -> _RollbackSimulationServer:
|
|
return _simulation_server
|
|
|
|
|
|
class CommandServer extends _NetworkCommandServer:
|
|
var commands_sent := [] as Array[Array]
|
|
|
|
func send_command(idx: int, data: PackedByteArray, target_peer: int = 0, mode: MultiplayerPeer.TransferMode = MultiplayerPeer.TRANSFER_MODE_RELIABLE, channel: int = 0) -> void:
|
|
commands_sent.append([idx, data, target_peer, mode, channel])
|