initial commit

This commit is contained in:
2020-05-09 12:45:05 +02:00
commit a3549d357b
46 changed files with 3051 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
extends Node
# {game_id:[_game_id, _game_name, _max_players, _player_list]} # player_list is a dict
# {game_id:[_game_id, _game_name, _max_players, {player_id:[_player_name, _player_id, _game_id, _is_host]}]}
var _open_games = {}
var _players_online = []
remote func get_open_games_from_server(id):
rpc_id(id, "update_open_games", _open_games)
remote func add_game_to_game_list(game_id, game_information, host_player):
_open_games[game_id] = game_information
add_player_to_open_game(game_id, host_player)
get_open_games_from_server(game_id)
remote func join_open_game(game_id, player_information):
add_player_to_open_game(game_id, player_information)
func add_player_to_open_game(game_id, player_information):
_open_games[game_id][3][player_information[1]] = player_information
remote func remove_player_from_open_game(game_id, player_id):
_open_games[game_id][3].erase(player_id)
remote func remove_game_from_game_list(game_id):
_open_games.erase(game_id)

View File

@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Scenes/Matchmaking/Networking/Networking_sync.gd" type="Script" id=1]
[node name="Networking" type="Node"]
script = ExtResource( 1 )