public override void OnLobbyDataUpdated(GalaxyID lobbyID, GalaxyID memberID) { Debug.Log("LobbyID: " + lobbyID + "\nMemberID: " + memberID); if (memberID.IsValid()) { if (matchmaking.IsCurrentUserLobbyOwner()) { matchmaking.SetLobbyData(lobbyID, "state", AllMembersReady(lobbyID) ? "ready" : "notReady"); } return; } GameObject.Find("OnlineWaitScreen").GetComponent <OnlineWaitController>().startGameButton.GetComponent <Button>(). interactable = (matchmaking.GetLobbyData(lobbyID, "state") == "ready" && matchmaking.IsCurrentUserLobbyOwner()); if (matchmaking.GetLobbyData(lobbyID, "state") == "steady") { Debug.Assert(matchmaking.GetLobbyMemberData(GalaxyManager.Instance.MyGalaxyID, "state") == "ready"); matchmaking.SetLobbyMemberData("state", "steady"); friends.SetRichPresence("connect", null); matchmaking.LobbyManagmentMainMenuListenersDispose(); matchmaking.LobbyManagmentInGameListenersInit(); SceneController.Instance.LoadScene(SceneController.SceneName.Online2PlayerGame, true); } }
public override void OnLobbyLeft(GalaxyID lobbyID, LobbyLeaveReason leaveReason) { if (leaveReason != LobbyLeaveReason.LOBBY_LEAVE_REASON_USER_LEFT) { GameObject.Find("PopUps").GetComponent <PopUps>().PopUpWithClosePopUpsButton("Host left the lobby", "Back"); } matchmaking.CurrentLobbyID = null; matchmaking.LobbyOwnerID = null; matchmaking.lobbyName = ""; friends.SetRichPresence("connect", null); GameObject.Find("OnlineChat").GetComponent <ChatController>().DisposeEntries(); GameObject.Find("MainMenu").GetComponent <MainMenuController>().SwitchMenu(MainMenuController.MenuEnum.Online); matchmaking.LobbyManagmentMainMenuListenersDispose(); matchmaking.LobbyChatListenersDispose(); }