Addition of Player hasEnteredWorld method.

This commit is contained in:
MobiusDevelopment
2022-02-03 22:19:24 +00:00
parent e0dc88e351
commit c81f7ee38c
71 changed files with 417 additions and 35 deletions
@@ -430,6 +430,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6182,8 +6183,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7386,6 +7389,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1425,7 +1425,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -707,6 +707,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -432,6 +432,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6184,8 +6185,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7389,6 +7392,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1431,7 +1431,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -745,6 +745,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -434,6 +434,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6186,8 +6187,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7391,6 +7394,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1431,7 +1431,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -745,6 +745,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -438,6 +438,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6181,8 +6182,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7386,6 +7389,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1431,7 +1431,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -745,6 +745,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -436,6 +436,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6198,8 +6199,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7402,6 +7405,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1441,7 +1441,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1534,7 +1533,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -751,6 +751,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -436,6 +436,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6198,8 +6199,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7402,6 +7405,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1523,7 +1523,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1616,7 +1615,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -751,6 +751,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -436,6 +436,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6199,8 +6200,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7403,6 +7406,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1523,7 +1523,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1616,7 +1615,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -751,6 +751,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -448,6 +448,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6164,8 +6165,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7418,6 +7421,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1517,7 +1517,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1610,7 +1609,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -761,6 +761,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -445,6 +445,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6259,8 +6260,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7520,6 +7523,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1499,7 +1499,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1592,7 +1591,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -782,6 +782,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -458,6 +458,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6276,8 +6277,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7546,6 +7549,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1499,7 +1499,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1592,7 +1591,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -792,6 +792,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -459,6 +459,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6309,8 +6310,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7583,6 +7586,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1510,7 +1510,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1603,7 +1602,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -796,6 +796,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -280,6 +280,7 @@ public class Player extends Playable
private String _accountName; private String _accountName;
private long _deleteTimer; private long _deleteTimer;
private boolean _isOnline = false; private boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -8172,6 +8173,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -587,6 +587,9 @@ public class EnterWorld implements IClientIncomingPacket
{ {
player.sendMessage("SVR time is " + fmt.format(new Date(Chronos.currentTimeMillis()))); player.sendMessage("SVR time is " + fmt.format(new Date(Chronos.currentTimeMillis())));
} }
// EnterWorld has finished.
player.setEnteredWorld();
} }
private void colorSystem(Player player) private void colorSystem(Player player)
@@ -288,6 +288,7 @@ public class Player extends Playable
private String _accountName; private String _accountName;
private long _deleteTimer; private long _deleteTimer;
private boolean _isOnline = false; private boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -8325,6 +8326,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -624,6 +624,9 @@ public class EnterWorld implements IClientIncomingPacket
{ {
player.sendMessage("SVR time is " + fmt.format(new Date(Chronos.currentTimeMillis()))); player.sendMessage("SVR time is " + fmt.format(new Date(Chronos.currentTimeMillis())));
} }
// EnterWorld has finished.
player.setEnteredWorld();
} }
private void colorSystem(Player player) private void colorSystem(Player player)
@@ -415,6 +415,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6558,8 +6559,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7685,6 +7688,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -705,6 +705,9 @@ public class EnterWorld implements IClientIncomingPacket
} }
}, 5000); }, 5000);
} }
// EnterWorld has finished.
player.setEnteredWorld();
} }
private void engage(Player player) private void engage(Player player)
@@ -434,6 +434,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6455,8 +6456,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7568,6 +7571,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -704,6 +704,9 @@ public class EnterWorld implements IClientIncomingPacket
} }
}, 5000); }, 5000);
} }
// EnterWorld has finished.
player.setEnteredWorld();
} }
private void engage(Player player) private void engage(Player player)
@@ -434,6 +434,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6157,8 +6158,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7344,6 +7347,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1433,7 +1433,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -724,6 +724,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -434,6 +434,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6157,8 +6158,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7344,6 +7347,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1433,7 +1433,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -724,6 +724,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -432,6 +432,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6143,8 +6144,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7330,6 +7333,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1443,7 +1443,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1536,7 +1535,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -734,6 +734,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -440,6 +440,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6157,8 +6158,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7357,6 +7360,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1525,7 +1525,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1618,7 +1617,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -734,6 +734,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -440,6 +440,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6157,8 +6158,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7357,6 +7360,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1525,7 +1525,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1618,7 +1617,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -734,6 +734,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -454,6 +454,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6112,8 +6113,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7310,6 +7313,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1519,7 +1519,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1612,7 +1611,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -742,6 +742,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -429,6 +429,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6138,8 +6139,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7322,6 +7325,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1425,7 +1425,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -720,6 +720,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -464,6 +464,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6247,8 +6248,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7462,6 +7465,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1627,7 +1627,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1720,7 +1719,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -779,6 +779,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -488,6 +488,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6292,8 +6293,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7528,6 +7531,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1636,7 +1636,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1729,7 +1728,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -793,6 +793,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**
@@ -488,6 +488,7 @@ public class Player extends Playable
private String _htmlPrefix = ""; private String _htmlPrefix = "";
private volatile boolean _isOnline = false; private volatile boolean _isOnline = false;
private boolean _enteredWorld = false;
private long _onlineTime; private long _onlineTime;
private long _onlineBeginTime; private long _onlineBeginTime;
private long _lastAccess; private long _lastAccess;
@@ -6292,8 +6293,10 @@ public class Player extends Playable
broadcastPacket(new Ride(this)); broadcastPacket(new Ride(this));
setMountObjectID(0); setMountObjectID(0);
storePetFood(petId); storePetFood(petId);
// Notify self and others about speed change // Notify self and others about speed change
broadcastUserInfo(); broadcastUserInfo();
return true; return true;
} }
@@ -7528,6 +7531,16 @@ public class Player extends Playable
return 0; return 0;
} }
public void setEnteredWorld()
{
_enteredWorld = true;
}
public boolean hasEnteredWorld()
{
return _enteredWorld;
}
/** /**
* Verifies if the player is in offline mode.<br> * Verifies if the player is in offline mode.<br>
* The offline mode may happen for different reasons:<br> * The offline mode may happen for different reasons:<br>
@@ -1636,7 +1636,6 @@ public abstract class Inventory extends ItemContainer
} }
} }
// Add new item in slot of paperdoll // Add new item in slot of paperdoll
if (item != null) if (item != null)
{ {
@@ -1729,7 +1728,7 @@ public abstract class Inventory extends ItemContainer
*/ */
private void checkEquipTask() private void checkEquipTask()
{ {
if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld())
{ {
getOwner().getActingPlayer().setUsingSkillItem(true); getOwner().getActingPlayer().setUsingSkillItem(true);
_skillItemTask = ThreadPool.schedule(() -> _skillItemTask = ThreadPool.schedule(() ->
@@ -793,6 +793,9 @@ public class EnterWorld implements IClientIncomingPacket
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
} }
}, 5500); }, 5500);
// EnterWorld has finished.
player.setEnteredWorld();
} }
/** /**