Files
Billiards/scenes/screens/lobby_screen/lobby_rpc.gd

36 lines
1.2 KiB
GDScript

extends Node
signal match_list_entries(match_list: Array)
signal match_list_entry_activated(match_id: String)
signal match_list_entry_added(match_entry: Dictionary)
signal match_list_entry_removed(match_id: String)
signal match_list_entry_load_match(
match_entry: Dictionary, is_player_1: bool
)
@rpc("authority", "call_local", "reliable")
func match_list_add_entry(match_entry: Dictionary) -> void:
push_warning("Client received new match entry...")
match_list_entry_added.emit(match_entry)
@rpc("authority", "call_local", "reliable")
func match_list_remove_entry(match_id: String) -> void:
push_warning("Client received delete match entry...")
match_list_entry_removed.emit(match_id)
@rpc("authority", "reliable")
func receive_match_list(match_list: Array) -> void:
push_warning("Client received match list...")
match_list_entries.emit(match_list)
@rpc("authority", "reliable")
func match_list_activate_entry(match_id: String) -> void:
push_warning("Client set active match entry...")
match_list_entry_activated.emit(match_id)
func load_game_scene(match_entry: Dictionary, is_player_1: bool) -> void:
push_warning("Client load game scene...")
match_list_entry_load_match.emit(match_entry, is_player_1)