public void ReconnectPlayer(string playerName)
    {
        if (thisRoomNumber == -1)
        {
            return;
        }
        FirebaseDatabase.DefaultInstance.GetReference("rooms/" + thisRoomNumber + "/players").GetValueAsync().ContinueWith(task => {
            if (task.IsFaulted)
            {
                Debug.LogError("No game data");
            }
            else if (task.IsCompleted)
            {
                DataSnapshot data = task.Result;


                bool gameInProgress = gameManager.CurrentGameState == GameManager.GameState.Playing ||
                                      gameManager.CurrentGameState == GameManager.GameState.Over;

                if (gameInProgress && (!data.HasChildren || data.ChildrenCount < 2))
                {
                    Debug.Log("Can't join a game with less than 2 players");
                    gameManager.AbortGame("The other player has disconnected");
                    return;
                }

                if (!data.Child(playerName).Exists)
                {
                    gameManager.AbortGame("This game cannot be continued");
                    return;
                }


                DatabaseReference reference = FirebaseDatabase.DefaultInstance.GetReference(
                    "rooms/" + thisRoomNumber + "/players/" + playerName + "/connected");
                reference.SetValueAsync("true");
            }
        });

        SetRoomStatus(thisRoomNumber, "done");
    }