diff --git a/src/protocol/UnitTest.java b/src/protocol/UnitTest.java new file mode 100644 index 00000000..dbe94365 --- /dev/null +++ b/src/protocol/UnitTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol; + +import java.util.Map; + +import main.NGECore; + +import org.apache.mina.core.buffer.IoBuffer; + +import engine.clientdata.ClientFileManager; +import engine.clientdata.visitors.CrcStringTableVisitor; +import engine.protocol.unitTests.AbstractUnitTest; +import engine.resources.common.Stf; +import engine.resources.objects.SWGObject; + +public abstract class UnitTest extends AbstractUnitTest { + + protected NGECore core; + + protected IoBuffer buffer = null; + + private static CrcStringTableVisitor crcTable = null; + + public UnitTest() { + super(); + core = NGECore.getInstance(); + + if (crcTable == null) { + try { + crcTable = ClientFileManager.loadFile("misc/object_template_crc_string_table.iff", CrcStringTableVisitor.class); + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + } + } + } + + public boolean checkObjectId(long objectId) { + Map map = UnitTests.getObjectIdMap(); + + if (objectId == 0) { + return false; + } + + SWGObject object = core.objectService.getObject(objectId); + + if (object == null) { + return false; + } + + if (map.containsKey(objectId)) { + if (map.get(objectId) == null) { + return false; + } + + if (!object.getClass().getSimpleName().equals(map.get(objectId))) { + return false; + } + } else { + map.put(object.getObjectID(), object.getClass().getSimpleName()); + } + + return true; + } + + public boolean checkString(String string) { + if (string == null) { + return false; + } + + return true; + } + + public boolean checkCrc(int crc) { + if (crcTable != null) { + String template = crcTable.getTemplateString(buffer.getInt()); + + if (template == null || template.length() == 0) { + return false; + } + } + + return true; + } + + public boolean checkStf(IoBuffer buffer, boolean failEmpty) { + Stf stf = new Stf(); + String string; + + string = getAsciiString(buffer); + + if (!checkString(string)) { + return false; + } + + stf.setStfFilename(string); + + if (buffer.getInt() > 0) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string)) { + return false; + } + + stf.setStfName(string); + + if (stf.getStfFilename().length() == 0 || stf.getStfName().length() == 0) { + return !failEmpty; + } + + if (stf.getStfValue() == null) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/UnitTests.java b/src/protocol/UnitTests.java new file mode 100644 index 00000000..497c654f --- /dev/null +++ b/src/protocol/UnitTests.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol; + +import java.util.HashMap; +import java.util.Map; + +import protocol.unitTests.BaselinesMessage; +import protocol.unitTests.ClientPermissionsMessage; +import protocol.unitTests.AccountFeatureBits; +import protocol.unitTests.AddIgnoreMessage; +import protocol.unitTests.AttributeListMessage; +import protocol.unitTests.CharacterCreationDisabled; +import protocol.unitTests.CharacterSheetResponseMessage; +import protocol.unitTests.ClientMfdStatusUpdateMessage; +import protocol.unitTests.ClientRandomNameResponse; +import protocol.unitTests.ClientVerifyAndLockNameResponse; +import protocol.unitTests.CmdSceneReady; +import protocol.unitTests.CmdStartScene; +import protocol.unitTests.CollectionServerFirstListResponse; +import engine.protocol.unitTests.AbstractUnitTest; +import engine.protocol.unitTests.AbstractUnitTests; +import engine.resources.common.CRC; + +public abstract class UnitTests extends AbstractUnitTests { + + private static Map objectIdMap = null; + + static { + Map unitTests = getUnitTests(); + unitTests.put(CRC.StringtoCRC("AccountFeatureBits"), new AccountFeatureBits()); + unitTests.put(CRC.StringtoCRC("AddIgnoreMessage"), new AddIgnoreMessage()); + unitTests.put(CRC.StringtoCRC("AttributeListMessage"), new AttributeListMessage()); + unitTests.put(CRC.StringtoCRC("BaselinesMessage"), new BaselinesMessage()); + unitTests.put(CRC.StringtoCRC("CharacterCreationDisabled"), new CharacterCreationDisabled()); + unitTests.put(CRC.StringtoCRC("CharacterSheetResponseMessage"), new CharacterSheetResponseMessage()); + unitTests.put(CRC.StringtoCRC("ClientMfdStatusUpdate"), new ClientMfdStatusUpdateMessage()); + unitTests.put(CRC.StringtoCRC("ClientPermissionsMessage"), new ClientPermissionsMessage()); + unitTests.put(CRC.StringtoCRC("ClientRandomNameResponse"), new ClientRandomNameResponse()); + unitTests.put(CRC.StringtoCRC("ClientVerifyAndLockNameResponse"), new ClientVerifyAndLockNameResponse()); + unitTests.put(CRC.StringtoCRC("CmdSceneReady"), new CmdSceneReady()); + unitTests.put(CRC.StringtoCRC("CmdStartScene"), new CmdStartScene()); + unitTests.put(CRC.StringtoCRC("CollectionServerFirstListResponse"), new CollectionServerFirstListResponse()); + } + + public static Map getObjectIdMap() { + if (objectIdMap == null) { + objectIdMap = new HashMap(); + } + + return objectIdMap; + } + +} diff --git a/src/protocol/unitTests/AccountFeatureBits.java b/src/protocol/unitTests/AccountFeatureBits.java new file mode 100644 index 00000000..177dee6c --- /dev/null +++ b/src/protocol/unitTests/AccountFeatureBits.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class AccountFeatureBits extends UnitTest { + + public AccountFeatureBits() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length != 22) { + return false; + } + + buffer.skip(6); + + return true; + } + +} diff --git a/src/protocol/unitTests/AddIgnoreMessage.java b/src/protocol/unitTests/AddIgnoreMessage.java new file mode 100644 index 00000000..2dde6aed --- /dev/null +++ b/src/protocol/unitTests/AddIgnoreMessage.java @@ -0,0 +1,86 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class AddIgnoreMessage extends UnitTest { + + public AddIgnoreMessage() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 32 + core.getGalaxyName().length()) { + return false; + } + + buffer.skip(6); + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + String string; + + string = getAsciiString(buffer); + + if (!checkString(string) || !string.equals("SWG")) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string) || !string.equals(core.getGalaxyName())) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string) || core.objectService.getObjectByFirstName(string) == null) { + return false; + } + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/AttributeListMessage.java b/src/protocol/unitTests/AttributeListMessage.java new file mode 100644 index 00000000..5095446a --- /dev/null +++ b/src/protocol/unitTests/AttributeListMessage.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class AttributeListMessage extends UnitTest { + + public AttributeListMessage() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 24) { + return false; + } + + buffer.skip(6); + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + if (buffer.getShort() != 0) { + return false; + } + + for (int i = 0; i < buffer.getInt(); i++) { + if (!checkString(getAsciiString(buffer))) { + return false; + } + + if (!checkString(getUnicodeString(buffer))) { + return false; + } + } + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/BaselinesMessage.java b/src/protocol/unitTests/BaselinesMessage.java new file mode 100644 index 00000000..6b4ba60c --- /dev/null +++ b/src/protocol/unitTests/BaselinesMessage.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class BaselinesMessage extends UnitTest { + + public BaselinesMessage() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 25) { + return false; + } + + buffer.skip(6); + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + try { + if (!((Boolean) Class.forName("protocol.unitTests.baselines." + (new StringBuilder(new String(buffer.flip().array(), 14, 4, "US-ASCII"))).reverse().toString() + buffer.skip(18).get()).getMethod("isValid", new Class[] { IoBuffer.class }).invoke(null, new Object[] { buffer.flip() }))) { + return false; + } + } catch (Exception e) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/CharacterCreationDisabled.java b/src/protocol/unitTests/CharacterCreationDisabled.java new file mode 100644 index 00000000..cade772d --- /dev/null +++ b/src/protocol/unitTests/CharacterCreationDisabled.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CharacterCreationDisabled extends UnitTest { + + public CharacterCreationDisabled() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 10) { + return false; + } + + buffer.skip(6); + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/CharacterSheetResponseMessage.java b/src/protocol/unitTests/CharacterSheetResponseMessage.java new file mode 100644 index 00000000..74b50083 --- /dev/null +++ b/src/protocol/unitTests/CharacterSheetResponseMessage.java @@ -0,0 +1,100 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CharacterSheetResponseMessage extends UnitTest { + + public CharacterSheetResponseMessage() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 66) { + return false; + } + + buffer.skip(6); + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.getInt() != 0) { + return false; + } + + buffer.skip(12); + + String string; + + string = getAsciiString(buffer); + + if (!checkString(string) || (string.length() > 0 && core.terrainService.getPlanetByName(string) == null)) { + return false; + } + + buffer.skip(12); + + string = getAsciiString(buffer); + + if (!checkString(string) || (string.length() > 0 && core.terrainService.getPlanetByName(string) == null)) { + return false; + } + + buffer.skip(12); + + string = getAsciiString(buffer); + + if (!checkString(string) || (string.length() > 0 && core.terrainService.getPlanetByName(string) == null)) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string)) { + return false; + } + + string = getUnicodeString(buffer); + + if (!checkString(string)) { + return false; + } + + if (buffer.getInt() > 10) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/ClientMfdStatusUpdateMessage.java b/src/protocol/unitTests/ClientMfdStatusUpdateMessage.java new file mode 100644 index 00000000..1f8151d3 --- /dev/null +++ b/src/protocol/unitTests/ClientMfdStatusUpdateMessage.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class ClientMfdStatusUpdateMessage extends UnitTest { + + public ClientMfdStatusUpdateMessage() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 14) { + return false; + } + + buffer.skip(10); + + if (!checkString(getUnicodeString(buffer))) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/ClientPermissionsMessage.java b/src/protocol/unitTests/ClientPermissionsMessage.java new file mode 100644 index 00000000..a5870b5f --- /dev/null +++ b/src/protocol/unitTests/ClientPermissionsMessage.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class ClientPermissionsMessage extends UnitTest { + + public ClientPermissionsMessage() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length != 10) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/ClientRandomNameResponse.java b/src/protocol/unitTests/ClientRandomNameResponse.java new file mode 100644 index 00000000..37c82e71 --- /dev/null +++ b/src/protocol/unitTests/ClientRandomNameResponse.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class ClientRandomNameResponse extends UnitTest { + + public ClientRandomNameResponse() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 20) { + return false; + } + + buffer.skip(6); + + String string; + + string = getAsciiString(buffer); + + if (!checkString(string) || !string.startsWith("object/creature/player/")) { + return false; + } + + string = getUnicodeString(buffer); + + if (!checkString(string) || string.length() == 0) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string) || !string.equals("ui")) { + return false; + } + + if (buffer.getInt() != 0) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string) || !string.equals("name_approved")) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/ClientVerifyAndLockNameResponse.java b/src/protocol/unitTests/ClientVerifyAndLockNameResponse.java new file mode 100644 index 00000000..1b5ed137 --- /dev/null +++ b/src/protocol/unitTests/ClientVerifyAndLockNameResponse.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class ClientVerifyAndLockNameResponse extends UnitTest { + + public ClientVerifyAndLockNameResponse() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 33) { + return false; + } + + buffer.skip(6); + + String string; + + string = getUnicodeString(buffer); + + if (!checkString(string) || string.length() == 0 || string.contains(" ")) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string) || !string.equals("ui")) { + return false; + } + + if (buffer.getInt() != 0) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string) || !string.equals("approved_flag")) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/CmdSceneReady.java b/src/protocol/unitTests/CmdSceneReady.java new file mode 100644 index 00000000..21a29b7b --- /dev/null +++ b/src/protocol/unitTests/CmdSceneReady.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CmdSceneReady extends UnitTest { + + public CmdSceneReady() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length != 6) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/CmdStartScene.java b/src/protocol/unitTests/CmdStartScene.java new file mode 100644 index 00000000..02fab45a --- /dev/null +++ b/src/protocol/unitTests/CmdStartScene.java @@ -0,0 +1,82 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CmdStartScene extends UnitTest { + + public CmdStartScene() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 47) { + return false; + } + + buffer.skip(6); + + if (buffer.get() > 1) { + return false; + } + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + String string; + + string = getAsciiString(buffer); + + if (!checkString(string) || core.terrainService.getPlanetByPath(string) == null) { + return false; + } + + buffer.skip(16); + + string = getAsciiString(buffer); + + if (!checkString(string) || !string.startsWith("object/creature/player/")) { + return false; + } + + if (buffer.getLong() < core.getGalacticTime()) { + return false; + } + + if (buffer.getInt() != 0x8EB5EA4E) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/CollectionServerFirstListResponse.java b/src/protocol/unitTests/CollectionServerFirstListResponse.java new file mode 100644 index 00000000..8011629c --- /dev/null +++ b/src/protocol/unitTests/CollectionServerFirstListResponse.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CollectionServerFirstListResponse extends UnitTest { + + public CollectionServerFirstListResponse() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 12) { + return false; + } + + buffer.skip(6); + + if (buffer.get() > 1) { + return false; + } + + String string; + + string = getAsciiString(buffer); + + if (!checkString(string) || string.equals(core.getGalaxyName())) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/ErrorMessage.java b/src/protocol/unitTests/ErrorMessage.java new file mode 100644 index 00000000..cfb0d818 --- /dev/null +++ b/src/protocol/unitTests/ErrorMessage.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class ErrorMessage extends UnitTest { + + public ErrorMessage() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + if (length < 11) { + return false; + } + + String string; + + string = getAsciiString(buffer); + + if (!checkString(string) || string.length() == 0) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string) || string.length() == 0) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/CREO1.java b/src/protocol/unitTests/baselines/CREO1.java new file mode 100644 index 00000000..b4639e21 --- /dev/null +++ b/src/protocol/unitTests/baselines/CREO1.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CREO1 extends UnitTest { + + public CREO1() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 4) { + return false; + } + + buffer.skip(8); + + if (buffer.getInt() != 6) { + return false; + } + + buffer.skip(8); + + if (buffer.getInt() != 0) { + return false; + } + + buffer.skip(4); + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.getInt() != 300) { + return false; + } + + if (buffer.getInt() != 0) { + return false; + } + + int skillSetSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < skillSetSize; i++) { + if (!checkString(getAsciiString(buffer))) { + return false; + } + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/CREO3.java b/src/protocol/unitTests/baselines/CREO3.java new file mode 100644 index 00000000..651fea83 --- /dev/null +++ b/src/protocol/unitTests/baselines/CREO3.java @@ -0,0 +1,126 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CREO3 extends UnitTest { + + public CREO3() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 19) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, true)) { + return false; + } + + String string; + + string = getUnicodeString(buffer); + + if (!checkString(string)) { + return false; + } + + if (buffer.getInt() != 1) { + return false; + } + + if (core.factionService.getName(buffer.getInt()) == null) { + return false; + } + + if (buffer.getInt() > 2) { + return false; + } + + buffer.skip(buffer.getShort()); + + int componentCustomizationSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < componentCustomizationSize; i++) { + checkCrc(buffer.getInt()); + } + + buffer.skip(4); + + if (buffer.getInt() > 10) { + return false; + } + + buffer.skip(4); + + if (buffer.getInt() == 0) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + if (buffer.get() > 14){ + return false; + } + + if (buffer.get() > 21) { + return false; + } + + if (checkObjectId(buffer.getLong())) { + return false; + } + + float height = buffer.getFloat(); + + if (height == 0 || height > 10) { + return false; + } + + buffer.skip(12); + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/CREO4.java b/src/protocol/unitTests/baselines/CREO4.java new file mode 100644 index 00000000..33f9075b --- /dev/null +++ b/src/protocol/unitTests/baselines/CREO4.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CREO4 extends UnitTest { + + public CREO4() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 16) { + return false; + } + + buffer.skip(8); + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.getInt() != 0) { + return false; + } + + int skillModListSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < skillModListSize; i++) { + if (buffer.get() != 0) { + return false; + } + + if (!checkString(getAsciiString(buffer))) { + return false; + } + + buffer.skip(8); + } + + buffer.skip(0); + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + buffer.skip(24); + + if (buffer.getInt() > 0) { + return false; + } + + if (buffer.getInt() > 0) { + return false; + } + + buffer.skip(4); + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/CREO6.java b/src/protocol/unitTests/baselines/CREO6.java new file mode 100644 index 00000000..d49de0c4 --- /dev/null +++ b/src/protocol/unitTests/baselines/CREO6.java @@ -0,0 +1,392 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CREO6 extends UnitTest { + + public CREO6() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 35) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, false)) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + int unknownSetSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < unknownSetSize; i++) { + if (!checkObjectId(buffer.getLong())) { + return false; + } + } + + buffer.skip(28); + + if (buffer.getShort() > 500) { + return false; + } + + if (buffer.getInt() > 2000) { + return false; + } + + String string; + + string = getAsciiString(buffer); + + if (!checkString(string)) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string)) { + return false; + } + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + string = getAsciiString(buffer); + + if (!checkString(string)) { + return false; + } + + buffer.skip(8); + + if (core.guildService.getGuildById(buffer.getInt()) == null) { + return false; + } + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + buffer.skip(9); + + if (buffer.getInt() != 6) { + return false; + } + + buffer.skip(8); + + if (buffer.getInt() != 0) { + return false; + } + + buffer.skip(4); + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.getInt() != 300) { + return false; + } + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.getInt() != 6) { + return false; + } + + buffer.skip(8); + + if (buffer.getInt() != 0) { + return false; + } + + buffer.skip(4); + + if (buffer.getInt() != 0) { + return false; + } + + if (buffer.getInt() != 300) { + return false; + } + + if (buffer.getInt() != 0) { + return false; + } + + int equipmentListSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < equipmentListSize; i++) { + buffer.skip(buffer.getShort()); + buffer.skip(4); + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + if (!checkCrc(buffer.getInt())) { + return false; + } + + if (buffer.get() == 1) { + if (buffer.getShort() != 20) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, true)) { + return false; + } + + string = getUnicodeString(buffer); + + if (!checkString(string)) { + return false; + } + + if (buffer.getInt() > 1) { + return false; + } + + if (buffer.getInt() > 0) { + return false; + } + + if (buffer.getInt() > 0) { + return false; + } + + buffer.skip(buffer.getShort()); + + int componentCustomizationSize = buffer.getInt(); + + buffer.skip(4); + + for (int n = 0; n < componentCustomizationSize; n++) { + checkCrc(buffer.getInt()); + } + + buffer.skip(12); + + if (buffer.get() > 1) { + return false; + } + + buffer.skip(28); + + if (buffer.getShort() != 9) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, true)) { + return false; + } + + buffer.skip(41); + } + } + + string = getAsciiString(buffer); + + if (!checkString(string)) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + int buffListSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < buffListSize; i++) { + int hasCrc = buffer.get(); + + if (hasCrc > 1) { + return false; + } + + buffer.skip(4); + + if (hasCrc == 1 && !checkCrc(buffer.getInt())) { + return false; + } + + buffer.skip(12); + } + + if (buffListSize > 1) { + buffer.skip(4); + } + + if (buffer.get() > 1) { + return false; + } + + if (buffer.get() > 2) { + return false; + } + + buffer.skip(4); + + if (buffer.get() > 1) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + int appearanceEquipmentListSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < appearanceEquipmentListSize; i++) { + buffer.skip(buffer.getShort()); + buffer.skip(4); + + if (!checkObjectId(buffer.getLong())) { + return false; + } + + if (!checkCrc(buffer.getInt())) { + return false; + } + + if (buffer.get() == 1) { + if (buffer.getShort() != 20) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, true)) { + return false; + } + + string = getUnicodeString(buffer); + + if (!checkString(string)) { + return false; + } + + if (buffer.getInt() > 1) { + return false; + } + + if (buffer.getInt() > 0) { + return false; + } + + if (buffer.getInt() > 0) { + return false; + } + + buffer.skip(buffer.getShort()); + + int componentCustomizationSize = buffer.getInt(); + + buffer.skip(4); + + for (int n = 0; n < componentCustomizationSize; n++) { + checkCrc(buffer.getInt()); + } + + buffer.skip(12); + + if (buffer.get() > 1) { + return false; + } + + buffer.skip(28); + + if (buffer.getShort() != 9) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, true)) { + return false; + } + + buffer.skip(41); + } + } + + buffer.skip(8); + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/CREO8.java b/src/protocol/unitTests/baselines/CREO8.java new file mode 100644 index 00000000..cd545707 --- /dev/null +++ b/src/protocol/unitTests/baselines/CREO8.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CREO8 extends UnitTest { + + public CREO8() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/CREO9.java b/src/protocol/unitTests/baselines/CREO9.java new file mode 100644 index 00000000..5e6855f1 --- /dev/null +++ b/src/protocol/unitTests/baselines/CREO9.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class CREO9 extends UnitTest { + + public CREO9() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/TANO3.java b/src/protocol/unitTests/baselines/TANO3.java new file mode 100644 index 00000000..ad2804a7 --- /dev/null +++ b/src/protocol/unitTests/baselines/TANO3.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class TANO3 extends UnitTest { + + public TANO3() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 13) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, true)) { + return false; + } + + String string; + + string = getUnicodeString(buffer); + + if (!checkString(string)) { + return false; + } + + if (buffer.getInt() != 1) { + return false; + } + + if (core.factionService.getName(buffer.getInt()) == null) { + return false; + } + + if (buffer.getInt() > 2) { + return false; + } + + buffer.skip(buffer.getShort()); + + int componentCustomizationSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < componentCustomizationSize; i++) { + checkCrc(buffer.getInt()); + } + + buffer.skip(4); + + if (buffer.getInt() > 10) { + return false; + } + + buffer.skip(4); + + if (buffer.getInt() == 0) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/TANO6.java b/src/protocol/unitTests/baselines/TANO6.java new file mode 100644 index 00000000..2ee4517d --- /dev/null +++ b/src/protocol/unitTests/baselines/TANO6.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class TANO6 extends UnitTest { + + public TANO6() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 8) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, false)) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + int unknownSetSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < unknownSetSize; i++) { + if (!checkObjectId(buffer.getLong())) { + return false; + } + } + + buffer.skip(28); + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/TANO8.java b/src/protocol/unitTests/baselines/TANO8.java new file mode 100644 index 00000000..55ecbbd7 --- /dev/null +++ b/src/protocol/unitTests/baselines/TANO8.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class TANO8 extends UnitTest { + + public TANO8() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/TANO9.java b/src/protocol/unitTests/baselines/TANO9.java new file mode 100644 index 00000000..731ba1af --- /dev/null +++ b/src/protocol/unitTests/baselines/TANO9.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class TANO9 extends UnitTest { + + public TANO9() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/WEAO3.java b/src/protocol/unitTests/baselines/WEAO3.java new file mode 100644 index 00000000..6779426b --- /dev/null +++ b/src/protocol/unitTests/baselines/WEAO3.java @@ -0,0 +1,132 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class WEAO3 extends UnitTest { + + public WEAO3() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 20) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, true)) { + return false; + } + + String string; + + string = getUnicodeString(buffer); + + if (!checkString(string)) { + return false; + } + + if (buffer.getInt() != 1) { + return false; + } + + if (core.factionService.getName(buffer.getInt()) == null) { + return false; + } + + if (buffer.getInt() > 2) { + return false; + } + + buffer.skip(buffer.getShort()); + + int componentCustomizationSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < componentCustomizationSize; i++) { + checkCrc(buffer.getInt()); + } + + buffer.skip(4); + + if (buffer.getInt() > 10) { + return false; + } + + buffer.skip(4); + + if (buffer.getInt() == 0) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + if (buffer.getFloat() > 10.0f) { + return false; + } + + if (buffer.getInt() > 0) { + return false; + } + + if (buffer.getInt() > 0) { + return false; + } + + if (buffer.getInt() > 20000) { + return false; + } + + if (buffer.getInt() > 0) { + return false; + } + + buffer.skip(4); + + if (buffer.getInt() > 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/WEAO6.java b/src/protocol/unitTests/baselines/WEAO6.java new file mode 100644 index 00000000..12d48512 --- /dev/null +++ b/src/protocol/unitTests/baselines/WEAO6.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class WEAO6 extends UnitTest { + + public WEAO6() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 9) { + return false; + } + + buffer.skip(4); + + if (!checkStf(buffer, false)) { + return false; + } + + if (buffer.get() > 1) { + return false; + } + + int unknownSetSize = buffer.getInt(); + + buffer.skip(4); + + for (int i = 0; i < unknownSetSize; i++) { + if (!checkObjectId(buffer.getLong())) { + return false; + } + } + + buffer.skip(28); + + if (buffer.getInt() > 13) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/WEAO8.java b/src/protocol/unitTests/baselines/WEAO8.java new file mode 100644 index 00000000..5909f21d --- /dev/null +++ b/src/protocol/unitTests/baselines/WEAO8.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class WEAO8 extends UnitTest { + + public WEAO8() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/protocol/unitTests/baselines/WEAO9.java b/src/protocol/unitTests/baselines/WEAO9.java new file mode 100644 index 00000000..dc2606c7 --- /dev/null +++ b/src/protocol/unitTests/baselines/WEAO9.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.unitTests.baselines; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.UnitTest; + +public class WEAO9 extends UnitTest { + + public WEAO9() { + super(); + } + + public boolean isValid(IoBuffer buffer) { + int length = buffer.array().length; + + buffer.skip(19); + + if (buffer.getInt() != (length - 23)) { + return false; + } + + if (buffer.getShort() != 0) { + return false; + } + + if (buffer.position() < length) { + return false; + } + + return true; + } + +} diff --git a/src/resources/common/Opcodes.java b/src/resources/common/Opcodes.java index 8a8cc6d8..c7bced7c 100644 --- a/src/resources/common/Opcodes.java +++ b/src/resources/common/Opcodes.java @@ -25,71 +25,70 @@ import engine.resources.common.CRC; public class Opcodes { - public static int AuctionQueryHeadersMessage = CRC.StringtoCRC("AuctionQueryHeadersMessage"); - public static int CreateImmediateAuctionMessage = CRC.StringtoCRC("CreateImmediateAuctionMessage"); - public static int ChatLeaveRoom = 0x493E3FFA; - public static int ChatEnterRoomById = CRC.StringtoCRC("ChatEnterRoomById"); - public static int ChatSendToRoom = CRC.StringtoCRC("ChatSendToRoom"); - public static int ChatDeletePersistentMessage = 0x8F251641; - public static int ChatInstantMessageToCharacter = 0x84BB21F7; - public static int ChatPersistentMessageToServer = 0x25A29FA6; - public static int ChatRequestPersistentMessage = 0x07E3559F; - public static int ChatRequestRoomList = 0x4C3D2CFA; - public static int ChatSystemMessage = CRC.StringtoCRC("ChatSystemMessage"); - public static int ClientOpenContainerMessage = 0x2D2D6EE1; - public static int CommoditiesItemTypeListRequest = 0x48F493C5; - public static int CommoditiesResourceTypeListRequest = 0xCB1AE82D; - public static int NewbieTutorialResponse = 0xCA88FBAD; - public static int CmdSceneReady = 0x43FD1C22; - public static int ConnectPlayerMessage = 0x2E365218; - public static int ClientCreateCharacter = 0xB97F3074; - public static int ClientIdMsg = 0xD5899226; - public static int ClientRandomNameRequest = 0xD6D1B6D1; - public static int ClientVerifyAndLockNameRequest = 0x9eb04b9f; - public static int DeleteCharacterMessage = 0xE87AD031; - public static int GetMapLocationsMessage = 0x1A7AB839; - public static int IsVendorOwnerMessage = CRC.StringtoCRC("IsVendorOwnerMessage"); - public static int LagRequest = 0x31805EE0; - public static int LoginClientId = 0x41131F96; - public static int ObjControllerMessage = 0x80CE5E46; - public static int ObjectMenuSelectMessage = 0x7CA18726; - public static int RequestGalaxyLoopTimes = 0x7D842D68; - public static int SelectCharacter = 0xB5098D76; - public static int SuiEventNotification = 0x092D3564; - public static int BaselinesMessage = CRC.StringtoCRC("BaselinesMessage"); - public static int DeltasMessage = CRC.StringtoCRC("DeltasMessage"); - public static int ChatAddFriend = 0x6FE7BD90; - public static int GcwRegionsReq = CRC.StringtoCRC("GcwRegionsReq"); - public static int GcwRegionsRsp = CRC.StringtoCRC("GcwRegionsRsp"); - public static int GcwGroupsRsp = CRC.StringtoCRC("GcwGroupsRsp"); - public static int ExpertiseRequestMessage = 0xC19085D5; - public static int ClientMfdStatusUpdateMessage = CRC.StringtoCRC("ClientMdfStatusUpdateMessage"); - public static int PlayMusicMessage = CRC.StringtoCRC("PlayMusicMessage"); - public static int PlanetTravelPointListRequest = 0x96405D4D; - public static int FactionRequestMessage = CRC.StringtoCRC("FactionRequestMessage"); - public static int FactionResponseMessage = CRC.StringtoCRC("FactionResponseMessage"); - public static int SetWaypointColor = CRC.StringtoCRC("SetWaypointColor"); - public static int GuildRequestMessage = CRC.StringtoCRC("GuildRequestMessage"); - public static int PlayerMoneyRequest = CRC.StringtoCRC("PlayerMoneyRequest"); - public static int LagReport = CRC.StringtoCRC("LagReport"); - public static int GetSpecificMapLocationsMessage = CRC.StringtoCRC("GetSpecificMapLocationsMessage"); - public static int SetCombatSpamFilter = CRC.StringtoCRC("SetCombatSpamFilter"); - public static int SetCombatSpamRangeFilter = CRC.StringtoCRC("SetCombatSpamRangeFilter"); - public static int SetLfgInterests = CRC.StringtoCRC("SetLfgInterests"); - public static int SetFurnitureRoationDegree = CRC.StringtoCRC("SetFurnitureRotationDegree"); - public static int SetJediSlotInfo = CRC.StringtoCRC("SetJediSlotInfo"); - public static int CollectionServerFirstListRequest = CRC.StringtoCRC("CollectionServerFirstListRequest"); - public static int ShowHelmet = CRC.StringtoCRC("ShowHelmet"); - public static int ShowBackpack = CRC.StringtoCRC("ShowBackpack"); - public static int CreateAuctionMessage = CRC.StringtoCRC("CreateAuctionMessage"); - public static int ChatOnEnteredRoom = CRC.StringtoCRC("ChatOnEnteredRoom"); - public static int ChatCreateRoom = CRC.StringtoCRC("ChatCreateRoom"); - public static int ChatQueryRoom = 0x9CF2B192; - public static int Unknown = 0x173B91C2; // packet sent to server on every character load-in - public static int GetAuctionDetails = CRC.StringtoCRC("GetAuctionDetails"); - public static int CancelLiveAuctionMessage = CRC.StringtoCRC("CancelLiveAuctionMessage"); - public static int BidAuctionMessage = CRC.StringtoCRC("BidAuctionMessage"); - public static int RetrieveAuctionItemMessage = CRC.StringtoCRC("RetrieveAuctionItemMessage"); - - + public static final int AuctionQueryHeadersMessage = CRC.StringtoCRC("AuctionQueryHeadersMessage"); + public static final int CreateImmediateAuctionMessage = CRC.StringtoCRC("CreateImmediateAuctionMessage"); + public static final int ChatLeaveRoom = 0x493E3FFA; + public static final int ChatEnterRoomById = CRC.StringtoCRC("ChatEnterRoomById"); + public static final int ChatSendToRoom = CRC.StringtoCRC("ChatSendToRoom"); + public static final int ChatDeletePersistentMessage = 0x8F251641; + public static final int ChatInstantMessageToCharacter = 0x84BB21F7; + public static final int ChatPersistentMessageToServer = 0x25A29FA6; + public static final int ChatRequestPersistentMessage = 0x07E3559F; + public static final int ChatRequestRoomList = 0x4C3D2CFA; + public static final int ChatSystemMessage = CRC.StringtoCRC("ChatSystemMessage"); + public static final int ClientOpenContainerMessage = 0x2D2D6EE1; + public static final int CommoditiesItemTypeListRequest = 0x48F493C5; + public static final int CommoditiesResourceTypeListRequest = 0xCB1AE82D; + public static final int NewbieTutorialResponse = 0xCA88FBAD; + public static final int CmdSceneReady = 0x43FD1C22; + public static final int ConnectPlayerMessage = 0x2E365218; + public static final int ClientCreateCharacter = 0xB97F3074; + public static final int ClientIdMsg = 0xD5899226; + public static final int ClientRandomNameRequest = 0xD6D1B6D1; + public static final int ClientVerifyAndLockNameRequest = 0x9eb04b9f; + public static final int DeleteCharacterMessage = 0xE87AD031; + public static final int GetMapLocationsMessage = 0x1A7AB839; + public static final int IsVendorOwnerMessage = CRC.StringtoCRC("IsVendorOwnerMessage"); + public static final int LagRequest = 0x31805EE0; + public static final int LoginClientId = 0x41131F96; + public static final int ObjControllerMessage = 0x80CE5E46; + public static final int ObjectMenuSelectMessage = 0x7CA18726; + public static final int RequestGalaxyLoopTimes = 0x7D842D68; + public static final int SelectCharacter = 0xB5098D76; + public static final int SuiEventNotification = 0x092D3564; + public static final int BaselinesMessage = 0x68A75F0C; + public static final int DeltasMessage = 0x12862153; + public static final int ChatAddFriend = 0x6FE7BD90; + public static final int GcwRegionsReq = CRC.StringtoCRC("GcwRegionsReq"); + public static final int GcwRegionsRsp = CRC.StringtoCRC("GcwRegionsRsp"); + public static final int GcwGroupsRsp = CRC.StringtoCRC("GcwGroupsRsp"); + public static final int ExpertiseRequestMessage = 0xC19085D5; + public static final int ClientMfdStatusUpdateMessage = CRC.StringtoCRC("ClientMdfStatusUpdateMessage"); + public static final int PlayMusicMessage = CRC.StringtoCRC("PlayMusicMessage"); + public static final int PlanetTravelPointListRequest = 0x96405D4D; + public static final int FactionRequestMessage = CRC.StringtoCRC("FactionRequestMessage"); + public static final int FactionResponseMessage = CRC.StringtoCRC("FactionResponseMessage"); + public static final int SetWaypointColor = CRC.StringtoCRC("SetWaypointColor"); + public static final int GuildRequestMessage = CRC.StringtoCRC("GuildRequestMessage"); + public static final int PlayerMoneyRequest = CRC.StringtoCRC("PlayerMoneyRequest"); + public static final int LagReport = CRC.StringtoCRC("LagReport"); + public static final int GetSpecificMapLocationsMessage = CRC.StringtoCRC("GetSpecificMapLocationsMessage"); + public static final int SetCombatSpamFilter = CRC.StringtoCRC("SetCombatSpamFilter"); + public static final int SetCombatSpamRangeFilter = CRC.StringtoCRC("SetCombatSpamRangeFilter"); + public static final int SetLfgInterests = CRC.StringtoCRC("SetLfgInterests"); + public static final int SetFurnitureRoationDegree = CRC.StringtoCRC("SetFurnitureRotationDegree"); + public static final int SetJediSlotInfo = CRC.StringtoCRC("SetJediSlotInfo"); + public static final int CollectionServerFirstListRequest = CRC.StringtoCRC("CollectionServerFirstListRequest"); + public static final int ShowHelmet = CRC.StringtoCRC("ShowHelmet"); + public static final int ShowBackpack = CRC.StringtoCRC("ShowBackpack"); + public static final int CreateAuctionMessage = CRC.StringtoCRC("CreateAuctionMessage"); + public static final int ChatOnEnteredRoom = CRC.StringtoCRC("ChatOnEnteredRoom"); + public static final int ChatCreateRoom = CRC.StringtoCRC("ChatCreateRoom"); + public static final int ChatQueryRoom = 0x9CF2B192; + public static final int Unknown = 0x173B91C2; // packet sent to server on every character load-in + public static final int GetAuctionDetails = CRC.StringtoCRC("GetAuctionDetails"); + public static final int CancelLiveAuctionMessage = CRC.StringtoCRC("CancelLiveAuctionMessage"); + public static final int BidAuctionMessage = CRC.StringtoCRC("BidAuctionMessage"); + public static final int RetrieveAuctionItemMessage = CRC.StringtoCRC("RetrieveAuctionItemMessage"); + }