Example #1
0
        public static void ReceiveRollingMsgNtf(CSPkg msg)
        {
            SCPKG_ROLLINGMSG_NTF stRollingMsgNtf = msg.stPkgData.get_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(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);
                if (cSDT_ROLLING_MSG.bType == 0)
                {
                    rollingInfo.content = "<color=#b5e9ff>" + rollingInfo.content + "</color>";
                }
                if (cSDT_ROLLING_MSG.bIsChat == 0)
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent <string>(EventID.ROLLING_SYSTEM_CHAT_INFO_RECEIVED, rollingInfo.content);
                }
                Singleton <CRollingSystem> .GetInstance().m_rollingInfos.Add(rollingInfo);
            }
            Singleton <CRollingSystem> .GetInstance().StartRolling();
        }
Example #2
0
        public static void ReceiveRollingMsgNtf(CSPkg msg)
        {
            SCPKG_ROLLINGMSG_NTF stRollingMsgNtf = msg.stPkgData.stRollingMsgNtf;
            int num = Mathf.Min(stRollingMsgNtf.astRollingMsg.Length, stRollingMsgNtf.bMsgCnt);

            for (int i = 0; i < num; i++)
            {
                RollingInfo      item             = new RollingInfo();
                CSDT_ROLLING_MSG csdt_rolling_msg = stRollingMsgNtf.astRollingMsg[i];
                item.resetPriorityTime = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().getCurrentTimeSinceLogin();

                item.priority    = CalculatePriority((COM_ROLLINGMSG_TYPE)csdt_rolling_msg.bType, csdt_rolling_msg.bPriority);
                item.repeatCount = CalculateRepeatCount(csdt_rolling_msg.dwStartTime, csdt_rolling_msg.dwEndTime, csdt_rolling_msg.wPeriod);
                item.content     = Utility.UTF8Convert(csdt_rolling_msg.szContent, csdt_rolling_msg.wContentLen);
                if (csdt_rolling_msg.bType == 0)
                {
                    item.content = "<color=#00ff00>" + item.content + "</color>";
                }
                if (csdt_rolling_msg.bIsChat == 0)
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent <string>(EventID.ROLLING_SYSTEM_CHAT_INFO_RECEIVED, item.content);
                }
                Singleton <CRollingSystem> .GetInstance().m_rollingInfos.Add(item);
            }
            Singleton <CRollingSystem> .GetInstance().StartRolling();
        }
        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();
        }
        private void StartRolling(CUIAutoScroller autoScroller)
        {
            if (autoScroller == null || autoScroller.IsScrollRunning() || !Singleton <LobbyLogic> .GetInstance().CanShowRolling || this.m_isInRollingCD)
            {
                return;
            }
            RectTransform rectTransform = autoScroller.transform as RectTransform;

            if (rectTransform != null)
            {
                if (Singleton <CLoudSpeakerSys> .instance.IsLoudSpeakerShowing())
                {
                    rectTransform.anchorMin = new Vector2(0.661f, 0.5f);
                }
                else
                {
                    rectTransform.anchorMin = new Vector2(0.3f, 0.5f);
                }
            }
            int nextShowRollingInfoIndex = this.GetNextShowRollingInfoIndex();

            if (0 <= nextShowRollingInfoIndex && nextShowRollingInfoIndex < this.m_rollingInfos.get_Count())
            {
                RollingInfo rollingInfo = this.m_rollingInfos.get_Item(nextShowRollingInfoIndex);
                autoScroller.SetText(rollingInfo.content);
                if (autoScroller.m_content != null)
                {
                    CUIEventScript component = autoScroller.m_content.GetComponent <CUIEventScript>();
                    if (component != null)
                    {
                        if (!string.IsNullOrEmpty(rollingInfo.url))
                        {
                            component.m_onClickEventParams.tagStr = rollingInfo.url;
                        }
                        else
                        {
                            component.m_onClickEventParams.tagStr = string.Empty;
                        }
                    }
                }
                autoScroller.StartAutoScroll(false);
                rollingInfo.isShowing = true;
            }
        }
Example #5
0
        private void HandleOnShowRollingInfo()
        {
            int onShowRollingInfoIndex = this.GetOnShowRollingInfoIndex();

            if ((0 <= onShowRollingInfoIndex) && (onShowRollingInfoIndex < this.m_rollingInfos.Count))
            {
                if (this.m_rollingInfos[onShowRollingInfoIndex].repeatCount > 1)
                {
                    RollingInfo local1 = this.m_rollingInfos[onShowRollingInfoIndex];
                    local1.repeatCount = (byte)(local1.repeatCount - 1);
                    this.m_rollingInfos[onShowRollingInfoIndex].priority  = 1;
                    this.m_rollingInfos[onShowRollingInfoIndex].isShowing = false;
                }
                else
                {
                    this.m_rollingInfos.RemoveAt(onShowRollingInfoIndex);
                }
            }
        }
Example #6
0
        private void HandleOnShowRollingInfo()
        {
            int onShowRollingInfoIndex = this.GetOnShowRollingInfoIndex();

            if (0 <= onShowRollingInfoIndex && onShowRollingInfoIndex < this.m_rollingInfos.get_Count())
            {
                if (this.m_rollingInfos.get_Item(onShowRollingInfoIndex).repeatCount > 1)
                {
                    RollingInfo expr_42 = this.m_rollingInfos.get_Item(onShowRollingInfoIndex);
                    expr_42.repeatCount -= 1;
                    this.m_rollingInfos.get_Item(onShowRollingInfoIndex).priority  = 1;
                    this.m_rollingInfos.get_Item(onShowRollingInfoIndex).isShowing = false;
                }
                else
                {
                    this.m_rollingInfos.RemoveAt(onShowRollingInfoIndex);
                }
            }
        }
Example #7
0
 private bool IsNeedResetResetPriority(RollingInfo rollingInfo)
 {
     return((rollingInfo.repeatCount > 0) && ((Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().getCurrentTimeSinceLogin() - rollingInfo.resetPriorityTime) > 300));
 }
 private bool IsNeedResetResetPriority(RollingInfo rollingInfo)
 {
     return(rollingInfo.repeatCount > 0 && CRoleInfo.GetCurrentUTCTime() - rollingInfo.resetPriorityTime > 300);
 }