Autor Tema: Bug char inmóvil  (Leído 88 veces)

andres14

  • Jr. Member
  • **
  • Mensajes: 62
  • Karma: +0/-0
    • Ver Perfil
Bug char inmóvil
« en: Octubre 24, 2018, 01:16:06 am »
Al estar pegando y utilizar skills el char aveces se queda inmóvil,deja escribir pero no moverse ni seguir pegando.
Esto pasa sólo en los guerreros de ataque cuerpo a cuerpo,en los arqueros y magos no pasa. No pude ver exactamente que es  lo que lo ocasiona ya que pareciera ser como un problema casi al azar.

fissban

  • Administrador
  • Full Member
  • *
  • Mensajes: 196
  • Karma: +0/-0
    • Ver Perfil
Re:Bug char inmóvil
« Respuesta #1 en: Octubre 24, 2018, 10:27:57 am »
prueba estos cambios.

Código
Index: dist/game/config/geoengine.properties
===================================================================
--- dist/game/config/geoengine.properties (revision 1128)
+++ dist/game/config/geoengine.properties (working copy)
@@ -17,12 +17,6 @@
 # at different folder/harddrive ("C:/Program Files/Lineage II/system/geodata/"), default: ./data/geodata/
 GeoDataPath = ./data/geodata/
 
-# Player coordinates synchronization, default: 2
-#   1 - partial synchronization Client --> Server ; don't use it with geodata
-#   2 - partial synchronization Server --> Client ; use this setting with geodata
-#  -1 - Old system: will synchronize Z only
-CoordSynchronize = 2
-
 # =================================================================
 #                           Path checking
 # =================================================================
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 1150)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -534,7 +534,6 @@
 
  /** Geodata */
  public static String GEODATA_PATH;
- public static int COORD_SYNCHRONIZE;
 
  /** Path checking */
  public static int PART_OF_CHARACTER_HEIGHT;
@@ -1604,9 +1603,6 @@
  case "OFFLINE_NAME_COLOR":
  OFFLINE_NAME_COLOR = Integer.parseInt(pValue);
  break;
- case "COORD_SYNCHRONIZE":
- COORD_SYNCHRONIZE = Integer.parseInt(pValue);
- break;
  case "PART_OF_CHARACTER_HEIGHT":
  PART_OF_CHARACTER_HEIGHT = Integer.parseInt(pValue);
  break;
@@ -2109,7 +2105,6 @@
  var config = new L2Properties(FILE_GEOENGINE);
 
  GEODATA_PATH = config.getString("GeoDataPath", "./data/geodata/");
- COORD_SYNCHRONIZE = config.getInteger("CoordSynchronize", -1);
  PART_OF_CHARACTER_HEIGHT = config.getInteger("PartOfCharacterHeight", 75);
  MAX_OBSTACLE_HEIGHT = config.getInteger("MaxObstacleHeight", 32);
  PATHFINDING = config.getBoolean("PathFinding", true);
Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/L2Character.java (revision 1130)
+++ java/net/sf/l2j/gameserver/model/actor/L2Character.java (working copy)
@@ -663,7 +663,7 @@
  if (timeToNextBowAttack > 0)
  {
  // Cancel the action because the bow can't be re-use at this moment
- ThreadPoolManager.getInstance().schedule(new NotifyAITask(CtrlEventType.READY_TO_ACT), timeToNextBowAttack);
+ ThreadPoolManager.getInstance().schedule(() -> getAI().notifyEvent(CtrlEventType.READY_TO_ACT), timeToNextBowAttack);
  sendPacket(ActionFailed.STATIC_PACKET);
  return;
  }
@@ -675,7 +675,7 @@
  if (getCurrentMp() < mpConsume)
  {
  // If L2PcInstance doesn't have enough MP, stop the attack
- ThreadPoolManager.getInstance().schedule(new NotifyAITask(CtrlEventType.READY_TO_ACT), 100);
+ ThreadPoolManager.getInstance().schedule(() -> getAI().notifyEvent(CtrlEventType.READY_TO_ACT), 100);
  sendPacket(SystemMessage.NOT_ENOUGH_MP);
  sendPacket(ActionFailed.STATIC_PACKET);
  return;
@@ -783,7 +783,7 @@
  }
 
  // Notify AI with CtrlEventType.READY_TO_ACT
- ThreadPoolManager.getInstance().schedule(new NotifyAITask(CtrlEventType.READY_TO_ACT), timeAtk);
+ ThreadPoolManager.getInstance().schedule(() -> getAI().notifyEvent(CtrlEventType.READY_TO_ACT), timeAtk);
  }
 
  /**
@@ -1807,32 +1807,7 @@
  }
  }
 
- /** Task of AI notification */
- public class NotifyAITask implements Runnable
- {
- private final CtrlEventType evt;
-
- NotifyAITask(CtrlEventType evt)
- {
- this.evt = evt;
- }
-
- @Override
- public void run()
- {
- try
- {
- getAI().notifyEvent(evt, null);
- }
- catch (final Throwable t)
- {
- LOG.log(Level.WARNING, "", t);
- }
- }
- }
-
  // =========================================================
- // =========================================================
 
  /** List containing all active skills effects in progress of a L2Character. */
  private final List<Effect> effects = new CopyOnWriteArrayList<>();
@@ -2490,7 +2465,7 @@
  */
  public boolean isInCombat()
  {
- return ((getAI().getTarget() != null) || getAI().isAutoAttacking());
+ return hasAI() && AttackStanceTaskManager.getInstance().isInAttackStance(this);
  }
 
  /**
@@ -2641,24 +2616,15 @@
  int yPrev = getY();
  int zPrev = getZ(); // the z coordinate may be modified by coordinate synchronizations
 
- double dx, dy, dz;
- if (Config.COORD_SYNCHRONIZE == 1)
- {
- // the only method that can modify x,y while moving (otherwise move would/should be set null)
- dx = moveData.xDestination - xPrev;
- dy = moveData.yDestination - yPrev;
- }
- else
- {
- // otherwise we need saved temporary values to avoid rounding errors
- dx = moveData.xDestination - moveData.xAccurate;
- dy = moveData.yDestination - moveData.yAccurate;
- }
+ // the only method that can modify x,y while moving (otherwise move would/should be set null)
+ double dx = moveData.xDestination - xPrev;
+ double dy = moveData.yDestination - yPrev;
+ double dz;
 
  final boolean isFloating = isFlying() || isInsideZone(ZoneType.WATER);
 
  // Z coordinate will follow geodata or client values once a second to reduce possible cpu load
- if ((Config.COORD_SYNCHRONIZE == 2) && !isFloating && !moveData.disregardingGeodata && (Rnd.get(10) == 0) && GeoEngine.getInstance().hasGeo(xPrev, yPrev))
+ if (!isFloating && !move.disregardingGeodata && Rnd.get(10) == 0 && GeoEngine.getInstance().hasGeo(xPrev, yPrev))
  {
  int geoHeight = GeoEngine.getInstance().getHeight(xPrev, yPrev, zPrev);
  dz = moveData.zDestination - geoHeight;
@@ -2971,7 +2937,7 @@
  // Movement checks:
  // when geodata == 2, for all characters except mobs returning home (could be changed later to teleport if pathfinding fails)
  // when geodata == 1, for l2playableinstance and l2riftinvaderinstance
- if (((Config.PATHFINDING) && !((this instanceof L2Attackable) && ((L2Attackable) this).isReturningToSpawnPoint())) || (this instanceof L2PcInstance) || isAfraid() || (this instanceof L2RiftInvaderInstance) || ((this instanceof L2Summon) && !(getAI().getIntention() == CtrlIntentionType.FOLLOW))) // assuming
+ if ((!(this instanceof L2Attackable && ((L2Attackable) this).isReturningToSpawnPoint())) || (this instanceof L2PcInstance && !(isInBoat && distance > 1500)) || (this instanceof L2Summon && !(getAI().getIntention() == CtrlIntentionType.FOLLOW)) || isAfraid())
  {
  // when following owner
  if (isOnGeodataPath())
Index: java/net/sf/l2j/gameserver/model/actor/ai/AbstractAI.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/ai/AbstractAI.java (revision 1128)
+++ java/net/sf/l2j/gameserver/model/actor/ai/AbstractAI.java (working copy)
@@ -6,7 +6,6 @@
 import net.sf.l2j.gameserver.ThreadPoolManager;
 import net.sf.l2j.gameserver.model.L2Object;
 import net.sf.l2j.gameserver.model.actor.L2Character;
-import net.sf.l2j.gameserver.model.actor.L2Summon;
 import net.sf.l2j.gameserver.model.actor.ai.enums.CtrlEventType;
 import net.sf.l2j.gameserver.model.actor.ai.enums.CtrlIntentionType;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
@@ -99,8 +98,6 @@
 
  /** Flags about client's state, in order to know which messages to send */
  protected volatile boolean clientMoving;
- /** Flags about client's state, in order to know which messages to send */
- protected volatile boolean clientAutoAttacking;
 
  /** Different targets this AI maintains */
  private L2Object target;
@@ -497,53 +494,15 @@
  clientMoving = false;
  }
 
- public boolean isAutoAttacking()
- {
- return clientAutoAttacking;
- }
-
- public void setAutoAttacking(boolean isAutoAttacking)
- {
- if (activeActor instanceof L2Summon)
- {
- L2Summon summon = (L2Summon) activeActor;
- if (summon.getOwner() != null)
- {
- summon.getOwner().getAI().setAutoAttacking(isAutoAttacking);
- }
- return;
- }
-
- clientAutoAttacking = isAutoAttacking;
- }
-
  /**
  * Start the actor Auto Attack client side by sending Server->Client packet AutoAttackStart <I>(broadcast)</I>.<br>
  * <FONT COLOR=#FF0000><B> <U>Caution</U> : Low level function, used by AI subclasses</B></FONT><br>
  */
  public void clientStartAutoAttack()
  {
- if (activeActor instanceof L2Summon)
- {
- L2Summon summon = (L2Summon) activeActor;
- if (summon.getOwner() != null)
- {
- summon.getOwner().getAI().clientStartAutoAttack();
- }
- return;
- }
-
- if (!isAutoAttacking())
- {
- if ((activeActor instanceof L2PcInstance) && (((L2PcInstance) activeActor).getPet() != null))
- {
- ((L2PcInstance) activeActor).getPet().broadcastPacket(new AutoAttackStart(((L2PcInstance) activeActor).getPet()));
- }
-
- // Send a Server->Client packet AutoAttackStart to the actor and all L2PcInstance in its knownPlayers
+ if (!AttackStanceTaskManager.getInstance().isInAttackStance(activeActor))
  activeActor.broadcastPacket(new AutoAttackStart(activeActor));
- setAutoAttacking(true);
- }
+
  AttackStanceTaskManager.getInstance().add(activeActor);
  }
 
@@ -553,28 +512,8 @@
  */
  public void clientStopAutoAttack()
  {
- if (activeActor instanceof L2Summon)
- {
- L2Summon summon = (L2Summon) activeActor;
- if (summon.getOwner() != null)
- {
- summon.getOwner().getAI().clientStopAutoAttack();
- }
- return;
- }
-
- if (activeActor instanceof L2PcInstance)
- {
- if (!AttackStanceTaskManager.getInstance().isInAttackStance(activeActor) && isAutoAttacking())
- {
- AttackStanceTaskManager.getInstance().add(activeActor);
- }
- }
- else if (isAutoAttacking())
- {
- activeActor.broadcastPacket(new AutoAttackStop(activeActor));
- setAutoAttacking(false);
- }
+ activeActor.broadcastPacket(new AutoAttackStop(activeActor));
+ AttackStanceTaskManager.getInstance().remove(activeActor);
  }
 
  /**
@@ -601,7 +540,7 @@
  */
  public void describeStateToPlayer(L2PcInstance player)
  {
- if (clientMoving)
+ if (getIntention() == CtrlIntentionType.MOVE_TO)
  {
  player.sendPacket(new CharMoveToLocation(activeActor));
  }
Index: java/net/sf/l2j/gameserver/model/actor/ai/CharacterAI.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/ai/CharacterAI.java (revision 1128)
+++ java/net/sf/l2j/gameserver/model/actor/ai/CharacterAI.java (working copy)
@@ -453,9 +453,6 @@
 
  AttackStanceTaskManager.getInstance().remove(activeActor);
 
- // Stop Server AutoAttack also
- setAutoAttacking(false);
-
  // Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation (broadcast)
  clientStopMoving(null);
 
@@ -480,9 +477,6 @@
 
  AttackStanceTaskManager.getInstance().remove(activeActor);
 
- // Stop Server AutoAttack also
- setAutoAttacking(false);
-
  // Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation (broadcast)
  clientStopMoving(null);
 
@@ -506,9 +500,6 @@
 
  AttackStanceTaskManager.getInstance().remove(activeActor);
 
- // stop Server AutoAttack also
- setAutoAttacking(false);
-
  // Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation (broadcast)
  clientStopMoving(null);
  }
Index: java/net/sf/l2j/gameserver/model/actor/ai/PlayerAI.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/ai/PlayerAI.java (revision 1128)
+++ java/net/sf/l2j/gameserver/model/actor/ai/PlayerAI.java (working copy)
@@ -169,7 +169,6 @@
  @Override
  protected void clientNotifyDead()
  {
- clientAutoAttacking = false;
  clientMoving = false;
 
  super.clientNotifyDead();
Index: java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java (revision 1128)
+++ java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java (working copy)
@@ -2,7 +2,6 @@
 
 import java.nio.ByteBuffer;
 
-import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.zone.enums.ZoneType;
 import net.sf.l2j.gameserver.network.AbstractClientBasePacket;
@@ -64,17 +63,15 @@
 
  if (activeChar.isInBoat())
  {
- if (Config.COORD_SYNCHRONIZE == 2)
+ dx = x - activeChar.getInBoatPosition().getX();
+ dy = y - activeChar.getInBoatPosition().getY();
+ dz = z - activeChar.getInBoatPosition().getZ();
+ diffSq = ((dx * dx) + (dy * dy));
+ if (diffSq > 250000)
  {
- dx = x - activeChar.getInBoatPosition().getX();
- dy = y - activeChar.getInBoatPosition().getY();
- dz = z - activeChar.getInBoatPosition().getZ();
- diffSq = ((dx * dx) + (dy * dy));
- if (diffSq > 250000)
- {
- sendPacket(new GetOnVehicle(activeChar.getObjectId(), data, activeChar.getInBoatPosition()));
- }
+ sendPacket(new GetOnVehicle(activeChar.getObjectId(), data, activeChar.getInBoatPosition()));
  }
+
  return;
  }
 
@@ -102,52 +99,16 @@
  activeChar.sendPacket(new ValidateLocation(activeChar));
  }
  }
- else if (diffSq < 360000) // if too large, messes observation
+ else if ((diffSq < 360000) && ((diffSq > 250000) || (Math.abs(dz) > 200))) // if too large, messes observation
  {
- if (Config.COORD_SYNCHRONIZE == -1) // Only Z coordinate synched to server, mainly used when no geodata
+ if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(z - activeChar.getClientLoc().getZ()) < 800))
  {
  activeChar.setXYZ(realX, realY, z);
- return;
- }
-
- if (Config.COORD_SYNCHRONIZE == 1) // Trusting also client x,y coordinates (should not be used with geodata)
- {
- if (!activeChar.isMoving() || !activeChar.validateMovementHeading(heading)) // Heading changed on client = possible obstacle
- {
- // character is not moving, take coordinates from client
- if (diffSq < 2500)
- {
- activeChar.setXYZ(realX, realY, z);
- }
- else
- {
- activeChar.setXYZ(x, y, z);
- }
- }
- else
- {
- activeChar.setXYZ(realX, realY, z);
- }
-
- activeChar.setHeading(heading);
- return;
+ realZ = z;
  }
-
- // Sync 2 (or other),
- // intended for geodata. Sends a validation packet to client
- // when too far from server calculated true coordinate.
- // Due to geodata "holes", some Z axis checks are made.
- if ((diffSq > 250000) || (Math.abs(dz) > 200))
+ else
  {
- if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(z - activeChar.getClientLoc().getZ()) < 800))
- {
- activeChar.setXYZ(realX, realY, z);
- realZ = z;
- }
- else
- {
- activeChar.sendPacket(new ValidateLocation(activeChar));
- }
+ activeChar.sendPacket(new ValidateLocation(activeChar));
  }
  }
  activeChar.setClientLoc(x, y, z, heading);
Index: java/net/sf/l2j/gameserver/task/continuous/AttackStanceTaskManager.java
===================================================================
--- java/net/sf/l2j/gameserver/task/continuous/AttackStanceTaskManager.java (revision 1128)
+++ java/net/sf/l2j/gameserver/task/continuous/AttackStanceTaskManager.java (working copy)
@@ -115,8 +115,6 @@
  ((L2PcInstance) character).getPet().broadcastPacket(new AutoAttackStop(((L2PcInstance) character).getPet()));
  }
 
- // Inform character AI and remove task.
- character.getAI().setAutoAttacking(false);
  iterator.remove();
  }
  }

franchus22

  • Newbie
  • *
  • Mensajes: 16
  • Karma: +0/-0
    • Ver Perfil
Re:Bug char inmóvil
« Respuesta #2 en: Octubre 25, 2018, 03:09:55 am »
Buenas me pasa exactamente lo mismo, ya probe con ese parche fiss y sigue igual, es muy random, me pasa tanto en pvp, como en la ciudad sacando un cubic, parece que el problema esta cuando castea un skill

fissban

  • Administrador
  • Full Member
  • *
  • Mensajes: 196
  • Karma: +0/-0
    • Ver Perfil
Re:Bug char inmóvil
« Respuesta #3 en: Octubre 25, 2018, 04:52:35 am »
y la consola no acusa nada? q loco

andres14

  • Jr. Member
  • **
  • Mensajes: 62
  • Karma: +0/-0
    • Ver Perfil
Re:Bug char inmóvil
« Respuesta #4 en: Octubre 25, 2018, 09:11:36 am »
También probé el parche y sigue pasando,la consola todo normal. Probaré ver si es la geodata,Me  parece que no está activada por defecto,como la activo?junto con el path

franchus22

  • Newbie
  • *
  • Mensajes: 16
  • Karma: +0/-0
    • Ver Perfil
Re:Bug char inmóvil
« Respuesta #5 en: Octubre 25, 2018, 09:24:28 am »
No, No tira ningun tipo de error en la consola

fissban

  • Administrador
  • Full Member
  • *
  • Mensajes: 196
  • Karma: +0/-0
    • Ver Perfil
Re:Bug char inmóvil
« Respuesta #6 en: Octubre 25, 2018, 11:18:30 am »
También probé el parche y sigue pasando,la consola todo normal. Probaré ver si es la geodata,Me  parece que no está activada por defecto,como la activo?junto con el path

patchnode ya no se usa, solo la geodata....y solo deben poner los files dentro de la carpeta geodata

andres14

  • Jr. Member
  • **
  • Mensajes: 62
  • Karma: +0/-0
    • Ver Perfil
Re:Bug char inmóvil
« Respuesta #7 en: Octubre 25, 2018, 11:59:01 am »
Ok probare con eso y publico.

franchus22

  • Newbie
  • *
  • Mensajes: 16
  • Karma: +0/-0
    • Ver Perfil
Re:Bug char inmóvil
« Respuesta #8 en: Octubre 25, 2018, 10:12:42 pm »
Acabo de probar con geodata, y sigue igual no cambia nada, el char se queda bugueado, no deja hacer nada, solo escribir

andres14

  • Jr. Member
  • **
  • Mensajes: 62
  • Karma: +0/-0
    • Ver Perfil
Re:Bug char inmóvil
« Respuesta #9 en: Octubre 25, 2018, 11:54:17 pm »
Efectivamente aun con la geodata instalada el bug sigue,lo curioso es que si deja usar potas de mp y ademas el administrador puede reparar el char con el comando //recall "nombre del char". Una vez el personaje muere en este estado,se recupera totalmente al reaparecer en la city
« Última modificación: Octubre 25, 2018, 11:56:27 pm por andres14 »