// Token: 0x06000B60 RID: 2912 RVA: 0x0004924C File Offset: 0x0004744C
    private void DrawOutgoingClanInvitation(GroupInvitationView view, int y, int width)
    {
        Rect position = new Rect(4f, (float)(y + 4), (float)(width - 1), 50f);

        GUI.BeginGroup(position);
        Rect position2 = new Rect(0f, 0f, position.width, position.height - 1f);

        if (GUI.enabled && position2.Contains(Event.current.mousePosition))
        {
            GUI.Box(position2, GUIContent.none, BlueStonez.box_grey50);
        }
        GUI.Label(new Rect(80f, 5f, position.width - 250f, 20f), string.Format("You invited: {0}", view.InviteeName), BlueStonez.label_interparkbold_13pt_left);
        GUI.Label(new Rect(80f, 30f, position.width - 250f, 20f), "> " + view.Message, BlueStonez.label_interparkmed_11pt_left);
        if (GUITools.Button(new Rect(position.width - 140f, 5f, 120f, 20f), new GUIContent(LocalizedStrings.CancelInvite), BlueStonez.buttondark_medium))
        {
            int groupInvitationId = view.GroupInvitationId;
            if (Singleton <InboxManager> .Instance._outgoingClanRequests.Remove(view))
            {
                ClanWebServiceClient.CancelInvitation(groupInvitationId, PlayerDataManager.AuthToken, null, delegate(Exception ex)
                {
                });
            }
        }
        GUI.EndGroup();
        GUI.Label(new Rect(4f, (float)(y + 50 + 8), (float)width, 1f), GUIContent.none, BlueStonez.horizontal_line_grey95);
    }
 // Token: 0x060012C3 RID: 4803 RVA: 0x0000CD50 File Offset: 0x0000AF50
 public void CheckCompleteClanData()
 {
     ClanWebServiceClient.GetMyClanId(PlayerDataManager.AuthToken, delegate(int ev)
     {
         PlayerDataManager.ClanID = ev;
         this.RefreshClanData(true);
     }, delegate(Exception ex)
     {
     });
 }
 // Token: 0x06000B10 RID: 2832 RVA: 0x00047544 File Offset: 0x00045744
 public void DeclineClanRequest(int requestId)
 {
     this.IncomingClanRequests.Value.RemoveAll((GroupInvitationView r) => r.GroupInvitationId == requestId);
     this.IncomingClanRequests.Fire();
     ClanWebServiceClient.DeclineClanInvitation(requestId, PlayerDataManager.AuthToken, delegate(ClanRequestDeclineView ev)
     {
     }, delegate(Exception ex)
     {
     });
 }
 // Token: 0x060012C4 RID: 4804 RVA: 0x0006F138 File Offset: 0x0006D338
 public void RefreshClanData(bool force = false)
 {
     if (PlayerDataManager.IsPlayerInClan && (force || this.NextClanRefresh < Time.time))
     {
         this.NextClanRefresh = Time.time + 30f;
         ClanWebServiceClient.GetOwnClan(PlayerDataManager.AuthToken, PlayerDataManager.ClanID, delegate(ClanView ev)
         {
             this.SetClanData(ev);
         }, delegate(Exception ex)
         {
         });
     }
 }
 // Token: 0x06000B1D RID: 2845 RVA: 0x00047980 File Offset: 0x00045B80
 internal void RefreshAllRequests()
 {
     this.NextRequestRefresh = Time.time + 30f;
     RelationshipWebServiceClient.GetContactRequests(PlayerDataManager.AuthToken, new Action <List <ContactRequestView> >(this.OnGetContactRequests), delegate(Exception ex)
     {
     });
     ClanWebServiceClient.GetAllGroupInvitations(PlayerDataManager.AuthToken, new Action <List <GroupInvitationView> >(this.OnGetAllGroupInvitations), delegate(Exception ex)
     {
     });
     if (Singleton <PlayerDataManager> .Instance.RankInClan != GroupPosition.Member)
     {
         ClanWebServiceClient.GetPendingGroupInvitations(PlayerDataManager.ClanID, PlayerDataManager.AuthToken, new Action <List <GroupInvitationView> >(this.OnGetPendingGroupInvitations), delegate(Exception ex)
         {
         });
     }
 }
 // Token: 0x060012CB RID: 4811 RVA: 0x0006F258 File Offset: 0x0006D458
 public void UpdateMemberTo(int cmid, GroupPosition position)
 {
     this.IsProcessingWebservice = true;
     ClanWebServiceClient.UpdateMemberPosition(new MemberPositionUpdateView(PlayerDataManager.ClanID, PlayerDataManager.AuthToken, cmid, position), delegate(int ev)
     {
         this.IsProcessingWebservice = false;
         ClanMemberView clanMemberView;
         if (ev == 0 && PlayerDataManager.TryGetClanMember(cmid, out clanMemberView))
         {
             clanMemberView.Position = position;
         }
     }, delegate(Exception ex)
     {
         this.IsProcessingWebservice = false;
     });
 }
 // Token: 0x060012C9 RID: 4809 RVA: 0x0000CDEE File Offset: 0x0000AFEE
 public void DisbanClan()
 {
     this.IsProcessingWebservice = true;
     ClanWebServiceClient.DisbandGroup(PlayerDataManager.ClanID, PlayerDataManager.AuthToken, delegate(int ev)
     {
         this.IsProcessingWebservice = false;
         if (ev == 0)
         {
             AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.SendUpdateClanMembers();
             this.SetClanData(null);
         }
     }, delegate(Exception ex)
     {
         this.IsProcessingWebservice = false;
     });
 }
    // Token: 0x060012CC RID: 4812 RVA: 0x0006F2C0 File Offset: 0x0006D4C0
    public void TransferOwnershipTo(int cmid)
    {
        this.IsProcessingWebservice = true;
        ClanWebServiceClient.TransferOwnership(PlayerDataManager.ClanID, PlayerDataManager.AuthToken, cmid, delegate(int ev)
        {
            this.IsProcessingWebservice = false;
            if (ev == 0)
            {
                ClanMemberView clanMemberView;
                if (PlayerDataManager.TryGetClanMember(cmid, out clanMemberView))
                {
                    clanMemberView.Position = GroupPosition.Leader;
                }
                if (PlayerDataManager.TryGetClanMember(PlayerDataManager.Cmid, out clanMemberView))
                {
                    clanMemberView.Position = GroupPosition.Member;
                }
                Singleton <PlayerDataManager> .Instance.RankInClan = GroupPosition.Member;
            }
            else
            {
                switch (ev)
                {
                case 100:
                    PopupSystem.ShowMessage("Sorry", "The player you selected can't be a clan leader, because he is not level 4 yet!");
                    break;

                case 101:
                    PopupSystem.ShowMessage("Sorry", "The player you selected can't be a clan leader, because has no friends!");
                    break;

                case 102:
                    PopupSystem.ShowMessage("Sorry", "The player you selected can't be a clan leader, because he doesn't own a clan license.");
                    break;

                default:
                    PopupSystem.ShowMessage("Sorry", "There was an error (code " + ev + "), please visit support.uberstrike.com for help.");
                    break;
                }
            }
        }, delegate(Exception ex)
        {
            this.IsProcessingWebservice = false;
        });
    }
 // Token: 0x060012CD RID: 4813 RVA: 0x0006F318 File Offset: 0x0006D518
 public void RemoveMemberFromClan(int cmid)
 {
     this.IsProcessingWebservice = true;
     ClanWebServiceClient.KickMemberFromClan(PlayerDataManager.ClanID, PlayerDataManager.AuthToken, cmid, delegate(int ev)
     {
         this.IsProcessingWebservice = false;
         if (ev == 0)
         {
             Singleton <PlayerDataManager> .Instance.ClanMembers.RemoveAll((ClanMemberView m) => m.Cmid == cmid);
             AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.SendUpdateClanMembers();
             AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.Operations.SendUpdateClanData(cmid);
             Singleton <ChatManager> .Instance.UpdateClanSection();
         }
     }, delegate(Exception ex)
     {
         this.IsProcessingWebservice = false;
     });
 }
 // Token: 0x060012C8 RID: 4808 RVA: 0x0000CDBD File Offset: 0x0000AFBD
 public void LeaveClan()
 {
     this.IsProcessingWebservice = true;
     ClanWebServiceClient.LeaveAClan(PlayerDataManager.ClanID, PlayerDataManager.AuthToken, delegate(int ev)
     {
         this.IsProcessingWebservice = false;
         if (ev == 0)
         {
             AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.SendUpdateClanMembers();
             this.SetClanData(null);
         }
         else
         {
             PopupSystem.ShowMessage("Leave Clan", "There was an error removing you from this clan.\nErrorCode = " + ev, PopupSystem.AlertType.OK);
         }
     }, delegate(Exception ex)
     {
         this.IsProcessingWebservice = false;
     });
 }
 // Token: 0x06000B0F RID: 2831 RVA: 0x000474B4 File Offset: 0x000456B4
 public void AcceptClanRequest(int clanInvitationId)
 {
     this.IncomingClanRequests.Value.RemoveAll((GroupInvitationView r) => r.GroupInvitationId == clanInvitationId);
     this.IncomingClanRequests.Fire();
     ClanWebServiceClient.AcceptClanInvitation(clanInvitationId, PlayerDataManager.AuthToken, delegate(ClanRequestAcceptView ev)
     {
         if (ev != null && ev.ActionResult == 0)
         {
             PopupSystem.ShowMessage(LocalizedStrings.Clan, LocalizedStrings.JoinClanSuccessMsg, PopupSystem.AlertType.OKCancel, delegate()
             {
                 MenuPageManager.Instance.LoadPage(PageType.Clans, false);
             }, "Go to Clans", null, "Not now", PopupSystem.ActionType.Positive);
             Singleton <ClanDataManager> .Instance.SetClanData(ev.ClanView);
             AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.SendUpdateClanMembers();
         }
         else
         {
             PopupSystem.ShowMessage(LocalizedStrings.Clan, LocalizedStrings.JoinClanErrorMsg, PopupSystem.AlertType.OK);
         }
     }, delegate(Exception ex)
     {
     });
 }
    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;
    }
    // Token: 0x06000CED RID: 3309 RVA: 0x00058DD8 File Offset: 0x00056FD8
    private void DrawInvitePlayerMessage(Rect rect)
    {
        GUI.depth   = 3;
        GUI.enabled = true;
        Rect position = new Rect(rect.x + (rect.width - 480f) / 2f, rect.y + (rect.height - 320f) / 2f, 480f, 320f);

        GUI.BeginGroup(position, BlueStonez.window);
        int num  = 25;
        int num2 = 120;
        int num3 = 320;
        int num4 = 70;
        int num5 = 100;
        int num6 = 132;

        GUI.Label(new Rect(0f, 0f, position.width, 0f), LocalizedStrings.InvitePlayer, BlueStonez.tab_strip);
        GUI.Label(new Rect(12f, 55f, position.width - 24f, 208f), GUIContent.none, BlueStonez.window_standard_grey38);
        GUI.Label(new Rect((float)num, (float)num4, 400f, 20f), LocalizedStrings.UseThisFormToSendClanInvitations, BlueStonez.label_interparkbold_11pt);
        GUI.Label(new Rect((float)num, (float)num5, 90f, 20f), LocalizedStrings.PlayerCaps, BlueStonez.label_interparkbold_18pt_right);
        GUI.Label(new Rect((float)num, (float)num6, 90f, 20f), LocalizedStrings.MessageCaps, BlueStonez.label_interparkbold_18pt_right);
        GUI.SetNextControlName("Message Receiver");
        GUI.enabled = !this._fixReceiver;
        this._name  = GUI.TextField(new Rect((float)num2, (float)num5, (float)num3, 24f), this._name, BlueStonez.textField);
        if (string.IsNullOrEmpty(this._name) && !GUI.GetNameOfFocusedControl().Equals("Message Receiver"))
        {
            GUI.color = new Color(1f, 1f, 1f, 0.3f);
            GUI.Label(new Rect((float)num2, (float)num5, (float)num3, 24f), " " + LocalizedStrings.StartTypingTheNameOfAFriend, BlueStonez.label_interparkbold_11pt_left);
            GUI.color = Color.white;
        }
        GUI.enabled = !this._showReceiverDropdownList;
        GUI.SetNextControlName("Description");
        this._message = GUI.TextArea(new Rect((float)num2, (float)num6, (float)num3, 108f), this._message, BlueStonez.textArea);
        this._message = this._message.Trim(new char[]
        {
            '\n',
            '\t'
        });
        GUI.enabled = (this._cmid != 0);
        if (GUITools.Button(new Rect(position.width - 155f - 155f, position.height - 44f, 150f, 32f), new GUIContent(LocalizedStrings.SendCaps), BlueStonez.button_green))
        {
            ClanWebServiceClient.InviteMemberToJoinAGroup(PlayerDataManager.ClanID, PlayerDataManager.AuthToken, this._cmid, this._message, delegate(int ev)
            {
            }, delegate(Exception ex)
            {
            });
            PanelManager.Instance.ClosePanel(PanelType.ClanRequest);
        }
        GUI.enabled = true;
        if (GUITools.Button(new Rect(position.width - 155f, position.height - 44f, 150f, 32f), new GUIContent(LocalizedStrings.CancelCaps), BlueStonez.button))
        {
            this._message = string.Empty;
            PanelManager.Instance.ClosePanel(PanelType.ClanRequest);
        }
        if (!this._fixReceiver)
        {
            if (!this._showReceiverDropdownList && GUI.GetNameOfFocusedControl().Equals("Message Receiver"))
            {
                this._cmid = 0;
                this._showReceiverDropdownList = true;
            }
            if (this._showReceiverDropdownList)
            {
                this.DoReceiverDropdownList(new Rect((float)num2, (float)(num5 + 24), (float)num3, this._receiverDropdownHeight));
            }
        }
        GUI.EndGroup();
    }
    // Token: 0x060012CA RID: 4810 RVA: 0x0006F1B0 File Offset: 0x0006D3B0
    public void CreateNewClan(string name, string motto, string tag)
    {
        this.IsProcessingWebservice = true;
        GroupCreationView createClanData = new GroupCreationView
        {
            Name          = name,
            Motto         = motto,
            ApplicationId = 1,
            AuthToken     = PlayerDataManager.AuthToken,
            Tag           = tag,
            Locale        = ApplicationDataManager.CurrentLocale.ToString()
        };

        ClanWebServiceClient.CreateClan(createClanData, delegate(ClanCreationReturnView ev)
        {
            this.IsProcessingWebservice = false;
            if (ev.ResultCode == 0)
            {
                global::EventHandler.Global.Fire(new GlobalEvents.ClanCreated());
                this.SetClanData(ev.ClanView);
            }
            else
            {
                int resultCode = ev.ResultCode;
                switch (resultCode)
                {
                case 1:
                    PopupSystem.ShowMessage("Invalid Clan Name", "The name '" + name + "' is not valid, please modify it.");
                    break;

                case 2:
                    PopupSystem.ShowMessage("Clan Collision", "You are already member of another clan, please leave first before creating your own.");
                    break;

                case 3:
                    PopupSystem.ShowMessage("Clan Name", "The name '" + name + "' is already taken, try another one.");
                    break;

                case 4:
                    PopupSystem.ShowMessage("Invalid Clan Tag", "The tag '" + tag + "' is not valid, please modify it.");
                    break;

                default:
                    switch (resultCode)
                    {
                    case 100:
                    case 101:
                    case 102:
                        PopupSystem.ShowMessage("Sorry", "You don't fulfill the minimal requirements to create your own clan.");
                        break;

                    default:
                        PopupSystem.ShowMessage("Sorry", "There was an error (code " + ev.ResultCode + "), please visit support.uberstrike.com for help.");
                        break;
                    }
                    break;

                case 8:
                    PopupSystem.ShowMessage("Invalid Clan Motto", "The motto '" + motto + "' is not valid, please modify it.");
                    break;

                case 10:
                    PopupSystem.ShowMessage("Clan Tag", "The tag '" + tag + "' is already taken, try another one.");
                    break;
                }
            }
        }, delegate(Exception ex)
        {
            this.IsProcessingWebservice = false;
            this.SetClanData(null);
        });
    }