├── .editorconfig ├── .gitignore ├── AIO Sandbox.sln ├── Common ├── Commands │ ├── CommandHelpAttribute.cs │ ├── CommandManager.cs │ └── Commands.cs ├── Common.csproj ├── Constants │ ├── AreaTriggers.cs │ ├── CharacterData.cs │ ├── Emotes.cs │ ├── Enums.cs │ ├── Opcodes.cs │ └── Worldports.cs ├── Cryptography │ ├── ARC4.cs │ ├── Authenticator.cs │ ├── BigInteger.cs │ ├── HMAC.cs │ └── PacketCrypt.cs ├── Extensions │ ├── CharacterExtensions.cs │ ├── Extensions.cs │ └── HandlerExtensions.cs ├── IniParser.cs ├── Interfaces │ ├── Handlers │ │ ├── IAuthHandler.cs │ │ ├── ICharHandler.cs │ │ └── IWorldHandler.cs │ ├── ICharacter.cs │ ├── IOpcodes.cs │ ├── IPacketReader.cs │ ├── IPacketWriter.cs │ ├── ISandbox.cs │ └── IWorldManager.cs ├── Logging │ └── Log.cs ├── Network │ ├── BasePacketReader.cs │ ├── BasePacketWriter.cs │ ├── BitPacker.cs │ ├── BitUnpacker.cs │ └── PacketManager.cs ├── Properties │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ ├── AreaTriggers.csv │ └── Worldports.csv └── Structs │ ├── Account.cs │ ├── BaseCharacter.cs │ └── Location.cs ├── LICENSE ├── Plugins ├── Alpha_3368 │ ├── Alpha_3368.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Alpha_3494 │ ├── Alpha_3494.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Beta_3592 │ ├── Beta_3592.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Beta_3694 │ ├── Beta_3694.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Beta_3734 │ ├── Beta_3734.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Beta_3807 │ ├── Beta_3807.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Beta_3892 │ ├── Beta_3892.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Beta_3988 │ ├── Beta_3988.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Cata_11927 │ ├── Cata_11927.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Cata_12025 │ ├── Cata_12025.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── Cata_12122 │ ├── Cata_12122.csproj │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── MoP_15464 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── MoP_15464.csproj │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ └── Sandbox.cs ├── TBC_5610 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_5610.csproj ├── TBC_5665 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_5665.csproj ├── TBC_5894 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_5894.csproj ├── TBC_5965 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_5965.csproj ├── TBC_6082 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_6082.csproj ├── TBC_6178 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_6178.csproj ├── TBC_6180 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_6180.csproj ├── TBC_6213 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_6213.csproj ├── TBC_6577 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_6577.csproj ├── TBC_7561 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_7561.csproj ├── TBC_8089 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── TBC_8089.csproj ├── Vanilla_4062 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_4062.csproj ├── Vanilla_4284 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_4284.csproj ├── Vanilla_4341 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_4341.csproj ├── Vanilla_4500 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_4500.csproj ├── Vanilla_4671 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_4671.csproj ├── Vanilla_4735 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_4735.csproj ├── Vanilla_4937 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_4937.csproj ├── Vanilla_5195 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_5195.csproj ├── Vanilla_5428 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_5428.csproj ├── Vanilla_5595 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── Vanilla_5595.csproj ├── WotLK_10026 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── WotLK_10026.csproj ├── WotLK_10958 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── WotLK_10958.csproj ├── WotLK_11685 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── WotLK_11685.csproj ├── WotLK_8303 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── WotLK_8303.csproj ├── WotLK_8874 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── WotLK_8874.csproj ├── WotLK_9056 │ ├── Character.cs │ ├── Handlers │ │ ├── AuthHandler.cs │ │ ├── CharHandler.cs │ │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── WotLK_9056.csproj └── WotLK_9614 │ ├── Character.cs │ ├── Handlers │ ├── AuthHandler.cs │ ├── CharHandler.cs │ └── WorldHandler.cs │ ├── Opcodes.cs │ ├── PacketReader.cs │ ├── PacketWriter.cs │ ├── Sandbox.cs │ └── WotLK_9614.csproj ├── README.md └── WorldServer ├── Network ├── RealmManager.cs ├── RealmSocket.cs ├── WorldManager.cs └── WorldSocket.cs ├── Packets └── HandlerDefinitions.cs ├── Plugins └── PluginHandler.cs ├── SandboxHost.cs ├── WorldServer.cs ├── WorldServer.csproj ├── favicon.ico └── settings.conf /Common/Commands/CommandHelpAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Common.Commands 4 | { 5 | [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)] 6 | public class CommandHelpAttribute : Attribute 7 | { 8 | public readonly string HelpText; 9 | 10 | public CommandHelpAttribute(string helptext) => HelpText = helptext; 11 | 12 | public override string ToString() 13 | { 14 | return HelpText; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Common/Commands/CommandManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Common.Interfaces; 5 | 6 | namespace Common.Commands 7 | { 8 | public class CommandManager 9 | { 10 | private delegate void CommandHandler(IWorldManager manager, string[] args); 11 | 12 | private static Dictionary CommandHandlers; 13 | 14 | static CommandManager() 15 | { 16 | CommandHandlers = new Dictionary(StringComparer.OrdinalIgnoreCase) 17 | { 18 | { "gps", Commands.Gps }, 19 | { "help", Commands.Help }, 20 | { "speed", Commands.Speed }, 21 | { "go", Commands.Go }, 22 | { "nudge", Commands.Nudge }, 23 | { "morph", Commands.Morph }, 24 | { "demorph", Commands.Demorph }, 25 | { "fly", Commands.Fly } 26 | }; 27 | } 28 | 29 | 30 | public static bool InvokeHandler(string message, IWorldManager manager) 31 | { 32 | if (string.IsNullOrEmpty(message) || message[0] != '.') 33 | return false; 34 | 35 | string[] parts = message.Split(' '); 36 | 37 | string command = parts[0].TrimStart('.').Trim(); // remove command "." prefix and format 38 | string[] args = parts.Skip(1).Select(x => x.Trim().ToLower()).ToArray(); 39 | 40 | if (CommandHandlers.TryGetValue(command, out var handle)) 41 | { 42 | handle.Invoke(manager, args); 43 | return true; 44 | } 45 | 46 | return false; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Common/Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\bin\$(Configuration)_$(Platform)\ 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Never 37 | 38 | 39 | Never 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Common/Constants/AreaTriggers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using Common.Extensions; 6 | using Common.Interfaces; 7 | using Common.Structs; 8 | 9 | namespace Common.Constants 10 | { 11 | public static class AreaTriggers 12 | { 13 | public static readonly IDictionary Triggers; 14 | 15 | private static readonly uint[] Continents = new uint[] { 0, 1, 530, 571 }; 16 | 17 | static AreaTriggers() 18 | { 19 | Triggers = new Dictionary(); 20 | } 21 | 22 | public static void Initialize(ISandbox sandbox) 23 | { 24 | var properties = typeof(Location).GetProperties(BindingFlags.Public | BindingFlags.Instance); 25 | var resource = Properties.Resources.AreaTriggers; 26 | var entries = resource.Split(new[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries); 27 | 28 | int j; 29 | for (int i = 0; i < entries.Length; i++) 30 | { 31 | string[] data = entries[i].Split(','); 32 | 33 | var location = new Location(); 34 | for (j = 0; j < properties.Length; j++) 35 | properties[j].SetValueEx(location, data[j + 1]); 36 | 37 | // skip invalid expansions 38 | if (location.Expansion > sandbox.Expansion) 39 | continue; 40 | 41 | // take the most recent variant 42 | var id = uint.Parse(data[0]); 43 | if (!Triggers.ContainsKey(id) || Triggers[id].Expansion < location.Expansion) 44 | Triggers[id] = location; 45 | } 46 | 47 | ApplyOverrides(sandbox.Build); 48 | } 49 | 50 | public static IEnumerable FindTrigger(string needle, Expansions expansion) 51 | { 52 | needle = needle.Sanitize(); 53 | 54 | var triggers = Triggers.Values.Where(x => x.IsMatch(needle, expansion) && !Continents.Contains(x.Map)); 55 | var exact = triggers.FirstOrDefault(x => x.IsMatch(needle, expansion, true)); 56 | 57 | return exact?.Yield() ?? triggers; 58 | } 59 | 60 | private static void ApplyOverrides(int build) 61 | { 62 | if (build <= 3494) 63 | { 64 | Triggers[45] = new Location(77f, -1f, 20f, 0, 44, "Scarlet Monastery"); 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Common/Constants/Opcodes.cs: -------------------------------------------------------------------------------- 1 | public enum Opcodes : ushort 2 | { 3 | SMSG_AUTH_CHALLENGE, 4 | SMSG_AUTH_RESPONSE, 5 | CMSG_AUTH_SESSION, 6 | CMSG_CHAR_CREATE, 7 | SMSG_CHAR_CREATE, 8 | CMSG_CHAR_DELETE, 9 | SMSG_CHAR_DELETE, 10 | CMSG_CHAR_ENUM, 11 | SMSG_CHAR_ENUM, 12 | CMSG_PING, 13 | SMSG_PONG, 14 | CMSG_PLAYER_LOGIN, 15 | SMSG_UPDATE_OBJECT, 16 | CMSG_QUERY_TIME, 17 | SMSG_LOGIN_SETTIMESPEED, 18 | 19 | // NameCache, 20 | CMSG_NAME_QUERY, 21 | SMSG_NAME_QUERY_RESPONSE, 22 | 23 | // Logout, 24 | CMSG_LOGOUT_REQUEST, 25 | SMSG_LOGOUT_COMPLETE, 26 | 27 | // Teleport, 28 | CMSG_WORLD_TELEPORT, 29 | SMSG_NEW_WORLD, 30 | SMSG_TRANSFER_PENDING, 31 | 32 | // Chat 33 | CMSG_MESSAGECHAT, 34 | SMSG_MESSAGECHAT, 35 | CMSG_TEXT_EMOTE, 36 | SMSG_TEXT_EMOTE, 37 | SMSG_EMOTE, 38 | 39 | // Movement, 40 | MSG_MOVE_START_FORWARD, 41 | MSG_MOVE_START_BACKWARD, 42 | MSG_MOVE_STOP, 43 | MSG_MOVE_START_STRAFE_LEFT, 44 | MSG_MOVE_START_STRAFE_RIGHT, 45 | MSG_MOVE_STOP_STRAFE, 46 | MSG_MOVE_JUMP, 47 | MSG_MOVE_START_TURN_LEFT, 48 | MSG_MOVE_START_TURN_RIGHT, 49 | MSG_MOVE_STOP_TURN, 50 | MSG_MOVE_START_PITCH_UP, 51 | MSG_MOVE_START_PITCH_DOWN, 52 | MSG_MOVE_STOP_PITCH, 53 | MSG_MOVE_SET_RUN_MODE, 54 | MSG_MOVE_SET_WALK_MODE, 55 | MOVE_COLLIDE_REDIRECT, 56 | MOVE_COLLIDE_STUCK, 57 | MSG_MOVE_START_SWIM, 58 | MSG_MOVE_STOP_SWIM, 59 | MSG_MOVE_SET_FACING, 60 | MSG_MOVE_SET_PITCH, 61 | MSG_MOVE_ROOT, 62 | MSG_MOVE_UNROOT, 63 | MSG_MOVE_HEARTBEAT, 64 | MSG_MOVE_FALL_LAND, 65 | MSG_MOVE_START_ASCEND, 66 | MSG_MOVE_STOP_ASCEND, 67 | 68 | // Force speed change 69 | SMSG_FORCE_SPEED_CHANGE, 70 | SMSG_FORCE_SWIM_SPEED_CHANGE, 71 | SMSG_FORCE_FLIGHT_SPEED_CHANGE, 72 | 73 | // Flight 74 | SMSG_MOVE_SET_CAN_FLY, 75 | SMSG_MOVE_UNSET_CAN_FLY, 76 | 77 | // Worldporting 78 | SMSG_MOVE_WORLDPORT_ACK, 79 | MSG_MOVE_WORLDPORT_ACK, 80 | MSG_MOVE_TELEPORT_ACK, 81 | CMSG_AREATRIGGER, 82 | CMSG_ZONEUPDATE, 83 | 84 | // Standstate 85 | CMSG_STANDSTATECHANGE, 86 | 87 | // Misc 88 | SMSG_LOGIN_VERIFY_WORLD, 89 | SMSG_TUTORIAL_FLAGS, 90 | SMSG_ACCOUNT_DATA_MD5, 91 | SMSG_UI_CONFIG_MD5, 92 | CMSG_UPDATE_ACCOUNT_DATA, 93 | SMSG_UPDATE_ACCOUNT_DATA, 94 | SMSG_TIME_SYNC_REQ, 95 | SMSG_INITIAL_SPELLS, 96 | SMSG_ADDON_INFO, 97 | MSG_VERIFY_CONNECTIVITY 98 | } 99 | -------------------------------------------------------------------------------- /Common/Constants/Worldports.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using Common.Extensions; 6 | using Common.Interfaces; 7 | using Common.Structs; 8 | 9 | namespace Common.Constants 10 | { 11 | public static class Worldports 12 | { 13 | public static readonly IList Locations; 14 | 15 | static Worldports() 16 | { 17 | Locations = new List(); 18 | } 19 | 20 | public static void Initialize(ISandbox sandbox) 21 | { 22 | var properties = typeof(Location).GetProperties(BindingFlags.Public | BindingFlags.Instance); 23 | var resource = Properties.Resources.Worldports; 24 | var entries = resource.Split(new[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries); 25 | 26 | int j; 27 | for (int i = 0; i < entries.Length; i++) 28 | { 29 | string[] data = entries[i].Split(','); 30 | 31 | var location = new Location(); 32 | for (j = 0; j < properties.Length; j++) 33 | properties[j].SetValueEx(location, data[j]); 34 | 35 | if (location.Expansion <= sandbox.Expansion) 36 | Locations.Add(location); 37 | } 38 | } 39 | 40 | public static IEnumerable FindLocation(string needle, Expansions expansion) 41 | { 42 | needle = needle.Sanitize(); 43 | 44 | var locations = Locations.Where(x => x.IsMatch(needle, expansion)); 45 | var exact = locations.FirstOrDefault(x => x.IsMatch(needle, expansion, true)); 46 | 47 | return exact?.Yield() ?? locations; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Common/Cryptography/ARC4.cs: -------------------------------------------------------------------------------- 1 | namespace Common.Cryptography 2 | { 3 | public class ARC4 4 | { 5 | private const int StateSize = 0x100; 6 | private readonly byte[] state; 7 | private byte x, y; 8 | 9 | public ARC4() 10 | { 11 | state = new byte[StateSize]; 12 | x = y = 0; 13 | } 14 | 15 | public void SetKey(byte[] key) 16 | { 17 | x = y = 0; 18 | 19 | for (int i = 0; i < StateSize; i++) 20 | state[i] = (byte)i; 21 | 22 | var j = 0; 23 | for (int i = 0; i < StateSize; i++) 24 | { 25 | j = (byte)((j + key[i % key.Length] + state[i]) & 255); 26 | 27 | (state[i], state[j]) = (state[j], state[i]); // swap 28 | } 29 | } 30 | 31 | public void Process(byte[] buffer, int length) 32 | { 33 | for (int i = 0; i < length; i++) 34 | { 35 | x = (byte)((x + 1) % StateSize); 36 | y = (byte)((y + state[x]) % StateSize); 37 | 38 | (state[x], state[y]) = (state[y], state[x]); // swap 39 | 40 | buffer[i] = (byte)(state[(state[x] + state[y]) % StateSize] ^ buffer[i]); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Common/Cryptography/HMAC.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | 4 | namespace Common.Cryptography 5 | { 6 | public static class HMAC 7 | { 8 | public static byte[] ComputeHash(byte[] key, byte[] data) 9 | { 10 | byte[] ipad = new byte[64 + data.Length]; // 64 + data 11 | byte[] opad = new byte[64 + 20]; // 64 + digest 12 | 13 | // fill 64 bytes of same value 14 | for (int i = 0; i < 64; i++) 15 | { 16 | ipad[i] = 0x36; 17 | opad[i] = 0x5C; 18 | } 19 | 20 | for (int i = 0; i < 16; i++) 21 | { 22 | ipad[i] = (byte)(ipad[i] ^ key[i]); 23 | opad[i] = (byte)(opad[i] ^ key[i]); 24 | } 25 | 26 | using (var sha1 = new SHA1Managed()) 27 | { 28 | Buffer.BlockCopy(data, 0, ipad, 64, data.Length); 29 | Buffer.BlockCopy(sha1.ComputeHash(ipad), 0, opad, 64, 20); 30 | return sha1.ComputeHash(opad); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Common/Extensions/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net.Sockets; 4 | using System.Reflection; 5 | using Common.Interfaces; 6 | using Common.Logging; 7 | 8 | namespace Common.Extensions 9 | { 10 | public static class Extensions 11 | { 12 | public static void SendData(this Socket socket, IPacketWriter packet, string packetname = "") 13 | { 14 | byte[] buffer = packet.ReadDataToSend(); 15 | try 16 | { 17 | socket.Send(buffer, 0, buffer.Length, SocketFlags.None); 18 | if (!string.IsNullOrEmpty(packetname)) 19 | Log.Message(LogType.DUMP, "SENT {0}.", packetname); 20 | } 21 | catch (Exception e) 22 | { 23 | Log.Message(LogType.ERROR, "{0}", e.Message); 24 | } 25 | } 26 | 27 | public static string ToUpperFirst(this string s) 28 | { 29 | if (string.IsNullOrEmpty(s)) 30 | return string.Empty; 31 | 32 | return char.ToUpper(s[0]) + s.ToLower().Substring(1); 33 | } 34 | 35 | public static byte Clamp(this byte i, byte min, byte max) => Math.Max(Math.Min(i, max), min); 36 | 37 | public static void SetValueEx(this PropertyInfo pi, object obj, string value) 38 | { 39 | Type type = pi.PropertyType.IsEnum ? pi.PropertyType.GetEnumUnderlyingType() : pi.PropertyType; 40 | pi.SetValue(obj, Convert.ChangeType(value, type)); 41 | } 42 | 43 | public static IEnumerable Yield(this T item) 44 | { 45 | yield return item; 46 | } 47 | 48 | public static string Sanitize(this string value) 49 | { 50 | if (value == null || value.Length <= 1) 51 | return value; 52 | 53 | return string.Join("", value.Split(new char[] { ' ', '\t', '\r', '\n', '\'', ',' })); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Common/Interfaces/Handlers/IAuthHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Sockets; 2 | 3 | namespace Common.Interfaces.Handlers 4 | { 5 | public interface IAuthHandler 6 | { 7 | IPacketWriter HandleAuthChallenge(); 8 | 9 | IPacketWriter HandleRedirect(); 10 | 11 | void HandleRealmList(Socket socket); 12 | 13 | void HandleAuthSession(ref IPacketReader packet, ref IWorldManager manager); 14 | 15 | void HandleLogoutRequest(ref IPacketReader packet, ref IWorldManager manager); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Common/Interfaces/Handlers/ICharHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Common.Interfaces.Handlers 2 | { 3 | public interface ICharHandler 4 | { 5 | void HandleCharEnum(ref IPacketReader packet, ref IWorldManager manager); 6 | 7 | void HandleCharCreate(ref IPacketReader packet, ref IWorldManager manager); 8 | 9 | void HandleCharDelete(ref IPacketReader packet, ref IWorldManager manager); 10 | 11 | void HandleNameCache(ref IPacketReader packet, ref IWorldManager manager); 12 | 13 | void HandleMovementStatus(ref IPacketReader packet, ref IWorldManager manager); 14 | 15 | void HandleMessageChat(ref IPacketReader packet, ref IWorldManager manager); 16 | 17 | void HandleStandState(ref IPacketReader packet, ref IWorldManager manager); 18 | 19 | void HandleTextEmote(ref IPacketReader packet, ref IWorldManager manager); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Common/Interfaces/Handlers/IWorldHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Common.Interfaces.Handlers 2 | { 3 | public interface IWorldHandler 4 | { 5 | void HandleWorldTeleport(ref IPacketReader packet, ref IWorldManager manager); 6 | 7 | void HandlePlayerLogin(ref IPacketReader packet, ref IWorldManager manager); 8 | 9 | void HandlePing(ref IPacketReader packet, ref IWorldManager manager); 10 | 11 | void HandleQueryTime(ref IPacketReader packet, ref IWorldManager manager); 12 | 13 | void HandleAreaTrigger(ref IPacketReader packet, ref IWorldManager manager); 14 | 15 | void HandleZoneUpdate(ref IPacketReader packet, ref IWorldManager manager); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Common/Interfaces/ICharacter.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Structs; 3 | 4 | namespace Common.Interfaces 5 | { 6 | public interface ICharacter 7 | { 8 | int Build { get; set; } 9 | 10 | ulong Guid { get; set; } 11 | string Name { get; set; } 12 | byte Race { get; set; } 13 | byte Class { get; set; } 14 | byte Gender { get; set; } 15 | byte Skin { get; set; } 16 | byte Face { get; set; } 17 | byte HairStyle { get; set; } 18 | byte HairColor { get; set; } 19 | byte FacialHair { get; set; } 20 | uint Level { get; set; } 21 | uint Zone { get; set; } 22 | Location Location { get; set; } 23 | bool IsOnline { get; set; } 24 | uint Health { get; set; } 25 | uint Mana { get; set; } 26 | uint Rage { get; set; } 27 | uint Focus { get; set; } 28 | uint Energy { get; set; } 29 | uint Strength { get; set; } 30 | uint Agility { get; set; } 31 | uint Stamina { get; set; } 32 | uint Intellect { get; set; } 33 | uint Spirit { get; set; } 34 | byte PowerType { get; set; } 35 | StandState StandState { get; set; } 36 | bool IsTeleporting { get; set; } 37 | uint DisplayId { get; set; } 38 | uint MountDisplayId { get; set; } 39 | float Scale { get; set; } 40 | bool IsFlying { get; set; } 41 | 42 | void Teleport(float x, float y, float z, float o, uint map, ref IWorldManager manager); 43 | 44 | IPacketWriter BuildFly(bool mode); 45 | 46 | IPacketWriter BuildForceSpeed(float modifier, SpeedType type = SpeedType.Run); 47 | 48 | IPacketWriter BuildMessage(string text); 49 | 50 | IPacketWriter BuildUpdate(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Common/Interfaces/IOpcodes.cs: -------------------------------------------------------------------------------- 1 | namespace Common.Interfaces 2 | { 3 | public interface IOpcodes 4 | { 5 | Opcodes this[uint id] { get; } 6 | uint this[Opcodes opcode] { get; } 7 | 8 | bool OpcodeExists(uint opcode); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Common/Interfaces/IPacketReader.cs: -------------------------------------------------------------------------------- 1 | namespace Common.Interfaces 2 | { 3 | public interface IPacketReader 4 | { 5 | uint Opcode { get; } 6 | uint Size { get; } 7 | long Position { get; set; } 8 | 9 | bool ReadBool(); 10 | 11 | byte ReadByte(); 12 | 13 | sbyte ReadInt8(); 14 | 15 | short ReadInt16(); 16 | 17 | int ReadInt32(); 18 | 19 | long ReadInt64(); 20 | 21 | byte ReadUInt8(); 22 | 23 | ushort ReadUInt16(); 24 | 25 | uint ReadUInt32(); 26 | 27 | ulong ReadUInt64(); 28 | 29 | float ReadFloat(); 30 | 31 | double ReadDouble(); 32 | 33 | string ReadString(); 34 | 35 | string ReadString(int size); 36 | 37 | byte[] ReadBytes(int count); 38 | 39 | byte[] ReadToEnd(); 40 | 41 | ulong ReadPackedGUID(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Common/Interfaces/IPacketWriter.cs: -------------------------------------------------------------------------------- 1 | namespace Common.Interfaces 2 | { 3 | public interface IPacketWriter 4 | { 5 | string Name { get; } 6 | uint Opcode { get; } 7 | uint Size { get; } 8 | bool PreAuth { get; set; } 9 | 10 | void WritePacketHeader(uint opcode); 11 | 12 | byte[] ReadDataToSend(); 13 | 14 | void WriteBool(bool data); 15 | 16 | void WriteInt8(sbyte data); 17 | 18 | void WriteInt16(short data); 19 | 20 | void WriteInt32(int data); 21 | 22 | void WriteInt64(long data); 23 | 24 | void WriteUInt8(byte data); 25 | 26 | void WriteUInt16(ushort data); 27 | 28 | void WriteUInt32(uint data); 29 | 30 | void WriteUInt64(ulong data); 31 | 32 | void WriteFloat(float data); 33 | 34 | void WriteDouble(double data); 35 | 36 | void WriteString(string data); 37 | 38 | void Write(byte[] data); 39 | 40 | void WritePackedGUID(ulong guid); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Common/Interfaces/ISandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces.Handlers; 3 | 4 | namespace Common.Interfaces 5 | { 6 | public interface ISandbox 7 | { 8 | string RealmName { get; } 9 | Expansions Expansion { get; } 10 | int Build { get; } 11 | int RealmPort { get; } 12 | int RedirectPort { get; } 13 | int WorldPort { get; } 14 | 15 | IOpcodes Opcodes { get; } 16 | IAuthHandler AuthHandler { get; } 17 | ICharHandler CharHandler { get; } 18 | IWorldHandler WorldHandler { get; } 19 | 20 | IPacketReader ReadPacket(byte[] data, bool parse = true); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Common/Interfaces/IWorldManager.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Sockets; 2 | using Common.Structs; 3 | 4 | namespace Common.Interfaces 5 | { 6 | public interface IWorldManager 7 | { 8 | Account Account { get; set; } 9 | Socket Socket { get; set; } 10 | ISandbox SandboxHost { get; } 11 | 12 | void Recieve(); 13 | 14 | void Send(IPacketWriter packet); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Common/Network/BasePacketReader.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Text; 3 | using Common.Cryptography; 4 | using Common.Interfaces; 5 | 6 | namespace Common.Network 7 | { 8 | public abstract class BasePacketReader : BinaryReader, IPacketReader 9 | { 10 | public uint Opcode { get; protected set; } 11 | public uint Size { get; protected set; } 12 | public long Position { get => BaseStream.Position; set => BaseStream.Position = value; } 13 | 14 | public BasePacketReader(byte[] data) : base(new MemoryStream(data)) { } 15 | 16 | public bool ReadBool() => base.ReadBoolean(); 17 | 18 | public sbyte ReadInt8() => base.ReadSByte(); 19 | 20 | public byte ReadUInt8() => base.ReadByte(); 21 | 22 | public float ReadFloat() => base.ReadSingle(); 23 | 24 | public new string ReadString() 25 | { 26 | StringBuilder sb = new StringBuilder(0x20); 27 | byte b; 28 | while (true) 29 | { 30 | b = ReadByte(); 31 | if (b == 0) 32 | break; 33 | 34 | sb.Append((char)b); 35 | } 36 | 37 | return sb.ToString(); 38 | } 39 | 40 | public string ReadString(int size) 41 | { 42 | return Encoding.UTF8.GetString(ReadBytes(size)); 43 | } 44 | 45 | public byte[] ReadToEnd() => base.ReadBytes((int)(Size - Position)); 46 | 47 | public ulong ReadPackedGUID() 48 | { 49 | byte mask = ReadByte(); 50 | ulong guid = 0; 51 | 52 | for (int i = 0; i < 8; i++) 53 | if ((mask & (1 << i)) != 0) 54 | guid |= (ulong)ReadByte() << (i * 8); 55 | 56 | return guid; 57 | } 58 | 59 | 60 | protected virtual void Decode(ref byte[] buffer, int count = 6) => Authenticator.PacketCrypt.Decode(buffer, count); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Common/Network/BasePacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | using Common.Cryptography; 5 | using Common.Interfaces; 6 | 7 | namespace Common.Network 8 | { 9 | public abstract class BasePacketWriter : BinaryWriter, IPacketWriter 10 | { 11 | public string Name { get; protected set; } 12 | public uint Opcode { get; protected set; } 13 | public uint Size { get; protected set; } 14 | public bool PreAuth { get; set; } = false; 15 | 16 | public BasePacketWriter() : base(new MemoryStream()) { } 17 | 18 | public abstract void WritePacketHeader(uint opcode); 19 | 20 | public abstract byte[] ReadDataToSend(); 21 | 22 | public void WriteBool(bool data) => base.Write(data); 23 | 24 | public void WriteInt8(sbyte data) => base.Write(data); 25 | 26 | public void WriteInt16(short data) => base.Write(data); 27 | 28 | public void WriteInt32(int data) => base.Write(data); 29 | 30 | public void WriteInt64(long data) => base.Write(data); 31 | 32 | public void WriteUInt8(byte data) => base.Write(data); 33 | 34 | public void WriteUInt16(ushort data) => base.Write(data); 35 | 36 | public void WriteUInt32(uint data) => base.Write(data); 37 | 38 | public void WriteUInt64(ulong data) => base.Write(data); 39 | 40 | public void WriteFloat(float data) => base.Write(data); 41 | 42 | public void WriteDouble(double data) => base.Write(data); 43 | 44 | public void WriteString(string data) 45 | { 46 | byte[] sBytes = Encoding.ASCII.GetBytes(data); 47 | Write(sBytes); 48 | base.Write((byte)0); // String null terminated 49 | } 50 | 51 | public void WritePackedGUID(ulong guid) 52 | { 53 | byte[] packed = new byte[9]; 54 | byte[] buffer = BitConverter.GetBytes(guid); 55 | 56 | int count = 0; 57 | for (int i = 0; i < buffer.Length; i++) 58 | { 59 | if (buffer[i] != 0) 60 | { 61 | packed[0] |= (byte)(1 << i); 62 | packed[++count] = buffer[i]; 63 | } 64 | } 65 | 66 | base.Write(packed, 0, count + 1); 67 | } 68 | 69 | 70 | protected virtual void Encode(ref byte[] buffer, int count = 4) => Authenticator.PacketCrypt.Encode(buffer, count); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Common/Network/BitPacker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Interfaces; 3 | 4 | namespace Common.Network 5 | { 6 | public class BitPacker 7 | { 8 | private readonly IPacketWriter _packetWriter; 9 | private byte Position = 8; 10 | private byte Buffer = 0; 11 | 12 | public BitPacker(IPacketWriter packetWriter) => _packetWriter = packetWriter; 13 | 14 | public void Write(T bit) 15 | { 16 | --Position; 17 | 18 | if (Convert.ToBoolean(bit)) 19 | Buffer |= (byte)(1 << (Position)); 20 | 21 | if (Position == 0) 22 | { 23 | Position = 8; 24 | _packetWriter.WriteUInt8(Buffer); 25 | Buffer = 0; 26 | } 27 | } 28 | 29 | public void Write(T bit, int count) 30 | { 31 | checked 32 | { 33 | for (int i = count - 1; i >= 0; --i) 34 | Write((T)Convert.ChangeType(((Convert.ToInt32(bit) >> i) & 1), typeof(T))); 35 | } 36 | } 37 | 38 | public void WriteMask(ulong guid, params int[] offsets) 39 | { 40 | for (var i = 0; i < offsets.Length; i++) 41 | Write((guid >> (offsets[i] * 8)) & 0xFF); 42 | } 43 | 44 | public void Flush() 45 | { 46 | if (Position == 8) 47 | return; 48 | 49 | _packetWriter.WriteUInt8(Buffer); 50 | Buffer = 0; 51 | Position = 8; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Common/Network/BitUnpacker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Interfaces; 3 | 4 | namespace Common.Network 5 | { 6 | public class BitUnpacker 7 | { 8 | private readonly IPacketReader _packetReader; 9 | 10 | private byte Position = 8; 11 | private byte Buffer = 0; 12 | 13 | public BitUnpacker(IPacketReader packetReader) 14 | { 15 | _packetReader = packetReader; 16 | } 17 | 18 | 19 | public bool GetBit() 20 | { 21 | if (Position == 8) 22 | { 23 | Buffer = _packetReader.ReadByte(); 24 | Position = 0; 25 | } 26 | 27 | int value = Buffer; 28 | Buffer = (byte)(2 * value); 29 | Position++; 30 | 31 | return (value >> 7) != 0; 32 | } 33 | 34 | public T GetBits(byte bitCount) 35 | { 36 | checked 37 | { 38 | int value = 0; 39 | for (int i = bitCount - 1; i >= 0; --i) 40 | value = GetBit() ? (1 << i) | value : value; 41 | 42 | return (T)Convert.ChangeType(value, typeof(T)); 43 | } 44 | } 45 | 46 | public ulong ReadPackedGuid(byte[] mask, byte[] bytes) 47 | { 48 | bool[] valueMask = new bool[mask.Length]; 49 | for (int i = 0; i < valueMask.Length; i++) 50 | valueMask[mask[i]] = GetBit(); 51 | 52 | byte[] valueBytes = new byte[bytes.Length]; 53 | for (int i = 0; i < bytes.Length; i++) 54 | if (valueMask[i]) 55 | valueBytes[bytes[i]] = (byte)(_packetReader.ReadByte() ^ 1); 56 | 57 | return BitConverter.ToUInt64(valueBytes, 0); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Common/Network/PacketManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Common.Interfaces; 3 | 4 | namespace Common.Network 5 | { 6 | public static class PacketManager 7 | { 8 | public delegate void PacketHandler(ref IPacketReader packet, ref IWorldManager manager); 9 | 10 | private static Dictionary OpcodeHandlers; 11 | 12 | static PacketManager() => OpcodeHandlers = new Dictionary(); 13 | 14 | public static void DefineOpcodeHandler(Opcodes opcode, PacketHandler handler) 15 | { 16 | OpcodeHandlers[opcode] = handler; 17 | } 18 | 19 | public static bool InvokeHandler(IPacketReader reader, IWorldManager manager, Opcodes opcode) 20 | { 21 | if (OpcodeHandlers.TryGetValue(opcode, out var handle)) 22 | { 23 | handle.Invoke(ref reader, ref manager); 24 | return true; 25 | } 26 | 27 | return false; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Common/Structs/Location.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Constants; 3 | using Common.Extensions; 4 | using Common.Interfaces; 5 | 6 | namespace Common.Structs 7 | { 8 | public class Location : ICloneable 9 | { 10 | public float X { get; set; } 11 | public float Y { get; set; } 12 | public float Z { get; set; } 13 | public float O { get; set; } 14 | public uint Map { get; set; } 15 | public string Description { get; set; } 16 | public Expansions Expansion { get; set; } 17 | 18 | private string formattedDesc; 19 | 20 | #region Constructors 21 | 22 | public Location() { } 23 | 24 | public Location(float x, float y, float z, float o, uint map, string description = "", Expansions expansion = Expansions.PreRelease) 25 | { 26 | X = x; 27 | Y = y; 28 | Z = z; 29 | O = o; 30 | Map = map; 31 | Description = description; 32 | Expansion = expansion; 33 | 34 | formattedDesc = description.Sanitize(); 35 | } 36 | 37 | #endregion 38 | 39 | #region Update 40 | 41 | public void Update(float x, float y, float z) => Update(x, y, z, O); 42 | 43 | public void Update(float x, float y, float z, float o) 44 | { 45 | X = x; 46 | Y = y; 47 | Z = z; 48 | O = o; 49 | } 50 | 51 | public void Update(IPacketReader packet, bool orientation = false) 52 | { 53 | X = packet.ReadFloat(); 54 | Y = packet.ReadFloat(); 55 | Z = packet.ReadFloat(); 56 | if (orientation) 57 | O = packet.ReadFloat(); 58 | } 59 | 60 | #endregion 61 | 62 | #region Helpers 63 | 64 | internal bool IsMatch(string needle, Expansions expansion, bool exact = false) 65 | { 66 | if (Expansion > expansion) 67 | return false; 68 | 69 | if (string.IsNullOrEmpty(formattedDesc)) 70 | formattedDesc = Description.Sanitize(); 71 | 72 | if (exact) 73 | return formattedDesc.Equals(needle, StringComparison.OrdinalIgnoreCase); 74 | else 75 | return formattedDesc.IndexOf(needle, StringComparison.OrdinalIgnoreCase) != -1; 76 | } 77 | 78 | 79 | public override string ToString() => $"X: {X}, Y: {Y}, Z: {Z}, O: {O}, Map: {Map}"; 80 | 81 | public object Clone() => MemberwiseClone(); 82 | 83 | #endregion 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 barncastle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Plugins/Alpha_3368/Alpha_3368.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Alpha_3368/Handlers/WorldHandler.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Extensions; 3 | using Common.Interfaces; 4 | using Common.Interfaces.Handlers; 5 | using Common.Logging; 6 | using Common.Structs; 7 | 8 | namespace Alpha_3368.Handlers 9 | { 10 | public class WorldHandler : IWorldHandler 11 | { 12 | public void HandlePing(ref IPacketReader packet, ref IWorldManager manager) 13 | { 14 | PacketWriter writer = new PacketWriter(Sandbox.Instance.Opcodes[global::Opcodes.SMSG_PONG], "SMSG_PONG"); 15 | writer.WriteUInt32(packet.ReadUInt32()); 16 | manager.Send(writer); 17 | } 18 | 19 | public void HandlePlayerLogin(ref IPacketReader packet, ref IWorldManager manager) 20 | { 21 | ulong guid = packet.ReadUInt64(); 22 | Character character = (Character)manager.Account.SetActiveChar(guid, Sandbox.Instance.Build); 23 | character.DisplayId = character.GetDisplayId(); 24 | 25 | manager.Send(character.BuildUpdate()); 26 | } 27 | 28 | public void HandleWorldTeleport(ref IPacketReader packet, ref IWorldManager manager) 29 | { 30 | packet.ReadUInt32(); 31 | byte zone = packet.ReadUInt8(); 32 | 33 | var character = manager.Account.ActiveCharacter; 34 | character.Location.Update(packet, true); 35 | character.Teleport(character.Location, ref manager); 36 | } 37 | 38 | public void HandleQueryTime(ref IPacketReader packet, ref IWorldManager manager) 39 | { 40 | PacketWriter queryTime = new PacketWriter(Sandbox.Instance.Opcodes[global::Opcodes.SMSG_LOGIN_SETTIMESPEED], "SMSG_LOGIN_SETTIMESPEED"); 41 | queryTime.WriteInt32(this.GetTime()); 42 | queryTime.WriteFloat(0.01666667f); 43 | manager.Send(queryTime); 44 | } 45 | 46 | public void HandleAreaTrigger(ref IPacketReader packet, ref IWorldManager manager) 47 | { 48 | uint id = packet.ReadUInt32(); 49 | if (AreaTriggers.Triggers.ContainsKey(id)) 50 | { 51 | var loc = AreaTriggers.Triggers[id]; 52 | manager.Account.ActiveCharacter.Teleport(loc, ref manager); 53 | } 54 | else 55 | Log.Message(LogType.ERROR, "AreaTrigger for {0} missing.", id); 56 | } 57 | 58 | public void HandleZoneUpdate(ref IPacketReader packet, ref IWorldManager manager) 59 | { 60 | manager.Account.ActiveCharacter.Zone = packet.ReadUInt32(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Plugins/Alpha_3368/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using Common.Network; 2 | 3 | namespace Alpha_3368 4 | { 5 | public class PacketReader : BasePacketReader 6 | { 7 | public PacketReader(byte[] data, bool parse = true) : base(data) 8 | { 9 | if (parse) 10 | { 11 | // Packet header (0.5.3.3368): Size: 2 bytes + Cmd: 4 bytes 12 | Size = (uint)((ReadUInt16() / 0x100) + 2); 13 | Opcode = ReadUInt32(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/Alpha_3368/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Alpha_3368 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | // Packet header (0.5.3.3368): Size: 2 bytes + Cmd: 2 bytes 20 | // Packet header after SMSG_AUTH_CHALLENGE (0.5.3.3368): Size: 2 bytes + Cmd: 4 bytes 21 | WriteUInt16(0); 22 | WriteUInt8((byte)(opcode % 0x100)); 23 | WriteUInt8((byte)(opcode / 0x100)); 24 | 25 | if (opcode != 0x1DD) 26 | { 27 | WriteUInt8(0); 28 | WriteUInt8(0); 29 | } 30 | } 31 | 32 | public override byte[] ReadDataToSend() 33 | { 34 | byte[] data = new byte[BaseStream.Length]; 35 | Seek(0, SeekOrigin.Begin); 36 | 37 | BaseStream.Read(data, 0, (int)BaseStream.Length); 38 | 39 | Size = (ushort)(data.Length - 2); 40 | if (!PreAuth) 41 | { 42 | data[0] = (byte)(Size / 0x100); 43 | data[1] = (byte)(Size % 0x100); 44 | } 45 | return data; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Plugins/Alpha_3368/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Alpha_3368.Handlers; 2 | using Common.Constants; 3 | using Common.Interfaces; 4 | using Common.Interfaces.Handlers; 5 | 6 | namespace Alpha_3368 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Alpha (0.5.3) Sandbox"; 13 | public Expansions Expansion => Expansions.PreRelease; 14 | public int Build => 3368; 15 | public int RealmPort => 9100; 16 | public int RedirectPort => 9090; 17 | public int WorldPort => 8100; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Alpha_3494/Alpha_3494.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Alpha_3494/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using Common.Network; 2 | 3 | namespace Alpha_3494 4 | { 5 | public class PacketReader : BasePacketReader 6 | { 7 | public PacketReader(byte[] data, bool parse = true) : base(data) 8 | { 9 | if (parse) 10 | { 11 | ushort size = ReadUInt16(); 12 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 13 | Opcode = ReadUInt32(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/Alpha_3494/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Alpha_3494 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt32(opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | Size = (ushort)((Size >> 8) + ((Size & 0xFF) << 8)); 35 | data[0] = (byte)(Size & 0xFF); 36 | data[1] = (byte)(Size >> 8); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/Alpha_3494/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Alpha_3494.Handlers; 2 | using Common.Constants; 3 | using Common.Interfaces; 4 | using Common.Interfaces.Handlers; 5 | 6 | namespace Alpha_3494 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Alpha (0.5.5) Sandbox"; 13 | public Expansions Expansion => Expansions.PreRelease; 14 | public int Build => 3592; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9090; 17 | public int WorldPort => 8086; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Beta_3592/Beta_3592.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Beta_3592/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using Common.Network; 2 | 3 | namespace Beta_3592 4 | { 5 | public class PacketReader : BasePacketReader 6 | { 7 | public PacketReader(byte[] data, bool parse = true) : base(data) 8 | { 9 | if (parse) 10 | { 11 | ushort size = ReadUInt16(); 12 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 13 | Opcode = ReadUInt32(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/Beta_3592/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Beta_3592 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt32(opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | Size = (ushort)((Size >> 8) + ((Size & 0xFF) << 8)); 35 | data[0] = (byte)(Size & 0xFF); 36 | data[1] = (byte)(Size >> 8); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Beta_3592/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Beta_3592.Handlers; 2 | using Common.Constants; 3 | using Common.Interfaces; 4 | using Common.Interfaces.Handlers; 5 | 6 | namespace Beta_3592 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Beta 1 (0.6.0) Sandbox"; 13 | public Expansions Expansion => Expansions.PreRelease; 14 | public int Build => 3592; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 9001; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Beta_3694/Beta_3694.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Beta_3694/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using Common.Network; 2 | 3 | namespace Beta_3694 4 | { 5 | public class PacketReader : BasePacketReader 6 | { 7 | public PacketReader(byte[] data, bool parse = true) : base(data) 8 | { 9 | if (parse) 10 | { 11 | ushort size = ReadUInt16(); 12 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 13 | Opcode = ReadUInt32(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/Beta_3694/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Beta_3694 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt32(opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | Size = (ushort)((Size >> 8) + ((Size & 0xFF) << 8)); 35 | data[0] = (byte)(Size & 0xFF); 36 | data[1] = (byte)(Size >> 8); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Beta_3694/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Beta_3694.Handlers; 2 | using Common.Constants; 3 | using Common.Interfaces; 4 | using Common.Interfaces.Handlers; 5 | 6 | namespace Beta_3694 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Beta 2 (0.7.X) Sandbox"; 13 | public Expansions Expansion => Expansions.PreRelease; 14 | public int Build => 3694; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 9001; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Beta_3734/Beta_3734.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Beta_3734/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using Common.Network; 2 | 3 | namespace Beta_3734 4 | { 5 | public class PacketReader : BasePacketReader 6 | { 7 | public PacketReader(byte[] data, bool parse = true) : base(data) 8 | { 9 | if (parse) 10 | { 11 | ushort size = ReadUInt16(); 12 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 13 | Opcode = ReadUInt32(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/Beta_3734/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Beta_3734 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt32(opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | Size = (ushort)((Size >> 8) + ((Size & 0xFF) << 8)); 35 | data[0] = (byte)(Size & 0xFF); 36 | data[1] = (byte)(Size >> 8); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Beta_3734/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Beta_3734.Handlers; 2 | using Common.Constants; 3 | using Common.Interfaces; 4 | using Common.Interfaces.Handlers; 5 | 6 | namespace Beta_3734 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Beta 3 (0.8.0) Sandbox"; 13 | public Expansions Expansion => Expansions.PreRelease; 14 | public int Build => 3734; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 9001; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Beta_3807/Beta_3807.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Beta_3807/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using Common.Network; 2 | 3 | namespace Beta_3807 4 | { 5 | public class PacketReader : BasePacketReader 6 | { 7 | public PacketReader(byte[] data, bool parse = true) : base(data) 8 | { 9 | if (parse) 10 | { 11 | ushort size = ReadUInt16(); 12 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 13 | Opcode = ReadUInt32(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/Beta_3807/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Beta_3807 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | // Size = (ushort)((Size >> 8) + ((Size & 0xFF) << 8)); 35 | data[0] = (byte)(Size >> 8); 36 | data[1] = (byte)(Size & 255); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Beta_3807/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Beta_3807.Handlers; 2 | using Common.Constants; 3 | using Common.Interfaces; 4 | using Common.Interfaces.Handlers; 5 | 6 | namespace Beta_3807 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Beta 3 (0.9.0) Sandbox"; 13 | public Expansions Expansion => Expansions.PreRelease; 14 | public int Build => 3807; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 9001; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Beta_3892/Beta_3892.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Beta_3892/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using Common.Network; 2 | 3 | namespace Beta_3892 4 | { 5 | public class PacketReader : BasePacketReader 6 | { 7 | public PacketReader(byte[] data, bool parse = true) : base(data) 8 | { 9 | if (parse) 10 | { 11 | ushort size = ReadUInt16(); 12 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 13 | Opcode = ReadUInt32(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/Beta_3892/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Beta_3892 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | // Size = (ushort)((Size >> 8) + ((Size & 0xFF) << 8)); 35 | data[0] = (byte)(Size >> 8); 36 | data[1] = (byte)(Size & 255); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Beta_3892/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Beta_3892.Handlers; 2 | using Common.Constants; 3 | using Common.Interfaces; 4 | using Common.Interfaces.Handlers; 5 | 6 | namespace Beta_3892 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Beta 3 (0.10.0/0.11.0) Sandbox"; 13 | public Expansions Expansion => Expansions.PreRelease; 14 | public int Build => 3892; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Beta_3988/Beta_3988.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Beta_3988/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using Common.Network; 2 | 3 | namespace Beta_3988 4 | { 5 | public class PacketReader : BasePacketReader 6 | { 7 | public PacketReader(byte[] data, bool parse = true) : base(data) 8 | { 9 | if (parse) 10 | { 11 | ushort size = ReadUInt16(); 12 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 13 | Opcode = ReadUInt32(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/Beta_3988/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Beta_3988 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | } 37 | return data; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Plugins/Beta_3988/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Beta_3988.Handlers; 2 | using Common.Constants; 3 | using Common.Interfaces; 4 | using Common.Interfaces.Handlers; 5 | 6 | namespace Beta_3988 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Beta 3 (0.12.0/1.0.X) Sandbox"; 13 | public Expansions Expansion => Expansions.PreRelease; 14 | public int Build => 3988; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Cata_11927/Cata_11927.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Cata_11927/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Cata_11927 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Cata_11927/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Cata_11927 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/Cata_11927/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Cata_11927.Handlers; 5 | 6 | namespace Cata_11927 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Cata (4.0.0.11927) Sandbox"; 13 | public Expansions Expansion => Expansions.Cata; 14 | public int Build => 11927; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Cata_12025/Cata_12025.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Cata_12025/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Cata_12025 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Cata_12025/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Cata_12025 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/Cata_12025/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Cata_12025.Handlers; 5 | 6 | namespace Cata_12025 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Cata (4.0.0.12025-4.0.0.12065) Sandbox"; 13 | public Expansions Expansion => Expansions.Cata; 14 | public int Build => 12025; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Cata_12122/Cata_12122.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Cata_12122/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Cata_12122 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Cata_12122/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Cata_12122 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/Cata_12122/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Cata_12122.Handlers; 5 | 6 | namespace Cata_12122 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Cata (4.0.0.12122-4.0.0.12319) Sandbox"; 13 | public Expansions Expansion => Expansions.Cata; 14 | public int Build => 12122; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/MoP_15464/MoP_15464.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/MoP_15464/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Cryptography; 3 | using Common.Network; 4 | 5 | namespace MoP_15464 6 | { 7 | public class PacketReader : BasePacketReader 8 | { 9 | public PacketReader(byte[] data, bool parse = true) : base(data) 10 | { 11 | if (parse) 12 | { 13 | if (Authenticator.PacketCrypt.Initialised) 14 | { 15 | Decode(ref data, 4); 16 | 17 | uint header = BitConverter.ToUInt32(data, 0); 18 | Size = (header >> 12) + 4u; 19 | Opcode = header & 0xFFF; 20 | } 21 | else 22 | { 23 | Size = BitConverter.ToUInt16(data, 0) + 2u; 24 | Opcode = BitConverter.ToUInt16(data, 2); 25 | } 26 | 27 | Position = 4; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Plugins/MoP_15464/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Cryptography; 3 | using Common.Network; 4 | 5 | namespace MoP_15464 6 | { 7 | public class PacketWriter : BasePacketWriter 8 | { 9 | public PacketWriter() : base() => PreAuth = true; 10 | 11 | public PacketWriter(uint opcode, string name) : base() 12 | { 13 | Name = name; 14 | Opcode = opcode; 15 | WritePacketHeader(opcode); 16 | } 17 | 18 | public override void WritePacketHeader(uint opcode) 19 | { 20 | WriteUInt16(0); 21 | WriteUInt16((ushort)opcode); 22 | } 23 | 24 | public override byte[] ReadDataToSend() 25 | { 26 | byte[] data = new byte[BaseStream.Length]; 27 | Seek(0, SeekOrigin.Begin); 28 | 29 | BaseStream.Read(data, 0, (int)BaseStream.Length); 30 | 31 | Size = (ushort)(data.Length - 2); 32 | 33 | if (!PreAuth) 34 | { 35 | if (Authenticator.PacketCrypt.Initialised) 36 | { 37 | uint header = ((Size - 2) << 12) | (Opcode & 0xFFF); 38 | data[0] = (byte)(header & 0xFF); 39 | data[1] = (byte)((header >> 8) & 0xFF); 40 | data[2] = (byte)((header >> 16) & 0xFF); 41 | data[3] = (byte)((header >> 24) & 0xFF); 42 | 43 | Encode(ref data); 44 | } 45 | else 46 | { 47 | data[0] = (byte)(Size & 0xFF); 48 | data[1] = (byte)((Size >> 8) & 0xFF); 49 | } 50 | } 51 | 52 | return data; 53 | } 54 | 55 | 56 | public void WriteGUIDByte(ulong guid, int index) 57 | { 58 | byte value = (byte)((guid >> (index * 8)) & 0xFF); 59 | if (value != 0) 60 | Write((byte)(value ^ 1)); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Plugins/MoP_15464/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using MoP_15464.Handlers; 5 | 6 | namespace MoP_15464 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "MoP (5.0.1.15464) Sandbox"; 13 | public Expansions Expansion => Expansions.MoP; 14 | public int Build => 15464; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_5610/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_5610 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_5610/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_5610 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_5610/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_5610.Handlers; 5 | 6 | namespace TBC_5610 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC Beta (2.0.0.5610) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 5610; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_5610/TBC_5610.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_5665/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_5665 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_5665/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_5665 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_5665/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_5665.Handlers; 5 | 6 | namespace TBC_5665 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC Beta (2.0.0.5665-2.0.0.5849) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 5665; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_5665/TBC_5665.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_5894/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_5894 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_5894/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_5894 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_5894/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_5894.Handlers; 5 | 6 | namespace TBC_5894 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC Beta (2.0.0.5894-2.0.0.5921) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 5894; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_5894/TBC_5894.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_5965/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_5965 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_5965/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_5965 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_5965/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_5965.Handlers; 5 | 6 | namespace TBC_5965 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC Beta (2.0.0.5965-2.0.0.6052) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 5965; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_5965/TBC_5965.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_6082/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_6082 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_6082/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_6082 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_6082/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_6082.Handlers; 5 | 6 | namespace TBC_6082 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC Beta (2.0.0.6082-2.0.2.6144) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 6082; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_6082/TBC_6082.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_6178/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_6178 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_6178/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_6178 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_6178/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_6178.Handlers; 5 | 6 | namespace TBC_6178 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC Beta (2.0.0.6178) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 6178; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_6178/TBC_6178.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_6180/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_6180 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_6180/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_6180 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_6180/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_6180.Handlers; 5 | 6 | namespace TBC_6180 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC (2.0.0.6180) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 6180; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_6180/TBC_6180.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_6213/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_6213 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_6213/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_6213 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_6213/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_6213.Handlers; 5 | 6 | namespace TBC_6213 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC Beta (2.0.0.6213-2.0.12) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 6213; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_6213/TBC_6213.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_6577/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_6577 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_6577/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_6577 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_6577/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_6577.Handlers; 5 | 6 | namespace TBC_6577 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC (2.1.0-2.2.3) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 6577; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_6577/TBC_6577.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_7561/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_7561 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_7561/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_7561 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_7561/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_7561.Handlers; 5 | 6 | namespace TBC_7561 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC (2.3.X) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 7561; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_7561/TBC_7561.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/TBC_8089/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace TBC_8089 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/TBC_8089/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace TBC_8089 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/TBC_8089/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using TBC_8089.Handlers; 5 | 6 | namespace TBC_8089 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "TBC (2.4.X) Sandbox"; 13 | public Expansions Expansion => Expansions.TBC; 14 | public int Build => 8089; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/TBC_8089/TBC_8089.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4062/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4062 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4062/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4062 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4062/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_4062.Handlers; 5 | 6 | namespace Vanilla_4062 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.1.0 - 1.2.4) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 4062; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4062/Vanilla_4062.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4284/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4284 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4284/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4284 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4284/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_4284.Handlers; 5 | 6 | namespace Vanilla_4284 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.3.X) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 4284; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4284/Vanilla_4284.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4341/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4341 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4341/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4341 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4341/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_4341.Handlers; 5 | 6 | namespace Vanilla_4341 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.4.0 - 1.5.2) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 4341; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4341/Vanilla_4341.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4500/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4500 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4500/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4500 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4500/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_4500.Handlers; 5 | 6 | namespace Vanilla_4500 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.6.X) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 4500; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4500/Vanilla_4500.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4671/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4671 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4671/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4671 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4671/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_4671.Handlers; 5 | 6 | namespace Vanilla_4671 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.7.X) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 4671; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4671/Vanilla_4671.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4735/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4735 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4735/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4735 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4735/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_4735.Handlers; 5 | 6 | namespace Vanilla_4735 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.8.X) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 4735; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4735/Vanilla_4735.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4937/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4937 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4937/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_4937 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4937/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_4937.Handlers; 5 | 6 | namespace Vanilla_4937 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.9.X) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 4937; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_4937/Vanilla_4937.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5195/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_5195 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5195/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_5195 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5195/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_5195.Handlers; 5 | 6 | namespace Vanilla_5195 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.10.X) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 5195; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5195/Vanilla_5195.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5428/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_5428 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5428/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_5428 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5428/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_5428.Handlers; 5 | 6 | namespace Vanilla_5428 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.11.X) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 5428; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5428/Vanilla_5428.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5595/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace Vanilla_5595 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5595/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace Vanilla_5595 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | return data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5595/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using Vanilla_5595.Handlers; 5 | 6 | namespace Vanilla_5595 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "Vanilla (1.12.X) Sandbox"; 13 | public Expansions Expansion => Expansions.Vanilla; 14 | public int Build => 5595; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/Vanilla_5595/Vanilla_5595.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/WotLK_10026/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace WotLK_10026 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/WotLK_10026/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace WotLK_10026 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/WotLK_10026/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using WotLK_10026.Handlers; 5 | 6 | namespace WotLK_10026 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "WotLK (3.2.x) Sandbox"; 13 | public Expansions Expansion => Expansions.WotLK; 14 | public int Build => 10026; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/WotLK_10026/WotLK_10026.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/WotLK_10958/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace WotLK_10958 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/WotLK_10958/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace WotLK_10958 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/WotLK_10958/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using WotLK_10958.Handlers; 5 | 6 | namespace WotLK_10958 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "WotLK (3.3.0-3.3.2) Sandbox"; 13 | public Expansions Expansion => Expansions.WotLK; 14 | public int Build => 10958; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/WotLK_10958/WotLK_10958.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/WotLK_11685/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace WotLK_11685 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/WotLK_11685/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace WotLK_11685 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/WotLK_11685/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using WotLK_11685.Handlers; 5 | 6 | namespace WotLK_11685 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "WotLK (3.3.x) Sandbox"; 13 | public Expansions Expansion => Expansions.WotLK; 14 | public int Build => 11685; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/WotLK_11685/WotLK_11685.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/WotLK_8303/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace WotLK_8303 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/WotLK_8303/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace WotLK_8303 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/WotLK_8303/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using WotLK_8303.Handlers; 5 | 6 | namespace WotLK_8303 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "WotLK (3.0.1.8303 - 3.0.1.8471) Sandbox"; 13 | public Expansions Expansion => Expansions.WotLK; 14 | public int Build => 8303; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/WotLK_8303/WotLK_8303.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/WotLK_8874/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace WotLK_8874 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/WotLK_8874/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace WotLK_8874 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/WotLK_8874/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using WotLK_8874.Handlers; 5 | 6 | namespace WotLK_8874 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "WotLK (3.0.1.8874) Sandbox"; 13 | public Expansions Expansion => Expansions.WotLK; 14 | public int Build => 8874; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/WotLK_8874/WotLK_8874.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/WotLK_9056/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace WotLK_9056 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/WotLK_9056/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace WotLK_9056 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/WotLK_9056/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using WotLK_9056.Handlers; 5 | 6 | namespace WotLK_9056 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "WotLK (3.0.2-3.0.9) Sandbox"; 13 | public Expansions Expansion => Expansions.WotLK; 14 | public int Build => 9056; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/WotLK_9056/WotLK_9056.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Plugins/WotLK_9614/PacketReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Common.Network; 3 | 4 | namespace WotLK_9614 5 | { 6 | public class PacketReader : BasePacketReader 7 | { 8 | public PacketReader(byte[] data, bool parse = true) : base(data) 9 | { 10 | if (parse) 11 | { 12 | Decode(ref data); 13 | ushort size = BitConverter.ToUInt16(data, 0); 14 | Size = (ushort)((size >> 8) + ((size & 0xFF) << 8) + 2); 15 | Opcode = BitConverter.ToUInt32(data, 2); 16 | 17 | Position = 6; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugins/WotLK_9614/PacketWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Common.Network; 3 | 4 | namespace WotLK_9614 5 | { 6 | public class PacketWriter : BasePacketWriter 7 | { 8 | public PacketWriter() : base() => PreAuth = true; 9 | 10 | public PacketWriter(uint opcode, string name) : base() 11 | { 12 | Name = name; 13 | Opcode = opcode; 14 | WritePacketHeader(opcode); 15 | } 16 | 17 | public override void WritePacketHeader(uint opcode) 18 | { 19 | WriteUInt16(0); 20 | WriteUInt16((ushort)opcode); 21 | } 22 | 23 | public override byte[] ReadDataToSend() 24 | { 25 | byte[] data = new byte[BaseStream.Length]; 26 | Seek(0, SeekOrigin.Begin); 27 | 28 | BaseStream.Read(data, 0, (int)BaseStream.Length); 29 | 30 | Size = (ushort)(data.Length - 2); 31 | 32 | if (!PreAuth) 33 | { 34 | data[0] = (byte)(Size >> 8); 35 | data[1] = (byte)(Size & 255); 36 | Encode(ref data); 37 | } 38 | 39 | return data; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugins/WotLK_9614/Sandbox.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | using WotLK_9614.Handlers; 5 | 6 | namespace WotLK_9614 7 | { 8 | public class Sandbox : ISandbox 9 | { 10 | public static Sandbox Instance { get; } = new Sandbox(); 11 | 12 | public string RealmName => "WotLK (3.1.x) Sandbox"; 13 | public Expansions Expansion => Expansions.WotLK; 14 | public int Build => 9614; 15 | public int RealmPort => 3724; 16 | public int RedirectPort => 9002; 17 | public int WorldPort => 8129; 18 | 19 | public IOpcodes Opcodes => new Opcodes(); 20 | 21 | public IAuthHandler AuthHandler => new AuthHandler(); 22 | public ICharHandler CharHandler => new CharHandler(); 23 | public IWorldHandler WorldHandler => new WorldHandler(); 24 | 25 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => new PacketReader(data, parse); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/WotLK_9614/WotLK_9614.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Library 4 | ..\..\bin\$(Configuration)_$(Platform)\Plugins 5 | net5.0 6 | 7 | false 8 | 9 | 10 | 11 | true 12 | full 13 | false 14 | DEBUG;TRACE 15 | prompt 16 | 4 17 | false 18 | 19 | 20 | 21 | pdbonly 22 | true 23 | TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /WorldServer/Network/RealmManager.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Sockets; 2 | using Common.Extensions; 3 | using Common.Logging; 4 | 5 | namespace WorldServer.Network 6 | { 7 | public class RealmManager 8 | { 9 | public static RealmSocket RealmSession { get; set; } 10 | public Socket RealmSocket { get; set; } 11 | public Socket ProxySocket { get; set; } 12 | 13 | public void RecieveRealm() =>WorldServer.Sandbox.AuthHandler.HandleRealmList(RealmSocket); 14 | 15 | public void RecieveProxy() 16 | { 17 | Log.Message(); 18 | Log.Message(LogType.NORMAL, "Begin redirection to WorldServer."); 19 | 20 | ProxySocket.SendData(WorldServer.Sandbox.AuthHandler.HandleRedirect()); 21 | ProxySocket.Close(); 22 | 23 | Log.Message(LogType.NORMAL, "Successfully redirected to WorldServer."); 24 | Log.Message(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WorldServer/Network/WorldSocket.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Net.Sockets; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using Common.Logging; 7 | 8 | namespace WorldServer.Network 9 | { 10 | public class WorldSocket 11 | { 12 | public bool Started { get; private set; } = false; 13 | 14 | private readonly CancellationTokenSource token; 15 | private TcpListener worldListener; 16 | 17 | public WorldSocket() => token = new CancellationTokenSource(); 18 | 19 | 20 | public bool Start() 21 | { 22 | try 23 | { 24 | worldListener = new TcpListener(IPAddress.Parse("127.0.0.1"), WorldServer.Sandbox.WorldPort); 25 | worldListener.Start(); 26 | Started = true; 27 | } 28 | catch (Exception e) 29 | { 30 | Log.Message(LogType.ERROR, "{0}", e.Message); 31 | Log.Message(); 32 | Started = false; 33 | } 34 | 35 | return Started; 36 | } 37 | 38 | public void StartConnectionThread() => new Thread(AcceptConnection).Start(); 39 | 40 | 41 | private void AcceptConnection() 42 | { 43 | while (true) 44 | { 45 | Thread.Sleep(1); 46 | if (worldListener.Pending()) 47 | { 48 | WorldManager World = new WorldManager 49 | { 50 | Socket = worldListener.AcceptSocket() 51 | }; 52 | 53 | World.Handshake(); 54 | Task.Run(World.Recieve, token.Token); 55 | } 56 | } 57 | } 58 | 59 | private void Dispose() 60 | { 61 | token.Cancel(); 62 | worldListener.Stop(); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /WorldServer/SandboxHost.cs: -------------------------------------------------------------------------------- 1 | using Common.Constants; 2 | using Common.Interfaces; 3 | using Common.Interfaces.Handlers; 4 | 5 | namespace WorldServer 6 | { 7 | public class SandboxHost : ISandbox 8 | { 9 | private readonly ISandbox _instance; 10 | 11 | public SandboxHost(ISandbox sandbox) 12 | { 13 | _instance = sandbox; 14 | } 15 | 16 | public string RealmName => _instance.RealmName; 17 | public Expansions Expansion => _instance.Expansion; 18 | public int Build => _instance.Build; 19 | public int RealmPort => _instance.RealmPort; 20 | public int RedirectPort => _instance.RedirectPort; 21 | public int WorldPort => _instance.WorldPort; 22 | 23 | public IOpcodes Opcodes => _instance.Opcodes; 24 | 25 | public IAuthHandler AuthHandler => _instance.AuthHandler; 26 | public ICharHandler CharHandler => _instance.CharHandler; 27 | public IWorldHandler WorldHandler => _instance.WorldHandler; 28 | 29 | public IPacketReader ReadPacket(byte[] data, bool parse = true) => _instance.ReadPacket(data, parse); 30 | 31 | public override string ToString() => _instance.RealmName; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /WorldServer/WorldServer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | ..\bin\$(Configuration)_$(Platform)\ 5 | net5.0 6 | 7 | AIO Sandbox 8 | WorldServer 9 | false 10 | 11 | 12 | 13 | true 14 | full 15 | false 16 | DEBUG;TRACE 17 | prompt 18 | 4 19 | false 20 | 21 | 22 | 23 | pdbonly 24 | true 25 | TRACE 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | PreserveNewest 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /WorldServer/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barncastle/AIO-Sandbox/a482f9cf7fd03c6045192f39bf1498526f6f4655/WorldServer/favicon.ico -------------------------------------------------------------------------------- /WorldServer/settings.conf: -------------------------------------------------------------------------------- 1 | [Settings] 2 | Expansion=3 3 | Password=admin --------------------------------------------------------------------------------