hpDec fix + Save quest expiration
Fixed an issue that would let a player to delay or anticipate the next map hpDec proc in certain conditions. Implemented mechanic that enables the DB save of expiration times for quests that needs this.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#Fri, 30 Jun 2017 01:05:52 -0300
|
#Fri, 30 Jun 2017 16:23:30 -0300
|
||||||
|
|
||||||
|
|
||||||
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=
|
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Vendored
BIN
Binary file not shown.
+24
-19
@@ -7,42 +7,47 @@ Vcoc - Freelance Developer
|
|||||||
Feature list:
|
Feature list:
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
PQs/Quests:
|
PQs:
|
||||||
* HPQ/KPQ/LPQ/LMPQ/OPQ/EllinPQ/PiratePQ 100%
|
* HPQ/KPQ/LPQ/LMPQ/OPQ/EllinPQ/PiratePQ 100%.
|
||||||
* CWKPQ as Expedition-based event 100%
|
* CWKPQ as Expedition-based event 100%.
|
||||||
* GuildPQ 100% + Guild queue and multi-lobby systems available.
|
* GuildPQ 100% + Guild queue with multi-lobby systems available.
|
||||||
* Brand-new PQ: Boss Rush PQ 100%
|
* Brand-new PQ: Boss Rush PQ 100%.
|
||||||
* BalrogPQ semi-functional
|
* BalrogPQ semi-functional.
|
||||||
* Doll house quest 100%
|
|
||||||
|
Quests:
|
||||||
|
* Doll house quest 100%.
|
||||||
|
* Quests can now reward properly items when matching a reward item with the player's job.
|
||||||
* Loads of quests have been patched.
|
* Loads of quests have been patched.
|
||||||
|
|
||||||
Player Social Network:
|
Player Social Network:
|
||||||
* Guild and Alliance system fully functional.
|
* Guild and Alliance system fully functional.
|
||||||
|
|
||||||
Cash:
|
Cash:
|
||||||
* EXP/DROP/Cosmetic Coupons 100%
|
* EXP/DROP/Cosmetic Coupons 100%.
|
||||||
|
* EXP/DROP coupons now appears as a buff effect when on active time.
|
||||||
* Great deal of cash items functional.
|
* Great deal of cash items functional.
|
||||||
|
|
||||||
PQ potentials:
|
PQ potentials:
|
||||||
* Lobby system - Limited multiple PQ instances on same channel.
|
* Lobby system - Multiple PQ instances on same channel.
|
||||||
* Guild queue system - Guilds can register themselves on a queue for GPQ.
|
* Expedition system - Multiples parties can attempt on a same instance (lobbies and expeds are mutually-exclusive).
|
||||||
|
* Guild queue system - Guilds can register themselves on a queue for the GPQ.
|
||||||
|
|
||||||
Server potentials:
|
Server potentials:
|
||||||
* Multi-worlds 100%
|
* Multi-worlds 100%.
|
||||||
* Adventurer Mount quests 100%
|
* Adventurer Mount quests 100%.
|
||||||
* All Equipment levels up.
|
* All Equipment levels up.
|
||||||
* Player level rates.
|
* Player level rates.
|
||||||
* Gain fame by quests.
|
* Gain fame by quests.
|
||||||
* Every monsterbook card is now droppable by overworld mobs.
|
* Every monsterbook card is now droppable by overworld mobs.
|
||||||
* Added Boss HP Bar for dozens of bosses (needs provided custom wz)
|
* Added Boss HP Bar for dozens of bosses (needs provided custom wz);
|
||||||
* Custom jail system (needs provided custom wz)
|
* Custom jail system (needs provided custom wz).
|
||||||
* Delete Character 100% (requires ENABLE_PIC activated)
|
* Delete Character 100% (requires ENABLE_PIC activated).
|
||||||
|
|
||||||
Admin/GM commands:
|
Admin/GM commands:
|
||||||
* New commands
|
* New commands.
|
||||||
* Zakum/Horntail/Pinkbean 100%
|
* Zakum/Horntail/Pinkbean 100%.
|
||||||
|
|
||||||
Project:
|
Project:
|
||||||
* Organized project code
|
* Organized project code.
|
||||||
* Highly configurable server (see server flags at ServerConstants)
|
* Highly configurable server (see server flags at ServerConstants).
|
||||||
---------------------------
|
---------------------------
|
||||||
@@ -348,3 +348,7 @@ Reestrutura
|
|||||||
28 - 29 Junho 2017,
|
28 - 29 Junho 2017,
|
||||||
Acabamento final da CWKPQ.
|
Acabamento final da CWKPQ.
|
||||||
Corrigido bug no esquema de recuperação de diretórios dos mapas, referenciados em String.wz.
|
Corrigido bug no esquema de recuperação de diretórios dos mapas, referenciados em String.wz.
|
||||||
|
|
||||||
|
30 Junho 2017,
|
||||||
|
Corrigido bug em mecânica de hpDec que permitia aos jogadores postergarem o efeito de decréscimo de HP.
|
||||||
|
Elaborada funcionalidade que permite salvar o "tempo até expirar" para quests com janela de tempo muito alta (as que usam "timeLimit2").
|
||||||
@@ -2,20 +2,6 @@
|
|||||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1"/>
|
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1"/>
|
||||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||||
<group>
|
<group/>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMapFactory.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/expeditions/MapleExpeditionType.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/CWKPQ.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/expeditions/MapleExpedition.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201112.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/AbstractPlayerInteraction.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201110.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201113.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/provider/MapleDataTool.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventManager.java</file>
|
|
||||||
</group>
|
|
||||||
</open-files>
|
</open-files>
|
||||||
</project-private>
|
</project-private>
|
||||||
|
|||||||
@@ -16433,6 +16433,7 @@ CREATE TABLE IF NOT EXISTS `queststatus` (
|
|||||||
`quest` int(11) NOT NULL DEFAULT '0',
|
`quest` int(11) NOT NULL DEFAULT '0',
|
||||||
`status` int(11) NOT NULL DEFAULT '0',
|
`status` int(11) NOT NULL DEFAULT '0',
|
||||||
`time` int(11) NOT NULL DEFAULT '0',
|
`time` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`expires` bigint(20) NOT NULL DEFAULT '0',
|
||||||
`forfeited` int(11) NOT NULL DEFAULT '0',
|
`forfeited` int(11) NOT NULL DEFAULT '0',
|
||||||
`info` tinyint(3) NOT NULL DEFAULT '0',
|
`info` tinyint(3) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`queststatusid`)
|
PRIMARY KEY (`queststatusid`)
|
||||||
|
|||||||
@@ -1974,7 +1974,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
public void run() {
|
public void run() {
|
||||||
doHurtHp();
|
doHurtHp();
|
||||||
}
|
}
|
||||||
}, lastHpTask);
|
}, 10000 - lastHpTask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3000,6 +3000,17 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final MapleQuestStatus getMapleQuestStatus(final int quest) {
|
||||||
|
synchronized (quests) {
|
||||||
|
for (final MapleQuestStatus q : quests.values()) {
|
||||||
|
if (q.getQuest().getId() == quest) {
|
||||||
|
return q;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public MapleQuestStatus getQuest(MapleQuest quest) {
|
public MapleQuestStatus getQuest(MapleQuest quest) {
|
||||||
synchronized (quests) {
|
synchronized (quests) {
|
||||||
if (!quests.containsKey(quest.getId())) {
|
if (!quests.containsKey(quest.getId())) {
|
||||||
@@ -4072,6 +4083,12 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
if (cTime > -1) {
|
if (cTime > -1) {
|
||||||
status.setCompletionTime(cTime * 1000);
|
status.setCompletionTime(cTime * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long eTime = rs.getLong("expires");
|
||||||
|
if (eTime > 0) {
|
||||||
|
status.setExpirationTime(eTime);
|
||||||
|
}
|
||||||
|
|
||||||
status.setForfeited(rs.getInt("forfeited"));
|
status.setForfeited(rs.getInt("forfeited"));
|
||||||
ret.quests.put(q.getId(), status);
|
ret.quests.put(q.getId(), status);
|
||||||
pse.setInt(1, rs.getInt("queststatusid"));
|
pse.setInt(1, rs.getInt("queststatusid"));
|
||||||
@@ -4180,6 +4197,14 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reloadQuestExpirations() {
|
||||||
|
for(MapleQuestStatus mqs: quests.values()) {
|
||||||
|
if(mqs.getExpirationTime() > 0) {
|
||||||
|
questTimeLimit2(mqs.getQuest(), mqs.getExpirationTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String makeMapleReadable(String in) {
|
public static String makeMapleReadable(String in) {
|
||||||
String i = in.replace('I', 'i');
|
String i = in.replace('I', 'i');
|
||||||
i = i.replace('l', 'L');
|
i = i.replace('l', 'L');
|
||||||
@@ -5078,7 +5103,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
ps.executeBatch();
|
ps.executeBatch();
|
||||||
deleteWhereCharacterId(con, "DELETE FROM eventstats WHERE characterid = ?");
|
deleteWhereCharacterId(con, "DELETE FROM eventstats WHERE characterid = ?");
|
||||||
deleteWhereCharacterId(con, "DELETE FROM queststatus WHERE characterid = ?");
|
deleteWhereCharacterId(con, "DELETE FROM queststatus WHERE characterid = ?");
|
||||||
ps = con.prepareStatement("INSERT INTO queststatus (`queststatusid`, `characterid`, `quest`, `status`, `time`, `forfeited`) VALUES (DEFAULT, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS);
|
ps = con.prepareStatement("INSERT INTO queststatus (`queststatusid`, `characterid`, `quest`, `status`, `time`, `expires`, `forfeited`) VALUES (DEFAULT, ?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS);
|
||||||
PreparedStatement psf;
|
PreparedStatement psf;
|
||||||
try (PreparedStatement pse = con.prepareStatement("INSERT INTO questprogress VALUES (DEFAULT, ?, ?, ?)")) {
|
try (PreparedStatement pse = con.prepareStatement("INSERT INTO questprogress VALUES (DEFAULT, ?, ?, ?)")) {
|
||||||
psf = con.prepareStatement("INSERT INTO medalmaps VALUES (DEFAULT, ?, ?)");
|
psf = con.prepareStatement("INSERT INTO medalmaps VALUES (DEFAULT, ?, ?)");
|
||||||
@@ -5089,7 +5114,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
ps.setInt(2, q.getQuest().getId());
|
ps.setInt(2, q.getQuest().getId());
|
||||||
ps.setInt(3, q.getStatus().getId());
|
ps.setInt(3, q.getStatus().getId());
|
||||||
ps.setInt(4, (int) (q.getCompletionTime() / 1000));
|
ps.setInt(4, (int) (q.getCompletionTime() / 1000));
|
||||||
ps.setInt(5, q.getForfeited());
|
ps.setLong(5, q.getExpirationTime());
|
||||||
|
ps.setInt(6, q.getForfeited());
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
try (ResultSet rs = ps.getGeneratedKeys()) {
|
try (ResultSet rs = ps.getGeneratedKeys()) {
|
||||||
rs.next();
|
rs.next();
|
||||||
@@ -5917,23 +5943,44 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void expireQuest(MapleQuest quest) {
|
||||||
|
if(getQuestStatus(quest.getId()) == MapleQuestStatus.Status.COMPLETED.getId()) return;
|
||||||
|
if(System.currentTimeMillis() < getMapleQuestStatus(quest.getId()).getExpirationTime()) return;
|
||||||
|
|
||||||
|
announce(MaplePacketCreator.questExpire(quest.getId()));
|
||||||
|
MapleQuestStatus newStatus = new MapleQuestStatus(quest, MapleQuestStatus.Status.NOT_STARTED);
|
||||||
|
newStatus.setForfeited(getQuest(quest).getForfeited() + 1);
|
||||||
|
updateQuest(newStatus);
|
||||||
|
}
|
||||||
|
|
||||||
public void questTimeLimit(final MapleQuest quest, int seconds) {
|
public void questTimeLimit(final MapleQuest quest, int seconds) {
|
||||||
final MapleCharacter chr = this;
|
|
||||||
ScheduledFuture<?> sf = TimerManager.getInstance().schedule(new Runnable() {
|
ScheduledFuture<?> sf = TimerManager.getInstance().schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if(chr.getQuestStatus(quest.getId()) == MapleQuestStatus.Status.COMPLETED.getId()) return;
|
expireQuest(quest);
|
||||||
|
|
||||||
announce(MaplePacketCreator.questExpire(quest.getId()));
|
|
||||||
MapleQuestStatus newStatus = new MapleQuestStatus(quest, MapleQuestStatus.Status.NOT_STARTED);
|
|
||||||
newStatus.setForfeited(getQuest(quest).getForfeited() + 1);
|
|
||||||
updateQuest(newStatus);
|
|
||||||
}
|
}
|
||||||
}, seconds * 1000);
|
}, seconds * 1000);
|
||||||
announce(MaplePacketCreator.addQuestTimeLimit(quest.getId(), seconds * 1000));
|
announce(MaplePacketCreator.addQuestTimeLimit(quest.getId(), seconds * 1000));
|
||||||
timers.add(sf);
|
timers.add(sf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void questTimeLimit2(final MapleQuest quest, long expires) {
|
||||||
|
long timeLeft = expires - System.currentTimeMillis();
|
||||||
|
|
||||||
|
if(timeLeft <= 0) {
|
||||||
|
expireQuest(quest);
|
||||||
|
} else {
|
||||||
|
ScheduledFuture<?> sf = TimerManager.getInstance().schedule(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
expireQuest(quest);
|
||||||
|
}
|
||||||
|
}, timeLeft);
|
||||||
|
|
||||||
|
timers.add(sf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void updateSingleStat(MapleStat stat, int newval) {
|
public void updateSingleStat(MapleStat stat, int newval) {
|
||||||
updateSingleStat(stat, newval, false);
|
updateSingleStat(stat, newval, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class MapleQuestStatus {
|
|||||||
private Map<Integer, String> progress = new LinkedHashMap<Integer, String>();
|
private Map<Integer, String> progress = new LinkedHashMap<Integer, String>();
|
||||||
private List<Integer> medalProgress = new LinkedList<Integer>();
|
private List<Integer> medalProgress = new LinkedList<Integer>();
|
||||||
private int npc;
|
private int npc;
|
||||||
private long completionTime;
|
private long completionTime, expirationTime;
|
||||||
private int forfeited = 0;
|
private int forfeited = 0;
|
||||||
private String customData;
|
private String customData;
|
||||||
|
|
||||||
@@ -71,6 +71,7 @@ public class MapleQuestStatus {
|
|||||||
this.questID = quest.getId();
|
this.questID = quest.getId();
|
||||||
this.setStatus(status);
|
this.setStatus(status);
|
||||||
this.completionTime = System.currentTimeMillis();
|
this.completionTime = System.currentTimeMillis();
|
||||||
|
this.expirationTime = 0;
|
||||||
if (status == Status.STARTED)
|
if (status == Status.STARTED)
|
||||||
registerMobs();
|
registerMobs();
|
||||||
}
|
}
|
||||||
@@ -80,6 +81,7 @@ public class MapleQuestStatus {
|
|||||||
this.setStatus(status);
|
this.setStatus(status);
|
||||||
this.setNpc(npc);
|
this.setNpc(npc);
|
||||||
this.completionTime = System.currentTimeMillis();
|
this.completionTime = System.currentTimeMillis();
|
||||||
|
this.expirationTime = 0;
|
||||||
if (status == Status.STARTED) {
|
if (status == Status.STARTED) {
|
||||||
registerMobs();
|
registerMobs();
|
||||||
}
|
}
|
||||||
@@ -89,9 +91,9 @@ public class MapleQuestStatus {
|
|||||||
return MapleQuest.getInstance(questID);
|
return MapleQuest.getInstance(questID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public short getQuestID() {
|
public short getQuestID() {
|
||||||
return questID;
|
return questID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Status getStatus() {
|
public Status getStatus() {
|
||||||
return status;
|
return status;
|
||||||
@@ -179,6 +181,14 @@ public class MapleQuestStatus {
|
|||||||
this.completionTime = completionTime;
|
this.completionTime = completionTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getExpirationTime() {
|
||||||
|
return expirationTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpirationTime(long expirationTime) {
|
||||||
|
this.expirationTime = expirationTime;
|
||||||
|
}
|
||||||
|
|
||||||
public int getForfeited() {
|
public int getForfeited() {
|
||||||
return forfeited;
|
return forfeited;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,6 +242,8 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
|
|||||||
if(pet != null)
|
if(pet != null)
|
||||||
player.startFullnessSchedule(PetDataFactory.getHunger(pet.getItemId()), pet, player.getPetIndex(pet));
|
player.startFullnessSchedule(PetDataFactory.getHunger(pet.getItemId()), pet, player.getPetIndex(pet));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.reloadQuestExpirations();
|
||||||
}
|
}
|
||||||
|
|
||||||
c.announce(MaplePacketCreator.updateGender(player));
|
c.announce(MaplePacketCreator.updateGender(player));
|
||||||
@@ -264,7 +266,6 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
|
|||||||
Server.getInstance().broadcastGMMessage(MaplePacketCreator.earnTitleMessage("GM " + player.getName() + " has logged in"));
|
Server.getInstance().broadcastGMMessage(MaplePacketCreator.earnTitleMessage("GM " + player.getName() + " has logged in"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.getMap().getHPDec() > 0) player.resetHpDecreaseTask();
|
if (player.getMap().getHPDec() > 0) player.resetHpDecreaseTask();
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class EventManager {
|
|||||||
private List<Boolean> openedLobbys;
|
private List<Boolean> openedLobbys;
|
||||||
private Properties props = new Properties();
|
private Properties props = new Properties();
|
||||||
private String name;
|
private String name;
|
||||||
private Lock l = new ReentrantLock();
|
private Lock lobbyLock = new ReentrantLock();
|
||||||
|
|
||||||
private static final int limitGuilds = 10; // max numbers of guilds in queue for GPQ.
|
private static final int limitGuilds = 10; // max numbers of guilds in queue for GPQ.
|
||||||
private static final int maxLobbys = 8; // an event manager holds up to this amount of concurrent lobbys
|
private static final int maxLobbys = 8; // an event manager holds up to this amount of concurrent lobbys
|
||||||
@@ -202,32 +202,32 @@ public class EventManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean getLockLobby(int lobbyId) {
|
private boolean getLockLobby(int lobbyId) {
|
||||||
l.lock();
|
lobbyLock.lock();
|
||||||
try {
|
try {
|
||||||
return openedLobbys.get(lobbyId);
|
return openedLobbys.get(lobbyId);
|
||||||
} finally {
|
} finally {
|
||||||
l.unlock();
|
lobbyLock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setLockLobby(int lobbyId, boolean lock) {
|
private void setLockLobby(int lobbyId, boolean lock) {
|
||||||
l.lock();
|
lobbyLock.lock();
|
||||||
try {
|
try {
|
||||||
openedLobbys.set(lobbyId, lock);
|
openedLobbys.set(lobbyId, lock);
|
||||||
} finally {
|
} finally {
|
||||||
l.unlock();
|
lobbyLock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean startLobbyInstance(int lobbyId) {
|
private boolean startLobbyInstance(int lobbyId) {
|
||||||
l.lock();
|
lobbyLock.lock();
|
||||||
try {
|
try {
|
||||||
if(!openedLobbys.get(lobbyId)) {
|
if(!openedLobbys.get(lobbyId)) {
|
||||||
openedLobbys.set(lobbyId, true);
|
openedLobbys.set(lobbyId, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
l.unlock();
|
lobbyLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class MapleQuest {
|
|||||||
|
|
||||||
private static Map<Integer, MapleQuest> quests = new HashMap<>();
|
private static Map<Integer, MapleQuest> quests = new HashMap<>();
|
||||||
protected short infoNumber, id;
|
protected short infoNumber, id;
|
||||||
protected int timeLimit;
|
protected int timeLimit, timeLimit2;
|
||||||
protected String infoex;
|
protected String infoex;
|
||||||
protected Map<MapleQuestRequirementType, MapleQuestRequirement> startReqs = new EnumMap<>(MapleQuestRequirementType.class);
|
protected Map<MapleQuestRequirementType, MapleQuestRequirement> startReqs = new EnumMap<>(MapleQuestRequirementType.class);
|
||||||
protected Map<MapleQuestRequirementType, MapleQuestRequirement> completeReqs = new EnumMap<>(MapleQuestRequirementType.class);
|
protected Map<MapleQuestRequirementType, MapleQuestRequirement> completeReqs = new EnumMap<>(MapleQuestRequirementType.class);
|
||||||
@@ -74,7 +74,7 @@ public class MapleQuest {
|
|||||||
MapleData reqInfo = questInfo.getChildByPath(String.valueOf(id));
|
MapleData reqInfo = questInfo.getChildByPath(String.valueOf(id));
|
||||||
if(reqInfo != null) {
|
if(reqInfo != null) {
|
||||||
timeLimit = MapleDataTool.getInt("timeLimit", reqInfo, 0);
|
timeLimit = MapleDataTool.getInt("timeLimit", reqInfo, 0);
|
||||||
timeLimit = Math.max(timeLimit, MapleDataTool.getInt("timeLimit2", reqInfo, 0)); // alas, nexon made we deal with 2 timeLimits
|
timeLimit2 = MapleDataTool.getInt("timeLimit2", reqInfo, 0);
|
||||||
autoStart = MapleDataTool.getInt("autoStart", reqInfo, 0) == 1;
|
autoStart = MapleDataTool.getInt("autoStart", reqInfo, 0) == 1;
|
||||||
autoPreComplete = MapleDataTool.getInt("autoPreComplete", reqInfo, 0) == 1;
|
autoPreComplete = MapleDataTool.getInt("autoPreComplete", reqInfo, 0) == 1;
|
||||||
autoComplete = MapleDataTool.getInt("autoComplete", reqInfo, 0) == 1;
|
autoComplete = MapleDataTool.getInt("autoComplete", reqInfo, 0) == 1;
|
||||||
@@ -287,8 +287,13 @@ public class MapleQuest {
|
|||||||
newStatus.setForfeited(c.getQuest(this).getForfeited());
|
newStatus.setForfeited(c.getQuest(this).getForfeited());
|
||||||
|
|
||||||
if (timeLimit > 0) {
|
if (timeLimit > 0) {
|
||||||
|
newStatus.setExpirationTime(System.currentTimeMillis() + (timeLimit * 1000));
|
||||||
c.questTimeLimit(this, timeLimit);
|
c.questTimeLimit(this, timeLimit);
|
||||||
}
|
}
|
||||||
|
if (timeLimit2 > 0) {
|
||||||
|
newStatus.setExpirationTime(System.currentTimeMillis() + timeLimit2);
|
||||||
|
c.questTimeLimit2(this, newStatus.getExpirationTime());
|
||||||
|
}
|
||||||
|
|
||||||
c.updateQuest(newStatus);
|
c.updateQuest(newStatus);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user