More packets implemented.

This commit is contained in:
Filip Maj 2015-10-12 00:42:28 -04:00
parent 9a9388aabf
commit 810edfcee4
12 changed files with 174 additions and 18 deletions

View File

@ -80,6 +80,7 @@
<Compile Include="packets\receive\LockTargetPacket.cs" /> <Compile Include="packets\receive\LockTargetPacket.cs" />
<Compile Include="packets\receive\EndScriptPacket.cs" /> <Compile Include="packets\receive\EndScriptPacket.cs" />
<Compile Include="packets\receive\StartScriptPacket.cs" /> <Compile Include="packets\receive\StartScriptPacket.cs" />
<Compile Include="packets\send\actor\DeleteAllActorsPacket.cs" />
<Compile Include="packets\send\actor\inventory\EquipmentChangePacket.cs" /> <Compile Include="packets\send\actor\inventory\EquipmentChangePacket.cs" />
<Compile Include="packets\send\actor\inventory\InventoryBeginChangePacket.cs" /> <Compile Include="packets\send\actor\inventory\InventoryBeginChangePacket.cs" />
<Compile Include="packets\send\actor\inventory\InventoryEndChangePacket.cs" /> <Compile Include="packets\send\actor\inventory\InventoryEndChangePacket.cs" />
@ -92,20 +93,25 @@
<Compile Include="packets\send\actor\SetActorNamePacket.cs" /> <Compile Include="packets\send\actor\SetActorNamePacket.cs" />
<Compile Include="packets\send\actor\SetActorSpeedPacket.cs" /> <Compile Include="packets\send\actor\SetActorSpeedPacket.cs" />
<Compile Include="packets\send\actor\SetActorStatePacket.cs" /> <Compile Include="packets\send\actor\SetActorStatePacket.cs" />
<Compile Include="packets\send\actor\SetActorTarget.cs" /> <Compile Include="packets\send\actor\SetActorTargetAnimatedPacket.cs" />
<Compile Include="packets\send\actor\SetActorTargetPacket.cs" />
<Compile Include="packets\send\login\0x2Packet.cs" /> <Compile Include="packets\send\login\0x2Packet.cs" />
<Compile Include="packets\send\actor\AddActorPacket.cs" /> <Compile Include="packets\send\actor\AddActorPacket.cs" />
<Compile Include="packets\send\actor\MoveActorToPositionPacket.cs" /> <Compile Include="packets\send\actor\MoveActorToPositionPacket.cs" />
<Compile Include="packets\send\actor\SetActorAppearancePacket.cs" /> <Compile Include="packets\send\actor\SetActorAppearancePacket.cs" />
<Compile Include="packets\send\actor\SetActorPositionPacket.cs" /> <Compile Include="packets\send\actor\SetActorPositionPacket.cs" />
<Compile Include="packets\send\login\InitPacket.cs" /> <Compile Include="packets\send\login\InitPacket.cs" />
<Compile Include="packets\send\LogoutPacket.cs" />
<Compile Include="packets\send\player\AchievementEarnedPacket.cs" />
<Compile Include="packets\send\player\CutsceneBookSetPacket.cs" /> <Compile Include="packets\send\player\CutsceneBookSetPacket.cs" />
<Compile Include="packets\send\player\SetAchievementPointsPacket.cs" />
<Compile Include="packets\send\player\SetChocoboNamePacket.cs" /> <Compile Include="packets\send\player\SetChocoboNamePacket.cs" />
<Compile Include="packets\send\player\SetGCInfoPacket.cs" /> <Compile Include="packets\send\player\SetGCInfoPacket.cs" />
<Compile Include="packets\send\player\SetLatestAchievementsPacket.cs" /> <Compile Include="packets\send\player\SetLatestAchievementsPacket.cs" />
<Compile Include="packets\send\player\SetPlayerDreamPacket.cs" /> <Compile Include="packets\send\player\SetPlayerDreamPacket.cs" />
<Compile Include="packets\send\player\SetPlayerTitlePacket.cs" /> <Compile Include="packets\send\player\SetPlayerTitlePacket.cs" />
<Compile Include="packets\send\PongPacket.cs" /> <Compile Include="packets\send\PongPacket.cs" />
<Compile Include="packets\send\QuitPacket.cs" />
<Compile Include="packets\send\SetMapPacket.cs" /> <Compile Include="packets\send\SetMapPacket.cs" />
<Compile Include="packets\send\SetMusicPacket.cs" /> <Compile Include="packets\send\SetMusicPacket.cs" />
<Compile Include="packets\send\SetWeatherPacket.cs" /> <Compile Include="packets\send\SetWeatherPacket.cs" />

View File

@ -309,7 +309,7 @@ namespace FFXIVClassic_Lobby_Server
case 0x00CD: case 0x00CD:
SetTargetPacket setTarget = new SetTargetPacket(subpacket.data); SetTargetPacket setTarget = new SetTargetPacket(subpacket.data);
player.setTarget(setTarget.actorID); player.setTarget(setTarget.actorID);
client.queuePacket(BasePacket.createPacket(SetActorTarget.buildPacket(player.actorID, player.actorID, setTarget.actorID), true, false)); client.queuePacket(BasePacket.createPacket(SetActorTargetAnimatedPacket.buildPacket(player.actorID, player.actorID, setTarget.actorID), true, false));
break; break;
//Lock Target //Lock Target
case 0x00CC: case 0x00CC:
@ -329,12 +329,7 @@ namespace FFXIVClassic_Lobby_Server
break; break;
case 0x012F: case 0x012F:
subpacket.debugPrintSubPacket(); subpacket.debugPrintSubPacket();
BasePacket scriptReply = new BasePacket("./packets/charawork2");
BasePacket scriptReply2 = new BasePacket("./packets/charawork3");
BasePacket scriptReply3 = new BasePacket("./packets/charawork4");
client.queuePacket(scriptReply);
client.queuePacket(scriptReply2);
client.queuePacket(scriptReply3);
break; break;
default: default:
Log.debug(String.Format("Unknown command 0x{0:X} received.", subpacket.header.opcode)); Log.debug(String.Format("Unknown command 0x{0:X} received.", subpacket.header.opcode));

View File

@ -0,0 +1,20 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.send.actor
{
class DeleteAllActorsPacket
{
public const ushort OPCODE = 0x0007;
public const uint PACKET_SIZE = 0x28;
public static SubPacket buildPacket(uint playerActorID)
{
return new SubPacket(OPCODE, playerActorID, playerActorID, new byte[8]);
}
}
}

View File

@ -0,0 +1,20 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.send.actor
{
class SetActorTargetAnimatedPacket
{
public const ushort OPCODE = 0x00D3;
public const uint PACKET_SIZE = 0x28;
public static SubPacket buildPacket(uint playerActorID, uint targetActorID, uint targetID)
{
return new SubPacket(OPCODE, playerActorID, targetID, BitConverter.GetBytes((ulong)targetID));
}
}
}

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.send.actor namespace FFXIVClassic_Map_Server.packets.send.actor
{ {
class SetActorTarget class SetActorTargetPacket
{ {
public const ushort OPCODE = 0x00DB; public const ushort OPCODE = 0x00DB;
public const uint PACKET_SIZE = 0x28; public const uint PACKET_SIZE = 0x28;

View File

@ -0,0 +1,20 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.send
{
class LogoutPacket
{
public const ushort OPCODE = 0x000E;
public const uint PACKET_SIZE = 0x28;
public static SubPacket buildPacket(uint playerActorID)
{
return new SubPacket(OPCODE, playerActorID, playerActorID, new byte[8]);
}
}
}

View File

@ -0,0 +1,20 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.send
{
class QuitPacket
{
public const ushort OPCODE = 0x0011;
public const uint PACKET_SIZE = 0x28;
public static SubPacket buildPacket(uint playerActorID)
{
return new SubPacket(OPCODE, playerActorID, playerActorID, new byte[8]);
}
}
}

View File

@ -0,0 +1,20 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.send.player
{
class AchievementEarnedPacket
{
public const ushort OPCODE = 0x019E;
public const uint PACKET_SIZE = 0x28;
public static SubPacket buildPacket(uint playerActorID, uint achievementID)
{
return new SubPacket(OPCODE, playerActorID, playerActorID, BitConverter.GetBytes((UInt64)achievementID));
}
}
}

View File

@ -0,0 +1,21 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.send.player
{
class SetAchievementPointsPacket
{
public const ushort OPCODE = 0x019C;
public const uint PACKET_SIZE = 0x28;
public static SubPacket buildPacket(uint playerActorID, uint numAchievementPoints)
{
return new SubPacket(OPCODE, playerActorID, playerActorID, BitConverter.GetBytes((UInt64) numAchievementPoints));
}
}
}

View File

@ -1,6 +1,7 @@
using FFXIVClassic_Lobby_Server.packets; using FFXIVClassic_Lobby_Server.packets;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -9,15 +10,28 @@ namespace FFXIVClassic_Map_Server.packets.send.player
{ {
class SetLatestAchievementsPacket class SetLatestAchievementsPacket
{ {
public const ushort OPCODE = 0x01A3; public const ushort OPCODE = 0x019B;
public const uint PACKET_SIZE = 0150; public const uint PACKET_SIZE = 0x40;
private byte[] mainstoryFlags = new byte[7]; public static SubPacket buildPacket(uint playerActorID, uint[] latestAchievementIDs)
private byte[] classFlags = new byte[2*17];
public static SubPacket buildPacket(uint playerActorID)
{ {
return null; byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
for (int i = 0; i < 5; i++)
{
//Had less than 5
if (i > latestAchievementIDs.Length)
break;
binWriter.Write((UInt32)latestAchievementIDs[i]);
}
}
}
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
} }
} }
} }

View File

@ -0,0 +1,20 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.send.player
{
class SetPlayerDreamPacket
{
public const ushort OPCODE = 0x01A7;
public const uint PACKET_SIZE = 0x28;
public static SubPacket buildPacket(uint playerActorID, uint dreamID)
{
return new SubPacket(OPCODE, playerActorID, playerActorID, BitConverter.GetBytes((uint)dreamID));
}
}
}

View File

@ -14,7 +14,7 @@ namespace FFXIVClassic_Map_Server.packets.send.player
public static SubPacket buildPacket(uint playerActorID, uint targetActorID, uint titleID) public static SubPacket buildPacket(uint playerActorID, uint targetActorID, uint titleID)
{ {
return new SubPacket(OPCODE, playerActorID, targetActorID, BitConverter.GetBytes((ulong)titleID)); return new SubPacket(OPCODE, playerActorID, targetActorID, BitConverter.GetBytes((UInt64)titleID));
} }
} }
} }