L2JMobius

Free Users => Solved/Invalid Bug Reports => Topic started by: G-hamsteR on August 24, 2020, 08:56:10 PM

Title: Lag caused by soulshots
Post by: G-hamsteR on August 24, 2020, 08:56:10 PM
Hello,

Soulshots cause great lag, especially if many players are hitting something for minutes. Here is a fix.

Code: [Select]
diff --git a/java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java b/java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
index a5bddf1..e3c58d1 100644
--- a/java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
+++ b/java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
@@ -119,7 +119,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_THE_SPIRITS_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
  }
 
  @Override
Title: Re: Lag caused by soulshots
Post by: Mobius on August 24, 2020, 08:58:51 PM
No change for other shots?
Maybe 3000...
Code: [Select]
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (working copy)
@@ -148,7 +148,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 3000);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (working copy)
@@ -163,7 +163,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 3000);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (working copy)
@@ -126,7 +126,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 3000);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (working copy)
@@ -119,7 +119,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_THE_SPIRITS_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 3000);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (working copy)
@@ -116,7 +116,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 3000);
  }
 
  @Override
Title: Re: Lag caused by soulshots
Post by: Mobius on August 24, 2020, 10:07:24 PM
New patch.
Code: [Select]
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (working copy)
@@ -148,7 +148,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (working copy)
@@ -163,7 +163,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (working copy)
@@ -122,11 +122,14 @@
  }
 
  // Charge Blessed Spiritshot
+ if (weaponInst.getChargedSpiritshot() != itemId)
+ {
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
+ }
  weaponInst.setChargedSpiritshot(ItemInstance.CHARGED_BLESSED_SPIRITSHOT);
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (working copy)
@@ -115,11 +115,14 @@
  }
 
  // Charge soulshot
+ if (weaponInst.getChargedSoulshot() != itemId)
+ {
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
+ }
  weaponInst.setChargedSoulshot(ItemInstance.CHARGED_SOULSHOT);
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_THE_SPIRITS_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (working copy)
@@ -112,11 +112,14 @@
  }
 
  // Charge Spiritshot
+ if (weaponInst.getChargedSpiritshot() != itemId)
+ {
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
+ }
  weaponInst.setChargedSpiritshot(ItemInstance.CHARGED_SPIRITSHOT);
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
  }
 
  @Override
Title: Re: Lag caused by soulshots
Post by: G-hamsteR on August 25, 2020, 03:01:53 PM
Other players can't see the shot effect.
Title: Re: Lag caused by soulshots
Post by: Mobius on August 25, 2020, 03:27:31 PM
Then use first patch, distance 600 and we done with this?
Code: [Select]
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (working copy)
@@ -148,7 +148,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (working copy)
@@ -163,7 +163,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (working copy)
@@ -126,7 +126,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (working copy)
@@ -119,7 +119,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_THE_SPIRITS_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (working copy)
@@ -116,7 +116,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
  }
 
  @Override
Title: Re: Lag caused by soulshots
Post by: G-hamsteR on August 25, 2020, 03:30:15 PM
Something went wrong. Even with the first patch, I can't see the soulshots. Let me find out what happened and send you feedback. Maybe the previous patch was fine and the problem in my case is somewhere else.
Title: Re: Lag caused by soulshots
Post by: Mobius on August 26, 2020, 08:23:58 PM
Putting this here. Talked to discord about it.
https://pastebin.com/e6d3rdMH
Title: Re: Lag caused by soulshots
Post by: Mobius on August 28, 2020, 12:55:03 PM
Partially fixed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/6d620543c798e0e36e3ac6bab7e312b9ec206c15