/// <summary> /// Initialize All MessagesSent /// </summary> public void Clear() { LastSentMessages.Clear(); DelayedMessages.Clear(); _waitingMessagesCount = 0; Result.Clear(); LostMessages.Clear(); WaitingMessages.Clear(); Result.Clear(); }
/// <summary> /// Lost message is a message whose Sender was not found /// </summary> /// <param name="message">The state of the message is changed to Lost</param> public void EnqueueLostMessage(Message message) { if (message is null) { throw new ArgumentNullException(nameof(message)); } message.State = MessageState.Lost; Result.LostMessagesCount++; if (Debug) { LostMessages.Add(message); } }
public override void Initialize() { this.StartCoroutine(InitializeCoroutine()); IEnumerator InitializeCoroutine() { PlayFabSettings.GlobalErrorHandler += this.OnGlobalErrorEvent; yield return(ReleasesManager.WaitForInitialization()); yield return(UnityPurchasingManager.WaitForInitialization()); PlayFabManager.Settings playfabSettings = ReleasesManager.Instance.CurrentRelease.PlayfabManagerSettings; string catalogVersion = playfabSettings.CatalogVersion; PlayFabSettings.staticSettings.TitleId = Lost.BuildConfig.RuntimeBuildConfig.Instance.GetString(PlayFabConfigExtensions.TitleId); this.Login = new LoginManager(this); // Starting the Logging In loop var combinedParams = new GetPlayerCombinedInfoRequestParams { GetTitleData = playfabSettings.LoadTitleDataKeys.Count > 0, TitleDataKeys = playfabSettings.LoadTitleDataKeys, GetUserInventory = playfabSettings.LoadInventory, GetUserVirtualCurrency = playfabSettings.LoadVirtualCurrency, GetPlayerProfile = playfabSettings.LoadPlayerProfile, GetCharacterList = playfabSettings.LoadCharacters, GetUserAccountInfo = true, }; LostMessages.BootloaderLoggingIn(); var login = this.Login.Login(this.loginMethod, combinedParams, playfabSettings.FacebookPermissions); yield return(login); this.Catalog = new CatalogManager(this, catalogVersion); this.Character = new CharacterManager(this, login.Value?.InfoResultPayload?.CharacterList); this.Inventory = new InventoryManager(this, login.Value?.InfoResultPayload?.UserInventory); this.Purchasing = new PurchasingManager(this, catalogVersion); this.PushNotifications = new PushNotificationManager(this); this.Store = new StoreManager(this, catalogVersion); this.TitleData = new TitleDataManager(this, login.Value?.InfoResultPayload?.TitleData); this.TitleNews = new TitleNewsManager(this); this.User = new UserManager(this, login.Value); this.VirtualCurrency = new VirtualCurrencyManager(this, login.Value?.InfoResultPayload?.UserVirtualCurrency); // Catalog if (playfabSettings.LoadCatalog) { LostMessages.BootloaderDownloadingCatalog(); yield return(this.Catalog.GetCatalog()); } // Stores if (playfabSettings.LoadStoresAtStartup?.Count > 0) { LostMessages.BootloaderLoadingStores(); foreach (var store in playfabSettings.LoadStoresAtStartup) { // TODO [bgish]: Tell the loading dialog that we're getting store "X" yield return(this.Store.GetStore(store)); } } // Initializing purchasing, but no need to wait on it later if (playfabSettings.LoadPurchasing) { LostMessages.BootloaderInitializingPurchasing(); yield return(this.Purchasing.Initialize()); } // Push Notifications if (Application.platform == RuntimePlatform.IPhonePlayer && playfabSettings.RegisterIosPushNotificationsAtStartup) { this.PushNotifications.RegisterPushNotificationsWithPlayFab(); } else if (Application.platform == RuntimePlatform.Android) { this.PushNotifications.RegisterPushNotificationsWithPlayFab(); } this.SetInstance(this); } }