Experimental DB pool + fixed stat overflow on equips
Implemented EXPERIMENTAL DBCP (connection pool), trying to improve concorrent access to DB. Added door portals on Kerning Square. Fixed equipments getting stat overflow when upgrading stats. Fixed expiring pets crashing the client in some cases.
This commit is contained in:
@@ -36,7 +36,6 @@ import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.actions.*;
|
||||
import server.quest.requirements.*;
|
||||
import tools.FilePrinter;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
/**
|
||||
@@ -113,8 +112,9 @@ public class MapleQuest {
|
||||
for (MapleData completeReq : completeReqData.getChildren()) {
|
||||
MapleQuestRequirementType type = MapleQuestRequirementType.getByWZName(completeReq.getName());
|
||||
MapleQuestRequirement req = this.getRequirement(type, completeReq);
|
||||
if(req == null)
|
||||
continue;
|
||||
|
||||
if(req == null)
|
||||
continue;
|
||||
|
||||
if (type.equals(MapleQuestRequirementType.INFO_NUMBER)) {
|
||||
infoNumber = (short) MapleDataTool.getInt(completeReq, 0);
|
||||
@@ -230,6 +230,9 @@ public class MapleQuest {
|
||||
}
|
||||
for (MapleQuestRequirement r : completeReqs.values()) {
|
||||
if (r == null || !r.check(c, npcid)) {
|
||||
if(r.getType() == MapleQuestRequirementType.MESO) { // TODO: find a way to tell the client about the new MESO requirement type.
|
||||
c.dropMessage(5, "You don't have enough mesos to complete this quest.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -402,6 +405,9 @@ public class MapleQuest {
|
||||
case MAX_LEVEL:
|
||||
ret = new MaxLevelRequirement(this, data);
|
||||
break;
|
||||
case MESO:
|
||||
ret = new MesoRequirement(this, data);
|
||||
break;
|
||||
case MIN_LEVEL:
|
||||
ret = new MinLevelRequirement(this, data);
|
||||
break;
|
||||
|
||||
@@ -26,7 +26,7 @@ package server.quest;
|
||||
* @author Matze
|
||||
*/
|
||||
public enum MapleQuestRequirementType {
|
||||
UNDEFINED(-1), JOB(0), ITEM(1), QUEST(2), MIN_LEVEL(3), MAX_LEVEL(4), END_DATE(5), MOB(6), NPC(7), FIELD_ENTER(8), INTERVAL(9), SCRIPT(10), PET(11), MIN_PET_TAMENESS(12), MONSTER_BOOK(13), NORMAL_AUTO_START(14), INFO_NUMBER(15), INFO_EX(16), COMPLETED_QUEST(17), START(18), END(19), DAY_BY_DAY(20);
|
||||
UNDEFINED(-1), JOB(0), ITEM(1), QUEST(2), MIN_LEVEL(3), MAX_LEVEL(4), END_DATE(5), MOB(6), NPC(7), FIELD_ENTER(8), INTERVAL(9), SCRIPT(10), PET(11), MIN_PET_TAMENESS(12), MONSTER_BOOK(13), NORMAL_AUTO_START(14), INFO_NUMBER(15), INFO_EX(16), COMPLETED_QUEST(17), START(18), END(19), DAY_BY_DAY(20), MESO(21);
|
||||
final byte type;
|
||||
|
||||
private MapleQuestRequirementType(int type) {
|
||||
@@ -82,6 +82,8 @@ public enum MapleQuestRequirementType {
|
||||
return END;
|
||||
} else if(name.equals("daybyday")) {
|
||||
return DAY_BY_DAY;
|
||||
} else if (name.equals("money")) {
|
||||
return MESO;
|
||||
} else {
|
||||
return UNDEFINED;
|
||||
}
|
||||
|
||||
52
src/server/quest/requirements/MesoRequirement.java
Normal file
52
src/server/quest/requirements/MesoRequirement.java
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
This file is part of the OdinMS Maple Story Server
|
||||
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
|
||||
Matthias Butz <matze@odinms.de>
|
||||
Jan Christian Meyer <vimes@odinms.de>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package server.quest.requirements;
|
||||
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
import client.MapleCharacter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Ronan
|
||||
*/
|
||||
public class MesoRequirement extends MapleQuestRequirement {
|
||||
private int meso = 0;
|
||||
|
||||
public MesoRequirement(MapleQuest quest, MapleData data) {
|
||||
super(MapleQuestRequirementType.MESO);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
meso = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean check(MapleCharacter chr, Integer npcid) {
|
||||
return chr.getMeso() >= meso;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user