potential stability improvements

This commit is contained in:
ceikry
2021-07-25 18:58:15 -05:00
parent 1da7949f44
commit d96fd7b283
4 changed files with 6 additions and 2 deletions
@@ -111,6 +111,7 @@ public final class DialogueInterpreter {
npc.getWalkingQueue().reset(); npc.getWalkingQueue().reset();
npc.getPulseManager().clear(); npc.getPulseManager().clear();
} catch(Exception e){ } catch(Exception e){
e.printStackTrace();
} }
} else if (args.length < 1) { } else if (args.length < 1) {
args = new Object[] { dialogueKey }; args = new Object[] { dialogueKey };
@@ -97,6 +97,7 @@ public final class GrandExchangeDatabase {
} }
initialized = true; initialized = true;
} catch (Exception e){ } catch (Exception e){
e.printStackTrace();
initNewDB(); initNewDB();
} }
} }
@@ -32,6 +32,7 @@ public final class PlayerParser {
} }
return true; return true;
} catch (Exception e){ } catch (Exception e){
e.printStackTrace();
return false; return false;
} }
} }
@@ -58,7 +59,7 @@ public final class PlayerParser {
while ((length = is.read(buffer)) > 0) { while ((length = is.read(buffer)) > 0) {
os.write(buffer, 0, length); os.write(buffer, 0, length);
} }
} catch (Exception ignored){ } catch (Exception e){ e.printStackTrace();
} finally { } finally {
try { try {
assert is != null; assert is != null;
@@ -67,6 +68,7 @@ public final class PlayerParser {
os.close(); os.close();
} catch (Exception f){ } catch (Exception f){
SystemLogger.logWarn("Unable to close file copiers in PlayerParser.java line 216."); SystemLogger.logWarn("Unable to close file copiers in PlayerParser.java line 216.");
f.printStackTrace();
} }
} }
} }
@@ -184,7 +184,7 @@ class MiningSkillPulse(private val player: Player, private val node: Node) : Pul
altered = true altered = true
} }
if (RandomFunction.roll(chance)) { if (RandomFunction.roll(chance)) {
val gem = RandomFunction.rollChanceTable(true, *GEM_REWARDS)[0] val gem = GEM_REWARDS.random()
player.packetDispatch.sendMessage("You find a " + gem.name + "!") player.packetDispatch.sendMessage("You find a " + gem.name + "!")
if (!player.inventory.add(gem, player)) { if (!player.inventory.add(gem, player)) {
player.packetDispatch.sendMessage("You do not have enough space in your inventory, so you drop the gem on the floor.") player.packetDispatch.sendMessage("You do not have enough space in your inventory, so you drop the gem on the floor.")