private IEnumerator JoinMatchLobby() { ApplicationModel.JoinToMatchLobby = false; var cancel = false; if (ApplicationModel.CurrentMatchLobbyToJoin.locked) { InvitationCodeModal.InvitationCodeModalResult modalResult = null; yield return(AskForInvitationCode((result) => { modalResult = result; })); cancel = modalResult.OptionSelected != InvitationCodeModal.OptionSelected.OK; if (!cancel) { yield return(StartCoroutine(ConnectMatchLobby(ApplicationModel.CurrentMatchLobbyToJoin.matchLobbyId, invitationCodeModal.Result.InvitationCode))); } } else { yield return(StartCoroutine(ConnectMatchLobby(ApplicationModel.CurrentMatchLobbyToJoin.matchLobbyId))); } if (!cancel && ApplicationModel.CurrentMatchLobby != null) { // HACK: set that the lobby players list has changed in order to trigger the players renderization ApplicationModel.CreateRemotePlayersHandler(PlayFabMultiplayerManager.Get()); ApplicationModel.MatchLobbyJoinedPlayerListHasChanged = true; SceneManager.LoadScene("MatchLobby"); } }
private void HandleUserAuthenticated() { Logger.Instance.Log("Party - HandleUserAuthenticated"); PlayFabMultiplayerManager.Get().CreateAndJoinNetwork(); PlayFabMultiplayerManager.Get().OnNetworkJoined += OnNetworkJoined; PlayFabMultiplayerManager.Get().OnError += OnError; }
private IEnumerator TryCreateMatchLobby(string sessionName) { var error = Constants.CREATE_MATCH_LOBBY_ERROR; UpdateGameStatus(Constants.MATCH_LOBBY_CREATING + sessionName); try { IsLobbyCreated = true; yield return(StartCoroutine(CreateMatchLobby(sessionName, true))); if (ApplicationModel.CurrentMatchLobby == null) { error = Constants.MATCH_LOBBY_REPEATED; } else { ApplicationModel.CreateRemotePlayersHandler(PlayFabMultiplayerManager.Get()); SceneManager.LoadScene("MatchLobby"); error = string.Empty; } } finally { if (!string.IsNullOrWhiteSpace(error)) { IsLobbyCreated = false; UpdateGameStatus(error); } } }
public PlayFabChatXboxLivePolicyProvider() { PlayFabMultiplayerManager._LogInfo("PlayFabChatXboxLivePolicyProvider:PlayFabChatXboxLivePolicyProvider()"); _multiplayerManager = PlayFabMultiplayerManager.Get(); string titleId = PlayFabSettings.staticSettings.TitleId; _playerChatPermissions = new Dictionary <PlayFabPlayer, PARTY_XBL_CHAT_PERMISSION_INFO>(new PlayerComparator()); _queuedCreateRemoteXboxLiveChatUserOps = new List <QueuedCreateRemoteXboxLiveChatUserOp>(); _xblStateChanges = new List <PARTY_XBL_STATE_CHANGE>(); _internalXuidExchangeMessageBuffer = new byte[_INTERNAL_XUID_EXCHANGE_MESSAGE_BUFFER_SIZE]; Succeeded(XBLSDK.PartyXblInitialize(titleId, out _xblPartyHandle)); _XUID_EXCHANGE_REQUEST_AS_BYTES = Encoding.ASCII.GetBytes(_XUID_EXCHANGE_REQUEST_MESSAGE_PREFIX); _XUID_EXCHANGE_RESPONSE_AS_BYTES = Encoding.ASCII.GetBytes(_XUID_EXCHANGE_RESPONSE_MESSAGE_PREFIX); }