public override void ReceivedGameServerPacket(List<byte> data)
{
byte[] packet = data.ToArray();
switch (packet[0])
{
case D2GS_WORLDOBJECT:
if (packet[1] == 0x02)
{
UInt32 obj = BitConverter.ToUInt16(packet, 6);
// Pindles portal
if (obj == 0x003c)
{
m_redPortal.Id = BitConverter.ToUInt32(packet, 2);
m_redPortal.Location.X = BitConverter.ToUInt16(packet, 8);
m_redPortal.Location.Y = BitConverter.ToUInt16(packet, 10);
if (debugging)
Console.WriteLine("{0}: [D2GS] Received red portal ID and coordinates", Account);
}
// A5 WP
if (obj == 0x01ad)
{
m_harrogathWp.Id = BitConverter.ToUInt32(packet, 2);
m_harrogathWp.Location.X = BitConverter.ToUInt16(packet, 8);
m_harrogathWp.Location.Y = BitConverter.ToUInt16(packet, 10);
if (debugging)
Console.WriteLine("{0}: [D2GS] Received A5 WP id and coordinates", Account);
}
// A1 WP
if (obj == 0x0077)
{
m_act1Wp.Id = BitConverter.ToUInt32(packet, 2);
m_act1Wp.Location.X = BitConverter.ToUInt16(packet, 8);
m_act1Wp.Location.Y = BitConverter.ToUInt16(packet, 10);
if(debugging)
Console.WriteLine("{0}: [D2GS] Received A1 WP id and coordinates", Account);
}
}
break;
case D2GS_ASSIGNPLAYER: // Player has entered the game.
if (!InGame) {
m_botThread = new Thread(BotThreadFunction);
m_botThread.Start();
Status = ClientStatus.STATUS_IN_TOWN;
InGame = true;
}
break;
}
}