Level/exp on all equips + Player stats overhaul + Chair handler patch

Implemented a massive overhaul on Character.wz, adding in equipment level-related nodes in order to make equipments level/EXP info available for anyone to check.
Implemented a major overhaul on the player stat management throughout the source, properly encapsulating and concurrency protecting it's mechanics.
Reviewed several MoveLifeHandler aspects, some of them trying to prevent mobs from falling from footholds in certain circumstances.
Fixed MP Recovery instant killing players when they run out of HP to use.
Fixed some chairs arbitrarily disconnecting players upon HP/MP recovery.
Fixed Puppets sticking to maps in certain scenarios.
Cached data and added concurrency protection for EXP gain on equipments.
Reworked Chair Mastery skill, now with recovering amounts based on a player's base HP/MP pool.
Fixed several deadlock issues revolving rate coupons and character inventory.
Improved overall autopot handler performance.
Reworked door bosses (such as Crocell), now spawning each 3 hours instead of upon player's demand.
Fixed alliances not saving rank names on DB at creation time.
Fixed alliances retaining disbanded guild info on DB.
Added Mystic Door support for the Mushroom Castle area.
This commit is contained in:
ronancpl
2018-09-23 22:37:00 -03:00
parent c3e3c6dfbb
commit 5480035005
255 changed files with 9576 additions and 7850 deletions

View File

@@ -101,6 +101,10 @@ public class EventManager {
for(int i = 0; i < maxLobbys; i++) this.openedLobbys.add(false);
}
private boolean isDisposed() {
return onLoadInstances <= -1000;
}
public void cancel() { // make sure to only call this when there are NO PLAYERS ONLINE to mess around with the event manager!
ess.dispose();
@@ -342,6 +346,8 @@ public class EventManager {
//Expedition method: starts an expedition
public boolean startInstance(int lobbyId, MapleExpedition exped, MapleCharacter leader) {
if (this.isDisposed()) return false;
try {
if(!playerPermit.contains(leader.getId()) && startSemaphore.tryAcquire(7777, TimeUnit.MILLISECONDS)) {
playerPermit.add(leader.getId());
@@ -399,6 +405,8 @@ public class EventManager {
}
public boolean startInstance(int lobbyId, MapleCharacter chr, MapleCharacter leader, int difficulty) {
if (this.isDisposed()) return false;
try {
if(!playerPermit.contains(leader.getId()) && startSemaphore.tryAcquire(7777, TimeUnit.MILLISECONDS)) {
playerPermit.add(leader.getId());
@@ -459,6 +467,8 @@ public class EventManager {
}
public boolean startInstance(int lobbyId, MapleParty party, MapleMap map, MapleCharacter leader) {
if (this.isDisposed()) return false;
try {
if(!playerPermit.contains(leader.getId()) && startSemaphore.tryAcquire(7777, TimeUnit.MILLISECONDS)) {
playerPermit.add(leader.getId());
@@ -516,6 +526,8 @@ public class EventManager {
}
public boolean startInstance(int lobbyId, MapleParty party, MapleMap map, int difficulty, MapleCharacter leader) {
if (this.isDisposed()) return false;
try {
if(!playerPermit.contains(leader.getId()) && startSemaphore.tryAcquire(7777, TimeUnit.MILLISECONDS)) {
playerPermit.add(leader.getId());
@@ -577,6 +589,8 @@ public class EventManager {
}
public boolean startInstance(int lobbyId, EventInstanceManager eim, String ldr, MapleCharacter leader) {
if (this.isDisposed()) return false;
try {
if(!playerPermit.contains(leader.getId()) && startSemaphore.tryAcquire(7777, TimeUnit.MILLISECONDS)) {
playerPermit.add(leader.getId());
@@ -811,7 +825,7 @@ public class EventManager {
int nextEventId;
queueLock.lock();
try {
if(onLoadInstances <= -1000 || readyInstances.size() + onLoadInstances >= Math.ceil((double)maxLobbys / 3.0)) return;
if (this.isDisposed() || readyInstances.size() + onLoadInstances >= Math.ceil((double)maxLobbys / 3.0)) return;
onLoadInstances++;
nextEventId = readyId;
@@ -823,7 +837,7 @@ public class EventManager {
EventInstanceManager eim = new EventInstanceManager(this, "sampleName" + nextEventId);
queueLock.lock();
try {
if(onLoadInstances <= -1000) { // EM already disposed
if (this.isDisposed()) { // EM already disposed
return;
}