Rename and clean up MapleCashidGenerator
This commit is contained in:
@@ -26,7 +26,7 @@ import client.autoban.AutobanManager;
|
|||||||
import client.creator.CharacterFactoryRecipe;
|
import client.creator.CharacterFactoryRecipe;
|
||||||
import client.inventory.*;
|
import client.inventory.*;
|
||||||
import client.inventory.Equip.StatUpgrade;
|
import client.inventory.Equip.StatUpgrade;
|
||||||
import client.inventory.manipulator.MapleCashidGenerator;
|
import client.inventory.manipulator.CashIdGenerator;
|
||||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||||
import client.keybind.MapleKeyBinding;
|
import client.keybind.MapleKeyBinding;
|
||||||
import client.keybind.MapleQuickslotBinding;
|
import client.keybind.MapleQuickslotBinding;
|
||||||
@@ -2269,7 +2269,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
ps3.executeUpdate();
|
ps3.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCashidGenerator.freeCashId(ringid);
|
CashIdGenerator.freeCashId(ringid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2286,7 +2286,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
ps2.setInt(1, petid);
|
ps2.setInt(1, petid);
|
||||||
ps2.executeUpdate();
|
ps2.executeUpdate();
|
||||||
}
|
}
|
||||||
MapleCashidGenerator.freeCashId(petid);
|
CashIdGenerator.freeCashId(petid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
package client;
|
package client;
|
||||||
|
|
||||||
import client.inventory.manipulator.MapleCashidGenerator;
|
import client.inventory.manipulator.CashIdGenerator;
|
||||||
import tools.DatabaseConnection;
|
import tools.DatabaseConnection;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
|
|
||||||
@@ -85,8 +85,8 @@ public class MapleRing implements Comparable<MapleRing> {
|
|||||||
ps.executeBatch();
|
ps.executeBatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCashidGenerator.freeCashId(ring.getRingId());
|
CashIdGenerator.freeCashId(ring.getRingId());
|
||||||
MapleCashidGenerator.freeCashId(ring.getPartnerRingId());
|
CashIdGenerator.freeCashId(ring.getPartnerRingId());
|
||||||
|
|
||||||
try (PreparedStatement ps = con.prepareStatement("UPDATE inventoryequipment SET ringid=-1 WHERE ringid=?")) {
|
try (PreparedStatement ps = con.prepareStatement("UPDATE inventoryequipment SET ringid=-1 WHERE ringid=?")) {
|
||||||
ps.setInt(1, ring.getRingId());
|
ps.setInt(1, ring.getRingId());
|
||||||
@@ -112,8 +112,8 @@ public class MapleRing implements Comparable<MapleRing> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int[] ringID = new int[2];
|
int[] ringID = new int[2];
|
||||||
ringID[0] = MapleCashidGenerator.generateCashId();
|
ringID[0] = CashIdGenerator.generateCashId();
|
||||||
ringID[1] = MapleCashidGenerator.generateCashId();
|
ringID[1] = CashIdGenerator.generateCashId();
|
||||||
|
|
||||||
try (Connection con = DatabaseConnection.getConnection()) {
|
try (Connection con = DatabaseConnection.getConnection()) {
|
||||||
try (PreparedStatement ps = con.prepareStatement("INSERT INTO rings (id, itemid, partnerRingId, partnerChrId, partnername) VALUES (?, ?, ?, ?, ?)")) {
|
try (PreparedStatement ps = con.prepareStatement("INSERT INTO rings (id, itemid, partnerRingId, partnerChrId, partnername) VALUES (?, ?, ?, ?, ?)")) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
package client.inventory;
|
package client.inventory;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.MapleCharacter;
|
||||||
import client.inventory.manipulator.MapleCashidGenerator;
|
import client.inventory.manipulator.CashIdGenerator;
|
||||||
import constants.game.ExpTable;
|
import constants.game.ExpTable;
|
||||||
import server.MapleItemInformationProvider;
|
import server.MapleItemInformationProvider;
|
||||||
import server.movement.AbsoluteLifeMovement;
|
import server.movement.AbsoluteLifeMovement;
|
||||||
@@ -103,7 +103,7 @@ public class Pet extends Item {
|
|||||||
ps.setInt(1, petid);
|
ps.setInt(1, petid);
|
||||||
|
|
||||||
owner.resetExcluded(petid);
|
owner.resetExcluded(petid);
|
||||||
MapleCashidGenerator.freeCashId(petid);
|
CashIdGenerator.freeCashId(petid);
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ public class Pet extends Item {
|
|||||||
public static int createPet(int itemid) {
|
public static int createPet(int itemid) {
|
||||||
try (Connection con = DatabaseConnection.getConnection();
|
try (Connection con = DatabaseConnection.getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement("INSERT INTO pets (petid, name, level, closeness, fullness, summoned, flag) VALUES (?, ?, 1, 0, 100, 0, 0)")) {
|
PreparedStatement ps = con.prepareStatement("INSERT INTO pets (petid, name, level, closeness, fullness, summoned, flag) VALUES (?, ?, 1, 0, 100, 0, 0)")) {
|
||||||
int ret = MapleCashidGenerator.generateCashId();
|
int ret = CashIdGenerator.generateCashId();
|
||||||
ps.setInt(1, ret);
|
ps.setInt(1, ret);
|
||||||
ps.setString(2, MapleItemInformationProvider.getInstance().getName(itemid));
|
ps.setString(2, MapleItemInformationProvider.getInstance().getName(itemid));
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
@@ -142,7 +142,7 @@ public class Pet extends Item {
|
|||||||
public static int createPet(int itemid, byte level, int closeness, int fullness) {
|
public static int createPet(int itemid, byte level, int closeness, int fullness) {
|
||||||
try (Connection con = DatabaseConnection.getConnection();
|
try (Connection con = DatabaseConnection.getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement("INSERT INTO pets (petid, name, level, closeness, fullness, summoned, flag) VALUES (?, ?, ?, ?, ?, 0, 0)")) {
|
PreparedStatement ps = con.prepareStatement("INSERT INTO pets (petid, name, level, closeness, fullness, summoned, flag) VALUES (?, ?, ?, ?, ?, 0, 0)")) {
|
||||||
int ret = MapleCashidGenerator.generateCashId();
|
int ret = CashIdGenerator.generateCashId();
|
||||||
ps.setInt(1, ret);
|
ps.setInt(1, ret);
|
||||||
ps.setString(2, MapleItemInformationProvider.getInstance().getName(itemid));
|
ps.setString(2, MapleItemInformationProvider.getInstance().getName(itemid));
|
||||||
ps.setByte(3, level);
|
ps.setByte(3, level);
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author RonanLana
|
* @author RonanLana
|
||||||
*/
|
*/
|
||||||
public class MapleCashidGenerator {
|
public class CashIdGenerator {
|
||||||
private static final Logger log = LoggerFactory.getLogger(MapleCashidGenerator.class);
|
private static final Logger log = LoggerFactory.getLogger(CashIdGenerator.class);
|
||||||
private final static Set<Integer> existentCashids = new HashSet<>(10000);
|
private final static Set<Integer> existentCashids = new HashSet<>(10000);
|
||||||
private static Integer runningCashid = 0;
|
private static Integer runningCashid = 0;
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ import client.SkillFactory;
|
|||||||
import client.command.CommandsExecutor;
|
import client.command.CommandsExecutor;
|
||||||
import client.inventory.Item;
|
import client.inventory.Item;
|
||||||
import client.inventory.ItemFactory;
|
import client.inventory.ItemFactory;
|
||||||
import client.inventory.manipulator.MapleCashidGenerator;
|
import client.inventory.manipulator.CashIdGenerator;
|
||||||
import client.newyear.NewYearCardRecord;
|
import client.newyear.NewYearCardRecord;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
import constants.game.GameConstants;
|
import constants.game.GameConstants;
|
||||||
@@ -852,7 +852,7 @@ public class Server {
|
|||||||
loadCouponRates(con);
|
loadCouponRates(con);
|
||||||
updateActiveCoupons(con);
|
updateActiveCoupons(con);
|
||||||
NewYearCardRecord.startPendingNewYearCardRequests(con);
|
NewYearCardRecord.startPendingNewYearCardRequests(con);
|
||||||
MapleCashidGenerator.loadExistentCashIdsFromDb(con);
|
CashIdGenerator.loadExistentCashIdsFromDb(con);
|
||||||
applyAllNameChanges(con); // -- name changes can be missed by INSTANT_NAME_CHANGE --
|
applyAllNameChanges(con); // -- name changes can be missed by INSTANT_NAME_CHANGE --
|
||||||
applyAllWorldTransfers(con);
|
applyAllWorldTransfers(con);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user