Development Syncup: Working on the map testing.

This commit is contained in:
Patrick_Pluto 2024-12-06 17:36:49 +01:00
parent c07c04e8f9
commit 1351ce3178
4 changed files with 45 additions and 0 deletions

View file

@ -236,3 +236,19 @@ func send_playerlist(status: int, newPeers: Dictionary) -> void:
Log.warning("Name %s is already taken in the room!" % Game.username)
3:
Log.warning("Sent a playerlist request to a regular peer, not the host!")
## General Game RPCs
# Does RPCs to all clients.
func send_rpcs(method: String, args: Array) -> void:
for peer: String in peers:
var id: int = peers[peer]
if rpc_id(id, method, args) != OK:
Log.warning("Failed to send the rpc %s to %d." % [method, id])
# Starts the game.
@rpc("any_peer", "call_remote", "reliable")
func start_game() -> void:
if multiplayer.get_remote_sender_id() == managerID:
if !get_tree().change_scene_to_file("res://scenes/maps/testmap.tscn"):
Log.warning("Couldn't load the map!")