From d3027c3b26caa8aa1957c6de0fb3208e745e4f54 Mon Sep 17 00:00:00 2001 From: Yogurt Date: Sat, 8 Jun 2019 21:11:51 -0700 Subject: [PATCH] ReAdding Azia's fixes that got removed when I fucked up on the license change. --- Lobby Server/ClientConnection.cs | 3 +++ Map Server/Actors/Chara/Player/Player.cs | 9 ++++++++- Map Server/actors/chara/player/Player.cs | 9 ++++++++- World Server/DataObjects/ClientConnection.cs | 6 ++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Lobby Server/ClientConnection.cs b/Lobby Server/ClientConnection.cs index 7eea428b..54560d2b 100644 --- a/Lobby Server/ClientConnection.cs +++ b/Lobby Server/ClientConnection.cs @@ -62,6 +62,9 @@ namespace Meteor.Lobby public void QueuePacket(BasePacket packet) { + if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1) + FlushQueuedSendPackets(); + SendPacketQueue.Add(packet); } diff --git a/Map Server/Actors/Chara/Player/Player.cs b/Map Server/Actors/Chara/Player/Player.cs index c8eb59d7..2837e8a8 100644 --- a/Map Server/Actors/Chara/Player/Player.cs +++ b/Map Server/Actors/Chara/Player/Player.cs @@ -1044,6 +1044,13 @@ namespace Meteor.Map.Actors resultContainer.CombineLists(); DoBattleAction(0, 0x7c000062, resultContainer.GetList()); + //If new class, init abilties and level + if (charaWork.battleSave.skillLevel[classId - 1] <= 0) + { + UpdateClassLevel(classId, 1); + EquipAbilitiesAtLevel(classId, 1); + } + //Set rested EXP charaWork.parameterSave.state_mainSkill[0] = classId; charaWork.parameterSave.state_mainSkillLevel = charaWork.battleSave.skillLevel[classId-1]; @@ -2143,7 +2150,7 @@ namespace Meteor.Map.Actors public void UnequipAbility(ushort hotbarSlot, bool printMessage = true) { - ushort trueHotbarSlot = (ushort)(hotbarSlot + charaWork.commandBorder); + ushort trueHotbarSlot = (ushort)(hotbarSlot + charaWork.commandBorder - 1); uint commandId = charaWork.command[trueHotbarSlot]; Database.UnequipAbility(this, hotbarSlot); charaWork.command[trueHotbarSlot] = 0; diff --git a/Map Server/actors/chara/player/Player.cs b/Map Server/actors/chara/player/Player.cs index c8eb59d7..2837e8a8 100644 --- a/Map Server/actors/chara/player/Player.cs +++ b/Map Server/actors/chara/player/Player.cs @@ -1044,6 +1044,13 @@ namespace Meteor.Map.Actors resultContainer.CombineLists(); DoBattleAction(0, 0x7c000062, resultContainer.GetList()); + //If new class, init abilties and level + if (charaWork.battleSave.skillLevel[classId - 1] <= 0) + { + UpdateClassLevel(classId, 1); + EquipAbilitiesAtLevel(classId, 1); + } + //Set rested EXP charaWork.parameterSave.state_mainSkill[0] = classId; charaWork.parameterSave.state_mainSkillLevel = charaWork.battleSave.skillLevel[classId-1]; @@ -2143,7 +2150,7 @@ namespace Meteor.Map.Actors public void UnequipAbility(ushort hotbarSlot, bool printMessage = true) { - ushort trueHotbarSlot = (ushort)(hotbarSlot + charaWork.commandBorder); + ushort trueHotbarSlot = (ushort)(hotbarSlot + charaWork.commandBorder - 1); uint commandId = charaWork.command[trueHotbarSlot]; Database.UnequipAbility(this, hotbarSlot); charaWork.command[trueHotbarSlot] = 0; diff --git a/World Server/DataObjects/ClientConnection.cs b/World Server/DataObjects/ClientConnection.cs index fe68ee8f..310c85f0 100644 --- a/World Server/DataObjects/ClientConnection.cs +++ b/World Server/DataObjects/ClientConnection.cs @@ -42,11 +42,17 @@ namespace Meteor.World public void QueuePacket(BasePacket packet) { + if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1) + FlushQueuedSendPackets(); + SendPacketQueue.Add(packet); } public void QueuePacket(SubPacket subpacket) { + if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1) + FlushQueuedSendPackets(); + bool isAuthed = true; bool isEncrypted = false; subpacket.SetTargetId(owner.sessionId);