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

@@ -28,6 +28,7 @@ import client.BuddylistEntry;
import client.MapleCharacter;
import client.MapleFamily;
import constants.ServerConstants;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
@@ -252,12 +253,15 @@ public class World {
public void setOfflineGuildStatus(int guildid, int guildrank, int cid) {
try {
try (PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement("UPDATE characters SET guildid = ?, guildrank = ? WHERE id = ?")) {
Connection con = DatabaseConnection.getConnection();
try (PreparedStatement ps = con.prepareStatement("UPDATE characters SET guildid = ?, guildrank = ? WHERE id = ?")) {
ps.setInt(1, guildid);
ps.setInt(2, guildrank);
ps.setInt(3, cid);
ps.execute();
}
con.close();
} catch (SQLException se) {
se.printStackTrace();
}