Ejemplo n.º 1
0
    public IEnumerator StartGetLoadout()
    {
        if (!Singleton <ItemManager> .Instance.ValidateItemMall())
        {
            PopupSystem.ShowMessage("Error Getting Shop Data", "The shop is empty, perhaps there\nwas an error getting the Shop data?", PopupSystem.AlertType.OK, new Action(HandleWebServiceError));
            yield break;
        }
        yield return(UserWebServiceClient.GetLoadout(AuthToken, delegate(LoadoutView ev)
        {
            if (ev != null)
            {
                CheckLoadoutForExpiredItems(ev);
                Singleton <LoadoutManager> .Instance.UpdateLoadout(ev);
                GameState.Current.Avatar.SetLoadout(new Loadout(Singleton <LoadoutManager> .Instance.Loadout));
                _localPlayerSkinColor = ColorConverter.HexToColor(ev.SkinColor);
            }
            else
            {
                ApplicationDataManager.LockApplication("It seems that you account is corrupted. Please visit support.uberstrike.com for advice.");
            }
        }, delegate(Exception ex)
        {
            ApplicationDataManager.LockApplication("There was an error getting your loadout.");
        }));

        yield break;
    }
Ejemplo n.º 2
0
    public IEnumerator StartGetMember()
    {
        yield return(UserWebServiceClient.GetMember(AuthToken, new Action <UberstrikeUserViewModel>(OnGetMemberEventReturn), delegate(Exception ex)
        {
            ApplicationDataManager.LockApplication("There was an error getting your player data.");
        }));

        yield break;
    }
    // Token: 0x06001913 RID: 6419 RVA: 0x00086688 File Offset: 0x00084888
    internal void DisableNetworkConnection(string message)
    {
        Debug.LogError("DisableNetworkConnection");
        if (GameState.Current.HasJoinedGame)
        {
            global::EventHandler.Global.Fire(new GameEvents.PlayerPause());
        }
        AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Dispose();

        Singleton <GameStateController> .Instance.Client.Dispose();

        ApplicationDataManager.LockApplication(message);
    }
Ejemplo n.º 4
0
    public IEnumerator StartGetMemberWallet()
    {
        if (Cmid < 1)
        {
            Debug.LogError("Player CMID is invalid! Have you called AuthenticationManager.StartAuthenticateMember?");
            ApplicationDataManager.LockApplication("The authentication process failed. Please sign in on www.uberstrike.com and restart UberStrike.");
        }
        else
        {
            IPopupDialog popupDialog = PopupSystem.ShowMessage("Updating", "Updating your points and credits balance...", PopupSystem.AlertType.None);
            yield return(UserWebServiceClient.GetMemberWallet(AuthToken, new Action <MemberWalletView>(OnGetMemberWalletEventReturn), delegate(Exception ex)
            {
            }));

            yield return(new WaitForSeconds(0.5f));

            PopupSystem.HideMessage(popupDialog);
        }
        yield break;
    }
Ejemplo n.º 5
0
    // Token: 0x0600122C RID: 4652 RVA: 0x0006D314 File Offset: 0x0006B514
    static ApplicationDataManager()
    {
        try
        {
            ApplicationDataManager.ImagePath = (ApplicationDataManager.WebServiceBaseUrl = File.ReadAllText(Path.Combine(Application.dataPath, ".uberstrok")));
        }
        catch
        {
            ApplicationDataManager.LockApplication("Failed to load '.uberstrok' host config.");
        }
        try
        {
            string hsbPath = Path.Combine(Application.dataPath, "HSB.ogg");
            string url     = "file:///" + hsbPath;
            WWW    hsb     = new WWW(url);

            // delay until it's loaded.
            // probably not the most efficient way of dealing with things?
            while (hsb.progress < 1)
            {
                ;
            }
            if (hsb.progress >= 1)
            {
                GameAudio.HomeSceneBackground = hsb.audioClip;
            }
        }
        catch
        {
        }
        ApplicationDataManager.IsDebug             = true;
        ApplicationDataManager.applicationDateTime = 0f;
        ApplicationDataManager.serverDateTime      = DateTime.Now;
        ApplicationDataManager.WebPlayerHasResult  = false;
        ApplicationDataManager.ApplicationOptions  = new ApplicationOptions();
    }
    private IEnumerator CompleteAuthentication(MemberAuthenticationResultView authView, bool isRegistrationLogin = false)
    {
        if (authView == null)
        {
            Debug.LogError("Account authentication error: MemberAuthenticationResultView was null, isRegistrationLogin: "******"There was an error logging you in. Please try again or contact us at http://support.cmune.com");
            yield break;
        }
        if (authView.MemberAuthenticationResult == MemberAuthenticationResult.IsBanned || authView.MemberAuthenticationResult == MemberAuthenticationResult.IsIpBanned)
        {
            ApplicationDataManager.LockApplication(LocalizedStrings.YourAccountHasBeenBanned);
            yield break;
        }
        if (authView.MemberAuthenticationResult == MemberAuthenticationResult.InvalidEsns)
        {
            Debug.Log("Result: " + authView.MemberAuthenticationResult);
            ShowLoginErrorPopup(LocalizedStrings.Error, "Sorry, this account is linked already.");
            yield break;
        }
        if (authView.MemberAuthenticationResult != MemberAuthenticationResult.Ok)
        {
            Debug.Log("Result: " + authView.MemberAuthenticationResult);
            ShowLoginErrorPopup(LocalizedStrings.Error, "Your login credentials are not correct. Please try to login again.");
            yield break;
        }
        Singleton <PlayerDataManager> .Instance.SetLocalPlayerMemberView(authView.MemberView);

        PlayerDataManager.AuthToken = authView.AuthToken;
        if (!PlayerDataManager.IsTestBuild)
        {
            PlayerDataManager.MagicHash = UberDaemon.Instance.GetMagicHash(authView.AuthToken);
            Debug.Log("Magic Hash:" + PlayerDataManager.MagicHash);
        }
        ApplicationDataManager.ServerDateTime = authView.ServerTime;
        global::EventHandler.Global.Fire(new GlobalEvents.Login(authView.MemberView.PublicProfile.AccessLevel));
        _progress.Text     = LocalizedStrings.LoadingFriendsList;
        _progress.Progress = 0.2f;
        yield return(UnityRuntime.StartRoutine(Singleton <CommsManager> .Instance.GetContactsByGroups()));

        _progress.Text     = LocalizedStrings.LoadingCharacterData;
        _progress.Progress = 0.3f;
        yield return(ApplicationWebServiceClient.GetConfigurationData("4.7.1", delegate(ApplicationConfigurationView appConfigView)
        {
            XpPointsUtil.Config = appConfigView;
        }, delegate(Exception ex)
        {
            ApplicationDataManager.LockApplication(LocalizedStrings.ErrorLoadingData);
        }));

        Singleton <PlayerDataManager> .Instance.SetPlayerStatisticsView(authView.PlayerStatisticsView);

        _progress.Text     = LocalizedStrings.LoadingMapData;
        _progress.Progress = 0.5f;
        bool mapsLoadedSuccessfully = false;

        yield return(ApplicationWebServiceClient.GetMaps("4.7.1", DefinitionType.StandardDefinition, delegate(List <MapView> callback)
        {
            mapsLoadedSuccessfully = Singleton <MapManager> .Instance.InitializeMapsToLoad(callback);
        }, delegate(Exception ex)
        {
            ApplicationDataManager.LockApplication(LocalizedStrings.ErrorLoadingMaps);
        }));

        if (!mapsLoadedSuccessfully)
        {
            ShowLoginErrorPopup(LocalizedStrings.Error, LocalizedStrings.ErrorLoadingMapsSupport);
            PopupSystem.HideMessage(_progress);
            yield break;
        }
        _progress.Progress = 0.6f;
        _progress.Text     = LocalizedStrings.LoadingWeaponAndGear;
        yield return(UnityRuntime.StartRoutine(Singleton <ItemManager> .Instance.StartGetShop()));

        if (!Singleton <ItemManager> .Instance.ValidateItemMall())
        {
            PopupSystem.HideMessage(_progress);
            yield break;
        }
        _progress.Progress = 0.7f;
        _progress.Text     = LocalizedStrings.LoadingPlayerInventory;
        yield return(UnityRuntime.StartRoutine(Singleton <ItemManager> .Instance.StartGetInventory(false)));

        _progress.Progress = 0.8f;
        _progress.Text     = LocalizedStrings.GettingPlayerLoadout;
        yield return(UnityRuntime.StartRoutine(Singleton <PlayerDataManager> .Instance.StartGetLoadout()));

        if (!Singleton <LoadoutManager> .Instance.ValidateLoadout())
        {
            ShowLoginErrorPopup(LocalizedStrings.ErrorGettingPlayerLoadout, LocalizedStrings.ErrorGettingPlayerLoadoutSupport);
            yield break;
        }
        _progress.Progress = 0.85f;
        _progress.Text     = LocalizedStrings.LoadingPlayerStatistics;
        yield return(UnityRuntime.StartRoutine(Singleton <PlayerDataManager> .Instance.StartGetMember()));

        if (!Singleton <PlayerDataManager> .Instance.ValidateMemberData())
        {
            ShowLoginErrorPopup(LocalizedStrings.ErrorGettingPlayerStatistics, LocalizedStrings.ErrorPlayerStatisticsSupport);
            yield break;
        }
        _progress.Progress = 0.9f;
        _progress.Text     = LocalizedStrings.LoadingClanData;
        yield return(ClanWebServiceClient.GetMyClanId(PlayerDataManager.AuthToken, delegate(int id)
        {
            PlayerDataManager.ClanID = id;
        }, delegate(Exception ex)
        {
        }));

        if (PlayerDataManager.ClanID > 0)
        {
            yield return(ClanWebServiceClient.GetOwnClan(PlayerDataManager.AuthToken, PlayerDataManager.ClanID, delegate(ClanView ev)
            {
                Singleton <ClanDataManager> .Instance.SetClanData(ev);
            }, delegate(Exception ex)
            {
            }));
        }
        GameState.Current.Avatar.SetDecorator(AvatarBuilder.CreateLocalAvatar());
        GameState.Current.Avatar.UpdateAllWeapons();
        yield return(new WaitForEndOfFrame());

        Singleton <InboxManager> .Instance.Initialize();

        yield return(new WaitForEndOfFrame());

        Singleton <BundleManager> .Instance.Initialize();

        yield return(new WaitForEndOfFrame());

        PopupSystem.HideMessage(_progress);
        if (!authView.IsAccountComplete)
        {
            PanelManager.Instance.OpenPanel(PanelType.CompleteAccount);
        }
        else
        {
            MenuPageManager.Instance.LoadPage(PageType.Home, false);
            IsAuthComplete = true;
        }
        Debug.LogWarning(string.Format("AuthToken:{0}, MagicHash:{1}", PlayerDataManager.AuthToken, PlayerDataManager.MagicHash));
        yield break;
    }