Beispiel #1
0
        protected override void Process(NetCommandData data)
        {
            List <string> onlineList = new List <string>();

            foreach (var client in AsyncClientPool.GetEnumerable())
            {
                onlineList.Add(client._Socket.RemoteEndPoint.ToString());
            }
            ByteStreamBuffer _steamBuffer = new ByteStreamBuffer();

            _steamBuffer.WriteObject(onlineList);
            data.Client.SendMessage(100, _steamBuffer);
        }
Beispiel #2
0
 /// <summary>
 /// 命令处理线程
 /// </summary>
 private void HandlerThread()
 {
     try
     {
         do
         {
             SocketData result;
             while (_commandQueue.TryDequeue(out result))
             {
                 NetCommandData _data = new NetCommandData();
                 _data.Client = _client;
                 _data.Data   = new ByteStreamBuffer(result._data);
                 _client._Facade.SendNotification(((PureNet.Command.NetCommandType)result._commandType).ToString(), _data);
             }
             _mre.Reset();
         }while (!isClose);
     }
     catch (Exception)
     {
     }
 }
Beispiel #3
0
 /// <summary>
 /// 命令处理过程
 /// </summary>
 /// <param name="data"></param>
 protected abstract void Process(NetCommandData data);