예제 #1
0
 public void LobbyEntered(GalaxyID lobbyID)
 {
     GalaxyManager.Instance.Matchmaking.CurrentLobbyID = lobbyID;
     GalaxyManager.Instance.Matchmaking.LobbyOwnerID   = matchmaking.GetLobbyOwner(lobbyID);
     matchmaking.SetLobbyMemberData("state", "notReady");
     GameObject.Find("MainMenu").GetComponent <MainMenuController>().SwitchMenu(MainMenuController.MenuEnum.OnlineWait);
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public override void OnLobbyMemberStateChanged(GalaxyID lobbyID, GalaxyID memberID, LobbyMemberStateChange memberStateChange)
 {
     Debug.Log("OnLobbyMemberStateChanged lobbyID: " + lobbyID + " memberID: " + memberID + " change: " + memberStateChange);
     if (memberStateChange != LobbyMemberStateChange.LOBBY_MEMBER_STATE_CHANGED_ENTERED)
     {
         matchmaking.SetLobbyData(lobbyID, "state", "notReady");
         matchmaking.SetLobbyMemberData("state", "notReady");
     }
 }
 void LobbyDataUpdatedSteady(GalaxyID lobbyID)
 {
     if (matchmaking.GetLobbyData(lobbyID, "state") == "steady")
     {
         Debug.Assert(matchmaking.GetLobbyMemberData(GalaxyManager.Instance.MyGalaxyID, "state") == "ready");
         matchmaking.SetLobbyMemberData("state", "steady");
         SceneController.Instance.LoadScene(SceneController.SceneName.Online2PlayerGame, true);
         matchmaking.ShutdownLobbyManagementMainMenu();
     }
 }
        private void LobbyCreated(GalaxyID lobbyID)
        {
            matchmaking.SetLobbyData(lobbyID, "name", matchmaking.lobbyName);
            matchmaking.SetLobbyData(lobbyID, "state", "notReady");

            matchmaking.CurrentLobbyID = lobbyID;
            matchmaking.LobbyOwnerID   = GalaxyInstance.Matchmaking().GetLobbyOwner(lobbyID);
            matchmaking.SetLobbyMemberData("state", "notReady");
            GameObject.Find("MainMenu").GetComponent <MainMenuController>().SwitchMenu(MainMenuController.MenuEnum.OnlineWait);
        }
예제 #6
0
 public override void OnLobbyEntered(GalaxyID lobbyID, LobbyEnterResult _result)
 {
     if (_result != LobbyEnterResult.LOBBY_ENTER_RESULT_SUCCESS)
     {
         Debug.Log("LobbyEnteredListenerBrowsing failed");
         GameObject.Find("MainMenu").GetComponent <MainMenuController>().SwitchMenu(MainMenuController.MenuEnum.OnlineBrowser);
         GameObject.Find("PopUps").GetComponent <PopUps>().PopUpWithClosePopUpsButton("Could not join lobby\nReason: " +
                                                                                      _result.ToString(), "Back");
         return;
     }
     Debug.Log("LobbyEnteredListenerBrowsing succeded");
     matchmaking.CurrentLobbyID = lobbyID;
     matchmaking.LobbyOwnerID   = matchmaking.GetLobbyOwner(lobbyID);
     matchmaking.SetLobbyMemberData("state", "notReady");
     GameObject.Find("MainMenu").GetComponent <MainMenuController>().SwitchMenu(MainMenuController.MenuEnum.OnlineWait);
     friends.SetRichPresence("status", "In online lobby");
     friends.SetRichPresence("connect", "--JoinLobby=" + lobbyID);
     matchmaking.LobbyManagmentMainMenuListenersInit();
     matchmaking.LobbyChatListenersInit();
     matchmaking.LobbyBrowsingListenersDispose();
 }