mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-19 13:00:19 -07:00
Fixed some issues that lead to indefinite shutdown times
This commit is contained in:
parent
1a1da2b71b
commit
4008f78433
3 changed files with 3 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ class AIRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic fun clearAllBots() {
|
@JvmStatic fun clearAllBots() {
|
||||||
PulseRepository.forEach { (_, it) ->
|
PulseRepository.toList().forEach { (_, it) ->
|
||||||
it.stop();
|
it.stop();
|
||||||
it.botScript.bot.clear();
|
it.botScript.bot.clear();
|
||||||
AIPlayer.deregister((it.botScript.bot as AIPlayer).uid)
|
AIPlayer.deregister((it.botScript.bot as AIPlayer).uid)
|
||||||
|
|
|
||||||
|
|
@ -351,6 +351,8 @@ public class Player extends Entity {
|
||||||
* @param force If we should force removal, a player engaged in combat will otherwise remain active until out of combat.
|
* @param force If we should force removal, a player engaged in combat will otherwise remain active until out of combat.
|
||||||
*/
|
*/
|
||||||
public void clear(boolean force) {
|
public void clear(boolean force) {
|
||||||
|
if (!isActive())
|
||||||
|
return;
|
||||||
if (force) {
|
if (force) {
|
||||||
Repository.getDisconnectionQueue().remove(getName());
|
Repository.getDisconnectionQueue().remove(getName());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,6 @@ object Repository {
|
||||||
playerNames.remove(player.name)
|
playerNames.remove(player.name)
|
||||||
UpdateSequence.renderablePlayers.remove(player)
|
UpdateSequence.renderablePlayers.remove(player)
|
||||||
player.session.disconnect()
|
player.session.disconnect()
|
||||||
player.clear(true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue