Пример #1
0
        public override bool Analysis()
        {
            List <string> analysisinfor = base.Split(3);

            List <Customer> customers = CustomerCollector.FindCustomers(analysisinfor[1]);

            if (customers != null && customers.Count > 0)
            {
                RecvChatContent cmd = new RecvChatContent();
                cmd._Content = new ChatContent()
                {
                    _FromUID         = int.Parse(analysisinfor[0]),
                    _ToUId           = int.Parse(analysisinfor[1]),
                    _Text            = analysisinfor[2],
                    _FromSendoutTime = DateTime.Now
                };
                byte[] bytecmd = cmd.GetProtocolCommand();

                foreach (Customer client in customers)
                {
                    client._SrcSocket.Send(bytecmd);
                }
            }

            return(true);
        }
Пример #2
0
        public static IClientCommand CreateClientCommandObject(
            TProtocol tprotocol)
        {
            #region
            IClientCommand orgdata = null;
            switch (tprotocol)
            {
            case TProtocol.RecvChatContent:
                orgdata = new RecvChatContent();
                break;
            }
            return(orgdata);

            #endregion
        }