コード例 #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);
        }
コード例 #2
0
            public CGSendChat sendMsg        = null;                     //客户端到服务器      发送的消息

            public HistoryMsg(CGSendChat sc)
            {
                sendMsg = sc;
            }