protected ServerRawPacket(ServerRawOpcode opcode, bool encrypted = false) { this.opcode = opcode; flags |= PacketFlag.Raw; if (encrypted) { flags |= PacketFlag.Encrypted; } }
public ServerPacket(ServerRawOpcode opcode, IWritable message) { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { writer.WritePackedUInt32((uint)opcode); message.Write(writer); Data = stream.ToArray(); } Size = 1 + (uint)Data.Length; Flags = PacketFlag.Raw; }
public ServerRawMessageAttribute(ServerRawOpcode opcode) { Opcode = opcode; }
/// <summary> /// Return <see cref="ServerRawOpcode"/> for supplied <see cref="IWritable"/>. /// </summary> public static bool GetRawOpcode(IWritable message, out ServerRawOpcode opcode) { return(rawMessageOpcodes.TryGetValue(message.GetType(), out opcode)); }