mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	More recruitment packets implemented. Still need to finish the search results packet.
This commit is contained in:
		| @@ -91,6 +91,7 @@ | ||||
|     <Compile Include="PacketProcessor.cs" /> | ||||
|     <Compile Include="packets\BasePacket.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\StartRecruitingRequestPacket.cs" /> | ||||
|     <Compile Include="packets\receive\script\CommandStartRequestPacket.cs" /> | ||||
| @@ -141,6 +142,8 @@ | ||||
|     <Compile Include="packets\send\PongPacket.cs" /> | ||||
|     <Compile Include="packets\send\QuitPacket.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\script\ScriptEndPacket.cs" /> | ||||
|     <Compile Include="packets\send\script\ScriptStartPacket.cs" /> | ||||
|   | ||||
| @@ -347,14 +347,21 @@ namespace FFXIVClassic_Lobby_Server | ||||
|                             StartRecruitingRequestPacket recruitRequestPacket = new StartRecruitingRequestPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(StartRecruitingResponse.buildPacket(player.actorID, true), true, false));     | ||||
|                             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: | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             RecruitmentSearchRequestPacket recruitSearchPacket = new RecruitmentSearchRequestPacket(subpacket.data);                             | ||||
|                             break; | ||||
|                         //Current Recruitment Details | ||||
|                         //Get Recruitment Details | ||||
|                         case 0x01C8: | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             //CurrentRecruitmentDetailsPacket currentRecruitDetailsPacket = new CurrentRecruitmentDetailsPacket(subpacket.data); | ||||
|                             RecruitmentDetailsRequestPacket currentRecruitDetailsPacket = new RecruitmentDetailsRequestPacket(subpacket.data); | ||||
|                             RecruitmentDetails details = new RecruitmentDetails(); | ||||
|                             details.recruiterName = "Localhost Character"; | ||||
|                             details.purposeId = 2; | ||||
| @@ -364,12 +371,10 @@ namespace FFXIVClassic_Lobby_Server | ||||
|                             details.num[0] = 1; | ||||
|                             client.queuePacket(BasePacket.createPacket(CurrentRecruitmentDetailsPacket.buildPacket(player.actorID, details), true, false));     | ||||
|                             break; | ||||
|                         //Party Window Opened, Request State | ||||
|                         case 0x01C5: | ||||
|                         case 0x01C4:                         | ||||
|                         //Accepted Recruiting | ||||
|                         case 0x01C6: | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             break; | ||||
|                             break;                         | ||||
|                         /* SOCIAL STUFF */ | ||||
|                         case 0x01C9: | ||||
|                             AddRemoveSocialPacket addBlackList = new AddRemoveSocialPacket(subpacket.data); | ||||
|   | ||||
| @@ -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); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user