Exemple #1
0
 public void Buy()
 {
     if (this.bCanBuy)
     {
         CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x459);
         msg.stPkgData.stShopBuyReq             = new CSPKG_CMD_SHOPBUY();
         msg.stPkgData.stShopBuyReq.iBuyType    = 4;
         msg.stPkgData.stShopBuyReq.iBuySubType = this.CurBuyTime + 1;
         Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false);
     }
     else if (!base.IsHaveEnoughDianQuan(1))
     {
         CUICommonSystem.OpenDianQuanNotEnoughTip();
     }
     else if (this.willOverMaxAP(1))
     {
         Singleton <CUIManager> .GetInstance().OpenTips("将超过体力最大上限值!", false, 1f, null, new object[0]);
     }
 }
Exemple #2
0
        private void On_Guild_PrepareGuild_Create(CUIEvent uiEvent)
        {
            Singleton <BeaconHelper> .GetInstance().m_curBuyDianInfo.buy_dia_channel = "3";

            Singleton <BeaconHelper> .GetInstance().m_curBuyDianInfo.call_back_time = Time.time;

            Singleton <BeaconHelper> .GetInstance().m_curBuyPropInfo.buy_prop_channel = "3";

            Singleton <BeaconHelper> .GetInstance().m_curBuyPropInfo.buy_prop_id_time = Time.time;

            int currentUTCTime = CRoleInfo.GetCurrentUTCTime();

            if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastCreateGuildTime != 0)
            {
                uint num2 = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)3).dwConfValue;
                if (currentUTCTime < (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastCreateGuildTime + num2))
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("Guild_Last_Create_Time_Tip", true, 1.5f, null, new object[0]);

                    return;
                }
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)5).dwConfValue;

            if (masterRoleInfo.DianQuan < dwConfValue)
            {
                CUICommonSystem.OpenDianQuanNotEnoughTip();
            }
            else
            {
                uint num4 = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)10).dwConfValue;
                if ((num4 != 0) && (num4 > Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().PvpLevel))
                {
                    string[] args = new string[] { num4.ToString() };
                    Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Join_Level_Limit", args), false, 1.5f, null, new object[0]);
                }
                else
                {
                    string str = CUIUtility.RemoveEmoji(this.m_form.GetWidget(0).GetComponent <Text>().text).Trim();
                    if (string.IsNullOrEmpty(str))
                    {
                        Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Empty", true, 1.5f, null, new object[0]);
                    }
                    else if (!Utility.IsValidText(str))
                    {
                        Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Invalid", true, 1.5f, null, new object[0]);
                    }
                    else if (string.IsNullOrEmpty(CUIUtility.RemoveEmoji(this.m_form.GetWidget(1).GetComponent <Text>().text).Trim()))
                    {
                        Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Bulletin_Empty", true, 1.5f, null, new object[0]);
                    }
                    else
                    {
                        uint     num5       = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)2).dwConfValue;
                        uint     num6       = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)1).dwConfValue;
                        TimeSpan span       = new TimeSpan(0, 0, 0, (int)num5);
                        string[] textArray2 = new string[] { span.TotalHours.ToString(), num6.ToString() };
                        string   text       = Singleton <CTextManager> .GetInstance().GetText("Guild_Create_Tip", textArray2);

                        Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text, enUIEventID.Guild_PrepareGuild_Create_Confirm, enUIEventID.Guild_PrepareGuild_Create_Cancel, false);
                    }
                }
            }
        }
Exemple #3
0
        private void On_Guild_PrepareGuild_Create(CUIEvent uiEvent)
        {
            Singleton <BeaconHelper> .GetInstance().m_curBuyDianInfo.buy_dia_channel = "3";

            Singleton <BeaconHelper> .GetInstance().m_curBuyDianInfo.call_back_time = Time.time;

            Singleton <BeaconHelper> .GetInstance().m_curBuyPropInfo.buy_prop_channel = "3";

            Singleton <BeaconHelper> .GetInstance().m_curBuyPropInfo.buy_prop_id_time = Time.time;

            int currentUTCTime = CRoleInfo.GetCurrentUTCTime();

            if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastCreateGuildTime != 0u)
            {
                uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey(3u).dwConfValue;
                if ((long)currentUTCTime < (long)((ulong)(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastCreateGuildTime + dwConfValue)))
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("Guild_Last_Create_Time_Tip", true, 1.5f, null, new object[0]);

                    return;
                }
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            uint dwConfValue2 = GameDataMgr.guildMiscDatabin.GetDataByKey(5u).dwConfValue;

            if (masterRoleInfo.DianQuan < (ulong)dwConfValue2)
            {
                CUICommonSystem.OpenDianQuanNotEnoughTip();
                return;
            }
            uint guildMemberMinPvpLevel = CGuildHelper.GetGuildMemberMinPvpLevel();

            if (guildMemberMinPvpLevel != 0u && guildMemberMinPvpLevel > Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().PvpLevel)
            {
                Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Join_Level_Limit", new string[]
                {
                    guildMemberMinPvpLevel.ToString()
                }), false, 1.5f, null, new object[0]);

                return;
            }
            Text   component = this.m_form.GetWidget(0).GetComponent <Text>();
            string text      = CUIUtility.RemoveEmoji(component.text).Trim();

            if (string.IsNullOrEmpty(text))
            {
                Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Empty", true, 1.5f, null, new object[0]);

                return;
            }
            if (!Utility.IsValidText(text))
            {
                Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Invalid", true, 1.5f, null, new object[0]);

                return;
            }
            Text   component2 = this.m_form.GetWidget(1).GetComponent <Text>();
            string text2      = CUIUtility.RemoveEmoji(component2.text).Trim();

            if (string.IsNullOrEmpty(text2))
            {
                Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Bulletin_Empty", true, 1.5f, null, new object[0]);

                return;
            }
            uint     dwConfValue3 = GameDataMgr.guildMiscDatabin.GetDataByKey(2u).dwConfValue;
            uint     dwConfValue4 = GameDataMgr.guildMiscDatabin.GetDataByKey(1u).dwConfValue;
            TimeSpan timeSpan     = new TimeSpan(0, 0, 0, (int)dwConfValue3);
            string   text3        = Singleton <CTextManager> .GetInstance().GetText("Guild_Create_Tip", new string[]
            {
                timeSpan.get_TotalHours().ToString(),
                dwConfValue4.ToString()
            });

            Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text3, enUIEventID.Guild_PrepareGuild_Create_Confirm, enUIEventID.Guild_PrepareGuild_Create_Cancel, false);
        }