Random work.

This commit is contained in:
Filip Maj
2016-12-13 15:02:28 -05:00
parent fd2df829de
commit 6c409e93a9
13 changed files with 284 additions and 115 deletions

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group
{
class CreateLinkshellPacket
{
public bool invalidPacket = false;
public string name;
public ushort crestid;
public uint master;
public CreateLinkshellPacket(byte[] data)
{
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryReader binReader = new BinaryReader(mem))
{
try
{
name = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
crestid = binReader.ReadUInt16();
master = binReader.ReadUInt32();
}
catch (Exception)
{
invalidPacket = true;
}
}
}
}
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group
{
class CreateRelationPacket
{
public bool invalidPacket = false;
public uint host;
public uint guest;
public uint command;
public CreateRelationPacket(byte[] data)
{
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryReader binReader = new BinaryReader(mem))
{
try
{
host = binReader.ReadUInt32();
guest = binReader.ReadUInt32();
command = binReader.ReadUInt32();
}
catch (Exception)
{
invalidPacket = true;
}
}
}
}
}
}

View File

@@ -3,16 +3,12 @@ using System.IO;
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group
{
class GroupControlGetDeletePacket
class DeleteGroupPacket
{
public const byte GROUP_CONTROL_GET = 0;
public const byte GROUP_CONTROL_DELETE = 1;
public bool invalidPacket = false;
public uint controlCode;
public bool invalidPacket = false;
public ulong groupId;
public GroupControlGetDeletePacket(byte[] data)
public DeleteGroupPacket(byte[] data)
{
using (MemoryStream mem = new MemoryStream(data))
{
@@ -20,7 +16,6 @@ namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group
{
try
{
controlCode = binReader.ReadUInt32();
groupId = binReader.ReadUInt64();
}
catch (Exception)

View File

@@ -0,0 +1,29 @@
using System;
using System.IO;
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group
{
class GetGroupPacket
{
public bool invalidPacket = false;
public ulong groupId;
public GetGroupPacket(byte[] data)
{
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryReader binReader = new BinaryReader(mem))
{
try
{
groupId = binReader.ReadUInt64();
}
catch (Exception)
{
invalidPacket = true;
}
}
}
}
}
}

View File

@@ -1,43 +0,0 @@
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;
}
}
}
}
}
}

View File

@@ -0,0 +1,47 @@
using System;
using System.IO;
using System.Text;
namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group
{
class ModifyLinkshellPacket
{
public bool invalidPacket = false;
public ushort argCode;
public string name;
public ushort crestid;
public uint master;
public ModifyLinkshellPacket(byte[] data)
{
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryReader binReader = new BinaryReader(mem))
{
try
{
argCode = binReader.ReadUInt16();
switch (argCode)
{
case 0:
name = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
break;
case 1:
crestid = binReader.ReadUInt16();
break;
case 2:
master = binReader.ReadUInt32();
break;
}
}
catch (Exception)
{
invalidPacket = true;
}
}
}
}
}
}