forked from jo3bingham/TibiaAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarketCreate.cs
More file actions
41 lines (34 loc) · 1.2 KB
/
MarketCreate.cs
File metadata and controls
41 lines (34 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using OXGaming.TibiaAPI.Constants;
namespace OXGaming.TibiaAPI.Network.ClientPackets
{
public class MarketCreate : ClientPacket
{
public MarketOfferType OfferType { get; set; }
public uint PiecePrice { get; set; }
public ushort Amount { get; set; }
public ushort ObjectId { get; set; }
public bool IsAnonymous { get; set; }
public MarketCreate(Client client)
{
Client = client;
PacketType = ClientPacketType.MarketCreate;
}
public override void ParseFromNetworkMessage(NetworkMessage message)
{
OfferType = (MarketOfferType)message.ReadByte();
ObjectId = message.ReadUInt16();
Amount = message.ReadUInt16();
PiecePrice = message.ReadUInt32();
IsAnonymous = message.ReadBool();
}
public override void AppendToNetworkMessage(NetworkMessage message)
{
message.Write((byte)ClientPacketType.MarketCreate);
message.Write((byte)OfferType);
message.Write(ObjectId);
message.Write(Amount);
message.Write(PiecePrice);
message.Write(IsAnonymous);
}
}
}