Exemple #1
0
 public override void Validate()
 {
     this._urlaList = UrlAction.ParseFromText(base.view.activity.Content, null);
     if (this._urlaList.Count > 0)
     {
         this._stepList.SetElementAmount(this._urlaList.Count);
         for (int i = 0; i < this._urlaList.Count; i++)
         {
             UrlAction            action   = this._urlaList[i];
             CUIListElementScript elemenet = this._stepList.GetElemenet(i);
             if (null != elemenet)
             {
                 CUIHttpImageScript component = elemenet.GetComponent <CUIHttpImageScript>();
                 if (null != component)
                 {
                     component.SetImageUrl(action.target);
                 }
             }
         }
         this._curStepIndex = 0;
         this._leftToRight  = true;
         this._stepList.MoveElementInScrollArea(this._curStepIndex, true);
         this._lastScrollTime = Time.time;
         this.updateOverTime();
     }
 }
Exemple #2
0
        private void OnClick(CUIEvent uiEvent)
        {
            int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

            if ((this._urlaList != null) && (srcWidgetIndexInBelongedList < this._urlaList.Count))
            {
                UrlAction action = this._urlaList[srcWidgetIndexInBelongedList];
                if (action.Execute())
                {
                    base.view.form.Close();
                }
            }
        }
Exemple #3
0
        private void OnClick(CUIEvent uiEvent)
        {
            int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

            if (this._urlaList != null && srcWidgetIndexInBelongedList < this._urlaList.get_Count())
            {
                UrlAction urlAction = this._urlaList.get_Item(srcWidgetIndexInBelongedList);
                if (urlAction.Execute())
                {
                    base.view.form.Close();
                }
            }
        }
        public static void ReceiveRollingMsgNtf(CSPkg msg)
        {
            SCPKG_ROLLINGMSG_NTF stRollingMsgNtf = msg.stPkgData.stRollingMsgNtf;
            int num = Mathf.Min(stRollingMsgNtf.astRollingMsg.Length, (int)stRollingMsgNtf.bMsgCnt);

            for (int i = 0; i < num; i++)
            {
                RollingInfo      rollingInfo      = new RollingInfo();
                CSDT_ROLLING_MSG cSDT_ROLLING_MSG = stRollingMsgNtf.astRollingMsg[i];
                rollingInfo.resetPriorityTime = CRoleInfo.GetCurrentUTCTime();
                rollingInfo.priority          = CRollingSystem.CalculatePriority((COM_ROLLINGMSG_TYPE)cSDT_ROLLING_MSG.bType, cSDT_ROLLING_MSG.bPriority);
                rollingInfo.repeatCount       = CRollingSystem.CalculateRepeatCount(cSDT_ROLLING_MSG.dwStartTime, cSDT_ROLLING_MSG.dwEndTime, cSDT_ROLLING_MSG.wPeriod);
                rollingInfo.content           = Utility.UTF8Convert(cSDT_ROLLING_MSG.szContent, (int)cSDT_ROLLING_MSG.wContentLen);
                bool flag = false;
                ListView <UrlAction> listView = UrlAction.ParseFromText(rollingInfo.content, null);
                if (listView.Count > 0)
                {
                    UrlAction urlAction = listView[0];
                    if (!string.IsNullOrEmpty(urlAction.target) && urlAction.action == UrlAction.Action.openUrl && !string.IsNullOrEmpty(urlAction.url))
                    {
                        rollingInfo.content = urlAction.target;
                        rollingInfo.url     = urlAction.url;
                        flag = true;
                    }
                }
                if (cSDT_ROLLING_MSG.bType == 0)
                {
                    if (flag)
                    {
                        rollingInfo.content = "<color=#fdb900>" + rollingInfo.content + "</color>";
                    }
                    else
                    {
                        rollingInfo.content = "<color=#b5e9ff>" + rollingInfo.content + "</color>";
                    }
                }
                if (cSDT_ROLLING_MSG.bIsChat == 1)
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent <string>(EventID.ROLLING_SYSTEM_CHAT_INFO_RECEIVED, rollingInfo.content);
                }
                Singleton <CRollingSystem> .GetInstance().m_rollingInfos.Add(rollingInfo);
            }
            Singleton <CRollingSystem> .GetInstance().StartRolling();
        }
Exemple #5
0
        public static ListView <UrlAction> ParseFromText(string text, char[] spliter = null)
        {
            ListView <UrlAction> view = new ListView <UrlAction>();

            if (spliter == null)
            {
                spliter = MultiSpliter;
            }
            try
            {
                string[] strArray = text.Split(spliter, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < strArray.Length; i++)
                {
                    string[] strArray2 = strArray[i].Split(InnerSpliter, StringSplitOptions.RemoveEmptyEntries);
                    if (strArray2.Length > 0)
                    {
                        DictionaryView <string, string> view2 = new DictionaryView <string, string>();
                        for (int j = 1; j < strArray2.Length; j++)
                        {
                            string[] strArray3 = strArray2[j].Split(ParamSpliter);
                            if ((strArray3 != null) && (strArray3.Length == 2))
                            {
                                view2.Add(strArray3[0], strArray3[1]);
                            }
                        }
                        UrlAction item = new UrlAction {
                            target = strArray2[0],
                            action = Action.none
                        };
                        if (view2.ContainsKey("action"))
                        {
                            string key = view2["action"];
                            if (key != null)
                            {
                                int num3;
                                if (< > f__switch$map2 == null)
                                {
                                    Dictionary <string, int> dictionary = new Dictionary <string, int>(3);
                                    dictionary.Add("openUrl", 0);
                                    dictionary.Add("openForm", 1);
                                    dictionary.Add("buy", 2);
                                    < > f__switch$map2 = dictionary;
                                }
Exemple #6
0
        private void updateOverTime()
        {
            UrlAction action = this._urlaList[this._curStepIndex];

            if (action.overTime > 0L)
            {
                DateTime time  = Utility.ULongToDateTime(action.overTime);
                DateTime time2 = Utility.ToUtcTime2Local((long)CRoleInfo.GetCurrentUTCTime());
                TimeSpan span  = (TimeSpan)(time - time2);
                string   str   = Singleton <CTextManager> .GetInstance().GetText("TIME_SPAN_FORMAT").Replace("{0}", span.Days.ToString()).Replace("{1}", span.Hours.ToString()).Replace("{2}", span.Minutes.ToString()).Replace("{3}", span.Seconds.ToString());

                this._timeCD.gameObject.CustomSetActive(time >= time2);
                this._timeCD.text = str;
            }
            else
            {
                this._timeCD.gameObject.CustomSetActive(false);
            }
        }
Exemple #7
0
        public override void Validate()
        {
            this._urlaList = UrlAction.ParseFromText(base.view.activity.Content, null);
            int count = this._urlaList.Count;

            if (count > 0)
            {
                this._stepList.SetElementAmount(count);
                for (int i = 0; i < count; i++)
                {
                    UrlAction            urlAction = this._urlaList[i];
                    CUIListElementScript elemenet  = this._stepList.GetElemenet(i);
                    if (null != elemenet)
                    {
                        CUIHttpImageScript component = elemenet.GetComponent <CUIHttpImageScript>();
                        if (null != component)
                        {
                            component.SetImageUrl(urlAction.target);
                        }
                    }
                }
                this._pickIdxList = new int[count];
                if (this._pickObject != null)
                {
                    CUIContainerScript component2 = this._pickObject.GetComponent <CUIContainerScript>();
                    if (component2 != null)
                    {
                        component2.RecycleAllElement();
                        for (int j = 0; j < this._urlaList.Count; j++)
                        {
                            this._pickIdxList[j] = component2.GetElement();
                        }
                    }
                }
                this._curStepIndex = 0;
                this._leftToRight  = true;
                this._stepList.MoveElementInScrollArea(this._curStepIndex, true);
                this.EnablePickObj(this._curStepIndex);
                this._lastScrollTime = Time.time;
                this.updateOverTime();
            }
        }
Exemple #8
0
        private void updateOverTime()
        {
            UrlAction urlAction = this._urlaList[this._curStepIndex];

            if (urlAction.overTime > 0uL)
            {
                DateTime dateTime  = Utility.ULongToDateTime(urlAction.overTime);
                DateTime dateTime2 = Utility.ToUtcTime2Local((long)CRoleInfo.GetCurrentUTCTime());
                TimeSpan timeSpan  = dateTime - dateTime2;
                string   text      = Singleton <CTextManager> .GetInstance().GetText("TIME_SPAN_FORMAT");

                text = text.Replace("{0}", timeSpan.get_Days().ToString());
                text = text.Replace("{1}", timeSpan.get_Hours().ToString());
                text = text.Replace("{2}", timeSpan.get_Minutes().ToString());
                text = text.Replace("{3}", timeSpan.get_Seconds().ToString());
                this._timeCD.gameObject.CustomSetActive(dateTime >= dateTime2);
                this._timeCD.set_text(text);
            }
            else
            {
                this._timeCD.gameObject.CustomSetActive(false);
            }
        }
Exemple #9
0
        public static ListView <UrlAction> ParseFromText(string text, char[] spliter = null)
        {
            ListView <UrlAction> listView = new ListView <UrlAction>();

            if (spliter == null)
            {
                spliter = UrlAction.MultiSpliter;
            }
            try
            {
                string[] array = text.Split(spliter, 1);
                for (int i = 0; i < array.Length; i++)
                {
                    string[] array2 = array[i].Split(UrlAction.InnerSpliter, 1);
                    if (array2.Length > 0)
                    {
                        DictionaryView <string, string> dictionaryView = new DictionaryView <string, string>();
                        for (int j = 1; j < array2.Length; j++)
                        {
                            string[] array3 = array2[j].Split(UrlAction.ParamSpliter);
                            if (array3 != null && array3.Length == 2)
                            {
                                dictionaryView.Add(array3[0], array3[1]);
                            }
                        }
                        UrlAction urlAction = new UrlAction();
                        urlAction.target = array2[0];
                        urlAction.action = UrlAction.Action.none;
                        if (dictionaryView.ContainsKey("action"))
                        {
                            string text2 = dictionaryView["action"];
                            string text3 = text2;
                            string text4 = text3;
                            if (text4 != null)
                            {
                                if (UrlAction.< > f__switch$map2 == null)
                                {
                                    Dictionary <string, int> dictionary = new Dictionary <string, int>(4);
                                    dictionary.Add("openUrl", 0);
                                    dictionary.Add("openForm", 1);
                                    dictionary.Add("buy", 2);
                                    dictionary.Add("openMatchUrl", 3);
                                    UrlAction.< > f__switch$map2 = dictionary;
                                }
                                int num;
                                if (UrlAction.< > f__switch$map2.TryGetValue(text4, ref num))
                                {
                                    switch (num)
                                    {
                                    case 0:
                                        urlAction.action = UrlAction.Action.openUrl;
                                        urlAction.url    = dictionaryView["url"];
                                        break;

                                    case 1:
                                        urlAction.action = UrlAction.Action.openForm;
                                        urlAction.form   = (RES_GAME_ENTRANCE_TYPE)int.Parse(dictionaryView["form"]);
                                        break;

                                    case 2:
                                        urlAction.action   = UrlAction.Action.buy;
                                        urlAction.prodType = (COM_ITEM_TYPE)int.Parse(dictionaryView["prodType"]);
                                        urlAction.prodID   = uint.Parse(dictionaryView["prodID"]);
                                        if (dictionaryView.ContainsKey("prodSpec"))
                                        {
                                            int.TryParse(dictionaryView["prodSpec"], ref urlAction.prodSpec);
                                        }
                                        break;

                                    case 3:
                                    {
                                        int num2 = text.IndexOf("#action=openMatchUrl");
                                        if (num2 > 0)
                                        {
                                            urlAction.target = text.Substring(0, num2);
                                        }
                                        urlAction.action = UrlAction.Action.openMatchUrl;
                                        break;
                                    }
                                    }
                                }
                            }
                        }
                        if (dictionaryView.ContainsKey("overTime"))
                        {
                            ulong.TryParse(dictionaryView["overTime"], ref urlAction.overTime);
                        }
                        if (dictionaryView.ContainsKey("showTime"))
                        {
                            int.TryParse(dictionaryView["showTime"], ref urlAction.showTime);
                        }
                        listView.Add(urlAction);
                    }
                }
            }
            catch (Exception var_11_299)
            {
            }
            return(listView);
        }
Exemple #10
0
        public static ListView <UrlAction> ParseFromText(string text, char[] spliter = null)
        {
            ListView <UrlAction> listView = new ListView <UrlAction>();

            if (spliter == null)
            {
                spliter = UrlAction.MultiSpliter;
            }
            try
            {
                string[] array = text.Split(spliter, 1);
                for (int i = 0; i < array.Length; i++)
                {
                    string[] array2 = array[i].Split(UrlAction.InnerSpliter, 1);
                    if (array2.Length > 0)
                    {
                        DictionaryView <string, string> dictionaryView = new DictionaryView <string, string>();
                        for (int j = 1; j < array2.Length; j++)
                        {
                            string[] array3 = array2[j].Split(UrlAction.ParamSpliter);
                            if (array3 != null && array3.Length == 2)
                            {
                                dictionaryView.Add(array3[0], array3[1]);
                            }
                        }
                        UrlAction urlAction = new UrlAction();
                        urlAction.target = array2[0];
                        urlAction.action = UrlAction.Action.none;
                        if (dictionaryView.ContainsKey("action"))
                        {
                            string text2 = dictionaryView.get_Item("action");
                            string text3 = text2;
                            if (text3 != null)
                            {
                                if (UrlAction.< > f__switch$map0 == null)
                                {
                                    Dictionary <string, int> dictionary = new Dictionary <string, int>(3);
                                    dictionary.Add("openUrl", 0);
                                    dictionary.Add("openForm", 1);
                                    dictionary.Add("buy", 2);
                                    UrlAction.< > f__switch$map0 = dictionary;
                                }
                                int num;
                                if (UrlAction.< > f__switch$map0.TryGetValue(text3, ref num))
                                {
                                    switch (num)
                                    {
                                    case 0:
                                        urlAction.action = UrlAction.Action.openUrl;
                                        urlAction.url    = dictionaryView.get_Item("url");
                                        break;

                                    case 1:
                                        urlAction.action = UrlAction.Action.openForm;
                                        urlAction.form   = int.Parse(dictionaryView.get_Item("form"));
                                        break;

                                    case 2:
                                        urlAction.action   = UrlAction.Action.buy;
                                        urlAction.prodType = int.Parse(dictionaryView.get_Item("prodType"));
                                        urlAction.prodID   = uint.Parse(dictionaryView.get_Item("prodID"));
                                        if (dictionaryView.ContainsKey("prodSpec"))
                                        {
                                            int.TryParse(dictionaryView.get_Item("prodSpec"), ref urlAction.prodSpec);
                                        }
                                        break;
                                    }
                                }
                            }
                        }
                        if (dictionaryView.ContainsKey("overTime"))
                        {
                            ulong.TryParse(dictionaryView.get_Item("overTime"), ref urlAction.overTime);
                        }
                        if (dictionaryView.ContainsKey("showTime"))
                        {
                            int.TryParse(dictionaryView.get_Item("showTime"), ref urlAction.showTime);
                        }
                        listView.Add(urlAction);
                    }
                }
            }
            catch (Exception var_9_25C)
            {
            }
            return(listView);
        }