Party leave/disband done.

This commit is contained in:
Filip Maj 2016-12-22 14:47:24 -05:00
parent 7c29a850c4
commit 6ba1f968c3
7 changed files with 134 additions and 5 deletions

View file

@ -286,6 +286,7 @@
<Compile Include="packets\WorldPackets\Send\Group\CreateLinkshellPacket.cs" />
<Compile Include="packets\WorldPackets\Send\Group\DeleteLinkshellPacket.cs" />
<Compile Include="packets\WorldPackets\Send\Group\ModifyLinkshellPacket.cs" />
<Compile Include="packets\WorldPackets\Send\Group\PartyLeavePacket.cs" />
<Compile Include="packets\WorldPackets\Send\Group\PartyModifyPacket.cs" />
<Compile Include="packets\WorldPackets\Send\SessionBeginConfirmPacket.cs" />
<Compile Include="packets\WorldPackets\Send\SessionEndConfirmPacket.cs" />

View file

@ -1305,10 +1305,14 @@ namespace FFXIVClassic_Map_Server.Actors
public void PartyLeave()
{
SubPacket leavePacket = PartyLeavePacket.BuildPacket(playerSession, false);
QueuePacket(leavePacket);
}
public void PartyDisband()
{
SubPacket disbandPacket = PartyLeavePacket.BuildPacket(playerSession, true);
QueuePacket(disbandPacket);
}
public void PartyPromote(uint actorId)

View file

@ -0,0 +1,30 @@
using FFXIVClassic.Common;
using FFXIVClassic_Map_Server.Actors;
using FFXIVClassic_Map_Server.dataobjects;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
{
class PartyLeavePacket
{
public const ushort OPCODE = 0x1021;
public const uint PACKET_SIZE = 0x28;
public static SubPacket BuildPacket(Session session, bool isDisband)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((UInt16)(isDisband ? 1 : 0));
}
}
return new SubPacket(true, OPCODE, session.id, session.id, data);
}
}
}