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); }
void LobbyMemberDataUpdatedReady(GalaxyID lobbyID) { if (GalaxyManager.Instance.MyGalaxyID == matchmaking.LobbyOwnerID) { matchmaking.SetLobbyData(lobbyID, "state", AllMembersReady(lobbyID) ? "ready" : "notReady"); } }
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); } }
void LobbyMemberDataUpdated(GalaxyID lobbyID, GalaxyID memberID) { if (AllMembersGo(lobbyID, memberID)) { matchmaking.SetLobbyData(lobbyID, "state", "go"); GameObject.Find("GameManager").GetComponent <Online2PlayerGameManager>().enabled = true; GameObject.Find("PopUps").GetComponent <PopUps>().ClosePopUps(); } }
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"); } }
public override void OnLobbyCreated(GalaxyID lobbyID, LobbyCreateResult _result) { if (_result != LobbyCreateResult.LOBBY_CREATE_RESULT_SUCCESS) { Debug.Log("LobbyCreatedListenerCreation failed"); GameObject.Find("MainMenu").GetComponent <MainMenuController>().SwitchMenu(MainMenuController.MenuEnum.OnlineCreate); GameObject.Find("PopUps").GetComponent <PopUps>().PopUpWithClosePopUpsButton("Could not create lobby\nReason: " + _result.ToString(), "back"); return; } Debug.Log("LobbyCreatedListenerCreation succeded"); matchmaking.SetLobbyData(lobbyID, "name", matchmaking.lobbyName); matchmaking.SetLobbyData(lobbyID, "state", "notReady"); 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.LobbyCreationListenersDispose(); }
public override void OnLobbyDataUpdated(GalaxyID lobbyID, GalaxyID memberID) { Debug.Log("LobbyID: " + lobbyID + "\nMemberID: " + memberID); if (memberID.IsValid()) { if (AllMembersGo(lobbyID) && matchmaking.IsCurrentUserLobbyOwner()) { matchmaking.SetLobbyData(lobbyID, "state", "go"); } return; } if (matchmaking.GetLobbyData(lobbyID, "state") == "go") { GameObject.Find("GameManager").GetComponent <Online2PlayerGameManager>().enabled = true; GameObject.Find("PopUps").GetComponent <PopUps>().ClosePopUps(); } }