示例#1
0
 public void AddGuildInfo(GuildInfo info)
 {
     if (!this.m_GuildDic.ContainsKey(info.briefInfo.uulUid))
     {
         this.m_GuildDic.Add(info.briefInfo.uulUid, info);
     }
 }
示例#2
0
 public CGuildModel()
 {
     this.m_CurrentPrepareGuildInfo       = new PrepareGuildInfo();
     this.m_CurrentGuildInfo              = new GuildInfo();
     this.m_PlayerGuildLastState          = COM_PLAYER_GUILD_STATE.COM_PLAYER_GUILD_STATE_NULL;
     this.m_PrepareGuildOldestRequestTime = 4294967295u;
     this.m_GuildDic                = new DictionaryView <ulong, GuildInfo>();
     this.m_PrepareGuildDic         = new DictionaryView <ulong, PrepareGuildInfo>();
     this.m_ApplicantDic            = new Dictionary <ulong, stApplicantInfo>();
     this.m_AppliedGuildDic         = new Dictionary <ulong, stAppliedGuildInfo>();
     this.m_InvitedFriendDic        = new Dictionary <ulong, stInvitedFriend>();
     this.m_IsLocalDataInited       = false;
     this.m_IsInited                = false;
     this.m_InvitePlayerUuid        = 0uL;
     this.m_InviteGuildUuid         = 0uL;
     this.m_InviteGuildLogicWorldId = 0;
     this.m_InvitGuildName          = null;
     this.m_recommendInfoDic        = new Dictionary <ulong, stRecommendInfo>();
     this.m_recommendTimeInfoDic    = new Dictionary <ulong, int>();
     this.m_inviteTimeInfoDic       = new Dictionary <ulong, int>();
     this.RankpointMemberInfoList   = new List <KeyValuePair <ulong, MemberRankInfo> >();
     this.RankpointRankInfoLists    = new ListView <RankpointRankInfo> [4];
     for (int i = 0; i < this.RankpointRankInfoLists.Length; i++)
     {
         this.RankpointRankInfoLists[i] = new ListView <RankpointRankInfo>();
     }
     this.RankpointRankGottens         = new bool[4];
     this.RankpointRankLastGottenTimes = new int[4];
 }
示例#3
0
        private void On_Guild_Guild_Select(CUIEvent uiEvent)
        {
            int       selectedIndex    = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex();
            GuildInfo guildInfoByIndex = this.m_Model.GetGuildInfoByIndex(selectedIndex);

            if (guildInfoByIndex != null)
            {
                CUIHttpImageScript component = this.m_form.GetWidget(34).GetComponent <CUIHttpImageScript>();
                component.SetImageUrl(CGuildHelper.GetHeadUrl(guildInfoByIndex.chairman.stBriefInfo.szHeadUrl));
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(this.m_form.GetWidget(41).GetComponent <Image>(), CGuildHelper.GetNobeLevel(guildInfoByIndex.chairman.stBriefInfo.uulUid, guildInfoByIndex.chairman.stBriefInfo.stVip.level), false);

                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.m_form.GetWidget(40).GetComponent <Image>(), CGuildHelper.GetNobeHeadIconId(guildInfoByIndex.chairman.stBriefInfo.uulUid, guildInfoByIndex.chairman.stBriefInfo.stVip.headIconId));

                this.m_form.GetWidget(10).GetComponent <Text>().text = guildInfoByIndex.briefInfo.sBulletin;
                this.m_form.GetWidget(11).GetComponent <Text>().text = guildInfoByIndex.chairman.stBriefInfo.sName;
                this.m_form.GetWidget(39).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Common_Level_Format", new string[]
                {
                    guildInfoByIndex.chairman.stBriefInfo.dwLevel.ToString()
                });

                Image component2 = this.m_form.GetWidget(46).GetComponent <Image>();
                Text  component3 = this.m_form.GetWidget(47).GetComponent <Text>();
                Text  component4 = this.m_form.GetWidget(48).GetComponent <Text>();
                component2.SetSprite(CGuildHelper.GetGradeIconPathByRankpointScore(guildInfoByIndex.RankInfo.totalRankPoint), this.m_form, true, false, false, false);
                component3.text = CGuildHelper.GetGradeName(guildInfoByIndex.RankInfo.totalRankPoint);
                component4.text = Singleton <CTextManager> .GetInstance().GetText("Guild_Profit_Desc", new string[]
                {
                    CGuildHelper.GetCoinProfitPercentage((int)guildInfoByIndex.briefInfo.bLevel).ToString()
                });
            }
        }
示例#4
0
        private void SetGuildListItem(CUIListElementScript listElementScript, GuildInfo info)
        {
            Transform  transform  = listElementScript.transform;
            Image      component  = transform.Find("imgIcon").GetComponent <Image>();
            Text       component2 = transform.Find("txtName").GetComponent <Text>();
            Text       component3 = transform.Find("txtMemCnt").GetComponent <Text>();
            GameObject gameObject = transform.Find("imgApplied").gameObject;
            Text       component4 = transform.Find("txtChairmanName").GetComponent <Text>();
            Text       component5 = transform.Find("txtSeasonRankpoint").GetComponent <Text>();
            Text       component6 = transform.Find("txtJoinLimit").GetComponent <Text>();
            string     prefabPath = CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + info.briefInfo.dwHeadId;

            component.SetSprite(prefabPath, this.m_form, true, false, false, false);
            component2.text = info.briefInfo.sName;
            component3.text = info.briefInfo.bMemberNum + "/" + CGuildHelper.GetMaxGuildMemberCountByLevel((int)info.briefInfo.bLevel);
            component4.text = info.chairman.stBriefInfo.sName;
            component5.text = info.chairman.RankInfo.totalRankPoint.ToString();
            component6.text = CGuildHelper.GetGuildJoinLimitText((int)info.briefInfo.LevelLimit, (int)info.briefInfo.GradeLimit, info.briefInfo.dwSettingMask);
            stGuildBriefInfo stBriefInfo = this.m_Model.GetAppliedGuildInfoByUid(info.briefInfo.uulUid).stBriefInfo;

            if (stBriefInfo.uulUid != 0uL)
            {
                gameObject.CustomSetActive(true);
            }
            else
            {
                gameObject.CustomSetActive(false);
            }
        }
示例#5
0
        private void RequestApplyJoinGuild(GuildInfo info)
        {
            CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x8ad);

            msg.stPkgData.stApplyJoinGuildReq.ullGuildID = info.stBriefInfo.uulUid;
            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false);
        }
示例#6
0
        private void On_Guild_Guild_List_Element_Enabled(CUIEvent uiEvent)
        {
            GuildInfo guildInfoByIndex = this.m_Model.GetGuildInfoByIndex(uiEvent.m_srcWidgetIndexInBelongedList);

            if (guildInfoByIndex != null)
            {
                this.SetGuildListItem(uiEvent.m_srcWidgetScript as CUIListElementScript, guildInfoByIndex);
            }
        }
 private void OnReceiveGuildSearchSuccess(GuildInfo info, int searchType)
 {
     if (Singleton <CGuildSystem> .GetInstance().IsInNormalGuild())
     {
         this.m_Model.ClearGuildInfoList();
         this.m_Model.AddGuildInfo(info);
         this.m_View.RefreshPreviewForm(true);
     }
 }
示例#8
0
        private void On_Guild_Guild_Join(CUIEvent uiEvent)
        {
            int       selectedIndex    = this.m_form.GetWidget(30).GetComponent <CUIListScript>().GetSelectedIndex();
            GuildInfo guildInfoByIndex = this.m_Model.GetGuildInfoByIndex(selectedIndex);

            if (guildInfoByIndex != null)
            {
                uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey(10).dwConfValue;
                if ((dwConfValue != 0) && (dwConfValue > Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().PvpLevel))
                {
                    string[] args = new string[] { dwConfValue.ToString() };
                    Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Join_Level_Limit", args), false, 1f, null, new object[0]);
                }
                else if (this.m_Model.GetAppliedGuildInfoByUid(guildInfoByIndex.stBriefInfo.uulUid).stBriefInfo.uulUid != 0)
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("Guild_Current_Guild_Has_Invited_Tip", true, 1f, null, new object[0]);
                }
                else
                {
                    if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastQuitGuildTime != 0)
                    {
                        int num3 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().getCurrentTimeSinceLogin();

                        uint     num4    = GameDataMgr.guildMiscDatabin.GetDataByKey(7).dwConfValue;
                        int      seconds = ((int)(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastQuitGuildTime + num4)) - num3;
                        TimeSpan span    = new TimeSpan(0, 0, 0, seconds);
                        if (seconds > 0)
                        {
                            string[] textArray2 = new string[] { ((int)span.TotalMinutes).ToString(), span.Seconds.ToString() };
                            Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Cannot_Apply_Tip", textArray2), false, 1f, null, new object[0]);

                            return;
                        }
                    }
                    if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.bApplyJoinGuildNum > 0)
                    {
                        uint num6 = GameDataMgr.guildMiscDatabin.GetDataByKey(8).dwConfValue;
                        if ((Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.bApplyJoinGuildNum + 1) > num6)
                        {
                            Singleton <CUIManager> .GetInstance().OpenTips("Guild_Today_Apply_Reach_Limit_Tip", true, 1f, null, new object[0]);

                            return;
                        }
                    }
                    if (this.m_Model.IsInGuildStep())
                    {
                        Singleton <CUIManager> .GetInstance().OpenTips("Guild_In_Guild_Step_Tip", true, 1f, null, new object[0]);
                    }
                    else
                    {
                        Singleton <EventRouter> .GetInstance().BroadCastEvent <GuildInfo>("Request_Apply_Guild_Join", guildInfoByIndex);
                    }
                }
            }
        }
示例#9
0
 private void OnReceiveGuildSearchSuccess(GuildInfo guildInfo, int searchType)
 {
     if (!Singleton <CGuildSystem> .GetInstance().IsInNormalGuild())
     {
         this.m_Model.ClearGuildInfoList();
         this.m_Model.AddGuildInfo(guildInfo);
         if (searchType == 0)
         {
             this.m_View.RefreshGuildListPanel(true);
         }
         else if (searchType == 1)
         {
             Singleton <CGuildInfoView> .GetInstance().OpenGuildPreviewForm(true);
         }
     }
 }
示例#10
0
        private void On_Guild_Guild_Select(CUIEvent uiEvent)
        {
            int       selectedIndex    = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex();
            GuildInfo guildInfoByIndex = this.m_Model.GetGuildInfoByIndex(selectedIndex);

            if (guildInfoByIndex != null)
            {
                this.m_form.GetWidget(0x22).GetComponent <CUIHttpImageScript>().SetImageUrl(CGuildHelper.GetHeadUrl(guildInfoByIndex.stChairman.stBriefInfo.szHeadUrl));
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(this.m_form.GetWidget(0x29).GetComponent <Image>(), CGuildHelper.GetNobeLevel(guildInfoByIndex.stChairman.stBriefInfo.uulUid, guildInfoByIndex.stChairman.stBriefInfo.stVip.level), false);

                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.m_form.GetWidget(40).GetComponent <Image>(), CGuildHelper.GetNobeHeadIconId(guildInfoByIndex.stChairman.stBriefInfo.uulUid, guildInfoByIndex.stChairman.stBriefInfo.stVip.headIconId));

                this.m_form.GetWidget(10).GetComponent <Text>().text = guildInfoByIndex.stBriefInfo.sBulletin;
                this.m_form.GetWidget(11).GetComponent <Text>().text = guildInfoByIndex.stChairman.stBriefInfo.sName;
                string[] args = new string[] { guildInfoByIndex.stChairman.stBriefInfo.dwLevel.ToString() };
                this.m_form.GetWidget(0x27).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Common_Level_Format", args);
            }
        }
        public void OnCreateOrAddSuccess(GuildInfo info)
        {
            this.m_Model.CurrentGuildInfo = info;
            if (Singleton <CGuildListView> .GetInstance().IsShow())
            {
                Singleton <CGuildListView> .GetInstance().CloseForm();

                this.m_View.OpenForm();
            }
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Guild/Form_Guild_Preview.prefab");

            if (form != null)
            {
                form.Close();
                this.m_View.OpenForm();
            }
            string[] args = new string[] { info.stBriefInfo.sName };
            Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Join_Success_Tip", args), false, 1f, null, new object[0]);
        }
示例#12
0
        private void On_Guild_Guild_Join(CUIEvent uiEvent)
        {
            int       selectedIndex    = this.m_form.GetWidget(30).GetComponent <CUIListScript>().GetSelectedIndex();
            GuildInfo guildInfoByIndex = this.m_Model.GetGuildInfoByIndex(selectedIndex);

            if (guildInfoByIndex == null)
            {
                return;
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            stGuildBriefInfo stBriefInfo = this.m_Model.GetAppliedGuildInfoByUid(guildInfoByIndex.briefInfo.uulUid).stBriefInfo;

            if (stBriefInfo.uulUid != 0uL)
            {
                Singleton <CUIManager> .GetInstance().OpenTips("Guild_Current_Guild_Has_Invited_Tip", true, 1.5f, null, new object[0]);

                return;
            }
            if (CGuildHelper.IsInLastQuitGuildCd())
            {
                return;
            }
            if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.bApplyJoinGuildNum > 0)
            {
                uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey(8u).dwConfValue;
                if ((long)(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.bApplyJoinGuildNum + 1) > (long)((ulong)dwConfValue))
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("Guild_Today_Apply_Reach_Limit_Tip", true, 1.5f, null, new object[0]);

                    return;
                }
            }
            if (this.m_Model.IsInGuildStep())
            {
                Singleton <CUIManager> .GetInstance().OpenTips("Guild_In_Guild_Step_Tip", true, 1.5f, null, new object[0]);

                return;
            }
            Singleton <EventRouter> .GetInstance().BroadCastEvent <GuildInfo>("Request_Apply_Guild_Join", guildInfoByIndex);
        }
示例#13
0
        private void On_Guild_Guild_Join(CUIEvent uiEvent)
        {
            int       selectedIndex    = this.m_form.GetWidget(30).GetComponent <CUIListScript>().GetSelectedIndex();
            GuildInfo guildInfoByIndex = this.m_Model.GetGuildInfoByIndex(selectedIndex);

            if (guildInfoByIndex != null)
            {
                uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)10).dwConfValue;
                if ((dwConfValue != 0) && (dwConfValue > Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().PvpLevel))
                {
                    string[] args = new string[] { dwConfValue.ToString() };
                    Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Join_Level_Limit", args), false, 1.5f, null, new object[0]);
                }
                else if (this.m_Model.GetAppliedGuildInfoByUid(guildInfoByIndex.stBriefInfo.uulUid).stBriefInfo.uulUid != 0)
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("Guild_Current_Guild_Has_Invited_Tip", true, 1.5f, null, new object[0]);
                }
                else if (!CGuildHelper.IsInLastQuitGuildCd())
                {
                    if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.bApplyJoinGuildNum > 0)
                    {
                        uint num3 = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)8).dwConfValue;
                        if ((Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.bApplyJoinGuildNum + 1) > num3)
                        {
                            Singleton <CUIManager> .GetInstance().OpenTips("Guild_Today_Apply_Reach_Limit_Tip", true, 1.5f, null, new object[0]);

                            return;
                        }
                    }
                    if (this.m_Model.IsInGuildStep())
                    {
                        Singleton <CUIManager> .GetInstance().OpenTips("Guild_In_Guild_Step_Tip", true, 1.5f, null, new object[0]);
                    }
                    else
                    {
                        Singleton <EventRouter> .GetInstance().BroadCastEvent <GuildInfo>("Request_Apply_Guild_Join", guildInfoByIndex);
                    }
                }
            }
        }
示例#14
0
 public void OnReceiveGuildInfoSuccess(GuildInfo info)
 {
     this.m_Model.CurrentGuildInfo = info;
     Singleton <CGuildMatchSystem> .GetInstance().CreateGuildMatchAllTeams();
 }
 public void OnReceiveGuildInfoSuccess(GuildInfo info)
 {
     this.m_Model.CurrentGuildInfo = info;
 }
示例#16
0
 public void OnRequestApplyJoinGuild(GuildInfo info)
 {
     this.m_Model.SetPlayerGuildStateToTemp();
     this.RequestApplyJoinGuild(info);
 }
        public static bool IsReachGuildJoinLimit(int playerPvpLevel, int playerRankGrade)
        {
            GuildInfo currentGuildInfo = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo;

            return(playerPvpLevel >= (int)currentGuildInfo.briefInfo.LevelLimit && CLadderSystem.GetGradeDataByShowGrade(CGuildHelper.GetFixedPlayerRankGrade(playerRankGrade)).bLogicGrade >= CLadderSystem.GetGradeDataByShowGrade((int)currentGuildInfo.briefInfo.GradeLimit).bLogicGrade);
        }
示例#18
0
 public void OnRequestApplyJoinGuild(GuildInfo info)
 {
     this.m_Model.SetPlayerGuildStateToTemp();
     this.RequestApplyJoinGuild(info.briefInfo.uulUid, info.briefInfo.LogicWorldId, false);
 }
示例#19
0
        public static bool IsReachGuildJoinLimit(int playerPvpLevel, int playerRankGrade)
        {
            GuildInfo currentGuildInfo = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo;

            return(playerPvpLevel >= (int)currentGuildInfo.briefInfo.LevelLimit && CGuildHelper.GetFixedPlayerRankGrade(playerRankGrade) >= (int)currentGuildInfo.briefInfo.GradeLimit);
        }