Move the real player authority to server
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

- Add rust bindings for the server player controller
- Implement reconciliation loop for checking the player state
- Place spawners on the test map
- Add Containerfile and helm chart
This commit is contained in:
2025-01-29 12:25:26 +01:00
parent 523900cc82
commit dfe888a918
94 changed files with 3002 additions and 144 deletions

View File

@ -20,30 +20,34 @@ func _ready() -> void:
err = _add_player_spawner()
if err != OK:
print("Couldn't load player spawner")
push_error("Couldn't load player spawner")
err = _add_object_spawner()
if err != OK:
print("Couldn't load object spawner")
push_error("Couldn't load object spawner")
# add objects spawner
if multiplayer.is_server():
_spawn_player(1)
else:
if not OS.has_feature("dedicated_server"):
_request_spawn.rpc_id(1, multiplayer.get_unique_id())
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
if multiplayer.is_server():
var active_players = player_spawner._get_root().get_children()
for n in active_players:
if not GameServerManager.players.has(n.owner_id):
_remove_player(n.owner_id)
@rpc("call_local", "reliable", "any_peer")
func _request_spawn(id: int):
_spawn_player(id)
func _spawn_player(id: int):
var char : Node3D = null
player_spawner.spawn_players(spawn_locations, id)
func _remove_player(id: int):
player_spawner.remove_player(id)
func _add_player_spawner() -> Error :
if not ResourceLoader.exists(PLAYER_SPAWNER):
return ERR_DOES_NOT_EXIST