mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-20 10:03:02 -04:00
Added missing encode and decode methods to some SWGPackets and refactored SWGPacket's CRC field to be set through a string
This commit is contained in:
@@ -80,6 +80,11 @@ public class Packet {
|
||||
}
|
||||
|
||||
public static void addList(ByteBuffer bb, Collection<? extends Encodable> list) {
|
||||
if (list == null) {
|
||||
addInt(bb, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
addInt(bb, list.size());
|
||||
for (Encodable encodable : list) {
|
||||
addData(bb, encodable.encode());
|
||||
@@ -237,7 +242,7 @@ public class Packet {
|
||||
int size = getInt(bb);
|
||||
|
||||
if (size <= 0)
|
||||
return null;
|
||||
return new ArrayList<>();
|
||||
|
||||
try {
|
||||
for (int i = 0; i < size; i++) {
|
||||
|
||||
Reference in New Issue
Block a user