private void MessageReceived(object sender, IoSessionMessageEventArgs e) { byte[] data = (byte[])e.Message; PacketDecoderNew decoder = new PacketDecoderNew(data); if (!decoder.Available()) { return; } ClientPacketProcessor.Instance.DelegateHandler(decoder.GetPacket()); decoder.Dispose(); }
private void MessageReceived(object sender, IoSessionMessageEventArgs e) { byte[] data = (byte[])e.Message; PacketDecoderNew decoder = new PacketDecoderNew(data); if (!decoder.Available()) { return; } ClientObject client = (ClientObject)e.Session.GetAttribute(SERVER_KEY); ServerPacketProcessor.Instance.DelegateHandler(client, decoder.GetPacket()); decoder.Dispose(); }