More recruitment packets implemented. Still need to finish the search results packet.

This commit is contained in:
Filip Maj 2015-12-06 22:58:42 -05:00
parent 4eda13501c
commit 93a08c0128
5 changed files with 105 additions and 8 deletions

View file

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.receive.recruitment
{
class RecruitmentDetailsRequestPacket
{
public bool invalidPacket = false;
public ulong recruitmentId;
public RecruitmentDetailsRequestPacket(byte[] data)
{
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryReader binReader = new BinaryReader(mem))
{
try{
recruitmentId = binReader.ReadUInt64();
}
catch (Exception){
invalidPacket = true;
}
}
}
}
}
}

View file

@ -0,0 +1,22 @@
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.recruitment
{
class EndRecruitmentPacket
{
public const ushort OPCODE = 0x01C4;
public const uint PACKET_SIZE = 0x28;
public static SubPacket buildPacket(uint playerActorID)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
data[0] = 1;
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
}
}
}

View file

@ -0,0 +1,34 @@
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.recruitment
{
class RecruiterStatePacket
{
public const ushort OPCODE = 0x01C5;
public const uint PACKET_SIZE = 0x038;
public static SubPacket buildPacket(uint playerActorID, bool isRecruiting, bool isRecruiter, long recruitmentId)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((UInt64)recruitmentId);
binWriter.Write((UInt32)0);
binWriter.Write((byte)(isRecruiter ? 1 : 0));
binWriter.Write((byte)(isRecruiting ? 1 : 0));
}
}
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
}
}
}