diff --git a/Server/Client.cs b/Server/Client.cs index 955cd24..6b650c5 100644 --- a/Server/Client.cs +++ b/Server/Client.cs @@ -232,9 +232,8 @@ namespace PSO2SERVER { // Check for and create packets directory if it doesn't exist var packetPath = string.Format( - "packets/{0}/0x{1:X2} - 0x{2:X2}" + "packets/{0}" , _server.StartTime.ToShortDateString().Replace('/', '-') - , typeA, typeB ); if (!Directory.Exists(packetPath)) @@ -264,9 +263,8 @@ namespace PSO2SERVER { // Check for and create packets directory if it doesn't exist var packetPath = string.Format( - "UnkClientPackets/{0}/0x{1:X2} - 0x{2:X2}" + "UnkClientPackets/{0}" , _server.StartTime.ToShortDateString().Replace('/', '-') - , typeA, typeB ); if (!Directory.Exists(packetPath)) Directory.CreateDirectory(packetPath); diff --git a/Server/ConsoleSystem.cs b/Server/ConsoleSystem.cs index 749e288..f859d94 100644 --- a/Server/ConsoleSystem.cs +++ b/Server/ConsoleSystem.cs @@ -991,7 +991,7 @@ namespace PSO2SERVER - context.SendPacket(new NoPayloadPacket(0x03, 0x2B)); + context.SendPacket(new UnlockControlsPacket()); } diff --git a/Server/Models/FixedPackets.cs b/Server/Models/FixedPackets.cs index be4eccb..b74258a 100644 --- a/Server/Models/FixedPackets.cs +++ b/Server/Models/FixedPackets.cs @@ -37,7 +37,7 @@ namespace PSO2SERVER.Models public enum PacketFlags : byte { None, - PACKED = 0x4, + PACKED = 0x04, FLAG_10 = 0x10, FULL_MOVEMENT = 0x20, OBJECT_RELATED = 0x40 diff --git a/Server/Packets/Handlers/03-00-MapTransfer.cs b/Server/Packets/Handlers/03-ServerHandler/03-00-MapTransfer.cs similarity index 100% rename from Server/Packets/Handlers/03-00-MapTransfer.cs rename to Server/Packets/Handlers/03-ServerHandler/03-00-MapTransfer.cs diff --git a/Server/Packets/Handlers/03-03-InitialLoad.cs b/Server/Packets/Handlers/03-ServerHandler/03-03-InitialLoad.cs similarity index 100% rename from Server/Packets/Handlers/03-03-InitialLoad.cs rename to Server/Packets/Handlers/03-ServerHandler/03-03-InitialLoad.cs diff --git a/Server/Packets/Handlers/03-06-UNK.cs b/Server/Packets/Handlers/03-ServerHandler/03-06-UNK.cs similarity index 100% rename from Server/Packets/Handlers/03-06-UNK.cs rename to Server/Packets/Handlers/03-ServerHandler/03-06-UNK.cs diff --git a/Server/Packets/Handlers/03-0C-PingResponse.cs b/Server/Packets/Handlers/03-ServerHandler/03-0C-PingResponse.cs similarity index 100% rename from Server/Packets/Handlers/03-0C-PingResponse.cs rename to Server/Packets/Handlers/03-ServerHandler/03-0C-PingResponse.cs diff --git a/Server/Packets/Handlers/03-10-DoItMaybe.cs b/Server/Packets/Handlers/03-ServerHandler/03-10-DoItMaybe.cs similarity index 90% rename from Server/Packets/Handlers/03-10-DoItMaybe.cs rename to Server/Packets/Handlers/03-ServerHandler/03-10-DoItMaybe.cs index 0f39223..5f2b7c1 100644 --- a/Server/Packets/Handlers/03-10-DoItMaybe.cs +++ b/Server/Packets/Handlers/03-ServerHandler/03-10-DoItMaybe.cs @@ -17,7 +17,7 @@ namespace PSO2SERVER.Packets.Handlers if (context.User == null || context.Character == null) return; - context.SendPacket(new NoPayloadPacket(0x03, 0x23)); + context.SendPacket(new LoadingScreenRemovePacket()); } #endregion diff --git a/Server/Packets/Handlers/03-12-CampshipTeleport.cs b/Server/Packets/Handlers/03-ServerHandler/03-12-CampshipTeleport.cs similarity index 100% rename from Server/Packets/Handlers/03-12-CampshipTeleport.cs rename to Server/Packets/Handlers/03-ServerHandler/03-12-CampshipTeleport.cs diff --git a/Server/Packets/Handlers/03-16-CampshipTeleportDown.cs b/Server/Packets/Handlers/03-ServerHandler/03-16-CampshipTeleportDown.cs similarity index 100% rename from Server/Packets/Handlers/03-16-CampshipTeleportDown.cs rename to Server/Packets/Handlers/03-ServerHandler/03-16-CampshipTeleportDown.cs diff --git a/Server/Packets/Handlers/03-34-ReturnToLobbyHandler.cs b/Server/Packets/Handlers/03-ServerHandler/03-34-TeleportCasinoToLobby.cs similarity index 93% rename from Server/Packets/Handlers/03-34-ReturnToLobbyHandler.cs rename to Server/Packets/Handlers/03-ServerHandler/03-34-TeleportCasinoToLobby.cs index 15f35fc..62498cb 100644 --- a/Server/Packets/Handlers/03-34-ReturnToLobbyHandler.cs +++ b/Server/Packets/Handlers/03-ServerHandler/03-34-TeleportCasinoToLobby.cs @@ -11,8 +11,9 @@ using PSO2SERVER.Zone; namespace PSO2SERVER.Packets.Handlers { [PacketHandlerAttr(0x03, 0x34)] - class ReturnToLobbyHandler : PacketHandler + class TeleportCasinoToLobby : PacketHandler { + /// (0x03, 0x34) Move Casino -> Lobby. public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size) { PacketReader reader = new PacketReader(data); diff --git a/Server/Packets/Handlers/03-35-CasinoTeleportHandler.cs b/Server/Packets/Handlers/03-ServerHandler/03-35-TeleportLobbyToCasino.cs similarity index 90% rename from Server/Packets/Handlers/03-35-CasinoTeleportHandler.cs rename to Server/Packets/Handlers/03-ServerHandler/03-35-TeleportLobbyToCasino.cs index 495e23a..dcd3422 100644 --- a/Server/Packets/Handlers/03-35-CasinoTeleportHandler.cs +++ b/Server/Packets/Handlers/03-ServerHandler/03-35-TeleportLobbyToCasino.cs @@ -10,8 +10,9 @@ using System.Text; namespace PSO2SERVER.Packets.Handlers { [PacketHandlerAttr(0x03, 0x35)] - class CasinoTeleportHandler : PacketHandler + class TeleportLobbyToCasino : PacketHandler { + /// (0x03, 0x35) Move Lobby -> Casino. public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size) { if (context.User == null) diff --git a/Server/Packets/Handlers/03-ServerHandler/03-38-TeleportBridgeToLobby.cs b/Server/Packets/Handlers/03-ServerHandler/03-38-TeleportBridgeToLobby.cs new file mode 100644 index 0000000..6b05f99 --- /dev/null +++ b/Server/Packets/Handlers/03-ServerHandler/03-38-TeleportBridgeToLobby.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using PSO2SERVER.Models; +using PSO2SERVER.Object; +using PSO2SERVER.Packets.PSOPackets; +using PSO2SERVER.Zone; + +namespace PSO2SERVER.Packets.Handlers +{ + [PacketHandlerAttr(0x03, 0x38)] + class TeleportBridgeToLobby : PacketHandler + { + /// (0x03, 0x38) Move Bridge -> Lobby. TODO + public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size) + { + PacketReader reader = new PacketReader(data); + + reader.ReadUInt64(); // Skip 8 bytes + if(reader.ReadUInt32() != 0x10) + { + Logger.WriteWarning("[WRN] Packet 0x3 0x34's first value was not 0x10! Investigate."); + } + + uint partOfLobby = reader.ReadUInt32(); + PSOLocation destination; + if(partOfLobby == 0) // Gate area + { + destination = new PSOLocation(0f, 1f, 0f, 0f, -0.22f, 2.4f, 198.75f); + } + else // Shop area + { + destination = new PSOLocation(0f, 1f, 0f, 20f, 0.20f, 1.23f, -175.25f); + } + Map lobbyMap = ZoneManager.Instance.MapFromInstance("lobby", "lobby"); + lobbyMap.SpawnClient(context, destination, "lobby"); + + } + } +} diff --git a/Server/Packets/Handlers/03-ServerHandler/03-39-TeleportLobbyToBridge.cs b/Server/Packets/Handlers/03-ServerHandler/03-39-TeleportLobbyToBridge.cs new file mode 100644 index 0000000..9aee467 --- /dev/null +++ b/Server/Packets/Handlers/03-ServerHandler/03-39-TeleportLobbyToBridge.cs @@ -0,0 +1,30 @@ +using PSO2SERVER.Models; +using PSO2SERVER.Object; +using PSO2SERVER.Packets.PSOPackets; +using PSO2SERVER.Zone; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace PSO2SERVER.Packets.Handlers +{ + [PacketHandlerAttr(0x03, 0x39)] + class TeleportLobbyToBridge : PacketHandler + { + /// (0x03, 0x39) Move Lobby -> Bridge. + public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size) + { + if (context.User == null) + return; + + // Dunno what these are yet. + context.SendPacket(0x11, 0xA, 0x0, BitConverter.GetBytes(context.User.PlayerId)); + context.SendPacket(0x1E, 0xC, 0x0, BitConverter.GetBytes(101)); + + Map bridgeMap = ZoneManager.Instance.MapFromInstance("bridge", "lobby"); + bridgeMap.SpawnClient(context, bridgeMap.GetDefaultLocation()); + + } + } +} diff --git a/Server/Packets/Handlers/03-ServerHandler/03-3B-TeleportCafeToLobby.cs b/Server/Packets/Handlers/03-ServerHandler/03-3B-TeleportCafeToLobby.cs new file mode 100644 index 0000000..1cfb06a --- /dev/null +++ b/Server/Packets/Handlers/03-ServerHandler/03-3B-TeleportCafeToLobby.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using PSO2SERVER.Models; +using PSO2SERVER.Object; +using PSO2SERVER.Packets.PSOPackets; +using PSO2SERVER.Zone; + +namespace PSO2SERVER.Packets.Handlers +{ + [PacketHandlerAttr(0x03, 0x3B)] + class TeleportCafeToLobby : PacketHandler + { + /// (0x03, 0x3B) Move Cafe -> Lobby. + public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size) + { + PacketReader reader = new PacketReader(data); + + reader.ReadUInt64(); // Skip 8 bytes + if(reader.ReadUInt32() != 0x10) + { + Logger.WriteWarning("[WRN] Packet 0x3 0x34's first value was not 0x10! Investigate."); + } + + uint partOfLobby = reader.ReadUInt32(); + PSOLocation destination; + if(partOfLobby == 0) // Gate area + { + destination = new PSOLocation(0f, 1f, 0f, 0f, -0.22f, 2.4f, 198.75f); + } + else // Shop area + { + destination = new PSOLocation(0f, 1f, 0f, 20f, 0.20f, 1.23f, -175.25f); + } + Map lobbyMap = ZoneManager.Instance.MapFromInstance("lobby", "lobby"); + lobbyMap.SpawnClient(context, destination, "lobby"); + + } + } +} diff --git a/Server/Packets/Handlers/03-ServerHandler/03-3C-TeleportLobbyToCafe.cs b/Server/Packets/Handlers/03-ServerHandler/03-3C-TeleportLobbyToCafe.cs new file mode 100644 index 0000000..f38cd57 --- /dev/null +++ b/Server/Packets/Handlers/03-ServerHandler/03-3C-TeleportLobbyToCafe.cs @@ -0,0 +1,30 @@ +using PSO2SERVER.Models; +using PSO2SERVER.Object; +using PSO2SERVER.Packets.PSOPackets; +using PSO2SERVER.Zone; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace PSO2SERVER.Packets.Handlers +{ + [PacketHandlerAttr(0x03, 0x3C)] + class TeleportLobbyToCafe : PacketHandler + { + /// (0x03, 0x3C) Move Lobby -> Cafe. + public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size) + { + if (context.User == null) + return; + + // Dunno what these are yet. + context.SendPacket(0x11, 0xA, 0x0, BitConverter.GetBytes(context.User.PlayerId)); + context.SendPacket(0x1E, 0xC, 0x0, BitConverter.GetBytes(101)); + + Map dstMap = ZoneManager.Instance.MapFromInstance("cafe", "lobby"); + dstMap.SpawnClient(context, dstMap.GetDefaultLocation()); + + } + } +} diff --git a/Server/Packets/Handlers/04-07-MovementHandlers.cs b/Server/Packets/Handlers/04-ObjectHandler/04-07-MovementHandlers.cs similarity index 100% rename from Server/Packets/Handlers/04-07-MovementHandlers.cs rename to Server/Packets/Handlers/04-ObjectHandler/04-07-MovementHandlers.cs diff --git a/Server/Packets/Handlers/04-08-MovementActionHandler.cs b/Server/Packets/Handlers/04-ObjectHandler/04-08-MovementActionHandler.cs similarity index 100% rename from Server/Packets/Handlers/04-08-MovementActionHandler.cs rename to Server/Packets/Handlers/04-ObjectHandler/04-08-MovementActionHandler.cs diff --git a/Server/Packets/Handlers/04-13-UNK.cs b/Server/Packets/Handlers/04-ObjectHandler/04-13-UNK.cs similarity index 100% rename from Server/Packets/Handlers/04-13-UNK.cs rename to Server/Packets/Handlers/04-ObjectHandler/04-13-UNK.cs diff --git a/Server/Packets/Handlers/04-14-ObjectInteract.cs b/Server/Packets/Handlers/04-ObjectHandler/04-14-ObjectInteract.cs similarity index 100% rename from Server/Packets/Handlers/04-14-ObjectInteract.cs rename to Server/Packets/Handlers/04-ObjectHandler/04-14-ObjectInteract.cs diff --git a/Server/Packets/Handlers/04-3C-ActionUpdateHandler.cs b/Server/Packets/Handlers/04-ObjectHandler/04-3C-ActionUpdateHandler.cs similarity index 100% rename from Server/Packets/Handlers/04-3C-ActionUpdateHandler.cs rename to Server/Packets/Handlers/04-ObjectHandler/04-3C-ActionUpdateHandler.cs diff --git a/Server/Packets/Handlers/04-71-MovementEndHandler.cs b/Server/Packets/Handlers/04-ObjectHandler/04-71-MovementEndHandler.cs similarity index 100% rename from Server/Packets/Handlers/04-71-MovementEndHandler.cs rename to Server/Packets/Handlers/04-ObjectHandler/04-71-MovementEndHandler.cs diff --git a/Server/Packets/Handlers/07-00-ChatHandler.cs b/Server/Packets/Handlers/07-ChatHandler/07-00-ChatHandler.cs similarity index 71% rename from Server/Packets/Handlers/07-00-ChatHandler.cs rename to Server/Packets/Handlers/07-ChatHandler/07-00-ChatHandler.cs index d59e304..3979d35 100644 --- a/Server/Packets/Handlers/07-00-ChatHandler.cs +++ b/Server/Packets/Handlers/07-ChatHandler/07-00-ChatHandler.cs @@ -8,27 +8,6 @@ namespace PSO2SERVER.Packets.Handlers [PacketHandlerAttr(0x07, 0x00)] public class ChatHandler : PacketHandler { - //public uint Unk1 { get; set; } - //public uint Unk2 { get; set; } - //public uint Unk3 { get; set; } - //public byte[] VerId { get; set; } = new byte[0x20]; - //public List Interfaces { get; set; } = new List(); - //public byte[] Unk4 { get; set; } = new byte[0x90]; - //public byte[] Unk5 { get; set; } = new byte[0x10]; - //public Language TextLang { get; set; } - //public Language VoiceLang { get; set; } - //public Language TextLang2 { get; set; } - //public Language LangLang { get; set; } - //public string Language { get; set; } = new string(' ', 0x10); - //public uint Unk6 { get; set; } - //public uint Unk7 { get; set; } - //public uint Magic1 { get; set; } - //public byte[] Unk8 { get; set; } = new byte[0x20]; - //public byte[] Unk9 { get; set; } = new byte[0x44]; - //public string Username { get; set; } = new string(' ', 0x40); - //public string Password { get; set; } = new string(' ', 0x40); - //public uint Unk10 { get; set; } - //public string Unk11 { get; set; } #region implemented abstract members of PacketHandler public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size) diff --git a/Server/Packets/Handlers/0B-09-UNK.cs b/Server/Packets/Handlers/0B-QuestHandler/0B-09-UNK.cs similarity index 100% rename from Server/Packets/Handlers/0B-09-UNK.cs rename to Server/Packets/Handlers/0B-QuestHandler/0B-09-UNK.cs diff --git a/Server/Packets/Handlers/0B-15-QuestCounterAvailableHander.cs b/Server/Packets/Handlers/0B-QuestHandler/0B-15-QuestCounterAvailableHander.cs similarity index 100% rename from Server/Packets/Handlers/0B-15-QuestCounterAvailableHander.cs rename to Server/Packets/Handlers/0B-QuestHandler/0B-15-QuestCounterAvailableHander.cs diff --git a/Server/Packets/Handlers/0B-17-QuestListRequestHandler.cs b/Server/Packets/Handlers/0B-QuestHandler/0B-17-QuestListRequestHandler.cs similarity index 100% rename from Server/Packets/Handlers/0B-17-QuestListRequestHandler.cs rename to Server/Packets/Handlers/0B-QuestHandler/0B-17-QuestListRequestHandler.cs diff --git a/Server/Packets/Handlers/0B-19-QuestDifficultyRequestHandler.cs b/Server/Packets/Handlers/0B-QuestHandler/0B-19-QuestDifficultyRequestHandler.cs similarity index 100% rename from Server/Packets/Handlers/0B-19-QuestDifficultyRequestHandler.cs rename to Server/Packets/Handlers/0B-QuestHandler/0B-19-QuestDifficultyRequestHandler.cs diff --git a/Server/Packets/Handlers/0B-30-QuestCounterHandler.cs b/Server/Packets/Handlers/0B-QuestHandler/0B-30-QuestCounterHandler.cs similarity index 100% rename from Server/Packets/Handlers/0B-30-QuestCounterHandler.cs rename to Server/Packets/Handlers/0B-QuestHandler/0B-30-QuestCounterHandler.cs diff --git a/Server/Packets/Handlers/0E-0C-QuestCounterHandler.cs b/Server/Packets/Handlers/0E-PartyHandler/0E-0C-QuestCounterHandler.cs similarity index 100% rename from Server/Packets/Handlers/0E-0C-QuestCounterHandler.cs rename to Server/Packets/Handlers/0E-PartyHandler/0E-0C-QuestCounterHandler.cs diff --git a/Server/Packets/Handlers/0E-19-UNK.cs b/Server/Packets/Handlers/0E-PartyHandler/0E-19-UNK.cs similarity index 100% rename from Server/Packets/Handlers/0E-19-UNK.cs rename to Server/Packets/Handlers/0E-PartyHandler/0E-19-UNK.cs diff --git a/Server/Packets/Handlers/11-00-Login.cs b/Server/Packets/Handlers/11-ClientHandler/11-00-Login.cs similarity index 100% rename from Server/Packets/Handlers/11-00-Login.cs rename to Server/Packets/Handlers/11-ClientHandler/11-00-Login.cs diff --git a/Server/Packets/Handlers/11-02-CharacterList.cs b/Server/Packets/Handlers/11-ClientHandler/11-02-CharacterList.cs similarity index 100% rename from Server/Packets/Handlers/11-02-CharacterList.cs rename to Server/Packets/Handlers/11-ClientHandler/11-02-CharacterList.cs diff --git a/Server/Packets/Handlers/11-04-StartGame.cs b/Server/Packets/Handlers/11-ClientHandler/11-04-StartGame.cs similarity index 100% rename from Server/Packets/Handlers/11-04-StartGame.cs rename to Server/Packets/Handlers/11-ClientHandler/11-04-StartGame.cs diff --git a/Server/Packets/Handlers/11-05-CharacterCreate.cs b/Server/Packets/Handlers/11-ClientHandler/11-05-CharacterCreate.cs similarity index 100% rename from Server/Packets/Handlers/11-05-CharacterCreate.cs rename to Server/Packets/Handlers/11-ClientHandler/11-05-CharacterCreate.cs diff --git a/Server/Packets/Handlers/11-06-DeleteCharacter.cs b/Server/Packets/Handlers/11-ClientHandler/11-06-DeleteCharacter.cs similarity index 100% rename from Server/Packets/Handlers/11-06-DeleteCharacter.cs rename to Server/Packets/Handlers/11-ClientHandler/11-06-DeleteCharacter.cs diff --git a/Server/Packets/Handlers/11-0B-KeyExchange.cs b/Server/Packets/Handlers/11-ClientHandler/11-0B-KeyExchange.cs similarity index 100% rename from Server/Packets/Handlers/11-0B-KeyExchange.cs rename to Server/Packets/Handlers/11-ClientHandler/11-0B-KeyExchange.cs diff --git a/Server/Packets/Handlers/11-0D-PingTimestampResponse.cs b/Server/Packets/Handlers/11-ClientHandler/11-0D-PingTimestampResponse.cs similarity index 100% rename from Server/Packets/Handlers/11-0D-PingTimestampResponse.cs rename to Server/Packets/Handlers/11-ClientHandler/11-0D-PingTimestampResponse.cs diff --git a/Server/Packets/Handlers/11-1D-GuildInfoRequest.cs b/Server/Packets/Handlers/11-ClientHandler/11-1D-GuildInfoRequest.cs similarity index 100% rename from Server/Packets/Handlers/11-1D-GuildInfoRequest.cs rename to Server/Packets/Handlers/11-ClientHandler/11-1D-GuildInfoRequest.cs diff --git a/Server/Packets/Handlers/11-2B-LogOutRequest.cs b/Server/Packets/Handlers/11-ClientHandler/11-2B-LogOutRequest.cs similarity index 100% rename from Server/Packets/Handlers/11-2B-LogOutRequest.cs rename to Server/Packets/Handlers/11-ClientHandler/11-2B-LogOutRequest.cs diff --git a/Server/Packets/Handlers/11-3E-CharacterSpawn.cs b/Server/Packets/Handlers/11-ClientHandler/11-3E-CharacterSpawn.cs similarity index 96% rename from Server/Packets/Handlers/11-3E-CharacterSpawn.cs rename to Server/Packets/Handlers/11-ClientHandler/11-3E-CharacterSpawn.cs index 3cd6e45..6f8c238 100644 --- a/Server/Packets/Handlers/11-3E-CharacterSpawn.cs +++ b/Server/Packets/Handlers/11-ClientHandler/11-3E-CharacterSpawn.cs @@ -37,7 +37,7 @@ namespace PSO2SERVER.Packets.Handlers lobbyMap.SpawnClient(context, lobbyMap.GetDefaultLocation(), "lobby"); // Unlock Controls - context.SendPacket(new NoPayloadPacket(0x03, 0x2B)); + context.SendPacket(new UnlockControlsPacket()); //context.SendPacket(File.ReadAllBytes("testbed/237.23-7.210.189.208.30.bin")); diff --git a/Server/Packets/Handlers/11-41-CreateCharacterOne.cs b/Server/Packets/Handlers/11-ClientHandler/11-41-CreateCharacterOne.cs similarity index 100% rename from Server/Packets/Handlers/11-41-CreateCharacterOne.cs rename to Server/Packets/Handlers/11-ClientHandler/11-41-CreateCharacterOne.cs diff --git a/Server/Packets/Handlers/11-54-CreateCharacterTwo.cs b/Server/Packets/Handlers/11-ClientHandler/11-54-CreateCharacterTwo.cs similarity index 100% rename from Server/Packets/Handlers/11-54-CreateCharacterTwo.cs rename to Server/Packets/Handlers/11-ClientHandler/11-54-CreateCharacterTwo.cs diff --git a/Server/Packets/Handlers/2F-06-SymbolArtHandler.cs b/Server/Packets/Handlers/2F-SymbolHandler/2F-06-SymbolArtHandler.cs similarity index 100% rename from Server/Packets/Handlers/2F-06-SymbolArtHandler.cs rename to Server/Packets/Handlers/2F-SymbolHandler/2F-06-SymbolArtHandler.cs diff --git a/Server/Packets/PacketHandler.cs b/Server/Packets/Handlers/PacketHandler.cs similarity index 100% rename from Server/Packets/PacketHandler.cs rename to Server/Packets/Handlers/PacketHandler.cs diff --git a/Server/Packets/PSOPackets/03-04-LoadingScreenTransitionPacket.cs b/Server/Packets/PSOPackets/03-ServerPacket/03-04-LoadingScreenTransitionPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/03-04-LoadingScreenTransitionPacket.cs rename to Server/Packets/PSOPackets/03-ServerPacket/03-04-LoadingScreenTransitionPacket.cs diff --git a/Server/Packets/PSOPackets/03-08-ServerHelloPacket.cs b/Server/Packets/PSOPackets/03-ServerPacket/03-08-ServerHelloPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/03-08-ServerHelloPacket.cs rename to Server/Packets/PSOPackets/03-ServerPacket/03-08-ServerHelloPacket.cs diff --git a/Server/Packets/PSOPackets/03-ServerPacket/03-23-LoadingScreenRemovePacket.cs b/Server/Packets/PSOPackets/03-ServerPacket/03-23-LoadingScreenRemovePacket.cs new file mode 100644 index 0000000..a77eee7 --- /dev/null +++ b/Server/Packets/PSOPackets/03-ServerPacket/03-23-LoadingScreenRemovePacket.cs @@ -0,0 +1,38 @@ +using PSO2SERVER.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace PSO2SERVER.Packets.PSOPackets +{ + public class LoadingScreenRemovePacket : Packet + { + private readonly byte _subtype; + private readonly byte _type; + + public LoadingScreenRemovePacket() + { + _type = 0x03; + _subtype = 0x23; + } + + #region implemented abstract members of Packet + + public override byte[] Build() + { + return new byte[0]; + } + + public override PacketHeader GetHeader() + { + return new PacketHeader + { + Type = _type, + Subtype = _subtype + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/Server/Packets/PSOPackets/03-ServerPacket/03-24-LoadingLevelPacket.cs b/Server/Packets/PSOPackets/03-ServerPacket/03-24-LoadingLevelPacket.cs new file mode 100644 index 0000000..e94e9fa --- /dev/null +++ b/Server/Packets/PSOPackets/03-ServerPacket/03-24-LoadingLevelPacket.cs @@ -0,0 +1,34 @@ +using PSO2SERVER.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace PSO2SERVER.Packets.PSOPackets +{ + public class LoadingLevelPacket : Packet + { + private readonly byte _subtype; + private readonly byte _type; + + public LoadingLevelPacket() + { + _type = 0x03; + _subtype = 0x24; + } + + #region implemented abstract members of Packet + + public override byte[] Build() + { + return new byte[0]; + } + + public override PacketHeader GetHeader() + { + return new PacketHeader(_type, _subtype, PacketFlags.PACKED); + } + + #endregion + } +} \ No newline at end of file diff --git a/Server/Packets/PSOPackets/03-ServerPacket/03-2B-UnlockControlsPacket.cs b/Server/Packets/PSOPackets/03-ServerPacket/03-2B-UnlockControlsPacket.cs new file mode 100644 index 0000000..1c44671 --- /dev/null +++ b/Server/Packets/PSOPackets/03-ServerPacket/03-2B-UnlockControlsPacket.cs @@ -0,0 +1,38 @@ +using PSO2SERVER.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace PSO2SERVER.Packets.PSOPackets +{ + public class UnlockControlsPacket : Packet + { + private readonly byte _subtype; + private readonly byte _type; + + public UnlockControlsPacket() + { + _type = 0x03; + _subtype = 0x2B; + } + + #region implemented abstract members of Packet + + public override byte[] Build() + { + return new byte[0]; + } + + public override PacketHeader GetHeader() + { + return new PacketHeader + { + Type = _type, + Subtype = _subtype + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/Server/Packets/PSOPackets/04-02-TeleportTransferPacket.cs b/Server/Packets/PSOPackets/04-ObjectPacket/04-02-TeleportTransferPacket.cs similarity index 90% rename from Server/Packets/PSOPackets/04-02-TeleportTransferPacket.cs rename to Server/Packets/PSOPackets/04-ObjectPacket/04-02-TeleportTransferPacket.cs index 71bc1d1..44f4121 100644 --- a/Server/Packets/PSOPackets/04-02-TeleportTransferPacket.cs +++ b/Server/Packets/PSOPackets/04-ObjectPacket/04-02-TeleportTransferPacket.cs @@ -26,7 +26,7 @@ namespace PSO2SERVER.Packets.PSOPackets public override PacketHeader GetHeader() { - return new PacketHeader(0x4, 0x2, PacketFlags.OBJECT_RELATED); + return new PacketHeader(0x04, 0x02, PacketFlags.OBJECT_RELATED); } } } diff --git a/Server/Packets/PSOPackets/04-07-MovementPacket.cs b/Server/Packets/PSOPackets/04-ObjectPacket/04-07-MovementPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/04-07-MovementPacket.cs rename to Server/Packets/PSOPackets/04-ObjectPacket/04-07-MovementPacket.cs diff --git a/Server/Packets/PSOPackets/04-15-ObjectActionPacket.cs b/Server/Packets/PSOPackets/04-ObjectPacket/04-15-ObjectActionPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/04-15-ObjectActionPacket.cs rename to Server/Packets/PSOPackets/04-ObjectPacket/04-15-ObjectActionPacket.cs diff --git a/Server/Packets/PSOPackets/08-04-CharacterSpawnPacket.cs b/Server/Packets/PSOPackets/08-SpawnPacket/08-04-CharacterSpawnPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/08-04-CharacterSpawnPacket.cs rename to Server/Packets/PSOPackets/08-SpawnPacket/08-04-CharacterSpawnPacket.cs diff --git a/Server/Packets/PSOPackets/0B-16-QuestAvailablePacket.cs b/Server/Packets/PSOPackets/0B-QuestPacket/0B-16-QuestAvailablePacket.cs similarity index 100% rename from Server/Packets/PSOPackets/0B-16-QuestAvailablePacket.cs rename to Server/Packets/PSOPackets/0B-QuestPacket/0B-16-QuestAvailablePacket.cs diff --git a/Server/Packets/PSOPackets/0B-18-QuestListPacket.cs b/Server/Packets/PSOPackets/0B-QuestPacket/0B-18-QuestListPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/0B-18-QuestListPacket.cs rename to Server/Packets/PSOPackets/0B-QuestPacket/0B-18-QuestListPacket.cs diff --git a/Server/Packets/PSOPackets/0B-1A-QuestDifficultyPacket.cs b/Server/Packets/PSOPackets/0B-QuestPacket/0B-1A-QuestDifficultyPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/0B-1A-QuestDifficultyPacket.cs rename to Server/Packets/PSOPackets/0B-QuestPacket/0B-1A-QuestDifficultyPacket.cs diff --git a/Server/Packets/PSOPackets/0E-02-PartyInitPacket.cs b/Server/Packets/PSOPackets/0E-PartyPacket/0E-02-PartyInitPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/0E-02-PartyInitPacket.cs rename to Server/Packets/PSOPackets/0E-PartyPacket/0E-02-PartyInitPacket.cs diff --git a/Server/Packets/PSOPackets/0E-25-SetQuestPacket.cs b/Server/Packets/PSOPackets/0E-PartyPacket/0E-25-SetQuestPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/0E-25-SetQuestPacket.cs rename to Server/Packets/PSOPackets/0E-PartyPacket/0E-25-SetQuestPacket.cs diff --git a/Server/Packets/PSOPackets/0E-31-QuestStartPacket.cs b/Server/Packets/PSOPackets/0E-PartyPacket/0E-31-QuestStartPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/0E-31-QuestStartPacket.cs rename to Server/Packets/PSOPackets/0E-PartyPacket/0E-31-QuestStartPacket.cs diff --git a/Server/Packets/PSOPackets/0F-14-SetMesetaPacket.cs b/Server/Packets/PSOPackets/0F-ItemPacket/0F-14-SetMesetaPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/0F-14-SetMesetaPacket.cs rename to Server/Packets/PSOPackets/0F-ItemPacket/0F-14-SetMesetaPacket.cs diff --git a/Server/Packets/PSOPackets/11-01-LoginDataPacket.cs b/Server/Packets/PSOPackets/11-ClientPacket/11-01-LoginDataPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/11-01-LoginDataPacket.cs rename to Server/Packets/PSOPackets/11-ClientPacket/11-01-LoginDataPacket.cs diff --git a/Server/Packets/PSOPackets/11-1C-SetCurrencyPacket.cs b/Server/Packets/PSOPackets/11-ClientPacket/11-1C-SetCurrencyPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/11-1C-SetCurrencyPacket.cs rename to Server/Packets/PSOPackets/11-ClientPacket/11-1C-SetCurrencyPacket.cs diff --git a/Server/Packets/PSOPackets/19-01-SystemMessagePacket.cs b/Server/Packets/PSOPackets/19-LobbyPacket/19-01-SystemMessagePacket.cs similarity index 100% rename from Server/Packets/PSOPackets/19-01-SystemMessagePacket.cs rename to Server/Packets/PSOPackets/19-LobbyPacket/19-01-SystemMessagePacket.cs diff --git a/Server/Packets/PSOPackets/1C-1F-GuildInfoPacket.cs b/Server/Packets/PSOPackets/1C-AlliancePacket/1C-1F-GuildInfoPacket.cs similarity index 100% rename from Server/Packets/PSOPackets/1C-1F-GuildInfoPacket.cs rename to Server/Packets/PSOPackets/1C-AlliancePacket/1C-1F-GuildInfoPacket.cs diff --git a/Server/Packets/PSOPackets/21-01-PalettePacket.cs b/Server/Packets/PSOPackets/21-PalettePacket/21-01-PalettePacket.cs similarity index 100% rename from Server/Packets/PSOPackets/21-01-PalettePacket.cs rename to Server/Packets/PSOPackets/21-PalettePacket/21-01-PalettePacket.cs diff --git a/Server/Packets/PSOPackets/2F-07-SymbolArtList.cs b/Server/Packets/PSOPackets/2F-SymbolPacket/2F-07-SymbolArtList.cs similarity index 100% rename from Server/Packets/PSOPackets/2F-07-SymbolArtList.cs rename to Server/Packets/PSOPackets/2F-SymbolPacket/2F-07-SymbolArtList.cs diff --git a/Server/Packets/NoPayloadPacket.cs b/Server/Packets/PSOPackets/NoPayloadPacket.cs similarity index 100% rename from Server/Packets/NoPayloadPacket.cs rename to Server/Packets/PSOPackets/NoPayloadPacket.cs diff --git a/Server/Server.csproj b/Server/Server.csproj index 52527e4..c36edd1 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -170,52 +170,59 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -224,11 +231,11 @@ - - - + + + - + @@ -238,15 +245,15 @@ - - + + - - - - - - + + + + + + diff --git a/Server/Zone/Map.cs b/Server/Zone/Map.cs index 67af9f9..2a2c5b8 100644 --- a/Server/Zone/Map.cs +++ b/Server/Zone/Map.cs @@ -102,7 +102,7 @@ namespace PSO2SERVER.Zone if (questOveride != "") // TODO: This is a temporary hack, fix me!! { var setAreaPacket = File.ReadAllBytes("Resources/quests/" + questOveride + ".bin"); - c.SendPacket(0x03, 0x24, 4, setAreaPacket); + c.SendPacket(0x03, 0x24, 0x04, setAreaPacket); } else { @@ -161,7 +161,7 @@ namespace PSO2SERVER.Zone } // Unlock Controls - c.SendPacket(new NoPayloadPacket(0x03, 0x2B)); // Inital spawn only, move this! + c.SendPacket(new UnlockControlsPacket()); // Inital spawn only, move this! Clients.Add(c);