forked from jo3bingham/TibiaAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFullMap.cs
More file actions
34 lines (29 loc) · 1.01 KB
/
FullMap.cs
File metadata and controls
34 lines (29 loc) · 1.01 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
using OXGaming.TibiaAPI.Constants;
using OXGaming.TibiaAPI.Utilities;
namespace OXGaming.TibiaAPI.Network.ServerPackets
{
public class FullMap : Map
{
private const int MapSizeX = 18;
private const int MapSizeY = 14;
public Position Position { get; set; }
public FullMap(Client client)
{
Client = client;
PacketType = ServerPacketType.FullMap;
}
public override void ParseFromNetworkMessage(NetworkMessage message)
{
Position = message.ReadPosition();
Client.WorldMapStorage.ResetMap();
Client.WorldMapStorage.SetPosition(Position.X, Position.Y, Position.Z);
message.ReadArea(0, 0, (MapSizeX - 1), (MapSizeY - 1), Fields);
}
public override void AppendToNetworkMessage(NetworkMessage message)
{
message.Write((byte)ServerPacketType.FullMap);
message.Write(Position);
base.AppendToNetworkMessage(message);
}
}
}