mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-22 12:47:46 +00:00
Manually added the group packets and dataobjects into dev branch because the working_on_groups branch is so old it probably will break stuff.
This commit is contained in:
parent
101070954d
commit
df6e16103c
20 changed files with 745 additions and 0 deletions
|
@ -81,6 +81,7 @@
|
|||
<Compile Include="actors\chara\player\Equipment.cs" />
|
||||
<Compile Include="actors\chara\player\Inventory.cs" />
|
||||
<Compile Include="actors\chara\Work.cs" />
|
||||
<Compile Include="actors\group\ContentWork.cs" />
|
||||
<Compile Include="actors\debug\Debug.cs" />
|
||||
<Compile Include="actors\director\Director.cs" />
|
||||
<Compile Include="actors\director\OpeningDirector.cs" />
|
||||
|
@ -89,8 +90,16 @@
|
|||
<Compile Include="actors\director\quest\QuestDirectorMan0u001.cs" />
|
||||
<Compile Include="actors\director\WeatherDirector.cs" />
|
||||
<Compile Include="actors\EventList.cs" />
|
||||
<Compile Include="actors\group\Group.cs" />
|
||||
<Compile Include="actors\group\GroupGlobalSave.cs" />
|
||||
<Compile Include="actors\group\GroupGlobalTemp.cs" />
|
||||
<Compile Include="actors\group\GroupMemberSave.cs" />
|
||||
<Compile Include="actors\judge\Judge.cs" />
|
||||
<Compile Include="actors\group\LinkshellWork.cs" />
|
||||
<Compile Include="actors\group\PartyWork.cs" />
|
||||
<Compile Include="actors\quest\Quest.cs" />
|
||||
<Compile Include="actors\group\RelationWork.cs" />
|
||||
<Compile Include="actors\group\RetainerWork.cs" />
|
||||
<Compile Include="actors\StaticActors.cs" />
|
||||
<Compile Include="actors\world\WorldMaster.cs" />
|
||||
<Compile Include="dataobjects\ZoneConnection.cs" />
|
||||
|
@ -188,10 +197,20 @@
|
|||
<Compile Include="packets\send\actor\SetActorIdleAnimationPacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorStatusPacket.cs" />
|
||||
<Compile Include="packets\send\actor\_0xFPacket.cs" />
|
||||
<Compile Include="packets\send\groups\CreateNamedGroup.cs" />
|
||||
<Compile Include="packets\send\groups\CreateNamedGroupMultiple.cs" />
|
||||
<Compile Include="packets\send\events\EndEventPacket.cs" />
|
||||
<Compile Include="packets\send\events\KickEventPacket.cs" />
|
||||
<Compile Include="packets\send\events\RunEventFunctionPacket.cs" />
|
||||
<Compile Include="packets\send\GameMessagePacket.cs" />
|
||||
<Compile Include="packets\send\groups\GroupHeaderPacket.cs" />
|
||||
<Compile Include="packets\send\groups\GroupMember.cs" />
|
||||
<Compile Include="packets\send\groups\GroupMembersBeginPacket.cs" />
|
||||
<Compile Include="packets\send\groups\GroupMembersEndPacket.cs" />
|
||||
<Compile Include="packets\send\groups\GroupMembersX08Packet.cs" />
|
||||
<Compile Include="packets\send\groups\GroupMembersX16Packet.cs" />
|
||||
<Compile Include="packets\send\groups\GroupMembersX32Packet.cs" />
|
||||
<Compile Include="packets\send\groups\GroupMembersX64Packet.cs" />
|
||||
<Compile Include="packets\send\list\ListEntry.cs" />
|
||||
<Compile Include="packets\send\list\ListUtils.cs" />
|
||||
<Compile Include="packets\send\list\SetListPropertyPacket.cs" />
|
||||
|
|
13
FFXIVClassic Map Server/actors/group/ContentWork.cs
Normal file
13
FFXIVClassic Map Server/actors/group/ContentWork.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.group
|
||||
{
|
||||
class ContentWork
|
||||
{
|
||||
public GroupGlobalTemp _globalTemp = new GroupGlobalTemp();
|
||||
}
|
||||
}
|
141
FFXIVClassic Map Server/actors/group/Group.cs
Normal file
141
FFXIVClassic Map Server/actors/group/Group.cs
Normal file
|
@ -0,0 +1,141 @@
|
|||
using FFXIVClassic_Lobby_Server.common;
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server.packets.send.group;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.group
|
||||
{
|
||||
class Group
|
||||
{
|
||||
public const uint PlayerPartyGroup = 10001;
|
||||
public const uint CompanyGroup = 20001;
|
||||
|
||||
public const uint GroupInvitationRelationGroup = 50001;
|
||||
public const uint TradeRelationGroup = 50002;
|
||||
public const uint BazaarBuyItemRelationGroup = 50009;
|
||||
|
||||
public const uint RetainerGroup = 80001;
|
||||
|
||||
public ulong groupId;
|
||||
public uint groupTypeId;
|
||||
public int localizedNamed = -1;
|
||||
public string groupName = "";
|
||||
|
||||
public PartyWork partyGroupWork; //For party group types
|
||||
public Object work; //For the rest
|
||||
|
||||
public List<GroupMember> members = new List<GroupMember>();
|
||||
|
||||
public Group(ulong id, uint typeId, object work)
|
||||
{
|
||||
groupId = id;
|
||||
groupTypeId = typeId;
|
||||
|
||||
if (work is PartyWork)
|
||||
partyGroupWork = (PartyWork)work;
|
||||
else
|
||||
this.work = work;
|
||||
}
|
||||
|
||||
public Group(ulong id, uint typeId, int nameId, object work)
|
||||
{
|
||||
groupId = id;
|
||||
groupTypeId = typeId;
|
||||
localizedNamed = nameId;
|
||||
|
||||
if (work is PartyWork)
|
||||
partyGroupWork = (PartyWork)work;
|
||||
else
|
||||
this.work = (PartyWork)work;
|
||||
}
|
||||
|
||||
public Group(ulong id, uint typeId, string name, object work)
|
||||
{
|
||||
groupId = id;
|
||||
groupTypeId = typeId;
|
||||
groupName = name;
|
||||
localizedNamed = -1;
|
||||
|
||||
if (work is PartyWork)
|
||||
partyGroupWork = (PartyWork)work;
|
||||
else
|
||||
this.work = work;
|
||||
}
|
||||
|
||||
public void add(Actor actor)
|
||||
{
|
||||
GroupMember member = new GroupMember(actor.actorId, (int)actor.displayNameId, 0, false, true, actor.customDisplayName);
|
||||
members.Add(member);
|
||||
}
|
||||
|
||||
public void sendMemberPackets(Player toPlayer)
|
||||
{
|
||||
ulong time = Utils.MilisUnixTimeStampUTC();
|
||||
|
||||
toPlayer.queuePacket(GroupHeaderPacket.buildPacket(toPlayer.actorId, toPlayer.zoneId, time, this));
|
||||
toPlayer.queuePacket(GroupMembersBeginPacket.buildPacket(toPlayer.actorId, toPlayer.zoneId, time, this));
|
||||
|
||||
int currentIndex = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (members.Count - currentIndex >= 64)
|
||||
toPlayer.queuePacket(GroupMembersX64Packet.buildPacket(toPlayer.actorId, toPlayer.zoneId, time, members, ref currentIndex));
|
||||
else if (members.Count - currentIndex >= 32)
|
||||
toPlayer.queuePacket(GroupMembersX32Packet.buildPacket(toPlayer.actorId, toPlayer.zoneId, time, members, ref currentIndex));
|
||||
else if (members.Count - currentIndex >= 16)
|
||||
toPlayer.queuePacket(GroupMembersX16Packet.buildPacket(toPlayer.actorId, toPlayer.zoneId, time, members, ref currentIndex));
|
||||
else if (members.Count - currentIndex > 0)
|
||||
toPlayer.queuePacket(GroupMembersX08Packet.buildPacket(toPlayer.actorId, toPlayer.zoneId, time, members, ref currentIndex));
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
toPlayer.queuePacket(GroupMembersEndPacket.buildPacket(toPlayer.actorId, toPlayer.zoneId, time, this));
|
||||
|
||||
}
|
||||
|
||||
public void sendWorkValues(Player player)
|
||||
{
|
||||
if (groupTypeId == PlayerPartyGroup)
|
||||
{
|
||||
SetGroupWorkValuesPacket groupWork = new SetGroupWorkValuesPacket(groupId);
|
||||
groupWork.addProperty(this, "partyGroupWork._globalTemp.owner");
|
||||
groupWork.setTarget("/_init");
|
||||
|
||||
SubPacket test = groupWork.buildPacket(player.actorId, player.actorId);
|
||||
player.queuePacket(test);
|
||||
}
|
||||
else if (groupTypeId == GroupInvitationRelationGroup)
|
||||
{
|
||||
SetGroupWorkValuesPacket groupWork = new SetGroupWorkValuesPacket(groupId);
|
||||
groupWork.addProperty(this, "work._globalTemp.host");
|
||||
groupWork.addProperty(this, "work._globalTemp.variableCommand");
|
||||
groupWork.setTarget("/_init");
|
||||
|
||||
SubPacket test = groupWork.buildPacket(player.actorId, player.actorId);
|
||||
test.debugPrintSubPacket();
|
||||
player.queuePacket(test);
|
||||
}
|
||||
else if (groupTypeId == RetainerGroup)
|
||||
{
|
||||
SetGroupWorkValuesPacket groupWork = new SetGroupWorkValuesPacket(groupId);
|
||||
groupWork.addProperty(this, "work._memberSave[0].cdIDOffset");
|
||||
groupWork.addProperty(this, "work._memberSave[0].placeName");
|
||||
groupWork.addProperty(this, "work._memberSave[0].conditions");
|
||||
groupWork.addProperty(this, "work._memberSave[0].level");
|
||||
groupWork.setTarget("/_init");
|
||||
|
||||
SubPacket test = groupWork.buildPacket(player.actorId, player.actorId);
|
||||
player.queuePacket(test);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
14
FFXIVClassic Map Server/actors/group/GroupGlobalSave.cs
Normal file
14
FFXIVClassic Map Server/actors/group/GroupGlobalSave.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.group
|
||||
{
|
||||
class GroupGlobalSave
|
||||
{
|
||||
public ulong master;
|
||||
public byte[] crestIcon = new byte[4];
|
||||
}
|
||||
}
|
20
FFXIVClassic Map Server/actors/group/GroupGlobalTemp.cs
Normal file
20
FFXIVClassic Map Server/actors/group/GroupGlobalTemp.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.group
|
||||
{
|
||||
class GroupGlobalTemp
|
||||
{
|
||||
public ulong owner;
|
||||
|
||||
//For content group
|
||||
public ulong director;
|
||||
|
||||
//For relation group
|
||||
public ulong host;
|
||||
public uint variableCommand;
|
||||
}
|
||||
}
|
20
FFXIVClassic Map Server/actors/group/GroupMemberSave.cs
Normal file
20
FFXIVClassic Map Server/actors/group/GroupMemberSave.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.group
|
||||
{
|
||||
class GroupMemberSave
|
||||
{
|
||||
//For LS
|
||||
public byte rank;
|
||||
|
||||
//For Retainers
|
||||
public byte cdIDOffset;
|
||||
public ushort placeName;
|
||||
public byte conditions;
|
||||
public byte level;
|
||||
}
|
||||
}
|
14
FFXIVClassic Map Server/actors/group/LinkshellWork.cs
Normal file
14
FFXIVClassic Map Server/actors/group/LinkshellWork.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.group
|
||||
{
|
||||
class LinkshellWork
|
||||
{
|
||||
public GroupGlobalSave _globalSave = new GroupGlobalSave();
|
||||
public GroupMemberSave[] _memberSave = new GroupMemberSave[128];
|
||||
}
|
||||
}
|
13
FFXIVClassic Map Server/actors/group/PartyWork.cs
Normal file
13
FFXIVClassic Map Server/actors/group/PartyWork.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.group
|
||||
{
|
||||
class PartyWork
|
||||
{
|
||||
public GroupGlobalTemp _globalTemp = new GroupGlobalTemp();
|
||||
}
|
||||
}
|
13
FFXIVClassic Map Server/actors/group/RelationWork.cs
Normal file
13
FFXIVClassic Map Server/actors/group/RelationWork.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.group
|
||||
{
|
||||
class RelationWork
|
||||
{
|
||||
public GroupGlobalTemp _globalTemp = new GroupGlobalTemp();
|
||||
}
|
||||
}
|
13
FFXIVClassic Map Server/actors/group/RetainerWork.cs
Normal file
13
FFXIVClassic Map Server/actors/group/RetainerWork.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.group
|
||||
{
|
||||
class RetainerWork
|
||||
{
|
||||
public GroupMemberSave[] _memberSave = new GroupMemberSave[128];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.actors.group;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
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.group
|
||||
{
|
||||
class CreateNamedGroup
|
||||
{
|
||||
public const ushort OPCODE = 0x0188;
|
||||
public const uint PACKET_SIZE = 0x60;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, Group group)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt64)group.groupId);
|
||||
binWriter.Write((UInt32)group.groupTypeId);
|
||||
binWriter.Write((Int32)group.localizedNamed);
|
||||
|
||||
binWriter.Write((UInt16)0x121C);
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(group.groupName), 0, Encoding.ASCII.GetByteCount(group.groupName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.groupName));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.actors.group;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
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.group
|
||||
{
|
||||
class CreateNamedGroupMultiple
|
||||
{
|
||||
public const ushort OPCODE = 0x0189;
|
||||
public const uint PACKET_SIZE = 0x228;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, Group[] groups, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max = 8;
|
||||
if (groups.Length - offset <= 8)
|
||||
max = groups.Length - offset;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(i * 0x40, SeekOrigin.Begin);
|
||||
|
||||
Group group = groups[offset+i];
|
||||
|
||||
binWriter.Write((UInt64)group.groupId);
|
||||
binWriter.Write((UInt32)group.groupTypeId);
|
||||
binWriter.Write((Int32)group.localizedNamed);
|
||||
|
||||
binWriter.Write((UInt16)0x121C);
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(group.groupName), 0, Encoding.ASCII.GetByteCount(group.groupName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.groupName));
|
||||
}
|
||||
|
||||
binWriter.Seek(0x200, SeekOrigin.Begin);
|
||||
binWriter.Write((Byte)max);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.actors.group;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
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.group
|
||||
{
|
||||
class GroupHeaderPacket
|
||||
{
|
||||
public const uint TYPEID_RETAINER = 0x13881;
|
||||
public const uint TYPEID_PARTY = 0x2711;
|
||||
public const uint TYPEID_LINKSHELL = 0x4E22;
|
||||
|
||||
public const ushort OPCODE = 0x017C;
|
||||
public const uint PACKET_SIZE = 0x98;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, Group group)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write list header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
|
||||
//Write list id
|
||||
binWriter.Write((UInt64)3);
|
||||
binWriter.Write((UInt64)group.groupId);
|
||||
binWriter.Write((UInt64)0);
|
||||
binWriter.Write((UInt64)group.groupId);
|
||||
|
||||
//This seems to change depending on what the list is for
|
||||
binWriter.Write((UInt32)group.groupTypeId);
|
||||
binWriter.Seek(0x40, SeekOrigin.Begin);
|
||||
|
||||
//This is for Linkshell
|
||||
binWriter.Write((UInt32)group.localizedNamed);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(group.groupName), 0, Encoding.ASCII.GetByteCount(group.groupName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.groupName));
|
||||
|
||||
binWriter.Seek(0x64, SeekOrigin.Begin);
|
||||
|
||||
binWriter.Write((UInt32)0x6D);
|
||||
binWriter.Write((UInt32)0x6D);
|
||||
binWriter.Write((UInt32)0x6D);
|
||||
binWriter.Write((UInt32)0x6D);
|
||||
|
||||
binWriter.Write((UInt32)group.members.Count);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
24
FFXIVClassic Map Server/packets/send/groups/GroupMember.cs
Normal file
24
FFXIVClassic Map Server/packets/send/groups/GroupMember.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.group
|
||||
{
|
||||
class GroupMember
|
||||
{
|
||||
public uint actorId;
|
||||
public int localizedName;
|
||||
public uint unknown2;
|
||||
public bool flag1;
|
||||
public bool isOnline;
|
||||
public string name;
|
||||
|
||||
public GroupMember(uint actorId, int localizedName, uint unknown2, bool flag1, bool isOnline, string name)
|
||||
{
|
||||
this.actorId = actorId;
|
||||
this.localizedName = localizedName;
|
||||
this.unknown2 = unknown2;
|
||||
this.flag1 = flag1;
|
||||
this.isOnline = isOnline;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.actors.group;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
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.group
|
||||
{
|
||||
class GroupMembersBeginPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x017D;
|
||||
public const uint PACKET_SIZE = 0x40;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, Group group)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write List Info
|
||||
binWriter.Write((UInt64)group.groupId);
|
||||
binWriter.Write((UInt32)group.members.Count);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.actors.group;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
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.group
|
||||
{
|
||||
class GroupMembersEndPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x017E;
|
||||
public const uint PACKET_SIZE = 0x38;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, Group group)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write List Info
|
||||
binWriter.Write((UInt64)group.groupId);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
using FFXIVClassic.Common;
|
||||
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.group
|
||||
{
|
||||
class GroupMembersX08Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x017F;
|
||||
public const uint PACKET_SIZE = 0x1B8;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, List<GroupMember> entries, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write Entries
|
||||
int max = 8;
|
||||
if (entries.Count-offset < 8)
|
||||
max = entries.Count - offset;
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(0x10 + (0x30 * i), SeekOrigin.Begin);
|
||||
|
||||
GroupMember entry = entries[i];
|
||||
binWriter.Write((UInt32)entry.actorId);
|
||||
binWriter.Write((Int32)entry.localizedName);
|
||||
binWriter.Write((UInt32)entry.unknown2);
|
||||
binWriter.Write((Byte)(entry.flag1? 1 : 0));
|
||||
binWriter.Write((Byte)(entry.isOnline? 1 : 0));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(entry.name), 0, Encoding.ASCII.GetByteCount(entry.name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(entry.name));
|
||||
|
||||
offset++;
|
||||
}
|
||||
//Write Count
|
||||
binWriter.Seek(0x10 + (0x30 * 8), SeekOrigin.Begin);
|
||||
binWriter.Write(max);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
using FFXIVClassic.Common;
|
||||
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.group
|
||||
{
|
||||
class GroupMembersX16Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0180;
|
||||
public const uint PACKET_SIZE = 0x330;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, List<GroupMember> entries, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write Entries
|
||||
int max = 16;
|
||||
if (entries.Count-offset < 16)
|
||||
max = entries.Count - offset;
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(0x10 + (0x30 * i), SeekOrigin.Begin);
|
||||
|
||||
GroupMember entry = entries[i];
|
||||
binWriter.Write((UInt32)entry.actorId);
|
||||
binWriter.Write((Int32)entry.localizedName);
|
||||
binWriter.Write((UInt32)entry.unknown2);
|
||||
binWriter.Write((Byte)(entry.flag1? 1 : 0));
|
||||
binWriter.Write((Byte)(entry.isOnline? 1 : 0));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(entry.name), 0, Encoding.ASCII.GetByteCount(entry.name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(entry.name));
|
||||
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
using FFXIVClassic.Common;
|
||||
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.group
|
||||
{
|
||||
class GroupMembersX32Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0181;
|
||||
public const uint PACKET_SIZE = 0x630;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, List<GroupMember> entries, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write Entries
|
||||
int max = 32;
|
||||
if (entries.Count-offset < 32)
|
||||
max = entries.Count - offset;
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(0x10 + (0x30 * i), SeekOrigin.Begin);
|
||||
|
||||
GroupMember entry = entries[i];
|
||||
binWriter.Write((UInt32)entry.actorId);
|
||||
binWriter.Write((Int32)entry.localizedName);
|
||||
binWriter.Write((UInt32)entry.unknown2);
|
||||
binWriter.Write((Byte)(entry.flag1? 1 : 0));
|
||||
binWriter.Write((Byte)(entry.isOnline? 1 : 0));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(entry.name), 0, Encoding.ASCII.GetByteCount(entry.name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(entry.name));
|
||||
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
using FFXIVClassic.Common;
|
||||
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.group
|
||||
{
|
||||
class GroupMembersX64Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0182;
|
||||
public const uint PACKET_SIZE = 0xC30;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, List<GroupMember> entries, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write Entries
|
||||
int max = 64;
|
||||
if (entries.Count - offset < 64)
|
||||
max = entries.Count - offset;
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(0x10 + (0x30 * i), SeekOrigin.Begin);
|
||||
|
||||
GroupMember entry = entries[i];
|
||||
binWriter.Write((UInt32)entry.actorId);
|
||||
binWriter.Write((Int32)entry.localizedName);
|
||||
binWriter.Write((UInt32)entry.unknown2);
|
||||
binWriter.Write((Byte)(entry.flag1? 1 : 0));
|
||||
binWriter.Write((Byte)(entry.isOnline? 1 : 0));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(entry.name), 0, Encoding.ASCII.GetByteCount(entry.name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(entry.name));
|
||||
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue