mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-25 06:07:46 +00:00
More recruitment packets implemented. Still need to finish the search results packet.
This commit is contained in:
parent
4eda13501c
commit
93a08c0128
5 changed files with 105 additions and 8 deletions
|
@ -91,6 +91,7 @@
|
||||||
<Compile Include="PacketProcessor.cs" />
|
<Compile Include="PacketProcessor.cs" />
|
||||||
<Compile Include="packets\BasePacket.cs" />
|
<Compile Include="packets\BasePacket.cs" />
|
||||||
<Compile Include="packets\receive\HandshakePacket.cs" />
|
<Compile Include="packets\receive\HandshakePacket.cs" />
|
||||||
|
<Compile Include="packets\receive\recruitment\RecruitmentDetailsRequestPacket.cs" />
|
||||||
<Compile Include="packets\receive\recruitment\RecruitmentSearchRequestPacket.cs" />
|
<Compile Include="packets\receive\recruitment\RecruitmentSearchRequestPacket.cs" />
|
||||||
<Compile Include="packets\receive\recruitment\StartRecruitingRequestPacket.cs" />
|
<Compile Include="packets\receive\recruitment\StartRecruitingRequestPacket.cs" />
|
||||||
<Compile Include="packets\receive\script\CommandStartRequestPacket.cs" />
|
<Compile Include="packets\receive\script\CommandStartRequestPacket.cs" />
|
||||||
|
@ -141,6 +142,8 @@
|
||||||
<Compile Include="packets\send\PongPacket.cs" />
|
<Compile Include="packets\send\PongPacket.cs" />
|
||||||
<Compile Include="packets\send\QuitPacket.cs" />
|
<Compile Include="packets\send\QuitPacket.cs" />
|
||||||
<Compile Include="packets\send\recruitment\CurrentRecruitmentDetailsPacket.cs" />
|
<Compile Include="packets\send\recruitment\CurrentRecruitmentDetailsPacket.cs" />
|
||||||
|
<Compile Include="packets\send\recruitment\EndRecruitmentPacket.cs" />
|
||||||
|
<Compile Include="packets\send\recruitment\RecruiterStatePacket.cs" />
|
||||||
<Compile Include="packets\send\recruitment\StartRecruitingResponse.cs" />
|
<Compile Include="packets\send\recruitment\StartRecruitingResponse.cs" />
|
||||||
<Compile Include="packets\send\script\ScriptEndPacket.cs" />
|
<Compile Include="packets\send\script\ScriptEndPacket.cs" />
|
||||||
<Compile Include="packets\send\script\ScriptStartPacket.cs" />
|
<Compile Include="packets\send\script\ScriptStartPacket.cs" />
|
||||||
|
|
|
@ -347,14 +347,21 @@ namespace FFXIVClassic_Lobby_Server
|
||||||
StartRecruitingRequestPacket recruitRequestPacket = new StartRecruitingRequestPacket(subpacket.data);
|
StartRecruitingRequestPacket recruitRequestPacket = new StartRecruitingRequestPacket(subpacket.data);
|
||||||
client.queuePacket(BasePacket.createPacket(StartRecruitingResponse.buildPacket(player.actorID, true), true, false));
|
client.queuePacket(BasePacket.createPacket(StartRecruitingResponse.buildPacket(player.actorID, true), true, false));
|
||||||
break;
|
break;
|
||||||
|
//End Recruiting
|
||||||
|
case 0x01C4:
|
||||||
|
client.queuePacket(BasePacket.createPacket(EndRecruitmentPacket.buildPacket(player.actorID), true, false));
|
||||||
|
break;
|
||||||
|
//Party Window Opened, Request State
|
||||||
|
case 0x01C5:
|
||||||
|
client.queuePacket(BasePacket.createPacket(RecruiterStatePacket.buildPacket(player.actorID, true, true, 1), true, false));
|
||||||
|
break;
|
||||||
|
//Search Recruiting
|
||||||
case 0x01C7:
|
case 0x01C7:
|
||||||
subpacket.debugPrintSubPacket();
|
|
||||||
RecruitmentSearchRequestPacket recruitSearchPacket = new RecruitmentSearchRequestPacket(subpacket.data);
|
RecruitmentSearchRequestPacket recruitSearchPacket = new RecruitmentSearchRequestPacket(subpacket.data);
|
||||||
break;
|
break;
|
||||||
//Current Recruitment Details
|
//Get Recruitment Details
|
||||||
case 0x01C8:
|
case 0x01C8:
|
||||||
subpacket.debugPrintSubPacket();
|
RecruitmentDetailsRequestPacket currentRecruitDetailsPacket = new RecruitmentDetailsRequestPacket(subpacket.data);
|
||||||
//CurrentRecruitmentDetailsPacket currentRecruitDetailsPacket = new CurrentRecruitmentDetailsPacket(subpacket.data);
|
|
||||||
RecruitmentDetails details = new RecruitmentDetails();
|
RecruitmentDetails details = new RecruitmentDetails();
|
||||||
details.recruiterName = "Localhost Character";
|
details.recruiterName = "Localhost Character";
|
||||||
details.purposeId = 2;
|
details.purposeId = 2;
|
||||||
|
@ -364,9 +371,7 @@ namespace FFXIVClassic_Lobby_Server
|
||||||
details.num[0] = 1;
|
details.num[0] = 1;
|
||||||
client.queuePacket(BasePacket.createPacket(CurrentRecruitmentDetailsPacket.buildPacket(player.actorID, details), true, false));
|
client.queuePacket(BasePacket.createPacket(CurrentRecruitmentDetailsPacket.buildPacket(player.actorID, details), true, false));
|
||||||
break;
|
break;
|
||||||
//Party Window Opened, Request State
|
//Accepted Recruiting
|
||||||
case 0x01C5:
|
|
||||||
case 0x01C4:
|
|
||||||
case 0x01C6:
|
case 0x01C6:
|
||||||
subpacket.debugPrintSubPacket();
|
subpacket.debugPrintSubPacket();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue