2016-06-08 22:29:04 +01:00
|
|
|
|
using System.Collections.Generic;
|
2015-12-29 01:20:46 -05:00
|
|
|
|
|
2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
|
2015-12-29 01:20:46 -05:00
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.list
|
|
|
|
|
{
|
|
|
|
|
class ListUtils
|
|
|
|
|
{
|
|
|
|
|
|
2016-06-14 21:29:10 +01:00
|
|
|
|
public static List<SubPacket> CreateList(uint actorId, uint locationCode, ulong sequenceId, ulong listId, uint listTypeId, List<ListEntry> listEntries)
|
2015-12-29 01:20:46 -05:00
|
|
|
|
{
|
|
|
|
|
List<SubPacket> subpacketList = new List<SubPacket>();
|
2016-06-14 21:29:10 +01:00
|
|
|
|
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));
|
2015-12-29 01:20:46 -05:00
|
|
|
|
return subpacketList;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-14 21:29:10 +01:00
|
|
|
|
public static List<SubPacket> CreateRetainerList(uint actorId, uint locationCode, ulong sequenceId, ulong listId, List<ListEntry> listEntries)
|
2015-12-29 01:20:46 -05:00
|
|
|
|
{
|
|
|
|
|
List<SubPacket> subpacketList = new List<SubPacket>();
|
2016-06-14 21:29:10 +01:00
|
|
|
|
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));
|
2015-12-29 01:20:46 -05:00
|
|
|
|
return subpacketList;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-14 21:29:10 +01:00
|
|
|
|
public static List<SubPacket> CreatePartyList(uint actorId, uint locationCode, ulong sequenceId, ulong listId, List<ListEntry> listEntries)
|
2015-12-29 01:20:46 -05:00
|
|
|
|
{
|
|
|
|
|
List<SubPacket> subpacketList = new List<SubPacket>();
|
2016-06-14 21:29:10 +01:00
|
|
|
|
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));
|
2015-12-29 01:20:46 -05:00
|
|
|
|
return subpacketList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|