Disabled the ability to create new HCIM accounts

Disabled the ability to select HCIM 10x xp rate
Existing HCIM will turn back to standard players after their next death (all permadeath rules still apply for that death)
Players on HCIM 10x will be reverted to 5x after their next death
If the player is in combat and disconnects via AFK timeout, then their forced logout timer has been reduced to 30 seconds from 15 minutes
If the player is in combat and x-logs or disconnects via network issues, then their forced logout timer has been reduced to 5 minutes from 15 minutes
This commit is contained in:
Ceikry
2025-02-01 13:48:18 +00:00
committed by Ryan
parent 0c8efbac7a
commit 6e9f3cb8b9
4 changed files with 32 additions and 21 deletions
@@ -130,6 +130,8 @@ public class Player extends Entity {
public HashMap<String,Function1<Player, Unit>> logoutListeners = new HashMap<>();
public Boolean isAfkLogout;
/**
* The inventory.
*/
@@ -4,11 +4,9 @@ import core.api.log
import core.game.node.entity.player.Player
import core.game.node.entity.player.info.login.PlayerParser
import core.game.system.task.TaskExecutor
import core.tools.SystemLogger
import core.game.world.GameWorld
import core.tools.Log
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import core.tools.secondsToTicks
/**
* Handles disconnecting players queuing.
@@ -37,7 +35,10 @@ class DisconnectionQueue {
else {
//Make sure there's no room for the disconnection queue to stroke out and leave someone logged in for 10 years.
queueTimers[it.key] = (queueTimers[it.key] ?: 0) + 3
if ((queueTimers[it.key] ?: Int.MAX_VALUE) >= 1500) {
val isValidAFKLogout = it.value?.player?.isAfkLogout == true
val seconds = if (isValidAFKLogout) 30 else 5 * 60 //30 seconds for AFK logout, 5 minutes for normal logout
val ticksNeeded = secondsToTicks(seconds)
if ((queueTimers[it.key] ?: Int.MAX_VALUE) >= ticksNeeded) {
it.value?.player?.let { player ->
player.finishClear()
Repository.removePlayer(player)
@@ -308,7 +308,10 @@ object PacketProcessor {
}
is Packet.TrackingAfkTimeout -> {
if (pkt.player.details.rights != Rights.ADMINISTRATOR)
{
pkt.player.isAfkLogout = true
pkt.player.packetDispatch.sendLogout()
}
}
is Packet.TrackingCameraPos -> {
//TODO Refactor the player monitor to be actually useful and log this