forked from jo3bingham/TibiaAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetOutfit.cs
More file actions
50 lines (45 loc) · 1.44 KB
/
GetOutfit.cs
File metadata and controls
50 lines (45 loc) · 1.44 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
42
43
44
45
46
47
48
49
50
using OXGaming.TibiaAPI.Constants;
namespace OXGaming.TibiaAPI.Network.ClientPackets
{
public class GetOutfit : ClientPacket
{
public OutfitWindowType WindowType { get; set; }
public ushort LookType { get; set; }
public GetOutfit(Client client)
{
Client = client;
PacketType = ClientPacketType.GetOutfit;
}
public override void ParseFromNetworkMessage(NetworkMessage message)
{
if (Client.VersionNumber >= 12000000)
{
WindowType = (OutfitWindowType)message.ReadByte();
if (WindowType != OutfitWindowType.SelectOutfit)
{
LookType = message.ReadUInt16();
}
}
else if (Client.VersionNumber >= 11706521)
{
LookType = message.ReadUInt16();
}
}
public override void AppendToNetworkMessage(NetworkMessage message)
{
message.Write((byte)ClientPacketType.GetOutfit);
if (Client.VersionNumber >= 12000000)
{
message.Write((byte)WindowType);
if (WindowType != OutfitWindowType.SelectOutfit)
{
message.Write(LookType);
}
}
else if (Client.VersionNumber >= 11706521)
{
message.Write(LookType);
}
}
}
}