mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-08-03 08:11:50 +02:00
Added all the base code for managing world-scope groups.
This commit is contained in:
parent
09e1e31e79
commit
31b13300ac
20 changed files with 940 additions and 4 deletions
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class GroupControlCreateModifyPacket
|
||||
{
|
||||
public const byte GROUP_CONTROL_CREATE = 0;
|
||||
public const byte GROUP_CONTROL_MODIFY = 1;
|
||||
|
||||
public const byte GROUP_PARTY = 0;
|
||||
public const byte GROUP_RETAINER = 1;
|
||||
public const byte GROUP_LINKSHELL = 2;
|
||||
public const byte GROUP_RELATION = 3;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
public byte controlCode;
|
||||
public ulong groupId;
|
||||
public byte groupType;
|
||||
|
||||
public GroupControlCreateModifyPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
controlCode = binReader.ReadByte();
|
||||
groupType = binReader.ReadByte();
|
||||
groupId = binReader.ReadUInt64();
|
||||
|
||||
//Work value data
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class GroupControlGetDeletePacket
|
||||
{
|
||||
public const byte GROUP_CONTROL_GET = 0;
|
||||
public const byte GROUP_CONTROL_DELETE = 1;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
public uint controlCode;
|
||||
public ulong groupId;
|
||||
|
||||
public GroupControlGetDeletePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
controlCode = binReader.ReadUInt32();
|
||||
groupId = binReader.ReadUInt64();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class GroupMemberChangePacket
|
||||
{
|
||||
public const int GROUP_MEMBER_ADD = 0;
|
||||
public const int GROUP_MEMBER_REMOVE = 0;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
public uint controlCode;
|
||||
public ulong groupId;
|
||||
public uint memberId;
|
||||
|
||||
public GroupMemberChangePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
controlCode = binReader.ReadUInt32();
|
||||
groupId = binReader.ReadUInt64();
|
||||
memberId = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_World_Server.DataObjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Send.Group
|
||||
{
|
||||
class GroupMemberListEndPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1022;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, ulong groupId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt64)groupId);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, 0, session.sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_World_Server.DataObjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Send.Group
|
||||
{
|
||||
class GroupMemberListPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1021;
|
||||
public const uint PACKET_SIZE = 0x2C;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, ulong groupId, uint numMembersInPacket)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt64)groupId);
|
||||
binWriter.Write((UInt32)numMembersInPacket);
|
||||
|
||||
//Members
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, 0, session.sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_World_Server.DataObjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Send.Group
|
||||
{
|
||||
class GroupMemberListStartPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1020;
|
||||
public const uint PACKET_SIZE = 0x30;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, int resultCode, ulong groupId, int numMembers)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32) resultCode);
|
||||
binWriter.Write((UInt64) groupId);
|
||||
binWriter.Write((UInt32) numMembers);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, 0, session.sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_World_Server.DataObjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Send.Group
|
||||
{
|
||||
class GroupWorkValuesPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1023;
|
||||
public const uint PACKET_SIZE = 0x80;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, ulong groupId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt64)groupId);
|
||||
//Write data
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, 0, session.sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue