Ejemplo n.º 1
0
 public void Clear()
 {
     if (this.m_timerReq != -1)
     {
         Singleton <CTimerManager> .get_instance().RemoveTimer(this.m_timerReq);
     }
     this.m_timerReq = -1;
     if (this.m_timerSpeaker != -1)
     {
         Singleton <CTimerManager> .get_instance().RemoveTimer(this.m_timerSpeaker);
     }
     this.m_timerSpeaker = -1;
     if (this.m_timerLoudSpeaker != -1)
     {
         Singleton <CTimerManager> .get_instance().RemoveTimer(this.m_timerLoudSpeaker);
     }
     this.m_timerLoudSpeaker        = -1;
     this.m_lastSpeakerBeginSec     = 0u;
     this.m_lastLoudSpeakerBeginSec = 0u;
     this.m_itemID = 0u;
     this.speakerList.Clear();
     this.loudSpeakerList.Clear();
     this.CurLoudSpeaker = null;
     this.CurSpekaer     = null;
 }
Ejemplo n.º 2
0
        public void ShowLoudSpeaker(COMDT_CHAT_MSG_HORN data)
        {
            this.m_loudSpeakerCount = 0;
            this.m_timerLoudSpeaker = Singleton <CTimerManager> .instance.AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnTimerLoudSpeaker));

            if (Singleton <BattleLogic> .instance.isRuning)
            {
                this.loudSpeakerList.Clear();
            }
            else
            {
                CUIFormScript form = Singleton <CUIManager> .instance.GetForm(LobbyForm.FORM_PATH);

                if (form != null)
                {
                    CUIAutoScroller component = form.GetWidget(5).GetComponent <CUIAutoScroller>();
                    if (component != null)
                    {
                        GameObject widget = form.GetWidget(6);
                        if (widget != null)
                        {
                            string rawText = UT.Bytes2String(data.szContent);
                            string str     = CChatUT.Build_4_LoudSpeaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, rawText);
                            component.SetText(CUIUtility.RemoveEmoji(str));
                            component.gameObject.CustomSetActive(true);
                            widget.CustomSetActive(true);
                            component.StopAutoScroll();
                            component.StartAutoScroll(true);
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void ShowSpeaker(COMDT_CHAT_MSG_HORN data)
        {
            this.m_speakerCount = 0;
            string a = CChatUT.Build_4_Speaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, UT.Bytes2String(data.szContent));

            this.m_timerSpeaker = Singleton <CTimerManager> .instance.AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnTimerSpeaker));

            Singleton <CChatController> .instance.model.sysData.Add_NewContent_Entry_Speaker(a);

            Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change");
        }
Ejemplo n.º 4
0
        private COMDT_CHAT_MSG_HORN PopSpeakerList(CS_HORN_TYPE type)
        {
            COMDT_CHAT_MSG_HORN            result   = null;
            ListView <COMDT_CHAT_MSG_HORN> listView = this.GetSpeakerList(type);

            if (listView.get_Count() > 0)
            {
                result = listView.get_Item(0);
                listView.RemoveAt(0);
            }
            return(result);
        }
Ejemplo n.º 5
0
        public static CChatEntity Build_4_LoudSpeaker(COMDT_CHAT_MSG_HORN data)
        {
            CChatEntity cChatEntity = new CChatEntity();

            cChatEntity.ullUid        = data.stFrom.ullUid;
            cChatEntity.iLogicWorldID = (uint)data.stFrom.iLogicWorldID;
            cChatEntity.text          = UT.Bytes2String(data.szContent);
            cChatEntity.type          = EChaterType.LoudSpeaker;
            CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.openId, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip);
            cChatEntity.time = CRoleInfo.GetCurrentUTCTime();
            return(cChatEntity);
        }
Ejemplo n.º 6
0
        private COMDT_CHAT_MSG_HORN PopSpeakerList(CS_HORN_TYPE type)
        {
            COMDT_CHAT_MSG_HORN            comdt_chat_msg_horn = null;
            ListView <COMDT_CHAT_MSG_HORN> speakerList         = this.GetSpeakerList(type);

            if (speakerList.Count > 0)
            {
                comdt_chat_msg_horn = speakerList[0];
                speakerList.RemoveAt(0);
            }
            return(comdt_chat_msg_horn);
        }
Ejemplo n.º 7
0
        public static CChatEntity Build_4_Speaker(COMDT_CHAT_MSG_HORN data)
        {
            CChatEntity entity = new CChatEntity {
                ullUid        = data.stFrom.ullUid,
                iLogicWorldID = (uint)data.stFrom.iLogicWorldID,
                text          = UT.Bytes2String(data.szContent),
                type          = EChaterType.Speaker
            };

            GetUser(entity.type, entity.ullUid, entity.iLogicWorldID, out entity.name, out entity.level, out entity.head_url, out entity.stGameVip);
            entity.time = CRoleInfo.GetCurrentUTCTime();
            return(entity);
        }
Ejemplo n.º 8
0
        public void ShowSpeaker(COMDT_CHAT_MSG_HORN data)
        {
            string a = CChatUT.Build_4_Speaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, UT.Bytes2String(data.szContent));

            this.m_timerSpeaker = Singleton <CTimerManager> .get_instance().AddTimer(1000, 0, new CTimer.OnTimeUpHandler(this.OnTimerSpeaker));

            if (Singleton <CChatController> .get_instance().model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Normal)
            {
                Singleton <CChatController> .get_instance().model.sysData.Add_NewContent_Entry_Speaker(a);

                Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change");
            }
        }
Ejemplo n.º 9
0
        public static CChatEntity Build_4_Speaker(COMDT_CHAT_MSG_HORN data)
        {
            CChatEntity entity = new CChatEntity {
                ullUid        = data.stFrom.ullUid,
                iLogicWorldID = (uint)data.stFrom.iLogicWorldID,
                text          = UT.Bytes2String(data.szContent),
                type          = EChaterType.Speaker
            };

            GetUser(entity.type, entity.ullUid, entity.iLogicWorldID, out entity.name, out entity.level, out entity.head_url, out entity.stGameVip);
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            entity.time = (masterRoleInfo != null) ? masterRoleInfo.getCurrentTimeSinceLogin() : 0;
            return(entity);
        }
Ejemplo n.º 10
0
        public void AddSpeakerArray(CS_HORN_TYPE type, COMDT_CHAT_MSG_HORN[] astMsgInfo, uint len)
        {
            ListView <COMDT_CHAT_MSG_HORN> listView = this.GetSpeakerList(type);
            int lastSpeakerBeginSec = (int)this.GetLastSpeakerBeginSec(type);
            int num = 0;

            while ((long)num < (long)((ulong)len))
            {
                if (lastSpeakerBeginSec < (int)astMsgInfo[num].dwBeginShowSec)
                {
                    listView.Add(astMsgInfo[num]);
                    Singleton <CChatController> .get_instance().model.Add_Palyer_Info(astMsgInfo[num].stFrom);

                    if (type == null)
                    {
                        bool flag = astMsgInfo[num].stFrom.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID;

                        if (Singleton <CChatController> .get_instance().view != null)
                        {
                            Singleton <CChatController> .get_instance().view.bRefreshNew = (!Singleton <CChatController> .get_instance().view.IsCheckHistory() || flag);
                        }
                        CChatEntity chatEnt = CChatUT.Build_4_Speaker(astMsgInfo[num]);
                        Singleton <CChatController> .get_instance().model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Lobby, 0uL, 0u);

                        this.m_lastSpeakerBeginSec = Math.Max(astMsgInfo[num].dwBeginShowSec, this.m_lastSpeakerBeginSec);
                    }
                    else
                    {
                        this.m_lastLoudSpeakerBeginSec = Math.Max(astMsgInfo[num].dwBeginShowSec, this.m_lastLoudSpeakerBeginSec);
                    }
                }
                num++;
            }
            if (len > 0u)
            {
                COMDT_CHAT_MSG_HORN cOMDT_CHAT_MSG_HORN = astMsgInfo[0];
                if (type == null)
                {
                    this.OnSpeakerNodeOpen();
                }
                else if (type == 1)
                {
                    this.OnLoudSpeakerTipsOpen();
                }
            }
        }
Ejemplo n.º 11
0
        private void OnLoudSpeakerTipsOpen()
        {
            if (!this.IsLoudSpeakerShowing())
            {
                this.CurLoudSpeaker = this.PopSpeakerList(CS_HORN_TYPE.CS_HORNTYPE_BIGER);
                if (this.CurLoudSpeaker != null)
                {
                    if (this.m_timerLoudSpeaker != -1)
                    {
                        Singleton <CTimerManager> .instance.RemoveTimer(this.m_timerLoudSpeaker);

                        this.m_timerLoudSpeaker = -1;
                    }
                    this.ShowLoudSpeaker(this.CurLoudSpeaker);
                }
            }
        }
Ejemplo n.º 12
0
        private void OnLoudSpeakerTipsOpen(CUIEvent uiEvent)
        {
            if (!this.IsLoudSpeakerShowing())
            {
                COMDT_CHAT_MSG_HORN data = this.PopSpeakerList(CS_HORN_TYPE.CS_HORNTYPE_BIGER);
                if (data != null)
                {
                    if (this.m_timerLoudSpeaker != -1)
                    {
                        Singleton <CTimerManager> .instance.RemoveTimer(this.m_timerLoudSpeaker);

                        this.m_timerLoudSpeaker = -1;
                    }
                    this.ShowLoudSpeaker(data);
                }
            }
        }
Ejemplo n.º 13
0
        private void OnSpeakerNodeOpen()
        {
            if (!this.IsSpeakerShowing())
            {
                COMDT_CHAT_MSG_HORN data = this.PopSpeakerList(CS_HORN_TYPE.CS_HORNTYPE_SMALL);
                if (data != null)
                {
                    if (this.m_timerSpeaker != -1)
                    {
                        Singleton <CTimerManager> .instance.RemoveTimer(this.m_timerSpeaker);

                        this.m_timerSpeaker = -1;
                    }
                    this.ShowSpeaker(data);
                }
            }
        }
Ejemplo n.º 14
0
        private void OnSpeakerNodeOpen()
        {
            if (!this.IsSpeakerShowing())
            {
                this.CurSpekaer = this.PopSpeakerList(CS_HORN_TYPE.CS_HORNTYPE_SMALL);
                if (this.CurSpekaer == null)
                {
                    return;
                }
                if (this.m_timerSpeaker != -1)
                {
                    Singleton <CTimerManager> .instance.RemoveTimer(this.m_timerSpeaker);

                    this.m_timerSpeaker = -1;
                }
                this.ShowSpeaker(this.CurSpekaer);
            }
        }
Ejemplo n.º 15
0
        private void OnSpeakerNodeOpen()
        {
            if (!this.IsSpeakerShowing())
            {
                this.CurSpekaer = this.PopSpeakerList(0);
                if (this.CurSpekaer == null)
                {
                    return;
                }
                if (this.m_timerSpeaker != -1)
                {
                    Singleton <CTimerManager> .get_instance().RemoveTimer(this.m_timerSpeaker);

                    this.m_timerSpeaker = -1;
                }
                this.ShowSpeaker(this.CurSpekaer);
            }
        }
Ejemplo n.º 16
0
        private void OnLoudSpeakerTipsOpen()
        {
            if (!this.IsLoudSpeakerShowing())
            {
                this.CurLoudSpeaker = this.PopSpeakerList(1);
                if (this.CurLoudSpeaker == null)
                {
                    return;
                }
                if (this.m_timerLoudSpeaker != -1)
                {
                    Singleton <CTimerManager> .get_instance().RemoveTimer(this.m_timerLoudSpeaker);

                    this.m_timerLoudSpeaker = -1;
                }
                this.ShowLoudSpeaker(this.CurLoudSpeaker);
            }
        }
Ejemplo n.º 17
0
        private void OnTimerLoudSpeaker(int timerSequence)
        {
            if ((long)CRoleInfo.GetCurrentUTCTime() >= (long)((ulong)this.GetSpeakerEndTime(1)))
            {
                Singleton <CTimerManager> .get_instance().RemoveTimer(timerSequence);

                this.m_timerLoudSpeaker = -1;
                this.CurLoudSpeaker     = null;
                CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CLobbySystem.LOBBY_FORM_PATH);

                if (form == null)
                {
                    return;
                }
                CUIAutoScroller component = form.GetWidget(5).GetComponent <CUIAutoScroller>();
                if (component == null)
                {
                    return;
                }
                GameObject widget = form.GetWidget(6);
                if (widget == null)
                {
                    return;
                }
                component.StopAutoScroll();
                if (Singleton <CChatController> .get_instance().view != null)
                {
                    Singleton <CChatController> .get_instance().view.ShowLoudSpeaker(false, null);
                }
                this.CurLoudSpeaker = this.PopSpeakerList(1);
                if (this.CurLoudSpeaker == null)
                {
                    component.gameObject.CustomSetActive(false);
                    widget.CustomSetActive(false);
                    this.GetSpeakerMsg(1, this.m_lastLoudSpeakerBeginSec);
                }
                else
                {
                    component.gameObject.CustomSetActive(true);
                    widget.CustomSetActive(true);
                    this.ShowLoudSpeaker(this.CurLoudSpeaker);
                }
            }
        }
Ejemplo n.º 18
0
        public void AddSpeakerArray(CS_HORN_TYPE type, COMDT_CHAT_MSG_HORN[] astMsgInfo, uint len)
        {
            ListView <COMDT_CHAT_MSG_HORN> speakerList = this.GetSpeakerList(type);
            int lastSpeakerBeginSec = (int)this.GetLastSpeakerBeginSec(type);

            for (int i = 0; i < len; i++)
            {
                if (lastSpeakerBeginSec < astMsgInfo[i].dwBeginShowSec)
                {
                    speakerList.Add(astMsgInfo[i]);
                    Singleton <CChatController> .instance.model.Add_Palyer_Info(astMsgInfo[i].stFrom);

                    if (type == CS_HORN_TYPE.CS_HORNTYPE_SMALL)
                    {
                        bool flag = astMsgInfo[i].stFrom.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID;

                        if (Singleton <CChatController> .instance.view != null)
                        {
                            Singleton <CChatController> .instance.view.bRefreshNew = !Singleton <CChatController> .instance.view.IsCheckHistory() || flag;
                        }
                        CChatEntity chatEnt = CChatUT.Build_4_Speaker(astMsgInfo[i]);
                        Singleton <CChatController> .instance.model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Lobby, 0L, 0);

                        this.m_lastSpeakerBeginSec = Math.Max(astMsgInfo[i].dwBeginShowSec, this.m_lastSpeakerBeginSec);
                    }
                    else
                    {
                        this.m_lastLoudSpeakerBeginSec = Math.Max(astMsgInfo[i].dwBeginShowSec, this.m_lastLoudSpeakerBeginSec);
                    }
                }
            }
            if (len > 0)
            {
                COMDT_CHAT_MSG_HORN comdt_chat_msg_horn = astMsgInfo[0];
                if (type == CS_HORN_TYPE.CS_HORNTYPE_SMALL)
                {
                    this.OnSpeakerNodeOpen();
                }
                else if (type == CS_HORN_TYPE.CS_HORNTYPE_BIGER)
                {
                    this.OnLoudSpeakerTipsOpen();
                }
            }
        }
Ejemplo n.º 19
0
        private void OnTimerLoudSpeaker(int timerSequence)
        {
            if (CRoleInfo.GetCurrentUTCTime() >= this.GetSpeakerEndTime(CS_HORN_TYPE.CS_HORNTYPE_BIGER))
            {
                Singleton <CTimerManager> .instance.RemoveTimer(timerSequence);

                this.m_timerLoudSpeaker = -1;
                this.CurLoudSpeaker     = null;
                CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CLobbySystem.LOBBY_FORM_PATH);

                if (form != null)
                {
                    CUIAutoScroller component = form.GetWidget(5).GetComponent <CUIAutoScroller>();
                    if (component != null)
                    {
                        GameObject widget = form.GetWidget(6);
                        if (widget != null)
                        {
                            component.StopAutoScroll();
                            if (Singleton <CChatController> .instance.view != null)
                            {
                                Singleton <CChatController> .instance.view.ShowLoudSpeaker(false, null);
                            }
                            this.CurLoudSpeaker = this.PopSpeakerList(CS_HORN_TYPE.CS_HORNTYPE_BIGER);
                            if (this.CurLoudSpeaker == null)
                            {
                                component.gameObject.CustomSetActive(false);
                                widget.CustomSetActive(false);
                                this.GetSpeakerMsg(CS_HORN_TYPE.CS_HORNTYPE_BIGER, this.m_lastLoudSpeakerBeginSec);
                            }
                            else
                            {
                                component.gameObject.CustomSetActive(true);
                                widget.CustomSetActive(true);
                                this.ShowLoudSpeaker(this.CurLoudSpeaker);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 20
0
        private void OnTimerSpeaker(int timerSequence)
        {
            if ((long)CRoleInfo.GetCurrentUTCTime() >= (long)((ulong)this.GetSpeakerEndTime(0)))
            {
                Singleton <CTimerManager> .get_instance().RemoveTimer(timerSequence);

                this.m_timerSpeaker = -1;
                this.CurSpekaer     = null;
                this.CurSpekaer     = this.PopSpeakerList(0);
                if (this.CurSpekaer != null)
                {
                    this.ShowSpeaker(this.CurSpekaer);
                }
                else
                {
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Speaker_EntryNode_TimeUp);

                    this.GetSpeakerMsg(0, this.m_lastSpeakerBeginSec);
                }
            }
        }
Ejemplo n.º 21
0
        private void OnTimerSpeaker(int timerSequence)
        {
            if (CRoleInfo.GetCurrentUTCTime() >= this.GetSpeakerEndTime(CS_HORN_TYPE.CS_HORNTYPE_SMALL))
            {
                Singleton <CTimerManager> .instance.RemoveTimer(timerSequence);

                this.m_timerSpeaker = -1;
                this.CurSpekaer     = null;
                this.CurSpekaer     = this.PopSpeakerList(CS_HORN_TYPE.CS_HORNTYPE_SMALL);
                if (this.CurSpekaer != null)
                {
                    this.ShowSpeaker(this.CurSpekaer);
                }
                else
                {
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Speaker_EntryNode_TimeUp);

                    this.GetSpeakerMsg(CS_HORN_TYPE.CS_HORNTYPE_SMALL, this.m_lastSpeakerBeginSec);
                }
            }
        }
Ejemplo n.º 22
0
        private void OnTimerSpeaker(int timerSequence)
        {
            this.m_speakerCount++;
            if (this.m_speakerCount >= GetSpeakerVaildTime(CS_HORN_TYPE.CS_HORNTYPE_SMALL))
            {
                Singleton <CTimerManager> .instance.RemoveTimer(timerSequence);

                this.m_timerSpeaker = -1;
                this.m_speakerCount = 0;
                COMDT_CHAT_MSG_HORN data = this.PopSpeakerList(CS_HORN_TYPE.CS_HORNTYPE_SMALL);
                if (data != null)
                {
                    this.ShowSpeaker(data);
                }
                else
                {
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Speaker_EntryNode_TimeUp);

                    this.GetSpeakerMsg(CS_HORN_TYPE.CS_HORNTYPE_SMALL, this.m_speakerIndex);
                }
            }
        }
Ejemplo n.º 23
0
        private void OnTimerLoudSpeaker(int timerSequence)
        {
            this.m_loudSpeakerCount++;
            if (this.m_loudSpeakerCount >= GetSpeakerVaildTime(CS_HORN_TYPE.CS_HORNTYPE_BIGER))
            {
                Singleton <CTimerManager> .instance.RemoveTimer(timerSequence);

                this.m_timerLoudSpeaker = -1;
                this.m_loudSpeakerCount = 0;
                COMDT_CHAT_MSG_HORN data = this.PopSpeakerList(CS_HORN_TYPE.CS_HORNTYPE_BIGER);
                CUIFormScript       form = Singleton <CUIManager> .instance.GetForm(LobbyForm.FORM_PATH);

                if (form != null)
                {
                    CUIAutoScroller component = form.GetWidget(5).GetComponent <CUIAutoScroller>();
                    if (component != null)
                    {
                        GameObject widget = form.GetWidget(6);
                        if (widget != null)
                        {
                            component.StopAutoScroll();
                            if (data == null)
                            {
                                component.gameObject.CustomSetActive(false);
                                widget.CustomSetActive(false);
                                this.GetSpeakerMsg(CS_HORN_TYPE.CS_HORNTYPE_BIGER, this.m_loudSpeakerIndex);
                            }
                            else
                            {
                                component.gameObject.CustomSetActive(true);
                                widget.CustomSetActive(true);
                                this.ShowLoudSpeaker(data);
                            }
                        }
                    }
                }
            }
        }