From f286922974d474ebdad64688b124ea478a28e364 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sun, 4 Dec 2016 10:52:22 -0500 Subject: [PATCH] Deleted the list folder and anything in it. This was the old way before I realized how groups work. --- .../FFXIVClassic Map Server.csproj | 7 - .../actors/chara/player/Player.cs | 1 - .../packets/send/list/ListBeginPacket.cs | 33 ---- .../packets/send/list/ListEndPacket.cs | 33 ---- .../packets/send/list/ListEntriesEndPacket.cs | 51 ----- .../packets/send/list/ListEntry.cs | 24 --- .../packets/send/list/ListStartPacket.cs | 61 ------ .../packets/send/list/ListUtils.cs | 41 ---- .../send/list/SetListPropertyPacket.cs | 183 ------------------ 9 files changed, 434 deletions(-) delete mode 100644 FFXIVClassic Map Server/packets/send/list/ListBeginPacket.cs delete mode 100644 FFXIVClassic Map Server/packets/send/list/ListEndPacket.cs delete mode 100644 FFXIVClassic Map Server/packets/send/list/ListEntriesEndPacket.cs delete mode 100644 FFXIVClassic Map Server/packets/send/list/ListEntry.cs delete mode 100644 FFXIVClassic Map Server/packets/send/list/ListStartPacket.cs delete mode 100644 FFXIVClassic Map Server/packets/send/list/ListUtils.cs delete mode 100644 FFXIVClassic Map Server/packets/send/list/SetListPropertyPacket.cs diff --git a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj index 21d0bb59..b6eaeae1 100644 --- a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj +++ b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj @@ -213,13 +213,6 @@ - - - - - - - diff --git a/FFXIVClassic Map Server/actors/chara/player/Player.cs b/FFXIVClassic Map Server/actors/chara/player/Player.cs index 97d521fd..9407a42a 100644 --- a/FFXIVClassic Map Server/actors/chara/player/Player.cs +++ b/FFXIVClassic Map Server/actors/chara/player/Player.cs @@ -8,7 +8,6 @@ using FFXIVClassic_Map_Server.lua; using FFXIVClassic_Map_Server.packets.send; using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.packets.send.events; -using FFXIVClassic_Map_Server.packets.send.list; using FFXIVClassic_Map_Server.packets.send.player; using FFXIVClassic_Map_Server.utils; using System; diff --git a/FFXIVClassic Map Server/packets/send/list/ListBeginPacket.cs b/FFXIVClassic Map Server/packets/send/list/ListBeginPacket.cs deleted file mode 100644 index ee63b473..00000000 --- a/FFXIVClassic Map Server/packets/send/list/ListBeginPacket.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.IO; - -using FFXIVClassic.Common; - -namespace FFXIVClassic_Map_Server.packets.send.list -{ - class ListBeginPacket - { - public const ushort OPCODE = 0x017D; - public const uint PACKET_SIZE = 0x40; - - public static SubPacket BuildPacket(uint playerActorID, uint locationCode, ulong sequenceId, ulong listId, int numEntries) - { - 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)listId); - binWriter.Write((UInt32)numEntries); - } - } - - return new SubPacket(OPCODE, playerActorID, playerActorID, data); - } - } -} diff --git a/FFXIVClassic Map Server/packets/send/list/ListEndPacket.cs b/FFXIVClassic Map Server/packets/send/list/ListEndPacket.cs deleted file mode 100644 index 788e7fac..00000000 --- a/FFXIVClassic Map Server/packets/send/list/ListEndPacket.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.IO; - -using FFXIVClassic.Common; - -namespace FFXIVClassic_Map_Server.packets.send.list -{ - class ListEndPacket - { - public const ushort OPCODE = 0x017E; - public const uint PACKET_SIZE = 0x38; - - public static SubPacket BuildPacket(uint playerActorID, uint locationCode, ulong sequenceId, ulong listId) - { - 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)listId); - } - } - - return new SubPacket(OPCODE, playerActorID, playerActorID, data); - } - - } -} diff --git a/FFXIVClassic Map Server/packets/send/list/ListEntriesEndPacket.cs b/FFXIVClassic Map Server/packets/send/list/ListEntriesEndPacket.cs deleted file mode 100644 index 0e7db0f9..00000000 --- a/FFXIVClassic Map Server/packets/send/list/ListEntriesEndPacket.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -using FFXIVClassic.Common; - -namespace FFXIVClassic_Map_Server.packets.send.list -{ - class ListEntriesEndPacket - { - public const ushort OPCODE = 0x017F; - public const uint PACKET_SIZE = 0x1B8; - - public static SubPacket BuildPacket(uint playerActorID, uint locationCode, ulong sequenceId, List entries, 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); - - ListEntry entry = entries[i]; - binWriter.Write((UInt32)entry.actorId); - binWriter.Write((UInt32)entry.unknown1); - 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)); - } - //Write Count - binWriter.Seek(0x10 + (0x30 * 8), SeekOrigin.Begin); - binWriter.Write(max); - } - } - - return new SubPacket(OPCODE, playerActorID, playerActorID, data); - } - } -} diff --git a/FFXIVClassic Map Server/packets/send/list/ListEntry.cs b/FFXIVClassic Map Server/packets/send/list/ListEntry.cs deleted file mode 100644 index 6fcb31ff..00000000 --- a/FFXIVClassic Map Server/packets/send/list/ListEntry.cs +++ /dev/null @@ -1,24 +0,0 @@ -using FFXIVClassic.Common; - -namespace FFXIVClassic_Map_Server.packets.send.list -{ - class ListEntry - { - public uint actorId; - public uint unknown1; - public uint unknown2; - public bool flag1; - public bool isOnline; - public string name; - - public ListEntry(uint actorId, uint unknown1, uint unknown2, bool flag1, bool isOnline, string name) - { - this.actorId = actorId; - this.unknown1 = unknown1; - this.unknown2 = unknown2; - this.flag1 = flag1; - this.isOnline = isOnline; - this.name = name; - } - } -} diff --git a/FFXIVClassic Map Server/packets/send/list/ListStartPacket.cs b/FFXIVClassic Map Server/packets/send/list/ListStartPacket.cs deleted file mode 100644 index 481762c6..00000000 --- a/FFXIVClassic Map Server/packets/send/list/ListStartPacket.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.IO; -using System.Text; - -using FFXIVClassic.Common; - -namespace FFXIVClassic_Map_Server.packets.send.list -{ - class ListStartPacket - { - 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, ulong listId, uint listTypeId, int numEntries) - { - byte[] data = new byte[PACKET_SIZE - 0x20]; - - using (MemoryStream mem = new MemoryStream(data)) - { - using (BinaryWriter binWriter = new BinaryWriter(mem)) - { - //Temp stuff - string name = ""; - - //Write list header - binWriter.Write((UInt64)locationCode); - binWriter.Write((UInt64)sequenceId); - - //Write list id - binWriter.Write((UInt64)3); - binWriter.Write((UInt64)listId); - binWriter.Write((UInt64)0); - binWriter.Write((UInt64)listId); - - //This seems to Change depending on what the list is for - binWriter.Write((UInt32)listTypeId); - binWriter.Seek(0x40, SeekOrigin.Begin); - - //This is for Linkshell - binWriter.Write((UInt32)0xFFFFFFFF); - binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name)); - - binWriter.Seek(0x64, SeekOrigin.Begin); - - binWriter.Write((UInt32)0x6D); - binWriter.Write((UInt32)0x6D); - binWriter.Write((UInt32)0x6D); - binWriter.Write((UInt32)0x6D); - - binWriter.Write((UInt32)numEntries); - } - } - - return new SubPacket(OPCODE, playerActorID, playerActorID, data); - } - } -} diff --git a/FFXIVClassic Map Server/packets/send/list/ListUtils.cs b/FFXIVClassic Map Server/packets/send/list/ListUtils.cs deleted file mode 100644 index 4f5df931..00000000 --- a/FFXIVClassic Map Server/packets/send/list/ListUtils.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Collections.Generic; - -using FFXIVClassic.Common; - -namespace FFXIVClassic_Map_Server.packets.send.list -{ - class ListUtils - { - - public static List CreateList(uint actorId, uint locationCode, ulong sequenceId, ulong listId, uint listTypeId, List listEntries) - { - List subpacketList = new List(); - subpacketList.Add(ListStartPacket.BuildPacket(actorId, locationCode, sequenceId, listId, listTypeId, listEntries.Count)); - subpacketList.Add(ListBeginPacket.BuildPacket(actorId, locationCode, sequenceId, listId, listEntries.Count)); - subpacketList.Add(ListEntriesEndPacket.BuildPacket(actorId, locationCode, sequenceId, listEntries, 0)); - subpacketList.Add(ListEndPacket.BuildPacket(actorId, locationCode, sequenceId, listId)); - return subpacketList; - } - - public static List CreateRetainerList(uint actorId, uint locationCode, ulong sequenceId, ulong listId, List listEntries) - { - List subpacketList = new List(); - subpacketList.Add(ListStartPacket.BuildPacket(actorId, locationCode, sequenceId, listId, ListStartPacket.TYPEID_RETAINER, listEntries.Count)); - subpacketList.Add(ListBeginPacket.BuildPacket(actorId, locationCode, sequenceId, listId, listEntries.Count)); - subpacketList.Add(ListEntriesEndPacket.BuildPacket(actorId, locationCode, sequenceId, listEntries, 0)); - subpacketList.Add(ListEndPacket.BuildPacket(actorId, locationCode, sequenceId, listId)); - return subpacketList; - } - - public static List CreatePartyList(uint actorId, uint locationCode, ulong sequenceId, ulong listId, List listEntries) - { - List subpacketList = new List(); - subpacketList.Add(ListStartPacket.BuildPacket(actorId, locationCode, sequenceId, listId, ListStartPacket.TYPEID_PARTY, listEntries.Count)); - subpacketList.Add(ListBeginPacket.BuildPacket(actorId, locationCode, sequenceId, listId, listEntries.Count)); - subpacketList.Add(ListEntriesEndPacket.BuildPacket(actorId, locationCode, sequenceId, listEntries, 0)); - subpacketList.Add(ListEndPacket.BuildPacket(actorId, locationCode, sequenceId, listId)); - return subpacketList; - } - - } -} diff --git a/FFXIVClassic Map Server/packets/send/list/SetListPropertyPacket.cs b/FFXIVClassic Map Server/packets/send/list/SetListPropertyPacket.cs deleted file mode 100644 index 4c4b9d85..00000000 --- a/FFXIVClassic Map Server/packets/send/list/SetListPropertyPacket.cs +++ /dev/null @@ -1,183 +0,0 @@ -using FFXIVClassic.Common; -using System; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; - -using FFXIVClassic.Common; - -namespace FFXIVClassic_Map_Server.packets.send.actor -{ - class SetListPropetyPacket - { - public const ushort OPCODE = 0x017A; - public const uint PACKET_SIZE = 0xB0; - - private const ushort MAXBYTES = 0x98; - - private ushort runningByteTotal = 0; - private byte[] data = new byte[PACKET_SIZE - 0x20]; - private bool isMore = false; - - private MemoryStream mem; - private BinaryWriter binWriter; - - public SetListPropetyPacket(ulong listId) - { - mem = new MemoryStream(data); - binWriter = new BinaryWriter(mem); - binWriter.Write((UInt64)listId); - binWriter.Seek(1, SeekOrigin.Current); - } - - public void CloseStreams() - { - binWriter.Dispose(); - mem.Dispose(); - } - - public bool AcceptCallback(uint id, byte value) - { - if (runningByteTotal + 6 > MAXBYTES) - return false; - - binWriter.Write((byte)1); - binWriter.Write((UInt32)id); - binWriter.Write((byte)value); - runningByteTotal+=6; - - return true; - } - - public bool AddShort(uint id, ushort value) - { - if (runningByteTotal + 7 > MAXBYTES) - return false; - - binWriter.Write((byte)2); - binWriter.Write((UInt32)id); - binWriter.Write((UInt16)value); - runningByteTotal+=7; - - return true; - } - - public bool AddInt(uint id, uint value) - { - if (runningByteTotal + 9 > MAXBYTES) - return false; - - binWriter.Write((byte)4); - binWriter.Write((UInt32)id); - binWriter.Write((UInt32)value); - runningByteTotal+=9; - - return true; - } - - public bool AddBuffer(uint id, byte[] buffer) - { - if (runningByteTotal + 5 + buffer.Length > MAXBYTES) - return false; - - binWriter.Write((byte)buffer.Length); - binWriter.Write((UInt32)id); - binWriter.Write(buffer); - runningByteTotal += (ushort)(5 + buffer.Length); - - return true; - } - - public void AddProperty(FFXIVClassic_Map_Server.Actors.Actor actor, string name) - { - string[] split = name.Split('.'); - int arrayIndex = 0; - - if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork"))) - return; - - Object curObj = actor; - for (int i = 0; i < split.Length; i++) - { - //For arrays - if (split[i].Contains('[')) - { - if (split[i].LastIndexOf(']') - split[i].IndexOf('[') <= 0) - return; - - arrayIndex = Convert.ToInt32(split[i].Substring(split[i].IndexOf('[') + 1, split[i].Length - split[i].LastIndexOf(']'))); - split[i] = split[i].Substring(0, split[i].IndexOf('[')); - } - - FieldInfo field = curObj.GetType().GetField(split[i]); - if (field == null) - return; - - curObj = field.GetValue(curObj); - if (curObj == null) - return; - } - - if (curObj == null) - return; - else - { - //Array, we actually care whats inside - if (curObj.GetType().IsArray) - { - if (((Array)curObj).Length <= arrayIndex) - return; - curObj = ((Array)curObj).GetValue(arrayIndex); - } - - if (curObj == null) - return; - - //Cast to the proper object and Add to packet - uint id = Utils.MurmurHash2(name, 0); - if (curObj is bool) - AcceptCallback(id, (byte)(((bool)curObj) ? 1 : 0)); - else if (curObj is byte) - AcceptCallback(id, (byte)curObj); - else if (curObj is ushort) - AddShort(id, (ushort)curObj); - else if (curObj is short) - AddShort(id, (ushort)(short)curObj); - else if (curObj is uint) - AddInt(id, (uint)curObj); - else if (curObj is int) - AddInt(id, (uint)(int)curObj); - else if (curObj is float) - AddBuffer(id, BitConverter.GetBytes((float)curObj)); - else - return; - } - } - - public void SetIsMore(bool flag) - { - isMore = flag; - } - - public void SetTarget(string target) - { - binWriter.Write((byte)(isMore ? 0x62 + target.Length : 0x82 + target.Length)); - binWriter.Write(Encoding.ASCII.GetBytes(target)); - runningByteTotal += (ushort)(1 + Encoding.ASCII.GetByteCount(target)); - - } - - public SubPacket BuildPacket(uint playerActorID, uint actorID) - { - binWriter.Seek(0x8, SeekOrigin.Begin); - binWriter.Write((byte)runningByteTotal); - - CloseStreams(); - - SubPacket packet = new SubPacket(OPCODE, playerActorID, actorID, data); - return packet; - } - - } -}