Merged in skeletonhorn/ffxiv-classic-server (pull request #63)

Add packet flush when packet queue is full to Lobby and World servers
This commit is contained in:
yogurt 2019-06-10 15:59:32 +00:00 committed by Filip Maj
commit 187d8300b0
4 changed files with 19 additions and 10 deletions

View File

@ -40,6 +40,9 @@ namespace FFXIVClassic_Lobby_Server
public void QueuePacket(BasePacket packet) public void QueuePacket(BasePacket packet)
{ {
if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1)
FlushQueuedSendPackets();
SendPacketQueue.Add(packet); SendPacketQueue.Add(packet);
} }

View File

@ -1023,6 +1023,13 @@ namespace FFXIVClassic_Map_Server.Actors
resultContainer.CombineLists(); resultContainer.CombineLists();
DoBattleAction(0, 0x7c000062, resultContainer.GetList()); 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 //Set rested EXP
charaWork.parameterSave.state_mainSkill[0] = classId; charaWork.parameterSave.state_mainSkill[0] = classId;
charaWork.parameterSave.state_mainSkillLevel = charaWork.battleSave.skillLevel[classId-1]; charaWork.parameterSave.state_mainSkillLevel = charaWork.battleSave.skillLevel[classId-1];
@ -1033,13 +1040,6 @@ namespace FFXIVClassic_Map_Server.Actors
charaWork.commandCategory[i] = 0; 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); ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
propertyBuilder.AddProperty("charaWork.parameterSave.state_mainSkill[0]"); propertyBuilder.AddProperty("charaWork.parameterSave.state_mainSkill[0]");
@ -2122,7 +2122,7 @@ namespace FFXIVClassic_Map_Server.Actors
public void UnequipAbility(ushort hotbarSlot, bool printMessage = true) 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]; uint commandId = charaWork.command[trueHotbarSlot];
Database.UnequipAbility(this, hotbarSlot); Database.UnequipAbility(this, hotbarSlot);
charaWork.command[trueHotbarSlot] = 0; charaWork.command[trueHotbarSlot] = 0;
@ -2480,7 +2480,7 @@ namespace FFXIVClassic_Map_Server.Actors
private void EquipAbilitiesAtLevel(byte classId, short level, List<CommandResult> actionList = null) private void EquipAbilitiesAtLevel(byte classId, short level, List<CommandResult> actionList = null)
{ {
//If there's any abilites that unlocks at this level, equip them. //If there's any abilites that unlocks at this level, equip them.
List<ushort> commandIds = Server.GetWorldManager().GetBattleCommandIdByLevel(classId, GetLevel()); List<ushort> commandIds = Server.GetWorldManager().GetBattleCommandIdByLevel(classId, level);
foreach (ushort commandId in commandIds) foreach (ushort commandId in commandIds)
{ {
EquipAbilityInFirstOpenSlot(classId, commandId, false); EquipAbilityInFirstOpenSlot(classId, commandId, false);

View File

@ -20,11 +20,17 @@ namespace FFXIVClassic_World_Server
public void QueuePacket(BasePacket packet) public void QueuePacket(BasePacket packet)
{ {
if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1)
FlushQueuedSendPackets();
SendPacketQueue.Add(packet); SendPacketQueue.Add(packet);
} }
public void QueuePacket(SubPacket subpacket) public void QueuePacket(SubPacket subpacket)
{ {
if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1)
FlushQueuedSendPackets();
bool isAuthed = true; bool isAuthed = true;
bool isEncrypted = false; bool isEncrypted = false;
subpacket.SetTargetId(owner.sessionId); subpacket.SetTargetId(owner.sessionId);

View File

@ -12,7 +12,7 @@ yolo
local modelIds = local modelIds =
{ {
["titan"] = 2107401, ["titan"] = 2107401,
["ifrit"] = 2107302, ["ifrit"] = 2207302,
["ifrithotair"] = 2207310, ["ifrithotair"] = 2207310,
["nail"] = 2207307, ["nail"] = 2207307,
["garuda"] = 2209501, ["garuda"] = 2209501,