Exemple #1
0
        public void ProcessMessageQueue(MessageQueue2 queue, EClientMessageFlow flowType)
        {
            if (!queue.hasMessages)
            {
                return;
            }

            List <Message2> messages = queue.messages;
            PacketStream2   stream   = client.packetStream;
            Message2        msg;

            for (int m = 0; m < messages.Count; m++)
            {
                msg = messages[m];

                stream.ResetByteIndex();
                msg.bytes.CopyTo(stream.byteStream, 0);

                if (ProcessMessage(stream, msg, flowType))
                {
                    _messageDiscarded.Add(msg);
                }
            }

            while (_messageDiscarded.Count > 0)
            {
                messages.Remove(_messageDiscarded.Pop().Recycle());
            }

            _messageDiscarded.Clear();
        }
Exemple #2
0
 private void testServerSendPacket(Client2 client)
 {
     /////////////// TEST SENDING BACK SOME BYTES BACK TO CLIENTS!
     packetStreamTemp.ResetByteIndex();
     packetStreamTemp.WriteBytes((byte)EPacketProtoID._00_HEART_BEAT << 4);
     trace(client._endpointIn + ":         >>>>>>> SENDING: " + packetStreamTemp.byteLength);
 }
Exemple #3
0
        private void WriteHeader(PacketStream2 stream, EPacketProtoID protoID, byte protoParams)
        {
            byte protoIDOffset = (byte)((int)protoID << 4);

            stream.ResetByteIndex();
            stream.WriteBytes(protoIDOffset | protoParams);
        }