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:
ronancpl
2017-08-23 18:01:17 -03:00
parent 36db21bf80
commit 6628e3db54
190 changed files with 18265 additions and 2183 deletions

View File

@@ -84,8 +84,9 @@ public final class ReportHandler extends AbstractMaplePacketHandler {
public void addReport(int reporterid, int victimid, int reason, String description, String chatlog) {
Calendar calendar = Calendar.getInstance();
Timestamp currentTimestamp = new java.sql.Timestamp(calendar.getTime().getTime());
Connection con = DatabaseConnection.getConnection();
Connection con = null;
try {
con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO reports (`reporttime`, `reporterid`, `victimid`, `reason`, `chatlog`, `description`) VALUES (?, ?, ?, ?, ?, ?)");
ps.setString(1, currentTimestamp.toGMTString().toString());
ps.setInt(2, reporterid);
@@ -96,6 +97,7 @@ public final class ReportHandler extends AbstractMaplePacketHandler {
ps.addBatch();
ps.executeBatch();
ps.close();
con.close();
} catch (SQLException ex) {
ex.printStackTrace();
}