public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); PlayerId = reader.ReadObjectId(); uint unknown1 = reader.ReadUInt(); BodyType = reader.ReadModelId(); ushort xloc = reader.ReadUShort(); ushort yloc = reader.ReadUShort(); byte unknown2 = reader.ReadByte(); sbyte zloc = reader.ReadSByte(); Location = new Location3D(xloc, yloc, zloc); (Direction, MovementType) = reader.ReadDirection(); //reader.Skip(5); //var minX = reader.ReadUShort(); //var minY = reader.ReadUShort(); //var maxX = reader.ReadUShort(); //var maxY = reader.ReadUShort(); //MapBoundary = new MapBoundary(minX, minY, maxX, maxY); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(3); DialogId = reader.ReadUInt(); MenuId = reader.ReadUShort(); var questionLength = reader.ReadByte(); Question = reader.ReadString(questionLength); var responsesCount = reader.ReadByte(); if (responsesCount == byte.MaxValue) { throw new PacketParsingException(rawPacket, $"Responses count is {responsesCount}. Cannot have byte 1 based index for all responses (last index would be 256 which cannot be encoded to a single byte)."); } Responses = new DialogBoxResponse[responsesCount]; for (byte i = 0; i < responsesCount; i++) { var modelId = reader.ReadModelId(); var color = reader.ReadColor(); var responseTextLength = reader.ReadByte(); var responseText = reader.ReadString(responseTextLength); Responses[i] = new DialogBoxResponse((byte)(i + 1), modelId, color, responseText); } }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); ContainerId = reader.ReadObjectId(); GumpModel = reader.ReadModelId(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); ItemId = reader.ReadObjectId(); Type = reader.ReadModelId(); reader.Skip(1); Layer = reader.ReadLayer(); PlayerId = reader.ReadObjectId(); Color = reader.ReadColor(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); MapId = reader.ReadObjectId(); MapArt = reader.ReadModelId(); UpperLeft = new Location2D(reader.ReadUShort(), reader.ReadUShort()); LowerRight = new Location2D(reader.ReadUShort(), reader.ReadUShort()); Width = reader.ReadUShort(); Height = reader.ReadUShort(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); PlayerId = reader.ReadObjectId(); Type = reader.ReadModelId(); Location = new Location3D(reader.ReadUShort(), reader.ReadUShort(), reader.ReadSByte()); (Direction, MovementType) = reader.ReadDirection(); Color = reader.ReadColor(); Flags = reader.ReadByte(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(3); Id = reader.ReadObjectId(); Model = reader.ReadModelId(); Type = (SpeechType)reader.ReadByte(); Color = (Color)reader.ReadUShort(); Font = reader.ReadUShort(); Name = reader.ReadString(30); Message = reader.ReadNullTerminatedString(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); ItemId = reader.ReadObjectId(); Type = reader.ReadModelId(); reader.Skip(1); Amount = reader.ReadUShort(); Location = new Location2D(reader.ReadUShort(), reader.ReadUShort()); ContainerId = reader.ReadObjectId(); Color = (Color)reader.ReadUShort(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); ContainerId = reader.ReadObjectId(); GumpModel = reader.ReadModelId(); if (protocolVersion >= 7090) { reader.ReadUShort(); } }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(3); SpeakerId = reader.ReadObjectId(); SpeakerBody = reader.ReadModelId(); Type = (SpeechType)reader.ReadByte(); Color = reader.ReadColor(); Font = reader.ReadUShort(); MessageId = new MessageId(reader.ReadInt()); Name = reader.ReadString(29); Arguments = reader.ReadNullTerminatedUnicodeString(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(4); Id = reader.ReadObjectId(); Type = reader.ReadModelId(); Facing = (Direction)reader.ReadByte(); Amount = reader.ReadUShort(); reader.ReadUShort(); // second amount? Location = new Location3D(reader.ReadUShort(), reader.ReadUShort(), reader.ReadSByte()); Layer = reader.ReadLayer(); Color = reader.ReadColor(); reader.ReadByte(); // flags }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); DirectionType = (EffectDirectionType)reader.ReadByte(); CharacterId = reader.ReadObjectId(); TargetId = reader.ReadObjectId(); Type = reader.ReadModelId(); Location = new Location3D(reader.ReadUShort(), reader.ReadUShort(), reader.ReadSByte()); TargetLocation = new Location3D(reader.ReadUShort(), reader.ReadUShort(), reader.ReadSByte()); AnimationSpeed = reader.ReadByte(); AdjustDirection = reader.ReadBool(); ExplodeOnImpact = reader.ReadBool(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); var packetSize = reader.ReadUShort(); SpeakerId = reader.ReadObjectId(); SpeakerBody = reader.ReadModelId(); reader.ReadByte(); // type Color = reader.ReadColor(); Font = reader.ReadUShort(); MessageId = new MessageId(reader.ReadInt()); reader.ReadByte(); // ignoring flags Name = reader.ReadString(30); Affix = reader.ReadNullTerminatedString(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); CursorTarget = (CursorTarget)reader.ReadByte(); CursorId = new CursorId(reader.ReadUInt()); CursorType = (CursorType)reader.ReadByte(); ClickedOnId = reader.ReadObjectId(); ushort xloc = reader.ReadUShort(); ushort yloc = reader.ReadUShort(); byte unknown = reader.ReadByte(); sbyte zloc = reader.ReadSByte(); Location = new Location3D(xloc, yloc, zloc); ClickedOnType = reader.ReadModelId(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(3); Id = reader.ReadObjectId(); Type = reader.ReadModelId(); Location = new Location3D(reader.ReadUShort(), reader.ReadUShort(), reader.ReadSByte()); (Direction, MovementType) = reader.ReadDirection(); Color = (Color)reader.ReadUShort(); Flags = reader.ReadByte(); Notoriety = (Notoriety)reader.ReadByte(); var items = new List <Item>(); var itemId = reader.ReadUInt(); while (itemId != 0x00000000) { var type = reader.ReadUShort(); var layer = (Layer)reader.ReadByte(); Color?color = null; if ((type & 0x8000) != 0) { type -= 0x8000; color = (Color)reader.ReadUShort(); } var item = new Item(new ObjectId(itemId), new ModelId(type), 1, new Location3D(0, 0, 0), containerId: Id, layer: layer, color: color); items.Add(item); itemId = reader.ReadUInt(); } Items = items.ToArray(); }
public override void Deserialize(Packet rawPacket) { this.rawPacket = rawPacket; var reader = new ArrayPacketReader(rawPacket.Payload); reader.Skip(1); PlayerId = reader.ReadObjectId(); BodyType = reader.ReadModelId(); reader.Skip(1); // unknown Color = reader.ReadColor(); Flags = reader.ReadByte(); var xloc = reader.ReadUShort(); var yloc = reader.ReadUShort(); reader.Skip(2); // unknown (Direction, MovementType) = reader.ReadDirection(); var zloc = reader.ReadSByte(); Location = new Location3D(xloc, yloc, zloc); }