ThreadTracker + Attempt on NPC Disappearing fix

Engineered the ThreadTracker: server-embedded deadlock auditing tool, which will print error messages in case of found deadlocks (also showing all in-use locks on the time of the issue).
Changed the player's id on DB now starting from 20mil, thus preventing players from overwriting NPC/mobs with same oid in-game. Requires proper testing to see if the issue has been cleared.
This commit is contained in:
ronancpl
2017-11-16 12:22:32 -02:00
parent aecc3e300a
commit 2b38b62683
50 changed files with 1099 additions and 123 deletions

View File

@@ -42,7 +42,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import tools.locks.MonitoredReentrantLock;
import javax.script.ScriptEngine;
@@ -77,6 +77,7 @@ import tools.FilePrinter;
import tools.HexTool;
import tools.MapleAESOFB;
import tools.MaplePacketCreator;
import tools.locks.MonitoredEnums;
public class MapleClient {
@@ -108,7 +109,7 @@ public class MapleClient {
private int picattempt = 0;
private byte gender = -1;
private boolean disconnecting = false;
private final Lock lock = new ReentrantLock(true);
private final Lock lock = new MonitoredReentrantLock(MonitoredEnums.CLIENT, true);
private int votePoints;
private int voteTime = -1;
private long lastNpcClick;
@@ -832,7 +833,7 @@ public class MapleClient {
removePlayer();
player.saveCooldowns();
player.saveToDB();
player.saveToDB(true);
player = null;
return;