Exemplo n.º 1
0
    ////获取文本框中的文字
    //public void GetChatData(string str)
    //{
    //    m_chatText = "";
    //    m_chatText = str;
    //}

    //发送聊天文字
    public void SendChatData(string chatText)
    {
        if (BWFManager.isReady && BWFManager.Contains(chatText))
        {
            chatText = BWFManager.ReplaceAll(chatText);
        }
        if (chatText.Length > LobbyChatDataLenght)
        {
            GameSceneUIHandler.ShowLog("文字长度过长,请重新输入!");
        }
        else if (chatText.Length == 0)
        {
            GameSceneUIHandler.ShowLog("输入信息不能为空!");
        }
        else
        {
            //var kernel = (GameScene)CServerItem.get().GetClientKernelSink();
            //if (kernel == null) { return; }
            //Buffer.BlockCopy(temp, 0, data, 0, temp.Length);
            //kernel.SendChatData(data);

            CGPLobbyMission kGPLobbyMission = CGPLobbyMission.GetInstance();
            if (kGPLobbyMission != null)
            {
                if (!kGPLobbyMission.isLobbyChatSystemSetted())
                {
                    kGPLobbyMission.setLobbyChatSystem(this);
                }

                kGPLobbyMission.SendChatData(chatText);
            }
        }
        //m_chatText = "";
    }
Exemplo n.º 2
0
    void Update()
    {
        m_fDeltaTime += Time.deltaTime;
        if (m_fDeltaTime > 5.0f)
        {
            m_fDeltaTime = 0f;

            CGPLobbyMission kGPLobbyMission = CGPLobbyMission.GetInstance();
            if (kGPLobbyMission != null)
            {
                if (!kGPLobbyMission.isAlive())
                {
                    kGPLobbyMission.SendChatData("StartChatConnect!");
                }

                if (!kGPLobbyMission.isLobbyChatSystemSetted())
                {
                    kGPLobbyMission.setLobbyChatSystem(this);
                }
            }
        }
    }