PlayerInstance isOnline method should return a boolean value.
This commit is contained in:
@@ -326,14 +326,14 @@ public class RecipeController
|
|||||||
|
|
||||||
if ((_player == null) || (_target == null))
|
if ((_player == null) || (_target == null))
|
||||||
{
|
{
|
||||||
LOGGER.warning("player or target == null (disconnected?), aborting" + _target + _player);
|
LOGGER.warning("Player or target == null (disconnected?), aborting" + _target + _player);
|
||||||
abort();
|
abort();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_player.isOnline() == 0) || (_target.isOnline() == 0))
|
if (_player.isOnline() || _target.isOnline())
|
||||||
{
|
{
|
||||||
LOGGER.warning("player or target is not online, aborting " + _target + _player);
|
LOGGER.warning("Player or target is not online, aborting " + _target + _player);
|
||||||
abort();
|
abort();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -342,12 +342,12 @@ public class RecipeController
|
|||||||
{
|
{
|
||||||
if (_target != _player)
|
if (_target != _player)
|
||||||
{
|
{
|
||||||
_target.sendMessage("Manufacture aborted");
|
_target.sendMessage("Manufacture aborted.");
|
||||||
_player.sendMessage("Manufacture aborted");
|
_player.sendMessage("Manufacture aborted.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_player.sendMessage("Item creation aborted");
|
_player.sendMessage("Item creation aborted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
abort();
|
abort();
|
||||||
|
@@ -327,15 +327,11 @@ abstract class AbstractAI implements Ctrl
|
|||||||
@Override
|
@Override
|
||||||
public void notifyEvent(CtrlEvent evt, Object arg0, Object arg1)
|
public void notifyEvent(CtrlEvent evt, Object arg0, Object arg1)
|
||||||
{
|
{
|
||||||
if (!_actor.isVisible() || !_actor.hasAI() || ((_actor instanceof PlayerInstance) && (((PlayerInstance) _actor).isOnline() == 0)) || ((_actor instanceof PlayerInstance) && ((PlayerInstance) _actor).isInOfflineMode()))
|
if (!_actor.isVisible() || !_actor.hasAI() || ((_actor instanceof PlayerInstance) && !((PlayerInstance) _actor).isOnline()) || ((_actor instanceof PlayerInstance) && ((PlayerInstance) _actor).isInOfflineMode()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* if (Config.DEBUG) LOGGER.warning("AbstractAI: notifyEvent -> " + evt + " " + arg0 + " " + arg1);
|
|
||||||
*/
|
|
||||||
|
|
||||||
switch (evt)
|
switch (evt)
|
||||||
{
|
{
|
||||||
case EVT_THINK:
|
case EVT_THINK:
|
||||||
@@ -744,7 +740,7 @@ abstract class AbstractAI implements Ctrl
|
|||||||
|
|
||||||
if (_actor instanceof PlayerInstance)
|
if (_actor instanceof PlayerInstance)
|
||||||
{
|
{
|
||||||
if (!AttackStanceTaskManager.getInstance().getAttackStanceTask(_actor) && isAutoAttacking)
|
if (!AttackStanceTaskManager.getInstance().hasAttackStanceTask(_actor) && isAutoAttacking)
|
||||||
{
|
{
|
||||||
AttackStanceTaskManager.getInstance().addAttackStanceTask(_actor);
|
AttackStanceTaskManager.getInstance().addAttackStanceTask(_actor);
|
||||||
}
|
}
|
||||||
|
@@ -648,7 +648,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
|
|
||||||
final Creature originalAttackTarget = getAttackTarget();
|
final Creature originalAttackTarget = getAttackTarget();
|
||||||
// Check if target is dead or if timeout is expired to stop this attack
|
// Check if target is dead or if timeout is expired to stop this attack
|
||||||
if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead() || ((originalAttackTarget instanceof PlayerInstance) && (((PlayerInstance) originalAttackTarget).isInOfflineMode() || (((PlayerInstance) originalAttackTarget).isOnline() == 0))) || (_attackTimeout < GameTimeController.getGameTicks()))
|
if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead() || ((originalAttackTarget instanceof PlayerInstance) && (((PlayerInstance) originalAttackTarget).isInOfflineMode() || !((PlayerInstance) originalAttackTarget).isOnline())) || (_attackTimeout < GameTimeController.getGameTicks()))
|
||||||
{
|
{
|
||||||
// Stop hating this target after the attack timeout or if target is dead
|
// Stop hating this target after the attack timeout or if target is dead
|
||||||
if (originalAttackTarget != null)
|
if (originalAttackTarget != null)
|
||||||
|
@@ -593,7 +593,7 @@ public class CreatureAI extends AbstractAI
|
|||||||
// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
|
// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
|
||||||
_actor.broadcastPacket(new AutoAttackStop(_actor.getObjectId()));
|
_actor.broadcastPacket(new AutoAttackStop(_actor.getObjectId()));
|
||||||
|
|
||||||
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(_actor))
|
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(_actor))
|
||||||
{
|
{
|
||||||
AttackStanceTaskManager.getInstance().removeAttackStanceTask(_actor);
|
AttackStanceTaskManager.getInstance().removeAttackStanceTask(_actor);
|
||||||
}
|
}
|
||||||
@@ -625,7 +625,7 @@ public class CreatureAI extends AbstractAI
|
|||||||
// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
|
// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
|
||||||
_actor.broadcastPacket(new AutoAttackStop(_actor.getObjectId()));
|
_actor.broadcastPacket(new AutoAttackStop(_actor.getObjectId()));
|
||||||
|
|
||||||
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(_actor))
|
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(_actor))
|
||||||
{
|
{
|
||||||
AttackStanceTaskManager.getInstance().removeAttackStanceTask(_actor);
|
AttackStanceTaskManager.getInstance().removeAttackStanceTask(_actor);
|
||||||
}
|
}
|
||||||
@@ -902,7 +902,7 @@ public class CreatureAI extends AbstractAI
|
|||||||
// Stop an AI Follow Task
|
// Stop an AI Follow Task
|
||||||
stopFollow();
|
stopFollow();
|
||||||
|
|
||||||
if (!AttackStanceTaskManager.getInstance().getAttackStanceTask(_actor))
|
if (!AttackStanceTaskManager.getInstance().hasAttackStanceTask(_actor))
|
||||||
{
|
{
|
||||||
_actor.broadcastPacket(new AutoAttackStop(_actor.getObjectId()));
|
_actor.broadcastPacket(new AutoAttackStop(_actor.getObjectId()));
|
||||||
}
|
}
|
||||||
|
@@ -255,7 +255,7 @@ public class FriendsBBSManager extends BaseBBSManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final PlayerInstance friend = World.getInstance().getPlayer(id);
|
final PlayerInstance friend = World.getInstance().getPlayer(id);
|
||||||
StringUtil.append(sb, "<a action=\"bypass _friend;select;", id, "\">[Select]</a> ", friendName, " ", (((friend != null) && (friend.isOnline() == 1)) ? "(on)" : "(off)"), "<br1>");
|
StringUtil.append(sb, "<a action=\"bypass _friend;select;", id, "\">[Select]</a> ", friendName, " ", (((friend != null) && friend.isOnline()) ? "(on)" : "(off)"), "<br1>");
|
||||||
}
|
}
|
||||||
content = content.replace("%friendslist%", sb.toString());
|
content = content.replace("%friendslist%", sb.toString());
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ public class FriendsBBSManager extends BaseBBSManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final PlayerInstance friend = World.getInstance().getPlayer(id);
|
final PlayerInstance friend = World.getInstance().getPlayer(id);
|
||||||
StringUtil.append(sb, "<a action=\"bypass _friend;deselect;", id, "\">[Deselect]</a> ", friendName, " ", (((friend != null) && (friend.isOnline() == 1)) ? "(on)" : "(off)"), "<br1>");
|
StringUtil.append(sb, "<a action=\"bypass _friend;deselect;", id, "\">[Deselect]</a> ", friendName, " ", (((friend != null) && friend.isOnline()) ? "(on)" : "(off)"), "<br1>");
|
||||||
}
|
}
|
||||||
content = content.replace("%selectedFriendsList%", sb.toString());
|
content = content.replace("%selectedFriendsList%", sb.toString());
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ public class FriendsBBSManager extends BaseBBSManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final PlayerInstance block = World.getInstance().getPlayer(id);
|
final PlayerInstance block = World.getInstance().getPlayer(id);
|
||||||
StringUtil.append(sb, "<a action=\"bypass _block;select;", id, "\">[Select]</a> ", blockName, " ", (((block != null) && (block.isOnline() == 1)) ? "(on)" : "(off)"), "<br1>");
|
StringUtil.append(sb, "<a action=\"bypass _block;select;", id, "\">[Select]</a> ", blockName, " ", (((block != null) && block.isOnline()) ? "(on)" : "(off)"), "<br1>");
|
||||||
}
|
}
|
||||||
content = content.replace("%blocklist%", sb.toString());
|
content = content.replace("%blocklist%", sb.toString());
|
||||||
|
|
||||||
@@ -328,7 +328,7 @@ public class FriendsBBSManager extends BaseBBSManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final PlayerInstance block = World.getInstance().getPlayer(id);
|
final PlayerInstance block = World.getInstance().getPlayer(id);
|
||||||
StringUtil.append(sb, "<a action=\"bypass _block;deselect;", id, "\">[Deselect]</a> ", blockName, " ", (((block != null) && (block.isOnline() == 1)) ? "(on)" : "(off)"), "<br1>");
|
StringUtil.append(sb, "<a action=\"bypass _block;deselect;", id, "\">[Deselect]</a> ", blockName, " ", (((block != null) && block.isOnline()) ? "(on)" : "(off)"), "<br1>");
|
||||||
}
|
}
|
||||||
content = content.replace("%selectedBlocksList%", sb.toString());
|
content = content.replace("%selectedBlocksList%", sb.toString());
|
||||||
|
|
||||||
|
@@ -941,13 +941,13 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final List<PlayerInstance> onlinePlayersList = new ArrayList<>();
|
final List<PlayerInstance> onlinePlayersList = new ArrayList<>();
|
||||||
|
|
||||||
for (PlayerInstance actual_player : World.getInstance().getAllPlayers())
|
for (PlayerInstance actualPlayer : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((actual_player != null) && (actual_player.isOnline() == 1) && !actual_player.isInOfflineMode())
|
if ((actualPlayer != null) && actualPlayer.isOnline() && !actualPlayer.isInOfflineMode())
|
||||||
{
|
{
|
||||||
onlinePlayersList.add(actual_player);
|
onlinePlayersList.add(actualPlayer);
|
||||||
}
|
}
|
||||||
else if (actual_player == null)
|
else if (actualPlayer == null)
|
||||||
{
|
{
|
||||||
LOGGER.warning("listCharacters: found player null into World Instance..");
|
LOGGER.warning("listCharacters: found player null into World Instance..");
|
||||||
}
|
}
|
||||||
|
@@ -96,7 +96,7 @@ public class AdminTownWar implements IAdminCommandHandler
|
|||||||
|
|
||||||
for (PlayerInstance onlinePlayer : pls)
|
for (PlayerInstance onlinePlayer : pls)
|
||||||
{
|
{
|
||||||
if (onlinePlayer.isOnline() == 1)
|
if (onlinePlayer.isOnline())
|
||||||
{
|
{
|
||||||
x = onlinePlayer.getX();
|
x = onlinePlayer.getX();
|
||||||
y = onlinePlayer.getY();
|
y = onlinePlayer.getY();
|
||||||
@@ -176,7 +176,7 @@ public class AdminTownWar implements IAdminCommandHandler
|
|||||||
|
|
||||||
for (PlayerInstance onlinePlayer : pls)
|
for (PlayerInstance onlinePlayer : pls)
|
||||||
{
|
{
|
||||||
if (onlinePlayer.isOnline() == 1)
|
if (onlinePlayer.isOnline())
|
||||||
{
|
{
|
||||||
x = onlinePlayer.getX();
|
x = onlinePlayer.getX();
|
||||||
y = onlinePlayer.getY();
|
y = onlinePlayer.getY();
|
||||||
|
@@ -227,7 +227,7 @@ public class Continuous implements ISkillHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If target is not in game anymore...
|
// If target is not in game anymore...
|
||||||
if ((target instanceof PlayerInstance) && (((PlayerInstance) target).isOnline() == 0))
|
if ((target instanceof PlayerInstance) && !((PlayerInstance) target).isOnline())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -82,7 +82,7 @@ public class OfflineShop implements IUserCommandHandler
|
|||||||
|
|
||||||
player.getInventory().updateDatabase();
|
player.getInventory().updateDatabase();
|
||||||
|
|
||||||
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.CANT_LOGOUT_WHILE_FIGHTING);
|
player.sendPacket(SystemMessageId.CANT_LOGOUT_WHILE_FIGHTING);
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
|
@@ -83,7 +83,7 @@ public class OfflineShop implements IVoicedCommandHandler
|
|||||||
|
|
||||||
player.getInventory().updateDatabase();
|
player.getInventory().updateDatabase();
|
||||||
|
|
||||||
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.CANT_LOGOUT_WHILE_FIGHTING);
|
player.sendPacket(SystemMessageId.CANT_LOGOUT_WHILE_FIGHTING);
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
|
@@ -525,7 +525,7 @@ public class ChristmasManager
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (pc.isOnline() == 0)
|
else if (!pc.isOnline())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -590,7 +590,7 @@ public class ChristmasManager
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (pc.isOnline() == 0)
|
else if (!pc.isOnline())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -113,7 +113,7 @@ public class PetitionManager
|
|||||||
public boolean endPetitionConsultation(PetitionState endState)
|
public boolean endPetitionConsultation(PetitionState endState)
|
||||||
{
|
{
|
||||||
setState(endState);
|
setState(endState);
|
||||||
if ((_responder != null) && (_responder.isOnline() == 1))
|
if ((_responder != null) && _responder.isOnline())
|
||||||
{
|
{
|
||||||
if (endState == PetitionState.Responder_Reject)
|
if (endState == PetitionState.Responder_Reject)
|
||||||
{
|
{
|
||||||
@@ -137,7 +137,7 @@ public class PetitionManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
// End petition consultation and inform them, if they are still online.
|
// End petition consultation and inform them, if they are still online.
|
||||||
if ((_petitioner != null) && (_petitioner.isOnline() == 1))
|
if ((_petitioner != null) && _petitioner.isOnline())
|
||||||
{
|
{
|
||||||
_petitioner.sendPacket(SystemMessageId.THIS_END_THE_PETITION_PLEASE_PROVIDE_FEEDBACK);
|
_petitioner.sendPacket(SystemMessageId.THIS_END_THE_PETITION_PLEASE_PROVIDE_FEEDBACK);
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ public class PetitionManager
|
|||||||
|
|
||||||
public void sendPetitionerPacket(GameServerPacket responsePacket)
|
public void sendPetitionerPacket(GameServerPacket responsePacket)
|
||||||
{
|
{
|
||||||
if ((_petitioner == null) || (_petitioner.isOnline() == 0))
|
if ((_petitioner == null) || !_petitioner.isOnline())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ public class PetitionManager
|
|||||||
|
|
||||||
public void sendResponderPacket(GameServerPacket responsePacket)
|
public void sendResponderPacket(GameServerPacket responsePacket)
|
||||||
{
|
{
|
||||||
if ((_responder == null) || (_responder.isOnline() == 0))
|
if ((_responder == null) || !_responder.isOnline())
|
||||||
{
|
{
|
||||||
endPetitionConsultation(PetitionState.Responder_Missing);
|
endPetitionConsultation(PetitionState.Responder_Missing);
|
||||||
return;
|
return;
|
||||||
|
@@ -83,7 +83,7 @@ public class CursedWeapon
|
|||||||
{
|
{
|
||||||
if (_isActivated)
|
if (_isActivated)
|
||||||
{
|
{
|
||||||
if ((_player != null) && (_player.isOnline() == 1))
|
if ((_player != null) && _player.isOnline())
|
||||||
{
|
{
|
||||||
// Remove from player
|
// Remove from player
|
||||||
LOGGER.info(_name + " being removed online.");
|
LOGGER.info(_name + " being removed online.");
|
||||||
|
@@ -121,12 +121,12 @@ public class Radar
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ((_me == null) || (_me.isOnline() == 0))
|
if ((_me == null) || !_me.isOnline())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_me.sendPacket(new RadarControl(1, 1, _me.getX(), _me.getY(), _me.getZ()));
|
_me.sendPacket(new RadarControl(1, 1, _me.getX(), _me.getY(), _me.getZ()));
|
||||||
if ((_myTarget == null) || (_myTarget.isOnline() == 0) || !_myTarget._haveFlagCTF)
|
if ((_myTarget == null) || !_myTarget.isOnline() || !_myTarget._haveFlagCTF)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -691,10 +691,10 @@ public class Attackable extends NpcInstance
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Manage Base, Quests and Sweep drops of the Attackable
|
// Manage Base, Quests and Sweep drops of the Attackable
|
||||||
doItemDrop((maxDealer != null) && (maxDealer.isOnline() == 1) ? maxDealer : lastAttacker);
|
doItemDrop((maxDealer != null) && maxDealer.isOnline() ? maxDealer : lastAttacker);
|
||||||
|
|
||||||
// Manage drop of Special Events created by GM for a defined period
|
// Manage drop of Special Events created by GM for a defined period
|
||||||
doEventDrop((maxDealer != null) && (maxDealer.isOnline() == 1) ? maxDealer : lastAttacker);
|
doEventDrop((maxDealer != null) && maxDealer.isOnline() ? maxDealer : lastAttacker);
|
||||||
|
|
||||||
if (!_mustGiveExpSp)
|
if (!_mustGiveExpSp)
|
||||||
{
|
{
|
||||||
@@ -1148,8 +1148,7 @@ public class Attackable extends NpcInstance
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ai._attacker.isAlikeDead() || !getKnownList().knowsObject(ai._attacker) || !ai._attacker.isVisible() || ((ai._attacker instanceof PlayerInstance) && (((PlayerInstance) ai._attacker).isOnline() == 0) && !((PlayerInstance) ai._attacker).isInOfflineMode())) // if player go in
|
if (ai._attacker.isAlikeDead() || !getKnownList().knowsObject(ai._attacker) || !ai._attacker.isVisible() || ((ai._attacker instanceof PlayerInstance) && !((PlayerInstance) ai._attacker).isOnline() && !((PlayerInstance) ai._attacker).isInOfflineMode()))
|
||||||
// offline
|
|
||||||
{
|
{
|
||||||
ai._hate = 0;
|
ai._hate = 0;
|
||||||
}
|
}
|
||||||
|
@@ -573,7 +573,7 @@ public class CubicInstance
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (owner.isDead() || (owner.isOnline() == 0))
|
if (owner.isDead() || !owner.isOnline())
|
||||||
{
|
{
|
||||||
stopAction();
|
stopAction();
|
||||||
owner.delCubic(_id);
|
owner.delCubic(_id);
|
||||||
@@ -582,11 +582,11 @@ public class CubicInstance
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!AttackStanceTaskManager.getInstance().getAttackStanceTask(owner))
|
if (!AttackStanceTaskManager.getInstance().hasAttackStanceTask(owner))
|
||||||
{
|
{
|
||||||
if (owner.getPet() != null)
|
if (owner.getPet() != null)
|
||||||
{
|
{
|
||||||
if (!AttackStanceTaskManager.getInstance().getAttackStanceTask(owner.getPet()))
|
if (!AttackStanceTaskManager.getInstance().hasAttackStanceTask(owner.getPet()))
|
||||||
{
|
{
|
||||||
stopAction();
|
stopAction();
|
||||||
return;
|
return;
|
||||||
@@ -1026,7 +1026,7 @@ public class CubicInstance
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
if (_owner.isDead() || (_owner.isOnline() == 0))
|
if (_owner.isDead() || !_owner.isOnline())
|
||||||
{
|
{
|
||||||
stopAction();
|
stopAction();
|
||||||
_owner.delCubic(_id);
|
_owner.delCubic(_id);
|
||||||
|
@@ -6848,7 +6848,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs12 = new CreatureSay(0, 15, "", getName() + " 5 consecutive kill! Only Gm."); // 8D
|
final CreatureSay cs12 = new CreatureSay(0, 15, "", getName() + " 5 consecutive kill! Only Gm."); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0) && player.isGM())
|
if ((player != null) && player.isOnline() && player.isGM())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs12);
|
player.sendPacket(cs12);
|
||||||
}
|
}
|
||||||
@@ -6861,7 +6861,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs = new CreatureSay(0, 15, "", getName() + " is Dominating!"); // 8D
|
final CreatureSay cs = new CreatureSay(0, 15, "", getName() + " is Dominating!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
@@ -6873,7 +6873,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs2 = new CreatureSay(0, 15, "", getName() + " is on a Rampage!"); // 8D
|
final CreatureSay cs2 = new CreatureSay(0, 15, "", getName() + " is on a Rampage!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs2);
|
player.sendPacket(cs2);
|
||||||
}
|
}
|
||||||
@@ -6885,7 +6885,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs3 = new CreatureSay(0, 15, "", getName() + " is on a Killing Spree!"); // 8D
|
final CreatureSay cs3 = new CreatureSay(0, 15, "", getName() + " is on a Killing Spree!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs3);
|
player.sendPacket(cs3);
|
||||||
}
|
}
|
||||||
@@ -6897,7 +6897,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs4 = new CreatureSay(0, 15, "", getName() + " is on a Monster Kill!"); // 8D
|
final CreatureSay cs4 = new CreatureSay(0, 15, "", getName() + " is on a Monster Kill!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs4);
|
player.sendPacket(cs4);
|
||||||
}
|
}
|
||||||
@@ -6909,7 +6909,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs5 = new CreatureSay(0, 15, "", getName() + " is Unstoppable!"); // 8D
|
final CreatureSay cs5 = new CreatureSay(0, 15, "", getName() + " is Unstoppable!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs5);
|
player.sendPacket(cs5);
|
||||||
}
|
}
|
||||||
@@ -6921,7 +6921,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs6 = new CreatureSay(0, 15, "", getName() + " is on an Ultra Kill!"); // 8D
|
final CreatureSay cs6 = new CreatureSay(0, 15, "", getName() + " is on an Ultra Kill!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs6);
|
player.sendPacket(cs6);
|
||||||
}
|
}
|
||||||
@@ -6933,7 +6933,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs7 = new CreatureSay(0, 15, "", getName() + " God Blessed!"); // 8D
|
final CreatureSay cs7 = new CreatureSay(0, 15, "", getName() + " God Blessed!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs7);
|
player.sendPacket(cs7);
|
||||||
}
|
}
|
||||||
@@ -6945,7 +6945,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs8 = new CreatureSay(0, 15, "", getName() + " is Wicked Sick!"); // 8D
|
final CreatureSay cs8 = new CreatureSay(0, 15, "", getName() + " is Wicked Sick!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs8);
|
player.sendPacket(cs8);
|
||||||
}
|
}
|
||||||
@@ -6957,7 +6957,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs9 = new CreatureSay(0, 15, "", getName() + " is on a Ludricrous Kill!"); // 8D
|
final CreatureSay cs9 = new CreatureSay(0, 15, "", getName() + " is on a Ludricrous Kill!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs9);
|
player.sendPacket(cs9);
|
||||||
}
|
}
|
||||||
@@ -6969,7 +6969,7 @@ public class PlayerInstance extends Playable
|
|||||||
final CreatureSay cs10 = new CreatureSay(0, 15, "", getName() + " is GodLike!"); // 8D
|
final CreatureSay cs10 = new CreatureSay(0, 15, "", getName() + " is GodLike!"); // 8D
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs10);
|
player.sendPacket(cs10);
|
||||||
}
|
}
|
||||||
@@ -8378,7 +8378,7 @@ public class PlayerInstance extends Playable
|
|||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
final PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE obj_id=?");
|
final PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE obj_id=?");
|
||||||
statement.setInt(1, isOnline());
|
statement.setInt(1, isOnline() ? 1 : 0);
|
||||||
statement.setLong(2, System.currentTimeMillis());
|
statement.setLong(2, System.currentTimeMillis());
|
||||||
statement.setInt(3, getObjectId());
|
statement.setInt(3, getObjectId());
|
||||||
statement.execute();
|
statement.execute();
|
||||||
@@ -8499,7 +8499,7 @@ public class PlayerInstance extends Playable
|
|||||||
statement.setInt(46, hasDwarvenCraft() ? 1 : 0);
|
statement.setInt(46, hasDwarvenCraft() ? 1 : 0);
|
||||||
statement.setString(47, getTitle());
|
statement.setString(47, getTitle());
|
||||||
statement.setInt(48, getAccessLevel().getLevel());
|
statement.setInt(48, getAccessLevel().getLevel());
|
||||||
statement.setInt(49, isOnline());
|
statement.setInt(49, isOnline() ? 1 : 0);
|
||||||
statement.setInt(50, isIn7sDungeon() ? 1 : 0);
|
statement.setInt(50, isIn7sDungeon() ? 1 : 0);
|
||||||
statement.setInt(51, getClanPrivileges());
|
statement.setInt(51, getClanPrivileges());
|
||||||
statement.setInt(52, getWantsPeace());
|
statement.setInt(52, getWantsPeace());
|
||||||
@@ -9128,13 +9128,13 @@ public class PlayerInstance extends Playable
|
|||||||
statement.setString(34, getTitle());
|
statement.setString(34, getTitle());
|
||||||
statement.setInt(35, getAccessLevel().getLevel());
|
statement.setInt(35, getAccessLevel().getLevel());
|
||||||
|
|
||||||
if (_isInOfflineMode || (isOnline() == 1)) // in offline mode or online
|
if (_isInOfflineMode || isOnline()) // in offline mode or online
|
||||||
{
|
{
|
||||||
statement.setInt(36, 1);
|
statement.setInt(36, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
statement.setInt(36, isOnline());
|
statement.setInt(36, isOnline() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
statement.setInt(37, isIn7sDungeon() ? 1 : 0);
|
statement.setInt(37, isIn7sDungeon() ? 1 : 0);
|
||||||
@@ -9310,13 +9310,12 @@ public class PlayerInstance extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return True if the PlayerInstance is on line.<BR>
|
* Return True if the PlayerInstance is online.
|
||||||
* <BR>
|
* @return if player is online
|
||||||
* @return the int
|
|
||||||
*/
|
*/
|
||||||
public int isOnline()
|
public boolean isOnline()
|
||||||
{
|
{
|
||||||
return _isOnline ? 1 : 0;
|
return _isOnline;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11436,7 +11435,7 @@ public class PlayerInstance extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
if (isOnline() == 1)
|
if (isOnline())
|
||||||
{
|
{
|
||||||
sendPacket(new SystemMessage(SystemMessageId.PLAYING_FOR_LONG_TIME));
|
sendPacket(new SystemMessage(SystemMessageId.PLAYING_FOR_LONG_TIME));
|
||||||
}
|
}
|
||||||
@@ -16154,7 +16153,7 @@ public class PlayerInstance extends Playable
|
|||||||
final Collection<PlayerInstance> allPlayers = World.getInstance().getAllPlayers();
|
final Collection<PlayerInstance> allPlayers = World.getInstance().getAllPlayers();
|
||||||
for (PlayerInstance player : allPlayers)
|
for (PlayerInstance player : allPlayers)
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() == 1) && (player.getClient() != null) && (player.getClient().getConnection() != null) && !player.getClient().getConnection().isClosed() && (player.getClient().getConnection().getInetAddress() != null) && !player.getName().equals(getName()))
|
if ((player != null) && player.isOnline() && (player.getClient() != null) && (player.getClient().getConnection() != null) && !player.getClient().getConnection().isClosed() && (player.getClient().getConnection().getInetAddress() != null) && !player.getName().equals(getName()))
|
||||||
{
|
{
|
||||||
final String ip = player.getClient().getConnection().getInetAddress().getHostAddress();
|
final String ip = player.getClient().getConnection().getInetAddress().getHostAddress();
|
||||||
if (thisip.equals(ip) && (this != player))
|
if (thisip.equals(ip) && (this != player))
|
||||||
@@ -16198,7 +16197,7 @@ public class PlayerInstance extends Playable
|
|||||||
|
|
||||||
for (PlayerInstance player : players)
|
for (PlayerInstance player : players)
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() == 1) && (player.getClient() != null) && (player.getClient().getConnection() != null) && !player.getClient().getConnection().isClosed() && !player.getName().equals(getName()))
|
if ((player != null) && player.isOnline() && (player.getClient() != null) && (player.getClient().getConnection() != null) && !player.getClient().getConnection().isClosed() && !player.getName().equals(getName()))
|
||||||
{
|
{
|
||||||
final String ip = player.getClient().getConnection().getInetAddress().getHostAddress();
|
final String ip = player.getClient().getConnection().getInetAddress().getHostAddress();
|
||||||
if (thisip.equals(ip) && (this != player))
|
if (thisip.equals(ip) && (this != player))
|
||||||
|
@@ -304,7 +304,7 @@ public class TamedBeastInstance extends FeedableBeastInstance
|
|||||||
public void onOwnerGotAttacked(Creature attacker)
|
public void onOwnerGotAttacked(Creature attacker)
|
||||||
{
|
{
|
||||||
// check if the owner is no longer around...if so, despawn
|
// check if the owner is no longer around...if so, despawn
|
||||||
if ((_owner == null) || (_owner.isOnline() == 0))
|
if ((_owner == null) || !_owner.isOnline())
|
||||||
{
|
{
|
||||||
doDespawn();
|
doDespawn();
|
||||||
return;
|
return;
|
||||||
@@ -466,7 +466,7 @@ public class TamedBeastInstance extends FeedableBeastInstance
|
|||||||
final PlayerInstance owner = _tamedBeast.getOwner();
|
final PlayerInstance owner = _tamedBeast.getOwner();
|
||||||
|
|
||||||
// check if the owner is no longer around...if so, despawn
|
// check if the owner is no longer around...if so, despawn
|
||||||
if ((owner == null) || (owner.isOnline() == 0))
|
if ((owner == null) || !owner.isOnline())
|
||||||
{
|
{
|
||||||
doDespawn();
|
doDespawn();
|
||||||
return;
|
return;
|
||||||
|
@@ -113,7 +113,7 @@ public class WeddingManagerInstance extends NpcInstance
|
|||||||
|
|
||||||
final PlayerInstance ptarget = (PlayerInstance) World.getInstance().findObject(player.getPartnerId());
|
final PlayerInstance ptarget = (PlayerInstance) World.getInstance().findObject(player.getPartnerId());
|
||||||
// partner online ?
|
// partner online ?
|
||||||
if ((ptarget == null) || (ptarget.isOnline() == 0))
|
if ((ptarget == null) || !ptarget.isOnline())
|
||||||
{
|
{
|
||||||
filename = "data/html/mods/Wedding_notfound.htm";
|
filename = "data/html/mods/Wedding_notfound.htm";
|
||||||
sendHtmlMessage(player, filename, replace);
|
sendHtmlMessage(player, filename, replace);
|
||||||
|
@@ -239,7 +239,7 @@ public class Announcements
|
|||||||
final CreatureSay cs = new CreatureSay(0, 18, null, text);
|
final CreatureSay cs = new CreatureSay(0, 18, null, text);
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0))
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(cs);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
|
@@ -1086,7 +1086,7 @@ public class CTF implements EventTask
|
|||||||
{
|
{
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
if (player.isOnline() != 0)
|
if (player.isOnline())
|
||||||
{
|
{
|
||||||
player.teleToLocation(_npcX, _npcY, _npcZ, false);
|
player.teleToLocation(_npcX, _npcY, _npcZ, false);
|
||||||
}
|
}
|
||||||
@@ -1372,7 +1372,7 @@ public class CTF implements EventTask
|
|||||||
{
|
{
|
||||||
_playersShuffle.remove(player);
|
_playersShuffle.remove(player);
|
||||||
}
|
}
|
||||||
else if ((player.isOnline() == 0) || player.isInJail() || player.isInOfflineMode())
|
else if (!player.isOnline() || player.isInJail() || player.isInOfflineMode())
|
||||||
{
|
{
|
||||||
removePlayer(player);
|
removePlayer(player);
|
||||||
}
|
}
|
||||||
@@ -2329,7 +2329,7 @@ public class CTF implements EventTask
|
|||||||
{
|
{
|
||||||
for (PlayerInstance player : _players)
|
for (PlayerInstance player : _players)
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0) && (player._inEventCTF))
|
if ((player != null) && player.isOnline() && (player._inEventCTF))
|
||||||
{
|
{
|
||||||
if ((teamName != null) && (player._teamNameCTF.equals(teamName)))
|
if ((teamName != null) && (player._teamNameCTF.equals(teamName)))
|
||||||
{
|
{
|
||||||
@@ -2604,7 +2604,7 @@ public class CTF implements EventTask
|
|||||||
{
|
{
|
||||||
for (PlayerInstance player : _playersShuffle)
|
for (PlayerInstance player : _playersShuffle)
|
||||||
{
|
{
|
||||||
if ((player == null) || (player.isOnline() == 0))
|
if ((player == null) || !player.isOnline())
|
||||||
{
|
{
|
||||||
_playersShuffle.remove(player);
|
_playersShuffle.remove(player);
|
||||||
eventPlayer._inEventCTF = false;
|
eventPlayer._inEventCTF = false;
|
||||||
@@ -2816,8 +2816,9 @@ public class CTF implements EventTask
|
|||||||
{
|
{
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((player.isOnline() == 0) && player._haveFlagCTF)
|
// logged off with a flag in his hands
|
||||||
{ // logged off with a flag in his hands
|
if (!player.isOnline() && player._haveFlagCTF)
|
||||||
|
{
|
||||||
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player.getName() + " logged off with a CTF flag!");
|
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player.getName() + " logged off with a CTF flag!");
|
||||||
player._haveFlagCTF = false;
|
player._haveFlagCTF = false;
|
||||||
if ((_teams.indexOf(player._teamNameHaveFlagCTF) >= 0) && _flagsTaken.get(_teams.indexOf(player._teamNameHaveFlagCTF)))
|
if ((_teams.indexOf(player._teamNameHaveFlagCTF) >= 0) && _flagsTaken.get(_teams.indexOf(player._teamNameHaveFlagCTF)))
|
||||||
@@ -3189,7 +3190,7 @@ public class CTF implements EventTask
|
|||||||
{
|
{
|
||||||
for (PlayerInstance player : _players)
|
for (PlayerInstance player : _players)
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0) && player._teamNameCTF.equals(ourFlag))
|
if ((player != null) && player.isOnline() && player._teamNameCTF.equals(ourFlag))
|
||||||
{
|
{
|
||||||
player.sendMessage(hasFlag.getName() + " took your flag!");
|
player.sendMessage(hasFlag.getName() + " took your flag!");
|
||||||
if (player._haveFlagCTF)
|
if (player._haveFlagCTF)
|
||||||
@@ -3340,6 +3341,6 @@ public class CTF implements EventTask
|
|||||||
*/
|
*/
|
||||||
public static boolean isOutsideCTFArea(PlayerInstance player)
|
public static boolean isOutsideCTFArea(PlayerInstance player)
|
||||||
{
|
{
|
||||||
return (player == null) || (player.isOnline() == 0) || (player.getX() <= (_eventCenterX - _eventOffset)) || (player.getX() >= (_eventCenterX + _eventOffset)) || (player.getY() <= (_eventCenterY - _eventOffset)) || (player.getY() >= (_eventCenterY + _eventOffset)) || (player.getZ() <= (_eventCenterZ - _eventOffset)) || (player.getZ() >= (_eventCenterZ + _eventOffset));
|
return (player == null) || !player.isOnline() || (player.getX() <= (_eventCenterX - _eventOffset)) || (player.getX() >= (_eventCenterX + _eventOffset)) || (player.getY() <= (_eventCenterY - _eventOffset)) || (player.getY() >= (_eventCenterY + _eventOffset)) || (player.getZ() <= (_eventCenterZ - _eventOffset)) || (player.getZ() >= (_eventCenterZ + _eventOffset));
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1010,7 +1010,7 @@ public class DM implements EventTask
|
|||||||
{
|
{
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
if (player.isOnline() != 0)
|
if (player.isOnline())
|
||||||
{
|
{
|
||||||
player.teleToLocation(_npcX, _npcY, _npcZ, false);
|
player.teleToLocation(_npcX, _npcY, _npcZ, false);
|
||||||
}
|
}
|
||||||
@@ -1291,7 +1291,7 @@ public class DM implements EventTask
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player._inEventDM && (player.isOnline() == 0)) || player.isInJail() || player.isInOfflineMode())
|
if ((player._inEventDM && !player.isOnline()) || player.isInJail() || player.isInOfflineMode())
|
||||||
{
|
{
|
||||||
if (!_joining)
|
if (!_joining)
|
||||||
{
|
{
|
||||||
|
@@ -43,7 +43,7 @@ public class PcPoint implements Runnable
|
|||||||
int score = 0;
|
int score = 0;
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
||||||
{
|
{
|
||||||
if ((player.isOnline() == 1) && (player.getLevel() > Config.PCB_MIN_LEVEL) && !player.isInOfflineMode())
|
if (player.isOnline() && (player.getLevel() > Config.PCB_MIN_LEVEL) && !player.isInOfflineMode())
|
||||||
{
|
{
|
||||||
score = Rnd.get(Config.PCB_POINT_MIN, Config.PCB_POINT_MAX);
|
score = Rnd.get(Config.PCB_POINT_MIN, Config.PCB_POINT_MAX);
|
||||||
|
|
||||||
|
@@ -1025,7 +1025,7 @@ public class TvT implements EventTask
|
|||||||
{
|
{
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
if (player.isOnline() != 0)
|
if (player.isOnline())
|
||||||
{
|
{
|
||||||
player.teleToLocation(_npcX, _npcY, _npcZ, false);
|
player.teleToLocation(_npcX, _npcY, _npcZ, false);
|
||||||
}
|
}
|
||||||
@@ -1310,7 +1310,7 @@ public class TvT implements EventTask
|
|||||||
{
|
{
|
||||||
_playersShuffle.remove(player);
|
_playersShuffle.remove(player);
|
||||||
}
|
}
|
||||||
else if ((player.isOnline() == 0) || player.isInJail() || player.isInOfflineMode())
|
else if (!player.isOnline() || player.isInJail() || player.isInOfflineMode())
|
||||||
{
|
{
|
||||||
removePlayer(player);
|
removePlayer(player);
|
||||||
}
|
}
|
||||||
@@ -2217,7 +2217,7 @@ public class TvT implements EventTask
|
|||||||
{
|
{
|
||||||
for (PlayerInstance player : _players)
|
for (PlayerInstance player : _players)
|
||||||
{
|
{
|
||||||
if ((player != null) && (player.isOnline() != 0) && (player._inEventTvT) && (!player.equals(looser)) && ((player._countTvTkills > 0) || Config.TVT_PRICE_NO_KILLS))
|
if ((player != null) && player.isOnline() && (player._inEventTvT) && (!player.equals(looser)) && ((player._countTvTkills > 0) || Config.TVT_PRICE_NO_KILLS))
|
||||||
{
|
{
|
||||||
if ((bestKiller != null) && (bestKiller.equals(player)))
|
if ((bestKiller != null) && (bestKiller.equals(player)))
|
||||||
{
|
{
|
||||||
@@ -2489,7 +2489,7 @@ public class TvT implements EventTask
|
|||||||
{
|
{
|
||||||
for (PlayerInstance player : _playersShuffle)
|
for (PlayerInstance player : _playersShuffle)
|
||||||
{
|
{
|
||||||
if ((player == null) || (player.isOnline() == 0))
|
if ((player == null) || !player.isOnline())
|
||||||
{
|
{
|
||||||
_playersShuffle.remove(player);
|
_playersShuffle.remove(player);
|
||||||
eventPlayer._inEventTvT = false;
|
eventPlayer._inEventTvT = false;
|
||||||
@@ -2644,7 +2644,7 @@ public class TvT implements EventTask
|
|||||||
{
|
{
|
||||||
_playersShuffle.remove(playerToKick);
|
_playersShuffle.remove(playerToKick);
|
||||||
removePlayer(playerToKick);
|
removePlayer(playerToKick);
|
||||||
if (playerToKick.isOnline() != 0)
|
if (playerToKick.isOnline())
|
||||||
{
|
{
|
||||||
playerToKick.getAppearance().setNameColor(playerToKick._originalNameColorTvT);
|
playerToKick.getAppearance().setNameColor(playerToKick._originalNameColorTvT);
|
||||||
playerToKick.setKarma(playerToKick._originalKarmaTvT);
|
playerToKick.setKarma(playerToKick._originalKarmaTvT);
|
||||||
|
@@ -790,7 +790,7 @@ class OlympiadGame
|
|||||||
sm1 = new SystemMessage(SystemMessageId.THE_GAME_ENDED_IN_A_TIE);
|
sm1 = new SystemMessage(SystemMessageId.THE_GAME_ENDED_IN_A_TIE);
|
||||||
broadcastMessage(sm1, true);
|
broadcastMessage(sm1, true);
|
||||||
}
|
}
|
||||||
else if ((_playerTwo == null) || (_playerTwo.isOnline() == 0) || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
|
else if ((_playerTwo == null) || !_playerTwo.isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
|
||||||
{
|
{
|
||||||
playerOneStat.set(POINTS, playerOnePoints + pointDiff);
|
playerOneStat.set(POINTS, playerOnePoints + pointDiff);
|
||||||
playerTwoStat.set(POINTS, playerTwoPoints - pointDiff);
|
playerTwoStat.set(POINTS, playerTwoPoints - pointDiff);
|
||||||
@@ -824,7 +824,7 @@ class OlympiadGame
|
|||||||
LOGGER.warning("Olympiad System: Game - " + _stadiumID + " on player validateWinner, an error has been occurred: " + e);
|
LOGGER.warning("Olympiad System: Game - " + _stadiumID + " on player validateWinner, an error has been occurred: " + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((_playerOne == null) || (_playerOne.isOnline() == 0) || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
|
else if ((_playerOne == null) || !_playerOne.isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
|
||||||
{
|
{
|
||||||
playerTwoStat.set(POINTS, playerTwoPoints + pointDiff);
|
playerTwoStat.set(POINTS, playerTwoPoints + pointDiff);
|
||||||
playerOneStat.set(POINTS, playerOnePoints - pointDiff);
|
playerOneStat.set(POINTS, playerOnePoints - pointDiff);
|
||||||
@@ -1124,7 +1124,7 @@ class OlympiadGameTask implements Runnable
|
|||||||
final PlayerInstance otherPlayer = _game._players.get(i ^ 1);
|
final PlayerInstance otherPlayer = _game._players.get(i ^ 1);
|
||||||
SystemMessage sm = null;
|
SystemMessage sm = null;
|
||||||
|
|
||||||
if ((player == null) || (player.isOnline() == 0))
|
if ((player == null) || !player.isOnline())
|
||||||
{
|
{
|
||||||
defaulted = true;
|
defaulted = true;
|
||||||
}
|
}
|
||||||
|
@@ -119,8 +119,7 @@ public class ArenaZone extends ZoneType
|
|||||||
if (creature instanceof PlayerInstance)
|
if (creature instanceof PlayerInstance)
|
||||||
{
|
{
|
||||||
final PlayerInstance player = (PlayerInstance) creature;
|
final PlayerInstance player = (PlayerInstance) creature;
|
||||||
|
if (player.isOnline())
|
||||||
if (player.isOnline() == 1)
|
|
||||||
{
|
{
|
||||||
player.teleToLocation(TeleportWhereType.TOWN);
|
player.teleToLocation(TeleportWhereType.TOWN);
|
||||||
}
|
}
|
||||||
|
@@ -176,7 +176,7 @@ public class BossZone extends ZoneType
|
|||||||
if (creature instanceof PlayerInstance)
|
if (creature instanceof PlayerInstance)
|
||||||
{
|
{
|
||||||
final PlayerInstance player = (PlayerInstance) creature;
|
final PlayerInstance player = (PlayerInstance) creature;
|
||||||
if (player.isOnline() == 1)
|
if (player.isOnline())
|
||||||
{
|
{
|
||||||
player.teleToLocation(x, y, z);
|
player.teleToLocation(x, y, z);
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ public class BossZone extends ZoneType
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if the player just got disconnected/logged out, store the dc time so that decisions can be made later about allowing or not the player to LOGGER into the zone
|
// if the player just got disconnected/logged out, store the dc time so that decisions can be made later about allowing or not the player to LOGGER into the zone
|
||||||
if ((player.isOnline() == 0) && _playersAllowed.contains(creature.getObjectId()))
|
if (!player.isOnline() && _playersAllowed.contains(creature.getObjectId()))
|
||||||
{
|
{
|
||||||
// mark the time that the player left the zone
|
// mark the time that the player left the zone
|
||||||
_playerAllowedReEntryTimes.put(creature.getObjectId(), System.currentTimeMillis() + _timeInvade);
|
_playerAllowedReEntryTimes.put(creature.getObjectId(), System.currentTimeMillis() + _timeInvade);
|
||||||
@@ -283,8 +283,7 @@ public class BossZone extends ZoneType
|
|||||||
if (creature instanceof PlayerInstance)
|
if (creature instanceof PlayerInstance)
|
||||||
{
|
{
|
||||||
final PlayerInstance player = (PlayerInstance) creature;
|
final PlayerInstance player = (PlayerInstance) creature;
|
||||||
|
if (player.isOnline())
|
||||||
if (player.isOnline() == 1)
|
|
||||||
{
|
{
|
||||||
player.teleToLocation(TeleportWhereType.TOWN);
|
player.teleToLocation(TeleportWhereType.TOWN);
|
||||||
}
|
}
|
||||||
@@ -338,7 +337,7 @@ public class BossZone extends ZoneType
|
|||||||
if (creature instanceof PlayerInstance)
|
if (creature instanceof PlayerInstance)
|
||||||
{
|
{
|
||||||
final PlayerInstance player = (PlayerInstance) creature;
|
final PlayerInstance player = (PlayerInstance) creature;
|
||||||
if ((player.isOnline() == 1) || player.isInOfflineMode())
|
if (player.isOnline() || player.isInOfflineMode())
|
||||||
{
|
{
|
||||||
npcKnownPlayers.put(player.getObjectId(), player);
|
npcKnownPlayers.put(player.getObjectId(), player);
|
||||||
}
|
}
|
||||||
|
@@ -134,8 +134,7 @@ public class CastleTeleportZone extends ZoneType
|
|||||||
if ((creature != null) && (creature instanceof PlayerInstance))
|
if ((creature != null) && (creature instanceof PlayerInstance))
|
||||||
{
|
{
|
||||||
final PlayerInstance player = (PlayerInstance) creature;
|
final PlayerInstance player = (PlayerInstance) creature;
|
||||||
|
if (player.isOnline())
|
||||||
if (player.isOnline() == 1)
|
|
||||||
{
|
{
|
||||||
player.teleToLocation(Rnd.get(_spawnLoc[0], _spawnLoc[1]), Rnd.get(_spawnLoc[2], _spawnLoc[3]), _spawnLoc[4]);
|
player.teleToLocation(Rnd.get(_spawnLoc[0], _spawnLoc[1]), Rnd.get(_spawnLoc[2], _spawnLoc[3]), _spawnLoc[4]);
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,7 @@ public class Appearing extends GameClientPacket
|
|||||||
{
|
{
|
||||||
final PlayerInstance player = getClient().getPlayer();
|
final PlayerInstance player = getClient().getPlayer();
|
||||||
|
|
||||||
if ((player == null) || (player.isOnline() == 0))
|
if ((player == null) || !player.isOnline())
|
||||||
{
|
{
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return;
|
return;
|
||||||
|
@@ -55,7 +55,7 @@ public class Logout extends GameClientPacket
|
|||||||
|
|
||||||
player.getInventory().updateDatabase();
|
player.getInventory().updateDatabase();
|
||||||
|
|
||||||
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.CANT_LOGOUT_WHILE_FIGHTING);
|
player.sendPacket(SystemMessageId.CANT_LOGOUT_WHILE_FIGHTING);
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
|
@@ -139,7 +139,7 @@ public class RequestEnchantItem extends GameClientPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isOnline() == 0)
|
if (!player.isOnline())
|
||||||
{
|
{
|
||||||
player.setActiveEnchantItem(null);
|
player.setActiveEnchantItem(null);
|
||||||
return;
|
return;
|
||||||
|
@@ -46,7 +46,7 @@ public class RequestFriendInvite extends GameClientPacket
|
|||||||
final PlayerInstance friend = World.getInstance().getPlayer(_name);
|
final PlayerInstance friend = World.getInstance().getPlayer(_name);
|
||||||
|
|
||||||
// can't use friend invite for locating invisible characters
|
// can't use friend invite for locating invisible characters
|
||||||
if ((friend == null) || (friend.isOnline() == 1) || friend.getAppearance().isInvisible())
|
if ((friend == null) || friend.isOnline() || friend.getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
// Target is not found in the game.
|
// Target is not found in the game.
|
||||||
player.sendPacket(SystemMessageId.THE_USER_YOU_REQUESTED_IS_NOT_IN_GAME);
|
player.sendPacket(SystemMessageId.THE_USER_YOU_REQUESTED_IS_NOT_IN_GAME);
|
||||||
|
@@ -53,7 +53,7 @@ public class RequestFriendList extends GameClientPacket
|
|||||||
|
|
||||||
final PlayerInstance friend = World.getInstance().getPlayer(id);
|
final PlayerInstance friend = World.getInstance().getPlayer(id);
|
||||||
|
|
||||||
player.sendPacket(SystemMessage.getSystemMessage(((friend == null) || (friend.isOnline() == 0)) ? SystemMessageId.S1_OFFLINE : SystemMessageId.S1_ONLINE).addString(friendName));
|
player.sendPacket(SystemMessage.getSystemMessage(((friend == null) || !friend.isOnline()) ? SystemMessageId.S1_OFFLINE : SystemMessageId.S1_ONLINE).addString(friendName));
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========================
|
// =========================
|
||||||
|
@@ -83,7 +83,7 @@ public class RequestRestart extends GameClientPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if player is in combat
|
// Check if player is in combat
|
||||||
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.CANT_RESTART_WHILE_FIGHTING);
|
player.sendPacket(SystemMessageId.CANT_RESTART_WHILE_FIGHTING);
|
||||||
sendPacket(RestartResponse.valueOf(false));
|
sendPacket(RestartResponse.valueOf(false));
|
||||||
|
@@ -54,7 +54,7 @@ public class FriendList extends GameServerPacket
|
|||||||
final String name = CharNameTable.getInstance().getPlayerName(objId);
|
final String name = CharNameTable.getInstance().getPlayerName(objId);
|
||||||
final PlayerInstance player1 = World.getInstance().getPlayer(objId);
|
final PlayerInstance player1 = World.getInstance().getPlayer(objId);
|
||||||
|
|
||||||
_info.add(new FriendInfo(objId, name, ((player1 != null) && (player1.isOnline() == 1))));
|
_info.add(new FriendInfo(objId, name, ((player1 != null) && player1.isOnline())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ public class PartyMatchList extends GameServerPacket
|
|||||||
|
|
||||||
for (PartyMatchRoom room : PartyMatchRoomList.getInstance().getRooms())
|
for (PartyMatchRoom room : PartyMatchRoomList.getInstance().getRooms())
|
||||||
{
|
{
|
||||||
if ((room.getMembers() < 1) || (room.getOwner() == null) || (room.getOwner().isOnline() == 0) || (room.getOwner().getPartyRoom() != room.getId()))
|
if ((room.getMembers() < 1) || (room.getOwner() == null) || !room.getOwner().isOnline() || (room.getOwner().getPartyRoom() != room.getId()))
|
||||||
{
|
{
|
||||||
PartyMatchRoomList.getInstance().deleteRoom(room.getId());
|
PartyMatchRoomList.getInstance().deleteRoom(room.getId());
|
||||||
continue;
|
continue;
|
||||||
|
@@ -27,7 +27,7 @@ public class PledgeShowMemberListAdd extends GameServerPacket
|
|||||||
private String _name;
|
private String _name;
|
||||||
private int _lvl;
|
private int _lvl;
|
||||||
private int _classId;
|
private int _classId;
|
||||||
private int _isOnline;
|
private int _objectId;
|
||||||
private int _pledgeType;
|
private int _pledgeType;
|
||||||
|
|
||||||
public PledgeShowMemberListAdd(PlayerInstance player)
|
public PledgeShowMemberListAdd(PlayerInstance player)
|
||||||
@@ -35,7 +35,7 @@ public class PledgeShowMemberListAdd extends GameServerPacket
|
|||||||
_name = player.getName();
|
_name = player.getName();
|
||||||
_lvl = player.getLevel();
|
_lvl = player.getLevel();
|
||||||
_classId = player.getClassId().getId();
|
_classId = player.getClassId().getId();
|
||||||
_isOnline = player.isOnline() == 1 ? player.getObjectId() : 0;
|
_objectId = player.isOnline() ? player.getObjectId() : 0;
|
||||||
_pledgeType = player.getPledgeType();
|
_pledgeType = player.getPledgeType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ public class PledgeShowMemberListAdd extends GameServerPacket
|
|||||||
_name = cm.getName();
|
_name = cm.getName();
|
||||||
_lvl = cm.getLevel();
|
_lvl = cm.getLevel();
|
||||||
_classId = cm.getClassId();
|
_classId = cm.getClassId();
|
||||||
_isOnline = cm.isOnline() ? cm.getObjectId() : 0;
|
_objectId = cm.isOnline() ? cm.getObjectId() : 0;
|
||||||
_pledgeType = cm.getPledgeType();
|
_pledgeType = cm.getPledgeType();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -63,7 +63,7 @@ public class PledgeShowMemberListAdd extends GameServerPacket
|
|||||||
writeD(_classId);
|
writeD(_classId);
|
||||||
writeD(0);
|
writeD(0);
|
||||||
writeD(1);
|
writeD(1);
|
||||||
writeD(_isOnline); // 1=online 0=offline
|
writeD(_objectId); // 1=online 0=offline?
|
||||||
writeD(_pledgeType);
|
writeD(_pledgeType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@ public class PledgeShowMemberListUpdate extends GameServerPacket
|
|||||||
private final int _level;
|
private final int _level;
|
||||||
private final int _classId;
|
private final int _classId;
|
||||||
private final int _objectId;
|
private final int _objectId;
|
||||||
private int _isOnline;
|
private final boolean _isOnline;
|
||||||
|
|
||||||
public PledgeShowMemberListUpdate(PlayerInstance player)
|
public PledgeShowMemberListUpdate(PlayerInstance player)
|
||||||
{
|
{
|
||||||
@@ -42,7 +42,7 @@ public class PledgeShowMemberListUpdate extends GameServerPacket
|
|||||||
{
|
{
|
||||||
_hasSponsor = _player.getSponsor() != 0 ? 1 : 0;
|
_hasSponsor = _player.getSponsor() != 0 ? 1 : 0;
|
||||||
}
|
}
|
||||||
else if (_player.isOnline() == 1)
|
else if (_player.isOnline())
|
||||||
{
|
{
|
||||||
_hasSponsor = _player.isClanLeader() ? 1 : 0;
|
_hasSponsor = _player.isClanLeader() ? 1 : 0;
|
||||||
}
|
}
|
||||||
@@ -64,14 +64,7 @@ public class PledgeShowMemberListUpdate extends GameServerPacket
|
|||||||
_level = player.getLevel();
|
_level = player.getLevel();
|
||||||
_classId = player.getClassId();
|
_classId = player.getClassId();
|
||||||
_objectId = player.getObjectId();
|
_objectId = player.getObjectId();
|
||||||
if (player.isOnline())
|
_isOnline = _player.isOnline();
|
||||||
{
|
|
||||||
_isOnline = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_isOnline = 0;
|
|
||||||
}
|
|
||||||
_pledgeType = player.getPledgeType();
|
_pledgeType = player.getPledgeType();
|
||||||
if (_pledgeType == Clan.SUBUNIT_ACADEMY)
|
if (_pledgeType == Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
@@ -96,7 +89,7 @@ public class PledgeShowMemberListUpdate extends GameServerPacket
|
|||||||
writeD(_classId);
|
writeD(_classId);
|
||||||
writeD(0);
|
writeD(0);
|
||||||
writeD(_objectId);
|
writeD(_objectId);
|
||||||
writeD(_isOnline); // 1=online 0=offline
|
writeD(_isOnline ? 1 : 0); // 1=online 0=offline
|
||||||
writeD(_pledgeType);
|
writeD(_pledgeType);
|
||||||
writeD(_hasSponsor);
|
writeD(_hasSponsor);
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class AttackStanceTaskManager
|
|||||||
_attackStanceTasks.remove(actor);
|
_attackStanceTasks.remove(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getAttackStanceTask(Creature actor)
|
public boolean hasAttackStanceTask(Creature actor)
|
||||||
{
|
{
|
||||||
if (actor instanceof Summon)
|
if (actor instanceof Summon)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user