// Token: 0x0600203D RID: 8253 RVA: 0x00099EB0 File Offset: 0x000980B0
    public override void Shoot(Ray ray, out CmunePairList <BaseGameProp, ShotPoint> hits)
    {
        hits = null;
        RaycastHit raycastHit;

        if (this.MinProjectileDistance > 0 && Physics.Raycast(ray.origin, ray.direction, out raycastHit, (float)this.MinProjectileDistance, UberstrikeLayerMasks.LocalRocketMask))
        {
            int num = base.Controller.NextProjectileId();
            hits = new CmunePairList <BaseGameProp, ShotPoint>(1);
            hits.Add(null, new ShotPoint(raycastHit.point, num));
            this.ShowExplosionEffect(raycastHit.point, raycastHit.normal, ray.direction, num);
            if (this.OnProjectileShoot != null)
            {
                this.OnProjectileShoot(new ProjectileInfo(num, new Ray(raycastHit.point, -ray.direction)));
            }
        }
        else
        {
            if (this._decorator)
            {
                this._decorator.ShowShootEffect(new RaycastHit[0]);
            }
            UnityRuntime.StartRoutine(this.EmitProjectile(ray));
        }
    }
 // Token: 0x06000D02 RID: 3330 RVA: 0x00059AF8 File Offset: 0x00057CF8
 private void Login(string emailAddress, string password)
 {
     CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Player_AutoLogin, this._rememberPassword);
     if (this._rememberPassword)
     {
         CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Password, password);
         CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Email, emailAddress);
     }
     this._errorAlpha = 1f;
     if (string.IsNullOrEmpty(emailAddress))
     {
         LoginPanelGUI.ErrorMessage = LocalizedStrings.EnterYourEmailAddress;
     }
     else if (string.IsNullOrEmpty(password))
     {
         LoginPanelGUI.ErrorMessage = LocalizedStrings.EnterYourPassword;
     }
     else if (!ValidationUtilities.IsValidEmailAddress(emailAddress))
     {
         LoginPanelGUI.ErrorMessage = LocalizedStrings.EmailAddressIsInvalid;
     }
     else if (!ValidationUtilities.IsValidPassword(password))
     {
         LoginPanelGUI.ErrorMessage = LocalizedStrings.PasswordIsInvalid;
     }
     else
     {
         this.Hide();
         UnityRuntime.StartRoutine(Singleton <AuthenticationManager> .Instance.StartLoginMemberEmail(emailAddress, password));
     }
 }
Example #3
0
    // Token: 0x060013E3 RID: 5091 RVA: 0x00072D48 File Offset: 0x00070F48
    public IEnumerator StartUpdateInventoryAndEquipNewItem(IUnityItem item, bool equipNow = false)
    {
        if (item != null)
        {
            IPopupDialog popupDialog = PopupSystem.ShowMessage(LocalizedStrings.UpdatingInventory, LocalizedStrings.WereUpdatingYourInventoryPleaseWait, PopupSystem.AlertType.None);
            yield return(UnityRuntime.StartRoutine(Singleton <ItemManager> .Instance.StartGetInventory(false)));

            PopupSystem.HideMessage(popupDialog);
            if (equipNow)
            {
                this.EquipItem(item);
            }
            else if (GameState.Current.HasJoinedGame && GameState.Current.IsInGame)
            {
                this.EquipItem(item);
            }
            else if (item.View.ItemProperties.ContainsKey(ItemPropertyType.PointsBoost) || item.View.ItemProperties.ContainsKey(ItemPropertyType.XpBoost))
            {
                InventoryItem invItem = this.GetItem(item.View.ID);
                PopupSystem.ShowItem(item, "\nYou just bought the boost item!\nThis item is activated and expires in " + invItem.DaysRemaining + " days");
            }
            else
            {
                PopupSystem.ShowItem(item, string.Empty);
            }
            yield return(UnityRuntime.StartRoutine(Singleton <PlayerDataManager> .Instance.StartGetMember()));
        }
        yield break;
    }
 // Token: 0x06001439 RID: 5177 RVA: 0x00074A84 File Offset: 0x00072C84
 public void SetLoadoutItem(global::LoadoutSlotType loadoutSlotType, IUnityItem item)
 {
     if (item == null)
     {
         this.ResetSlot(loadoutSlotType);
     }
     else
     {
         InventoryItem inventoryItem;
         if (Singleton <InventoryManager> .Instance.TryGetInventoryItem(item.View.ID, out inventoryItem) && inventoryItem.IsValid)
         {
             if (item.View.ItemType == UberstrikeItemType.Weapon)
             {
                 this.RemoveDuplicateWeaponClass(inventoryItem);
             }
             this.Loadout.SetSlot(loadoutSlotType, item);
         }
         else if (item.View != null)
         {
             BuyPanelGUI buyPanelGUI = PanelManager.Instance.OpenPanel(PanelType.BuyItem) as BuyPanelGUI;
             if (buyPanelGUI)
             {
                 buyPanelGUI.SetItem(item, BuyingLocationType.Shop, BuyingRecommendationType.None, false);
             }
         }
         UnityRuntime.StartRoutine(Singleton <PlayerDataManager> .Instance.StartSetLoadout());
         this.UpdateArmor();
     }
 }
Example #5
0
    // Token: 0x06001334 RID: 4916 RVA: 0x000705F0 File Offset: 0x0006E7F0
    public IEnumerator StartUpdatingLatency(Action <float> progressCallback)
    {
        yield return(UnityRuntime.StartRoutine(this.StartUpdatingServerLoads()));

        float minTimeout = Time.time + 4f;
        float maxTimeout = Time.time + 10f;
        int   count      = 0;

        while (count != this._loadRequests.Count)
        {
            yield return(new WaitForSeconds(1f));

            count = 0;
            foreach (ServerLoadRequest r in this._loadRequests.Values)
            {
                if (r.RequestState != ServerLoadRequest.RequestStateType.Waiting)
                {
                    count++;
                }
            }
            progressCallback((float)count / (float)this._loadRequests.Count);
            if ((count > 0 && Time.time > minTimeout) || Time.time > maxTimeout)
            {
                yield break;
            }
        }
        yield break;
    }
 // Token: 0x06000945 RID: 2373 RVA: 0x00007CF2 File Offset: 0x00005EF2
 public void ShowNextPopup(int delay = 0)
 {
     if (this.popups.Count > 0)
     {
         UnityRuntime.StartRoutine(this.ShowPopup(this.popups.Dequeue(), delay));
     }
 }
    public void LoginByChannel()
    {
        string @string = PlayerPrefs.GetString("CurrentSteamUser", string.Empty);

        Debug.Log(string.Format("SteamWorks SteamID:{0}, PlayerPrefs SteamID:{1}", PlayerDataManager.SteamId, @string));
        if (string.IsNullOrEmpty(@string) || @string != PlayerDataManager.SteamId)
        {
            Debug.Log(string.Format("No SteamID saved. Using SteamWorks SteamID:{0}", PlayerDataManager.SteamId));
            PopupSystem.ShowMessage(string.Empty, "Have you played UberStrike before?", PopupSystem.AlertType.OKCancel, delegate()
            {
                UnityRuntime.StartRoutine(StartLoginMemberSteam(true));
            }, "No", delegate()
            {
                PopupSystem.ShowMessage(string.Empty, "Do you want to upgrade an UberStrike.com or Facebook account?\n\nNOTE: This will permenantly link your UberStrike account to this Steam ID", PopupSystem.AlertType.OKCancel, delegate()
                {
                    UnityRuntime.StartRoutine(StartLoginMemberSteam(true));
                }, "No", delegate()
                {
                    UnityRuntime.StartRoutine(StartLoginMemberSteam(false));
                }, "Yes");
            }, "Yes");
        }
        else
        {
            Debug.Log(string.Format("Login using saved SteamID:{0}", @string));
            UnityRuntime.StartRoutine(StartLoginMemberSteam(true));
        }
    }
 // Token: 0x06000455 RID: 1109 RVA: 0x000052F7 File Offset: 0x000034F7
 public void FadeOut()
 {
     this._targetVolume = 0f;
     if (!this._isFading)
     {
         UnityRuntime.StartRoutine(this.StartFading());
     }
 }
Example #9
0
    // Token: 0x0600123C RID: 4668 RVA: 0x0006D4C4 File Offset: 0x0006B6C4
    private static IEnumerator StartRefreshWalletInventory()
    {
        yield return(UnityRuntime.StartRoutine(Singleton <PlayerDataManager> .Instance.StartGetMemberWallet()));

        yield return(UnityRuntime.StartRoutine(Singleton <ItemManager> .Instance.StartGetInventory(true)));

        yield break;
    }
Example #10
0
 // Token: 0x0600108F RID: 4239 RVA: 0x00066978 File Offset: 0x00064B78
 private void UseConsumableItem(InventoryItem inventoryItem)
 {
     if (this.IsConsumptionEnabled)
     {
         ShopWebServiceClient.UseConsumableItem(PlayerDataManager.AuthToken, inventoryItem.Item.View.ID, null, null);
         inventoryItem.AmountRemaining--;
         if (inventoryItem.AmountRemaining == 0)
         {
             UnityRuntime.StartRoutine(Singleton <ItemManager> .Instance.StartGetInventory(false));
         }
     }
 }
 // Token: 0x06000454 RID: 1108 RVA: 0x000052BC File Offset: 0x000034BC
 public void FadeIn(float volume)
 {
     this._targetVolume = volume;
     if (!this._isFading)
     {
         if (!this._audioSource.isPlaying)
         {
             this._audioSource.Play();
         }
         UnityRuntime.StartRoutine(this.StartFading());
     }
 }
    public void PlayClip(AudioClip clip, Vector3 position, float duration, bool loop = false)
    {
        ObjectPooler.Instance.Instantiate(AudioObjectName, position, out var go);
        var source = go.GetComponent <AudioSource>();

        source.clip = clip;
        source.loop = loop;
        source.Play();

        if (!loop)
        {
            UnityRuntime.Invoke(() => { go?.SetActive(false); }, duration);
        }
    }
Example #13
0
 // Token: 0x06000C74 RID: 3188 RVA: 0x00053E1C File Offset: 0x0005201C
 public void SetValuablePlayer(StatsSummary playerStats)
 {
     this._curPlayerStats = playerStats;
     this._curBadgeTitle  = string.Empty;
     this._curBadgeText   = string.Empty;
     this._achievementList.Clear();
     if (playerStats != null)
     {
         foreach (KeyValuePair <byte, ushort> keyValuePair in this._curPlayerStats.Achievements)
         {
             this._achievementList.Add((AchievementType)keyValuePair.Key);
         }
     }
     UnityRuntime.StartRoutine(this.StartBadgeShow());
 }
 // Token: 0x06001B7B RID: 7035 RVA: 0x0008D360 File Offset: 0x0008B560
 public void LoadLevel(string level, Action onSuccess = null)
 {
     if (!this.IsLoading)
     {
         if (GameState.Current.Avatar.Decorator != null)
         {
             GameState.Current.Avatar.Decorator.transform.parent = null;
         }
         UnityRuntime.StartRoutine(this.LoadLevelAsync(level, onSuccess));
     }
     else
     {
         Debug.LogError("Trying to load level twice!");
     }
 }
Example #15
0
 // Token: 0x06001A2F RID: 6703 RVA: 0x00089B88 File Offset: 0x00087D88
 public TrainingRoom()
 {
     GameState.Current.MatchState.RegisterState(GameStateId.PregameLoadout, new PregameLoadoutState(GameState.Current.MatchState));
     GameState.Current.MatchState.RegisterState(GameStateId.MatchRunning, new OfflineMatchState(GameState.Current.MatchState));
     GameState.Current.PlayerState.RegisterState(PlayerStateId.Playing, new PlayerPlayingState(GameState.Current.PlayerState));
     GameState.Current.PlayerState.RegisterState(PlayerStateId.Killed, new PlayerKilledOfflineState(GameState.Current.PlayerState));
     GameState.Current.PlayerState.RegisterState(PlayerStateId.Paused, new PlayerPausedState(GameState.Current.PlayerState));
     GameState.Current.PlayerState.RegisterState(PlayerStateId.Overview, new PlayerOverviewState(GameState.Current.PlayerState));
     GameState.Current.Actions.KillPlayer = delegate()
     {
         if (GameState.Current.IsInGame)
         {
             GameState.Current.PlayerKilled(0, PlayerDataManager.Cmid, (UberstrikeItemClass)0, (BodyPart)0, Vector3.zero);
         }
     };
     GameState.Current.Actions.ExplosionHitDamage = delegate(int targetCmid, ushort damage, Vector3 force, byte slot, byte distance)
     {
         GameStateHelper.PlayerHit(targetCmid, damage, BodyPart.Body, force);
         if (GameState.Current.PlayerData.Health <= 0)
         {
             GameState.Current.PlayerData.Set(PlayerStates.Dead, true);
             GameState.Current.PlayerKilled(targetCmid, targetCmid, Singleton <WeaponController> .Instance.GetCurrentWeapon().View.ItemClass, BodyPart.Body, force);
         }
     };
     GameState.Current.Actions.JoinTeam = delegate(TeamID team)
     {
         GameActorInfo gameActorInfo = new GameActorInfo
         {
             Cmid      = PlayerDataManager.Cmid,
             SkinColor = PlayerDataManager.SkinColor
         };
         GameState.Current.PlayerData.Player           = gameActorInfo;
         GameState.Current.Players[gameActorInfo.Cmid] = gameActorInfo;
         GameState.Current.InstantiateAvatar(gameActorInfo);
         GameState.Current.MatchState.SetState(GameStateId.MatchRunning);
         UnityRuntime.StartRoutine(this.ShowTrainingGameMessages());
     };
     TabScreenPanelGUI.SortPlayersByRank = new Action <IEnumerable <GameActorInfo> >(GameStateHelper.SortDeathMatchPlayers);
     AutoMonoBehaviour <UnityRuntime> .Instance.OnUpdate += this.OnUpdate;
     GameStateHelper.EnterGameMode();
     GameState.Current.MatchState.SetState(GameStateId.PregameLoadout);
 }
    public void PlayRandomClip(IList <AudioClip> clips, float duration)
    {
        ObjectPooler.Instance.Instantiate(AudioObjectName, Camera.main.transform.position, out var go);
        var source = go.GetComponent <AudioSource>();

        var clip = clips.RandomObject();

        while (clip == _lastPlayedClip)
        {
            clip = clips.RandomObject();
        }

        _lastPlayedClip = clip;

        source.clip = clip;
        source.loop = false;
        source.Play();

        UnityRuntime.Invoke(() => { go?.SetActive(false); }, duration);
    }
    public IEnumerator StartLoginMemberEmail(string emailAddress, string password)
    {
        if (string.IsNullOrEmpty(emailAddress) || string.IsNullOrEmpty(password))
        {
            ShowLoginErrorPopup(LocalizedStrings.Error, "Your login credentials are not correct. Please try to login again.");
            yield break;
        }
        _progress.Text     = "Authenticating Account";
        _progress.Progress = 0.1f;
        PopupSystem.Show(_progress);
        MemberAuthenticationResultView authenticationView = null;

        if (ApplicationDataManager.Channel == ChannelType.Steam)
        {
            yield return(AuthenticationWebServiceClient.LinkSteamMember(emailAddress, password, PlayerDataManager.SteamId, SystemInfo.deviceUniqueIdentifier, delegate(MemberAuthenticationResultView ev)
            {
                authenticationView = ev;
                PlayerPrefs.SetString("CurrentSteamUser", PlayerDataManager.SteamId);
                PlayerPrefs.Save();
            }, delegate(Exception ex)
            {
            }));
        }
        else
        {
            yield return(AuthenticationWebServiceClient.LoginMemberEmail(emailAddress, password, ApplicationDataManager.Channel, SystemInfo.deviceUniqueIdentifier, delegate(MemberAuthenticationResultView ev)
            {
                authenticationView = ev;
            }, delegate(Exception ex)
            {
            }));
        }
        if (authenticationView == null)
        {
            ShowLoginErrorPopup(LocalizedStrings.Error, "The login could not be processed. Please check your internet connection and try again.");
            yield break;
        }
        yield return(UnityRuntime.StartRoutine(CompleteAuthentication(authenticationView, false)));

        yield break;
    }
    public IEnumerator StartLoginMemberSteam(bool directSteamLogin)
    {
        if (directSteamLogin)
        {
            _progress.Text     = "Authenticating with Steam";
            _progress.Progress = 0.05f;
            PopupSystem.Show(_progress);
            m_GetAuthSessionTicketResponse = Callback <GetAuthSessionTicketResponse_t> .Create(new Callback <GetAuthSessionTicketResponse_t> .DispatchDelegate(OnGetAuthSessionTicketResponse));

            byte[]      ticket = new byte[1024];
            uint        pcbTicket;
            HAuthTicket authTicket = SteamUser.GetAuthSessionTicket(ticket, 1024, out pcbTicket);
            int         num        = (int)pcbTicket;
            string      authToken  = num.ToString();
            string      machineId  = SystemInfo.deviceUniqueIdentifier;
            MemberAuthenticationResultView authenticationView = null;
            _progress.Text     = "Authenticating with UberStrike";
            _progress.Progress = 0.1f;
            yield return(AuthenticationWebServiceClient.LoginSteam(PlayerDataManager.SteamId, authToken, machineId, delegate(MemberAuthenticationResultView result)
            {
                authenticationView = result;
                PlayerPrefs.SetString("CurrentSteamUser", PlayerDataManager.SteamId);
                PlayerPrefs.Save();
            }, delegate(Exception error)
            {
                Debug.LogError("Account authentication error: " + error);
                ShowLoginErrorPopup(LocalizedStrings.Error, "There was an error logging you in. Please try again or contact us at http://support.cmune.com");
            }));

            yield return(UnityRuntime.StartRoutine(CompleteAuthentication(authenticationView, false)));
        }
        else
        {
            PopupSystem.ClearAll();
            yield return(PanelManager.Instance.OpenPanel(PanelType.Login));
        }
        yield break;
    }
Example #19
0
    // Token: 0x06001313 RID: 4883 RVA: 0x00070084 File Offset: 0x0006E284
    private IEnumerator StartCreatingOnBestGameServer()
    {
        if (Singleton <GameServerController> .Instance.SelectedServer == null)
        {
            ProgressPopupDialog _autoJoinPopup = PopupSystem.ShowProgress(LocalizedStrings.LoadingGameList, LocalizedStrings.FindingAServerToJoin, null);
            yield return(UnityRuntime.StartRoutine(Singleton <GameServerManager> .Instance.StartUpdatingLatency(delegate(float progress)
            {
                _autoJoinPopup.Progress = progress;
            })));

            PhotonServer bestServer = Singleton <GameServerManager> .Instance.GetBestServer();

            if (bestServer == null)
            {
                PopupSystem.HideMessage(_autoJoinPopup);
                PopupSystem.ShowMessage("Could not find server", "No suitable server could be located! Please try again soon.");
                yield break;
            }
            Singleton <GameServerController> .Instance.SelectedServer = bestServer;
            PopupSystem.HideMessage(_autoJoinPopup);
        }
        PanelManager.Instance.OpenPanel(PanelType.CreateGame);
        yield break;
    }
    // Token: 0x06001295 RID: 4757 RVA: 0x0006E9EC File Offset: 0x0006CBEC
    public void BuyBundle(BundleUnityView bundle)
    {
        Debug.Log("Trying to buy bundle with id id: " + bundle.BundleView.Id.ToString());
        int    id        = bundle.BundleView.Id;
        string steamId   = PlayerDataManager.SteamId;
        string authToken = PlayerDataManager.AuthToken;

        ShopWebServiceClient.BuyBundleSteam(id, steamId, authToken, delegate(bool success)
        {
            if (!success)
            {
                Debug.Log("Starting steam payment failed! (Handled WS Error)");
                PopupSystem.ClearAll();
                PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
            }
        }, delegate(Exception ex)
        {
            Debug.Log(ex.Message);
            PopupSystem.ClearAll();
            PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
        });
        this._appStorePopup = (PopupSystem.ShowMessage("In App Purchase", "Purchasing, please wait...", PopupSystem.AlertType.None) as BasePopupDialog);
        UnityRuntime.StartRoutine(this.StartCancelDialogTimer());
    }
 // Token: 0x06000932 RID: 2354 RVA: 0x0003A59C File Offset: 0x0003879C
 private void OnGui()
 {
     if (this._releaseDragItem)
     {
         this._releaseDragItem = false;
         this.CurrentId        = 0;
         this.DraggedItem      = null;
     }
     if (Event.current.type == EventType.MouseUp)
     {
         this._releaseDragItem = true;
     }
     if (this.IsDragging)
     {
         if (this._dragBegin)
         {
             this._dragBegin = false;
             if (this.OnDragBegin != null)
             {
                 this.OnDragBegin(this.DraggedItem);
             }
             UnityRuntime.StartRoutine(this.StartDragZoom(0f, 1f, 1.25f, 0.1f, 0.8f));
         }
         else
         {
             if (!this._isZooming)
             {
                 this._dragScalePivot = GUIUtility.ScreenToGUIPoint(Event.current.mousePosition);
             }
             GUIUtility.ScaleAroundPivot(new Vector2(this._zoomMultiplier, this._zoomMultiplier), this._dragScalePivot);
             GUI.backgroundColor = new Color(1f, 1f, 1f, this._alphaValue);
             GUI.matrix          = Matrix4x4.identity;
             this.DraggedItem.Item.DrawIcon(new Rect(this._dragScalePivot.x - 24f, this._dragScalePivot.y - 24f, 48f, 48f));
         }
     }
 }
 public void StartLogout()
 {
     UnityRuntime.StartRoutine(Logout());
 }
 // Token: 0x0600143A RID: 5178 RVA: 0x0000DA09 File Offset: 0x0000BC09
 public void ResetSlot(global::LoadoutSlotType loadoutSlotType)
 {
     this.Loadout.ClearSlot(loadoutSlotType);
     UnityRuntime.StartRoutine(Singleton <PlayerDataManager> .Instance.StartSetLoadout());
     this.UpdateArmor();
 }
    // Token: 0x06000D66 RID: 3430 RVA: 0x0005D9FC File Offset: 0x0005BBFC
    private void OnGUI()
    {
        if (Mathf.Abs(this._keyboardOffset - this._targetKeyboardOffset) > 2f)
        {
            this._keyboardOffset = Mathf.Lerp(this._keyboardOffset, this._targetKeyboardOffset, Time.deltaTime * 4f);
        }
        else
        {
            this._keyboardOffset = this._targetKeyboardOffset;
        }
        Rect position = new Rect((float)(Screen.width - 500) * 0.5f, ((float)Screen.height - this._height) * 0.5f - this._keyboardOffset, 500f, this._height);

        GUI.BeginGroup(position, GUIContent.none, BlueStonez.window);
        GUI.Label(new Rect(0f, 0f, position.width, 56f), LocalizedStrings.Welcome, BlueStonez.tab_strip);
        Rect position2 = new Rect(20f, 55f, position.width - 40f, position.height - 78f);

        GUI.Label(position2, GUIContent.none, BlueStonez.window_standard_grey38);
        GUI.BeginGroup(position2);
        GUI.Label(new Rect(0f, 0f, position2.width, 60f), LocalizedStrings.PleaseProvideValidEmailPasswordMsg, BlueStonez.label_interparkbold_18pt);
        GUI.Label(new Rect(0f, 76f, 170f, 11f), LocalizedStrings.Email, BlueStonez.label_interparkbold_11pt_right);
        GUI.Label(new Rect(0f, 110f, 170f, 11f), LocalizedStrings.Password, BlueStonez.label_interparkbold_11pt_right);
        GUI.Label(new Rect(0f, 147f, 170f, 11f), LocalizedStrings.VerifyPassword, BlueStonez.label_interparkbold_11pt_right);
        GUI.enabled = this._enableGUI;
        GUI.SetNextControlName("@Email");
        this._emailAddress = GUI.TextField(new Rect(180f, 69f, 180f, 22f), this._emailAddress, BlueStonez.textField);
        if (string.IsNullOrEmpty(this._emailAddress) && GUI.GetNameOfFocusedControl() != "@Email")
        {
            GUI.color = new Color(1f, 1f, 1f, 0.3f);
            GUI.Label(new Rect(188f, 75f, 180f, 22f), LocalizedStrings.EnterYourEmailAddress, BlueStonez.label_interparkmed_11pt_left);
            GUI.color = Color.white;
        }
        GUI.SetNextControlName("@Password1");
        this._password1 = GUI.PasswordField(new Rect(180f, 104f, 180f, 22f), this._password1, '*', BlueStonez.textField);
        if (string.IsNullOrEmpty(this._password1) && GUI.GetNameOfFocusedControl() != "@Password1")
        {
            GUI.color = new Color(1f, 1f, 1f, 0.3f);
            GUI.Label(new Rect(188f, 110f, 172f, 18f), LocalizedStrings.EnterYourPassword, BlueStonez.label_interparkmed_11pt_left);
            GUI.color = Color.white;
        }
        GUI.SetNextControlName("@Password2");
        this._password2 = GUI.PasswordField(new Rect(180f, 140f, 180f, 22f), this._password2, '*', BlueStonez.textField);
        if (string.IsNullOrEmpty(this._password2) && GUI.GetNameOfFocusedControl() != "@Password2")
        {
            GUI.color = new Color(1f, 1f, 1f, 0.3f);
            GUI.Label(new Rect(188f, 146f, 180f, 22f), LocalizedStrings.RetypeYourPassword, BlueStonez.label_interparkmed_11pt_left);
            GUI.color = Color.white;
        }
        GUI.enabled      = true;
        GUI.contentColor = this._errorMessageColor;
        GUI.Label(new Rect(0f, 175f, position2.width, 40f), this._errorMessage, BlueStonez.label_interparkbold_11pt);
        GUI.contentColor = Color.white;
        GUI.EndGroup();
        GUI.Label(new Rect(100f, position.height - 42f - 22f, 300f, 16f), "By clicking OK you agree to the", BlueStonez.label_interparkbold_11pt);
        if (GUI.Button(new Rect(185f, position.height - 30f - 12f, 130f, 20f), "Terms of Service", BlueStonez.buttondark_small))
        {
            ApplicationDataManager.OpenUrl("Terms Of Service", "http://www.cmune.com/index.php/terms-of-service/");
            this.HideKeyboard();
        }
        GUI.Label(new Rect(207f, position.height - 15f - 22f, 90f, 20f), GUIContent.none, BlueStonez.horizontal_line_grey95);
        GUI.enabled = this._enableGUI;
        if (GUITools.Button(new Rect(position.width - 150f, position.height - 42f - 22f, 120f, 32f), new GUIContent(LocalizedStrings.OkCaps), BlueStonez.button_green))
        {
            this.HideKeyboard();
            if (!ValidationUtilities.IsValidEmailAddress(this._emailAddress))
            {
                this._targetHeight      = 340f;
                this._errorMessageColor = Color.red;
                this._errorMessage      = LocalizedStrings.EmailAddressIsInvalid;
            }
            else if (this._password1 != this._password2)
            {
                this._targetHeight      = 340f;
                this._errorMessageColor = Color.red;
                this._errorMessage      = LocalizedStrings.PasswordDoNotMatch;
            }
            else if (!ValidationUtilities.IsValidPassword(this._password1))
            {
                this._targetHeight      = 340f;
                this._errorMessageColor = Color.red;
                this._errorMessage      = LocalizedStrings.PasswordInvalidCharsMsg;
            }
            else
            {
                this._enableGUI         = false;
                this._targetHeight      = 340f;
                this._errorMessageColor = Color.grey;
                this._errorMessage      = LocalizedStrings.PleaseWait;
                AuthenticationWebServiceClient.CreateUser(this._emailAddress, this._password1, ApplicationDataManager.Channel, ApplicationDataManager.CurrentLocale.ToString(), SystemInfo.deviceUniqueIdentifier, delegate(MemberRegistrationResult result)
                {
                    if (result == MemberRegistrationResult.Ok)
                    {
                        this.Hide();
                        CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Email, this._emailAddress);
                        CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Password, this._password1);
                        UnityRuntime.StartRoutine(Singleton <AuthenticationManager> .Instance.StartLoginMemberEmail(this._emailAddress, this._password1));
                        this._targetHeight      = 300f;
                        this._errorMessage      = string.Empty;
                        this._emailAddress      = string.Empty;
                        this._password1         = string.Empty;
                        this._password2         = string.Empty;
                        this._errorMessageColor = Color.red;
                        this._enableGUI         = true;
                    }
                    else
                    {
                        this._enableGUI         = true;
                        this._targetHeight      = 340f;
                        this._errorMessageColor = Color.red;
                        this._errorMessages.TryGetValue(result, out this._errorMessage);
                    }
                }, delegate(Exception ex)
                {
                    this._enableGUI    = true;
                    this._targetHeight = 300f;
                    this._errorMessage = string.Empty;
                    this.ShowSignUpErrorPopup(LocalizedStrings.Error, "Sign Up was unsuccessful. There was an error communicating with the server.");
                });
            }
        }
        if (GUITools.Button(new Rect(30f, position.height - 42f - 22f, 120f, 32f), new GUIContent(LocalizedStrings.BackCaps), BlueStonez.button))
        {
            this.Hide();
            this.HideKeyboard();
            PanelManager.Instance.OpenPanel(PanelType.Login);
        }
        GUI.enabled = true;
        GUI.EndGroup();
    }
Example #25
0
 // Token: 0x0600193A RID: 6458 RVA: 0x00010D81 File Offset: 0x0000EF81
 protected override void OnUpdateFriendsList()
 {
     UnityRuntime.StartRoutine(Singleton <CommsManager> .Instance.GetContactsByGroups());
 }
 public void PlayClipDelayed(AudioClip clip, float delay)
 {
     UnityRuntime.Invoke(() => PlayClip(clip), delay);
 }
Example #27
0
 // Token: 0x06001237 RID: 4663 RVA: 0x0000C9AC File Offset: 0x0000ABAC
 public static void RefreshWallet()
 {
     UnityRuntime.StartRoutine(ApplicationDataManager.StartRefreshWalletInventory());
 }
Example #28
0
 // Token: 0x06001311 RID: 4881 RVA: 0x0000D04F File Offset: 0x0000B24F
 public void CreateOnFastestServer()
 {
     UnityRuntime.StartRoutine(this.StartCreatingOnBestGameServer());
 }
Example #29
0
 // Token: 0x06001310 RID: 4880 RVA: 0x0000D041 File Offset: 0x0000B241
 public void JoinFastestServer()
 {
     UnityRuntime.StartRoutine(this.StartJoiningBestGameServer());
 }
    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;
    }