Beispiel #1
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_GUILD_LEAVE packet = (GC_GUILD_LEAVE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }

            //离开帮会,清空个人帮会信息
            GameManager.gameManager.PlayerDataPool.GuildInfo.CleanUp();
            //更新帮会界面(如果未打开,则不处理)
            if (null != GUIData.delGuildDataUpdate)
            {
                GUIData.delGuildDataUpdate();
            }

            if (ChatInfoLogic.Instance() != null)
            {
                ChatInfoLogic.Instance().UpdateGuildChannel();
            }

            UIManager.CloseUI(UIInfo.GuildRoot);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Beispiel #2
0
 void ShowChatInfoRootOver(bool bSuccess, object param)
 {
     if (null != ChatInfoLogic.Instance())
     {
         ChatInfoLogic.Instance().BeginChat(m_Guid, m_PlayerNameLabel.text);
     }
 }
Beispiel #3
0
    /// <summary>
    /// 播放语音
    /// </summary>
    /// <param name="audioName">语音路径</param>

    /*public static void PlayAudio(string audioName)
     * {
     *  if (!m_bInited)
     *      m_Instance.Init();
     *  if (m_Status == SpeechStatus.SS_DEFAULT)
     *  {
     *      m_Status = SpeechStatus.SS_PLAYING;
     *      SpeechAPI.PlayAudio(audioName);
     *      if (ChatInfoLogic.Instance() != null)
     *      {
     *          ChatInfoLogic.Instance().OnPlayVoiceChat();
     *      }
     *  }
     * }
     *
     * /// <summary>
     * /// 播放buffer内的语音
     * /// </summary>
     * /// <param name="audioIdx"></param>
     * public static void PlayAudio(byte[] buffer)
     * {
     *  if (!m_bInited)
     *      m_Instance.Init();
     *
     *  if (m_Status == SpeechStatus.SS_DEFAULT && buffer != null)
     *  {
     *      m_Status = SpeechStatus.SS_PLAYING;
     *      SpeechAPI.PlayAudioBuffer(buffer);
     *      if (ChatInfoLogic.Instance() != null)
     *      {
     *          ChatInfoLogic.Instance().OnPlayVoiceChat();
     *      }
     *  }
     * }*/

    public static void PlayAudio(int voiceindex, byte[] buffer, bool bForce = false)
    {
        if (!m_bInited)
        {
            m_Instance.Init();
        }

        if (buffer != null)
        {
            if (m_Status == SpeechStatus.SS_DEFAULT || bForce)
            {
                m_Status = SpeechStatus.SS_PLAYING;
                GameManager.gameManager.SoundManager.MusicDown();
                SpeechAPI.PlayAudioBuffer(buffer);
                GameManager.gameManager.PlayerDataPool.VoiceChatDownloadRecord.PlayingVoiceIndex = voiceindex;
                if (ChatInfoLogic.Instance() != null)
                {
                    ChatInfoLogic.Instance().OnPlayVoiceChat();
                }
#if UNITY_ANDROID && !UNITY_EDITOR
                SpeechEngine.Instance().InvokeRepeating("ForcePlayOver", 20.0f, 1.0f);
#endif
            }
        }
    }
Beispiel #4
0
 public void OnClickItem()
 {
     if (ChatInfoLogic.Instance() != null)
     {
         ChatInfoLogic.Instance().InsertMissionLinkText(m_missionId);
     }
 }
Beispiel #5
0
    void InitDefaultTextOnTellChat()
    {
        if (ChatInfoLogic.Instance() == null)
        {
            return;
        }

        if (gameObject.name != "ChatInfoInput")
        {
            return;
        }

        if (ChatInfoLogic.Instance().GetCurChannelType() != (int)CG_CHAT.CHATTYPE.CHAT_TYPE_TELL &&
            ChatInfoLogic.Instance().GetCurChannelType() != (int)CG_CHAT.CHATTYPE.CHAT_TYPE_FRIEND)
        {
            return;
        }

        if (ChatInfoLogic.Instance().TellChatReceiverName == "" &&
            ChatInfoLogic.Instance().FriendChatReceiverName == "")
        {
            return;
        }

        if (ChatInfoLogic.Instance().GetCurChannelType() == (int)CG_CHAT.CHATTYPE.CHAT_TYPE_TELL)
        {
            mText = "/" + ChatInfoLogic.Instance().TellChatReceiverName + " ";
        }
        if (ChatInfoLogic.Instance().GetCurChannelType() == (int)CG_CHAT.CHATTYPE.CHAT_TYPE_FRIEND)
        {
            mText = "/" + ChatInfoLogic.Instance().FriendChatReceiverName + " ";
        }
    }
//     void Update()
//     {
//         if (null != m_setUpBtn)
//         {
//             m_setUpBtn.gameObject.transform.localPosition = new Vector3(m_setUpBtn.gameObject.transform.localPosition.x, m_setUpBtn_transform.localPosition.y, 0);
//         }
//     }
    void OnEnable()
    {
        if (ChatInfoLogic.Instance() == null)
        {
            return;
        }

        /*   SETUP_TYPE defaultSetup = ConvertChatInfoChannelToSetupType(ChatInfoLogic.Instance().CurChannelType);*/

        //         if (defaultSetup == SETUP_TYPE.TYPE_INVALID)
        //         {
        //             return;
        //         }
        //
        //         if ((int)defaultSetup < 0 || (int)defaultSetup >= m_SetupTypeList.Count)
        //         {
        //             return;
        //         }
        m_nCurSetupIndex = (int)SETUP_TYPE.TYPE_VARIOUS;
        SetupTypeOnClick();
//         if (null != m_setUpBtn)
//         {
//             m_setUpBtn_transform = m_setUpBtn.gameObject.transform;
//         }
    }
    public void OnClickItem(GameObject obj)
    {
        if (ChatInfoLogic.Instance() != null)
        {
            ShareTargetChooseLogic.AdditionShareMsg = "";
            ShareTargetChooseLogic.IsYaoHe          = false;

//             int index = -1;
//
//             if (int.TryParse(obj.name, out index))
//             {
//
//             }
//
//             if (index < 0 || index >= showDataCount)
//             {
//                 return;
//             }
//
//             m_item = showData[index].item;

            if (null == m_item)
            {
                return;
            }
            if (m_item.IsEquipMent())
            {
                ChatInfoLogic.Instance().InsertEquipLinkText(m_item);
            }
            else
            {
                ChatInfoLogic.Instance().InsertItemLinkText(m_item);
            }
        }
    }
Beispiel #8
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_TEAM_LEAVE packet = (GC_TEAM_LEAVE)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }

            //直接调用MainPlayer的离队操作
            if (null != Singleton <ObjManager> .GetInstance().MainPlayer)
            {
                Singleton <ObjManager> .GetInstance().MainPlayer.LeaveTeam();
            }

            //更新组队界面(如果未打开,则在UpdateTeamInfo中会不处理)
            if (null != GUIData.delFriendDataUpdate)
            {
                GUIData.delFriendDataUpdate();
            }

            if (ChatInfoLogic.Instance() != null)
            {
                ChatInfoLogic.Instance().UpdateTeamChannel();
            }

            if (MissionDialogAndLeftTabsLogic.Instance() != null)
            {
                MissionDialogAndLeftTabsLogic.Instance().UpdateButtonTeamFollow();
            }


            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
    public void OnClickItem()
    {
        string text = "";

        if (ChatInfoLogic.Instance().CurChannelType == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_TELL)
        {
            text = "/" + ChatInfoLogic.Instance().TellChatReceiverName + " " + m_chatText.text;
        }
        else
        {
            text = m_chatText.text;
        }
        if (!string.IsNullOrEmpty(text))
        {
            if (text.Length > 3 && PlatformHelper.IsEnableGM() && text.Substring(0, 2) == GameDefines.GMCMD_BEGINORDER)
            {
                Utils.SendGMCommand(text.Substring(2, text.Length - 2));
            }
            else
            {
                text = Utils.StrFilter_Chat(text);

                Utils.SendCGChatPak(text, m_historyItem);
            }
        }
    }
    //点击头像响应函数
    void ChatInfoItemOnClick()
    {
        //匿名的头像点击没反应也在此处理了,直接比较字典里的“匿名”二字。
        if (Singleton <ObjManager> .Instance.MainPlayer == null || m_SpeakerName.Equals(StrDictionary.GetClientDictionaryString("#{10566}")))
        {
            return;
        }
        //自己不能查看自己的
        if (Singleton <ObjManager> .Instance.MainPlayer.GUID == m_SpeakerGuid || m_SpeakerGuid == GlobeVar.INVALID_GUID)
        {
            return;
        }

        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        if (ChatInfoLogic.Instance() != null)
        {
            ChatInfoLogic.Instance().m_LastSpeakerChatLogic.gameObject.SetActive(true);
            // ChatInfoLogic.Instance().ShowSpeakerMenu();
            if (LastSpeakerChatLogic.Instance() != null)
            {
                LastSpeakerChatLogic.Instance().ShowButtonMenu(m_SpeakerGuid, m_SpeakerName);
                LastSpeakerChatLogic.Instance().SetOtherPlayerInfo(m_Profession, m_SpeakerLevel, m_SpeakerName);
            }

            // LastSpeakerChatLogic.Instance().ShowButtonMenu(m_SpeakerGuid, m_SpeakerName, m_SpeakerLevel, m_SpeakerProfession);
        }
    }
Beispiel #11
0
 public void Init(ChatHistoryItem history, int linkindex)
 {
     if (linkindex < 0 || linkindex >= history.ELinkType.Count)
     {
         return;
     }
     m_chatHistoryItem = history;
     m_LinkType        = history.ELinkType[linkindex];
     m_LinkTypeList.Add(m_LinkType);
     if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_ITEM)
     {
         Utils.ReadLinkFromHistory_Item(history, m_EquipOrItemLink, linkindex);
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_EQUIP)
     {
         Utils.ReadLinkFromHistory_Equip(history, m_EquipOrItemLink, linkindex);
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_COPYTEAM)
     {
         Utils.ReadLinkFromHistory_Team(history, out m_playerGUID);
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_MOVETO)
     {
         Utils.ReadLinkFromHistory_MoveTo(history, ref m_MoveToLink, linkindex);
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_PLAYERINFO)
     {
         Utils.ReadLinkFromHistory_PlayerInfo(history, out m_playerInfoGUID, linkindex);
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_SWORDSMAN)
     {
         Utils.ReadLinkFromHistory_SwordsMan(history, m_SwordsManLink, linkindex);
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_GUILDCRUITE)
     {
         Utils.ReadLinkFromHistory_GuildInfo(history, out m_guildIdForRecruit, linkindex);
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_HONGBAO)
     {
         Utils.ReadLinkFromHistory_HongBaoInfo(history, ref m_HongBaoInfoLink, linkindex);
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_PROPAGATE)
     {
         Utils.ReadLinkFromHistory_Propagate(history, m_fellow, linkindex);
         if (ChatInfoLogic.Instance() != null)
         {
             ChatInfoLogic.Instance().SelectFellowName = m_fellow.Name;
         }
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_MISSION)
     {
         Utils.ReadLinkFromHistory_MissionInfo(history, ref m_missionLink, linkindex);
     }
     else if (m_LinkType == GC_CHAT.LINKTYPE.LINK_TYPE_PROPAGATE_AGREE)
     {
         //do nothing
         Debug.Log("fanzhipeng =====            has received GC_CHAT.LINKTYPE.LINK_TYPE_PROPAGATE_AGREE");
     }
 }
 void ShowChatInfoRootOver(bool bSuccess, object param)
 {
     if (bSuccess)
     {
         ChatInfoLogic.Instance().InsertEquipLinkText(m_Equip);
         EquipTooltipsLogic.Instance().CloseWindow();
     }
 }
Beispiel #13
0
    public void ShowNewChat(string strChatFull)
    {
        int linesCount = 0;

        textList.Add(strChatFull, out linesCount);
        ChatInfoLogic.Instance().MoveLinkPos(ChatInfoLogic.EMOTIONLINK_MOVE_DIRECTION.EMOTIONLINK_MOVE_UP, linesCount);
        ChatInfoLogic.Instance().MoveEmotionPos(ChatInfoLogic.EMOTIONLINK_MOVE_DIRECTION.EMOTIONLINK_MOVE_UP, linesCount);
    }
Beispiel #14
0
    /// <summary>
    /// 拖拽操作 统一改为设置ScrollBar.value 之后会调用回调函数OnScrollBarValueChange
    /// </summary>
    /// <param name="delta">拖拽位移</param>
    void OnDrag(Vector2 delta)
    {
//         if(mSelected)
//         {
//             float val = (delta.y > 0) ? -0.05f : 0.05f;
//             if (m_ChatScrollBar.gameObject.activeSelf)
//             {
//                 UpdateScrollBarValue(val);
//             }
//             else
//             {
//                 UpdateFakeScrollBarValue(val);
//             }
//         }
        if (mSelected)
        {
            bool withScroll = false;
            if (mScroll != 0)
            {
                withScroll = true;
            }

            int   maxLines = maxHeight > 0 ? Mathf.FloorToInt(maxHeight / (textLabel.font.size * textLabel.font.pixelSize)) : 100000;
            float val      = 0;
            if (delta.y > 0)
            {
                if (mScroll <= 0)
                {
                    return;
                }
            }
            else
            {
                if (mScroll >= mTotalLines - maxLines)
                {
                    return;
                }
            }
            val = -delta.y / 10.0f;

            mScroll = mScroll + val;
            if (mScroll <= 0)
            {
                mScroll = 0;
                if (withScroll && ChatInfoLogic.Instance() != null && ChatInfoLogic.Instance().WaitRefresh)
                {
                    ChatInfoLogic.Instance().InitChatInfo();
                    ChatInfoLogic.Instance().WaitRefresh = false;
                }
            }
            if (mScroll >= mTotalLines - maxLines)
            {
                mScroll = mTotalLines - maxLines;
            }
            UpdateVisibleText();
        }
    }
Beispiel #15
0
 private void PlayRecordOver()
 {
     if (ChatInfoLogic.Instance() != null)
     {
         ChatInfoLogic.Instance().OnPlayVoiceChatOver();
     }
     GameManager.gameManager.SoundManager.MusicRecover();
     GameManager.gameManager.PlayerDataPool.VoiceChatDownloadRecord.OnPlayRecordOver();
 }
Beispiel #16
0
    public void OnSubmit()
    {
        if (textList != null)
        {
            string text = NGUITools.StripSymbols(mInput.value);

//             float test = 1/32;
//             Debug.Log(Mathf.CeilToInt(test));
//             float.TryParse(text, out test);
//
//             Debug.Log("test " + test + " " + Mathf.CeilToInt(test));
            text = ChatInfoLogic.Instance().InsertLinkSymbols(text);

            string textCopy = text;
            if (ChatInfoLogic.Instance().GetCurChannelType() == (int)CG_CHAT.CHATTYPE.CHAT_TYPE_TELL)
            {
                textCopy = textCopy.Replace("/" + ChatInfoLogic.Instance().TellChatReceiverName + " ", "");
            }
            else if (ChatInfoLogic.Instance().GetCurChannelType() == (int)CG_CHAT.CHATTYPE.CHAT_TYPE_FRIEND)
            {
                textCopy = textCopy.Replace("/" + ChatInfoLogic.Instance().FriendChatReceiverName + " ", "");
            }

            if (!string.IsNullOrEmpty(textCopy))
            {
                //int line;
                //textList.Add(text, out line);

                if (text.Length > 3 && PlatformHelper.IsEnableGM() && text.Substring(0, 2) == GameDefines.GMCMD_BEGINORDER)
                {
                    if (text.Length > 6 && text.Substring(2, 5) == "showg")
                    {
                        ChatInfoLogic.Instance().ClearCurInput();
                        mInput.selected = false;
                        ChatInfoLogic.Instance().OnCloseClick();
                        NewplayerGuidPartnerBd.OpenUI();
                        return;
                    }
                    else
                    {
                        Utils.SendGMCommand(text.Substring(2, text.Length - 2));
                    }
                }
                else
                {
                    text = Utils.StrFilter_Chat(text);
                    ChatHistoryItem item = new ChatHistoryItem();
                    item.CleanUp();
                    Utils.SendCGChatPak(text, item);
                }
            }

            ChatInfoLogic.Instance().ClearCurInput();
            mInput.selected = false;
        }
    }
Beispiel #17
0
 void ShowChatInfoRootOver(bool bSuccess, object param)
 {
     if (bSuccess)
     {
         //发起私聊
         if (null != ChatInfoLogic.Instance())
         {
             ChatInfoLogic.Instance().BeginChat(m_PopMenuSelectGuid, m_PopMenuSelectName);
         }
     }
 }
Beispiel #18
0
 void ShowChatInfoRootOver(bool bSuccess, object param)
 {
     if (m_Item != null && m_Item.IsValid())
     {
         if (bSuccess)
         {
             ChatInfoLogic.Instance().InsertItemLinkText(m_Item);
             ItemTooltipsLogic.Instance().CloseWindow();
         }
     }
 }
Beispiel #19
0
 void ShowChatInfoRootOver_Reserve(bool bSuccess, object param)
 {
     if (bSuccess)
     {
         //发起私聊
         if (null != ChatInfoLogic.Instance())
         {
             ChatInfoLogic.Instance().BeginChat(m_CurSelectReserveMember, m_CurSelectReserveMemberName);
         }
     }
 }
Beispiel #20
0
 void ShowChatInfoRootOver(bool bSuccess, object param)
 {
     if (bSuccess)
     {
         //发起私聊
         if (null != ChatInfoLogic.Instance())
         {
             ChatInfoLogic.Instance().BeginChat(m_playerGUID, m_playerName);
         }
     }
 }
 //点击与关系人私聊
 void OnClickRelationChat()
 {
     if (GlobeVar.INVALID_GUID != m_Guid)
     {
         //发起私聊
         //未打开过则创建
         if (null == ChatInfoLogic.Instance())
         {
             UIManager.ShowUI(UIInfo.ChatInfoRoot, ShowChatInfoRootOver);
         }
     }
 }
 private void ShowChatInfoRootOver(bool bSuccess, object param)
 {
     if (bSuccess && param != null)
     {
         string[] strs = param as string[];
         //发起私聊
         if (null != ChatInfoLogic.Instance() && strs != null && strs.Length == 2)
         {
             ChatInfoLogic.Instance().BeginChat(ulong.Parse(strs[1]), strs[0]);
         }
     }
 }
 public void OnChatPrivate()
 {
     if (GlobeVar.INVALID_GUID != m_Guid && !string.IsNullOrEmpty(m_Name))
     {
         //发起私聊
         //未打开过则创建
         if (null == ChatInfoLogic.Instance())
         {
             UIManager.ShowUI(UIInfo.ChatInfoRoot, ShowChatInfoRootOver, new string[] { m_Name, m_Guid.ToString() });
         }
     }
 }
Beispiel #24
0
 public void onClickChatPrive()
 {
     if (GlobeVar.INVALID_GUID != m_Guid && m_PlayerNameLabel.text != "")
     {
         //发起私聊
         //未打开过则创建
         if (null == ChatInfoLogic.Instance())
         {
             UIManager.ShowUI(UIInfo.ChatInfoRoot, ShowChatInfoRootOver, m_PlayerNameLabel.text);
         }
     }
 }
Beispiel #25
0
 public void ShowChatInfoRootOver(bool bSuccess, object param)
 {
     if (bSuccess)
     {
         //发起私聊
         string PlayerName = param as string;
         if (null != ChatInfoLogic.Instance())
         {
             ChatInfoLogic.Instance().BeginChat(m_playerGuid, PlayerName);
         }
     }
 }
Beispiel #26
0
 // 私聊
 public void onSecretChat()
 {
     if (GlobeVar.INVALID_GUID != m_playerGuid && m_playerName != "")
     {
         //发起私聊
         //未打开过则创建
         if (null == ChatInfoLogic.Instance())
         {
             UIManager.ShowUI(UIInfo.ChatInfoRoot, ShowChatInfoRootOver, m_playerName);
         }
     }
 }
Beispiel #27
0
    public void onChatPrivateEx(bool issuss, object parm)
    {
        UInt64 guid = Convert.ToUInt64(parm);

        if (GlobeVar.INVALID_GUID != guid)
        {
            if (null != ChatInfoLogic.Instance() && m_name != "")
            {
                ChatInfoLogic.Instance().BeginChat(guid, m_name);
            }
        }
    }
Beispiel #28
0
    /// <summary>
    /// Add a new paragraph.
    /// </summary>

    protected void Add(string text, bool updateVisible, out int linesCount)
    {
        linesCount = 1;
        Paragraph ce = null;

        if (mParagraphs.Count < maxEntries)
        {
            ce = new Paragraph();
        }
        else
        {
            ce = mParagraphs[0];
            mParagraphs.RemoveAt(0);
        }

        ce.text = text;
        mParagraphs.Add(ce);

        if (textLabel != null && textLabel.font != null)
        {
            // Rebuild the line
            string line;
            textLabel.font.WrapText(ce.text, out line, textLabel.width, 100000,
                                    0, textLabel.supportEncoding, textLabel.symbolStyle);
            ce.lines   = line.Split(mSeparator);
            linesCount = ce.lines.Length;

            // Recalculate the total number of lines
            mTotalLines = 0;
            for (int i = 0, imax = mParagraphs.Count; i < imax; ++i)
            {
                mTotalLines += mParagraphs[i].lines.Length;
            }
        }

        // Update the visible text
        if (updateVisible)
        {
            UpdateVisibleText();
        }

        m_ChatCount += 1;
        if (m_ChatCount >= NEEDCLEAR_COUNT)
        {
            if (ChatInfoLogic.Instance() != null && false == ChatInfoLogic.Instance().WaitRefresh)
            {
                ChatInfoLogic.Instance().InitChatInfo();
            }
        }
    }
 void InsertEmotion()
 {
     // 如果小喇叭窗口正打开 说明是小喇叭的表情窗口 插入表情代码后直接return
     if (LoudSpeakerLogic.Instance() != null && LoudSpeakerLogic.Instance().IsLoudSpeakerWindowShow())
     {
         LoudSpeakerLogic.Instance().InsertEmotion(gameObject);
         LoudSpeakerLogic.Instance().CloseEmotionRoot();
         return;
     }
     if (ChatInfoLogic.Instance() != null)
     {
         ChatInfoLogic.Instance().InsertEmotion(gameObject);
     }
 }
Beispiel #30
0
    public void SubmitTextAndVoice(string text, byte[] voicechat)
    {
        if (!string.IsNullOrEmpty(text))
        {
            text = Utils.StrFilter_Chat(text);
            ChatHistoryItem item = new ChatHistoryItem();
            item.CleanUp();
            Utils.SendCGChatPak(text, item, voicechat);

            LogModule.DebugLog("SendCGChatPak");
        }

        ChatInfoLogic.Instance().ClearCurInput();
        mInput.selected = false;
    }