Exemple #1
0
        /*
         * 客户端发送聊天消息
         */
        public int SendChatMessage(string chatMsg, int channel)
        {
            //Limit Talk Speed

            //is GMCommand  Special Format For chatMsg
            //:command par1 par2


            //Find Channel To Send Message
            Channel cha = channelList[(ChannelType)channel];

            if (HandleCommand(chatMsg))
            {
                return(1);
            }

            if (cha == null)
            {
                Debug.LogError("Talk::SendChatMessage Channel Not Exist ");
                return(1);
            }

            CGSendChat.Builder sendChat = CGSendChat.CreateBuilder();
            sendChat.ChannelId  = channel;
            sendChat.TargetName = "";
            sendChat.Content    = chatMsg;
            cha.setSendPacket(sendChat);

            if (cha.isClose)
            {
                return(1);
            }
            else if (!cha.TalkNeedCheck())
            {
                return(1);
            }
            else if (!cha.TalkTimeCheck())
            {
                return(1);
            }

            //CGSendChat sc =
            KBEngine.Bundle.sendImmediate(sendChat);
            return(0);
        }
Exemple #2
0
 public void setSendPacket(CGSendChat.Builder data)
 {
 }