Example #1
0
        public static DisposableRealmPacketIn CreateFromOutPacket(BufferSegment oldSegment, BufferSegment newSegment,
                                                                  int offset, int totalLength)
        {
            int num = oldSegment.Offset + offset;

            return(DisposableRealmPacketIn.Create(
                       (PacketId)((RealmServerOpCode)((int)oldSegment.Buffer.Array[num + 2] |
                                                      (int)oldSegment.Buffer.Array[num + 3] << 8)), oldSegment.Buffer.Array,
                       oldSegment.Offset + offset + 4, totalLength - 4, newSegment));
        }
Example #2
0
        public static DisposableRealmPacketIn CreateFromOutPacket(byte[] outPacket, int offset, int totalLength)
        {
            int num = offset;
            RealmServerOpCode realmServerOpCode =
                (RealmServerOpCode)((int)outPacket[num + 2] | (int)outPacket[num + 3] << 8);
            BufferSegment segment = BufferManager.GetSegment(totalLength + 2);

            return(DisposableRealmPacketIn.Create((PacketId)realmServerOpCode, outPacket, offset + 4, totalLength - 4,
                                                  segment));
        }
Example #3
0
        public static DisposableRealmPacketIn Create(PacketId opCode, byte[] outPacketContent)
        {
            BufferSegment segment = BufferManager.GetSegment(outPacketContent.Length + 6);

            return(DisposableRealmPacketIn.Create(opCode, outPacketContent, 0, outPacketContent.Length, segment));
        }
Example #4
0
 public static DisposableRealmPacketIn CreateFromOutPacket(BufferSegment oldSegment, BufferSegment newSegment,
                                                           int totalLength)
 {
     return(DisposableRealmPacketIn.CreateFromOutPacket(oldSegment, newSegment, 0, totalLength));
 }
Example #5
0
 public static DisposableRealmPacketIn CreateFromOutPacket(BufferSegment segment, RealmPacketOut packet)
 {
     byte[] finalizedPacket = packet.GetFinalizedPacket();
     return(DisposableRealmPacketIn.Create(packet.PacketId, finalizedPacket, packet.HeaderSize,
                                           finalizedPacket.Length - packet.HeaderSize, segment));
 }
Example #6
0
 public static DisposableRealmPacketIn CreateFromOutPacket(RealmPacketOut packet)
 {
     byte[] finalizedPacket = packet.GetFinalizedPacket();
     return(DisposableRealmPacketIn.CreateFromOutPacket(finalizedPacket, 0, finalizedPacket.Length));
 }