Ludibrium Maze PQ

Implemented Ludibrium Maze PQ.
This commit is contained in:
ronancpl
2017-05-15 15:52:24 -03:00
parent b26469301d
commit a56312ddd3
35 changed files with 8081 additions and 8015 deletions

View File

@@ -183,6 +183,15 @@ public class EventManager {
return Integer.parseInt(props.getProperty(key));
}
private boolean getLockLobby(int lobbyId) {
l.lock();
try {
return openedLobbys.get(lobbyId);
} finally {
l.unlock();
}
}
private void setLockLobby(int lobbyId, boolean lock) {
l.lock();
try {
@@ -243,10 +252,14 @@ public class EventManager {
//Expedition method: starts an expedition
public boolean startInstance(int lobbyId, MapleExpedition exped) {
try {
if(lobbyId > -1) {
if(lobbyId == -1) {
lobbyId = availableLobbyInstance();
if(lobbyId == -1) return false;
}
else {
if(getLockLobby(lobbyId)) return false;
startLobbyInstance(lobbyId);
}
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
if(eim == null) {
@@ -271,10 +284,14 @@ public class EventManager {
public boolean startInstance(int lobbyId, MapleCharacter chr) {
try {
if(lobbyId > -1) {
if(lobbyId == -1) {
lobbyId = availableLobbyInstance();
if(lobbyId == -1) return false;
}
else {
if(getLockLobby(lobbyId)) return false;
startLobbyInstance(lobbyId);
}
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
if(eim == null) {
@@ -298,10 +315,14 @@ public class EventManager {
public boolean startInstance(int lobbyId, MapleParty party, MapleMap map) {
try {
if(lobbyId > -1) {
if(lobbyId == -1) {
lobbyId = availableLobbyInstance();
if(lobbyId == -1) return false;
}
else {
if(getLockLobby(lobbyId)) return false;
startLobbyInstance(lobbyId);
}
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
if(eim == null) {
@@ -326,10 +347,14 @@ public class EventManager {
public boolean startInstance(int lobbyId, MapleParty party, MapleMap map, int difficulty) {
try {
if(lobbyId > -1) {
if(lobbyId == -1) {
lobbyId = availableLobbyInstance();
if(lobbyId == -1) return false;
}
else {
if(getLockLobby(lobbyId)) return false;
startLobbyInstance(lobbyId);
}
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", difficulty, (lobbyId > -1) ? lobbyId : party.getLeaderId()));
if(eim == null) {
@@ -354,10 +379,14 @@ public class EventManager {
public boolean startInstance(int lobbyId, EventInstanceManager eim, String leader) {
try {
if(lobbyId > -1) {
if(lobbyId == -1) {
lobbyId = availableLobbyInstance();
if(lobbyId == -1) return false;
}
else {
if(getLockLobby(lobbyId)) return false;
startLobbyInstance(lobbyId);
}
if(eim == null) {
if(lobbyId > -1) setLockLobby(lobbyId, false);