Heartstopper Commit

Enabled every catch block in the project to log parsed exceptions.
This commit is contained in:
ronancpl
2017-04-02 21:38:07 -03:00
parent 3990a08202
commit 5f01d3b7fd
88 changed files with 13325 additions and 40964 deletions

View File

@@ -71,6 +71,7 @@ public class MakerItemFactory {
ps.close();
createCache.put(toCreate, ret);
} catch (SQLException sqle) {
sqle.printStackTrace();
}
}
return createCache.get(toCreate);

View File

@@ -1134,6 +1134,7 @@ public class MapleItemInformationProvider {
rs.close();
ps.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
if (rs != null) {
@@ -1143,6 +1144,7 @@ public class MapleItemInformationProvider {
ps.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
@@ -1293,6 +1295,7 @@ public class MapleItemInformationProvider {
}
}
} catch (SQLException ex) {
ex.printStackTrace();
}*/
int tdex = chr.getDex(), tstr = chr.getStr(), tint = chr.getInt(), tluk = chr.getLuk(), fame = chr.getFame();
if (chr.getJob() != MapleJob.SUPERGM || chr.getJob() != MapleJob.GM) {
@@ -1374,6 +1377,7 @@ public class MapleItemInformationProvider {
}
}
} catch (SQLException ex) {
ex.printStackTrace();
}*/
int reqLevel = getEquipStats(equip.getItemId()).get("reqLevel");

View File

@@ -40,6 +40,7 @@ public class TimerManager implements TimerManagerMBean {
try {
mBeanServer.registerMBean(this, new ObjectName("server:type=TimerManger"));
} catch (Exception e) {
e.printStackTrace();
}
}

View File

@@ -79,7 +79,7 @@ public class MapleMonsterInformationProvider {
rs.close();
ps.close();
} catch (SQLException e) {
System.err.println("Error retrieving drop" + e);
System.err.println("Error retrieving drop" + e);
} finally {
try {
if (ps != null) {
@@ -89,6 +89,7 @@ public class MapleMonsterInformationProvider {
rs.close();
}
} catch (SQLException ignore) {
ignore.printStackTrace();
}
}
}
@@ -116,6 +117,7 @@ public class MapleMonsterInformationProvider {
rs.getShort("questid")));
}
} catch (SQLException e) {
e.printStackTrace();
return ret;
} finally {
try {
@@ -126,6 +128,7 @@ public class MapleMonsterInformationProvider {
rs.close();
}
} catch (SQLException ignore) {
ignore.printStackTrace();
return ret;
}
}
@@ -159,6 +162,8 @@ public class MapleMonsterInformationProvider {
return MapleLifeFactory.getMonster(id).getName();
} catch (Exception e)
{
e.printStackTrace();
System.err.println("Nonexistant mob id " + id);
return null; //nonexistant mob
}
}

View File

@@ -175,6 +175,7 @@ public class HiredMerchant extends AbstractMapleMapObject {
ps.executeUpdate();
}
} catch (Exception e) {
e.printStackTrace();
}
}
} else {
@@ -186,6 +187,7 @@ public class HiredMerchant extends AbstractMapleMapObject {
try {
this.saveItems(false);
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -198,6 +200,7 @@ public class HiredMerchant extends AbstractMapleMapObject {
saveItems(true);
items.clear();
} catch (SQLException ex) {
ex.printStackTrace();
}
//Server.getInstance().getChannel(world, channel).removeHiredMerchant(ownerId);
map.broadcastMessage(MaplePacketCreator.destroyHiredMerchant(getOwnerId()));
@@ -247,10 +250,12 @@ public class HiredMerchant extends AbstractMapleMapObject {
try {
this.saveItems(timeout);
} catch (Exception e) {
e.printStackTrace();
}
items.clear();
} catch (Exception e) {
e.printStackTrace();
}
schedule.cancel(false);
}
@@ -284,6 +289,7 @@ public class HiredMerchant extends AbstractMapleMapObject {
try {
this.saveItems(false);
} catch (SQLException ex) {
ex.printStackTrace();
}
}
@@ -292,6 +298,7 @@ public class HiredMerchant extends AbstractMapleMapObject {
try {
this.saveItems(false);
} catch (SQLException ex) {
ex.printStackTrace();
}
}

View File

@@ -733,6 +733,39 @@ public class MapleMap {
public List<MapleMapObject> getAllPlayer() {
return getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.PLAYER));
}
public List<MapleCharacter> getAllPlayers() {
List<MapleCharacter> character = new LinkedList<>();
chrRLock.lock();
try {
for (MapleCharacter a : characters) {
character.add(a);
}
} finally {
chrRLock.unlock();
}
return character;
}
public List<MapleCharacter> getPlayersInRange(Rectangle box, List<MapleCharacter> chr) {
List<MapleCharacter> character = new LinkedList<>();
chrRLock.lock();
try {
for (MapleCharacter a : characters) {
if (chr.contains(a.getClient().getPlayer())) {
if (box.contains(a.getPosition())) {
character.add(a);
}
}
}
} finally {
chrRLock.unlock();
}
return character;
}
public void destroyReactor(int oid) {
final MapleReactor reactor = getReactorByOid(oid);
@@ -1131,23 +1164,6 @@ public class MapleMap {
}
public List<MapleCharacter> getPlayersInRange(Rectangle box, List<MapleCharacter> chr) {
List<MapleCharacter> character = new LinkedList<>();
chrRLock.lock();
try {
for (MapleCharacter a : characters) {
if (chr.contains(a.getClient().getPlayer())) {
if (box.contains(a.getPosition())) {
character.add(a);
}
}
}
return character;
} finally {
chrRLock.unlock();
}
}
public void spawnSummon(final MapleSummon summon) {
spawnAndAddRangedMapObject(summon, new DelayedPacketCreation() {
@Override

View File

@@ -146,6 +146,7 @@ public class MapleMapFactory {
}
}
} catch (Exception e) {
e.printStackTrace();
}
for (MapleData life : mapData.getChildByPath("life")) {
String id = MapleDataTool.getString(life.getChildByPath("id"));
@@ -180,6 +181,9 @@ public class MapleMapFactory {
map.setMapName(MapleDataTool.getString("mapName", nameData.getChildByPath(getMapStringName(omapid)), ""));
map.setStreetName(MapleDataTool.getString("streetName", nameData.getChildByPath(getMapStringName(omapid)), ""));
} catch (Exception e) {
e.printStackTrace();
System.err.println("Not found mapid " + omapid);
map.setMapName("");
map.setStreetName("");
}
@@ -270,7 +274,7 @@ public class MapleMapFactory {
builder.append("victoria");
} else if (mapid >= 200000000 && mapid < 300000000) {
builder.append("ossyria");
} else if (mapid >= 540000000 && mapid < 551030200) {
} else if (mapid >= 540000000 && mapid < 560000000) {
builder.append("singapore");
} else if (mapid >= 600000000 && mapid < 620000000) {
builder.append("MasteriaGL");

View File

@@ -63,6 +63,7 @@ public class PlayerNPCs extends AbstractMapleMapObject {
rs2.close();
ps.close();
} catch (SQLException e) {
e.printStackTrace();
}
}