Client clean-up + PiratePQ Implementation

Major update on client packets, now properly making unseen killed
monsters not appear as residual on a player's client. Many updates
revolving the PiratePQ environment as well.
This commit is contained in:
ronancpl
2017-04-12 15:32:55 -03:00
parent 768d9d0264
commit 6791a3d475
48 changed files with 990 additions and 194 deletions

View File

@@ -87,6 +87,10 @@ public class AbstractPlayerInteraction {
public MapleCharacter getChar() {
return c.getPlayer();
}
public MapleMap getMap() {
return c.getPlayer().getMap();
}
public void warp(int map) {
getPlayer().changeMap(getWarpMap(map), getWarpMap(map).getPortal(0));
@@ -142,6 +146,14 @@ public class AbstractPlayerInteraction {
return getWarpMap(map);
}
public int countAllMonstersOnMap(int map) {
return getMap(map).countAllMonsters();
}
public int countMonster() {
return getPlayer().getMap().countAllMonsters();
}
public void resetMapObjects(int mapid) {
getWarpMap(mapid).resetMapObjects();
}
@@ -651,10 +663,6 @@ public class AbstractPlayerInteraction {
}
}
public void sendClock(MapleClient d, int time) {
d.announce(MaplePacketCreator.getClock((int) (time - System.currentTimeMillis()) / 1000));
}
public void useItem(int id) {
MapleItemInformationProvider.getInstance().getItemEffect(id).applyTo(c.getPlayer());
c.announce(MaplePacketCreator.getItemMessage(id));//Useful shet :3

View File

@@ -256,27 +256,27 @@ public class EventInstanceManager {
}
public void dispose() {
try {
em.getIv().invokeFunction("dispose", this);
} catch (ScriptException | NoSuchMethodException ex) {
ex.printStackTrace();
}
wL.lock();
try {
chars.clear();
} finally {
wL.unlock();
}
mobs.clear();
killCount.clear();
mapFactory = null;
if (expedition != null) {
em.getChannelServer().getExpeditions().remove(expedition);
}
em.disposeInstance(name);
em = null;
try {
em.getIv().invokeFunction("dispose", this);
} catch (ScriptException | NoSuchMethodException ex) {
ex.printStackTrace();
}
wL.lock();
try {
chars.clear();
} finally {
wL.unlock();
}
mobs.clear();
killCount.clear();
mapFactory = null;
if (expedition != null) {
em.getChannelServer().getExpeditions().remove(expedition);
}
em.disposeInstance(name);
em = null;
}
public MapleMapFactory getMapFactory() {

View File

@@ -38,6 +38,9 @@ import net.server.world.MapleParty;
import server.TimerManager;
import server.expeditions.MapleExpedition;
import server.maps.MapleMap;
import server.life.MapleMonster;
import server.life.MapleLifeFactory;
import client.MapleCharacter;
/**
@@ -194,4 +197,8 @@ public class EventManager {
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
}
}
public MapleMonster getMonster(int mid) {
return(MapleLifeFactory.getMonster(mid));
}
}