From 324026874ac746e8b45af62af0e0df91545d461d Mon Sep 17 00:00:00 2001 From: Yogurt Date: Sat, 8 Jun 2019 23:02:49 -0700 Subject: [PATCH 1/6] Add packet flush when packet queue is full to Lobby and World servers --- FFXIVClassic Lobby Server/ClientConnection.cs | 3 +++ FFXIVClassic World Server/DataObjects/ClientConnection.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/FFXIVClassic Lobby Server/ClientConnection.cs b/FFXIVClassic Lobby Server/ClientConnection.cs index 91be70d6..e7c474f2 100644 --- a/FFXIVClassic Lobby Server/ClientConnection.cs +++ b/FFXIVClassic Lobby Server/ClientConnection.cs @@ -40,6 +40,9 @@ namespace FFXIVClassic_Lobby_Server public void QueuePacket(BasePacket packet) { + if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1) + FlushQueuedSendPackets(); + SendPacketQueue.Add(packet); } diff --git a/FFXIVClassic World Server/DataObjects/ClientConnection.cs b/FFXIVClassic World Server/DataObjects/ClientConnection.cs index 7c3427a8..d9da3ba1 100644 --- a/FFXIVClassic World Server/DataObjects/ClientConnection.cs +++ b/FFXIVClassic World Server/DataObjects/ClientConnection.cs @@ -20,6 +20,9 @@ namespace FFXIVClassic_World_Server public void QueuePacket(BasePacket packet) { + if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1) + FlushQueuedSendPackets(); + SendPacketQueue.Add(packet); } From 561114833c883ef76fb0b602c5f317fbcce05f45 Mon Sep 17 00:00:00 2001 From: Yogurt Date: Sun, 9 Jun 2019 15:14:23 -0700 Subject: [PATCH 2/6] Add one more check to World Server. This should fix World breaking after idling for a long time --- FFXIVClassic World Server/DataObjects/ClientConnection.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FFXIVClassic World Server/DataObjects/ClientConnection.cs b/FFXIVClassic World Server/DataObjects/ClientConnection.cs index d9da3ba1..dfc7b33a 100644 --- a/FFXIVClassic World Server/DataObjects/ClientConnection.cs +++ b/FFXIVClassic World Server/DataObjects/ClientConnection.cs @@ -28,6 +28,9 @@ namespace FFXIVClassic_World_Server public void QueuePacket(SubPacket subpacket) { + if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1) + FlushQueuedSendPackets(); + bool isAuthed = true; bool isEncrypted = false; subpacket.SetTargetId(owner.sessionId); From 57f3de66f822bde8ba71f7c13d0c73200e33346a Mon Sep 17 00:00:00 2001 From: Yogurt Date: Sun, 9 Jun 2019 15:34:31 -0700 Subject: [PATCH 3/6] Fix level 0 stuff --- .../actors/chara/player/Player.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/FFXIVClassic Map Server/actors/chara/player/Player.cs b/FFXIVClassic Map Server/actors/chara/player/Player.cs index 150057d0..a9327ec7 100644 --- a/FFXIVClassic Map Server/actors/chara/player/Player.cs +++ b/FFXIVClassic Map Server/actors/chara/player/Player.cs @@ -1023,6 +1023,13 @@ namespace FFXIVClassic_Map_Server.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]; @@ -1033,13 +1040,6 @@ namespace FFXIVClassic_Map_Server.Actors charaWork.commandCategory[i] = 0; } - //If new class, init abilties and level - if (charaWork.battleSave.skillLevel[classId - 1] <= 0) - { - UpdateClassLevel(classId, 1); - EquipAbilitiesAtLevel(classId, 1); - } - ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this); propertyBuilder.AddProperty("charaWork.parameterSave.state_mainSkill[0]"); @@ -2480,7 +2480,7 @@ namespace FFXIVClassic_Map_Server.Actors private void EquipAbilitiesAtLevel(byte classId, short level, List actionList = null) { //If there's any abilites that unlocks at this level, equip them. - List commandIds = Server.GetWorldManager().GetBattleCommandIdByLevel(classId, GetLevel()); + List commandIds = Server.GetWorldManager().GetBattleCommandIdByLevel(classId, level); foreach (ushort commandId in commandIds) { EquipAbilityInFirstOpenSlot(classId, commandId, false); From a92b558c881f88e826c453b138779f1563e04a8a Mon Sep 17 00:00:00 2001 From: Yogurt Date: Sun, 9 Jun 2019 16:53:35 -0700 Subject: [PATCH 4/6] Fix removing abilities from hotbar --- FFXIVClassic Map Server/actors/chara/player/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFXIVClassic Map Server/actors/chara/player/Player.cs b/FFXIVClassic Map Server/actors/chara/player/Player.cs index a9327ec7..382d4acd 100644 --- a/FFXIVClassic Map Server/actors/chara/player/Player.cs +++ b/FFXIVClassic Map Server/actors/chara/player/Player.cs @@ -2122,7 +2122,7 @@ namespace FFXIVClassic_Map_Server.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; From 8da65938b758af15d5554ab36948253286e731bf Mon Sep 17 00:00:00 2001 From: Yogurt Date: Sun, 9 Jun 2019 17:21:21 -0700 Subject: [PATCH 5/6] Update ifrit appearance id to fix irit death animation --- data/scripts/commands/gm/spawnnpc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/scripts/commands/gm/spawnnpc.lua b/data/scripts/commands/gm/spawnnpc.lua index bf8870d1..e17295fc 100644 --- a/data/scripts/commands/gm/spawnnpc.lua +++ b/data/scripts/commands/gm/spawnnpc.lua @@ -12,7 +12,7 @@ yolo local modelIds = { ["titan"] = 2107401, - ["ifrit"] = 2107302, + ["ifrit"] = 2207302, ["ifrithotair"] = 2207310, ["nail"] = 2207307, ["garuda"] = 2209501, From e9b3f4e51ee4ce060a2b84b243476fe89b218a66 Mon Sep 17 00:00:00 2001 From: Yogurt Date: Mon, 10 Jun 2019 21:32:22 -0700 Subject: [PATCH 6/6] Add playanimation script --- data/scripts/commands/gm/playanimation.lua | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 data/scripts/commands/gm/playanimation.lua diff --git a/data/scripts/commands/gm/playanimation.lua b/data/scripts/commands/gm/playanimation.lua new file mode 100644 index 00000000..54fcf46f --- /dev/null +++ b/data/scripts/commands/gm/playanimation.lua @@ -0,0 +1,28 @@ +require("global"); + +properties = { + permissions = 0, + parameters = "sss", + description = +[[ +Plays animation on target. +!playanimation +]], +} + + +function onTrigger(player, argc, animType, modelAnim, effectId) + local sender = "[battleaction] "; + local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil; + if player and actor then + aid = tonumber(animType) or 0 + mid = tonumber(modelAnim) or 0 + eid = tonumber(effectId) or 0 + local id = bit32.lshift(aid, 24); + id = bit32.bor(id, bit32.lshift(mid, 12)); + id = bit32.bor(id, eid) + actor:PlayAnimation(id) + else + print(sender.."unable to add experience, ensure player name is valid."); + end; +end; \ No newline at end of file