Rename legacy PowerGrant to PowerGrantedTrains
Ends the name clash with the parser's engine.parsers.objects.PowerGrant. It no longer extends AbstractGameObject: it was never cached or sent as a game object, and the renamed class has no GameObjectType entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fae15889f7
commit
3c57a8bb0e
2 files changed
+14
-19
No files matched your search
@@ -334,7 +334,7 @@ public class CharacterPower extends AbstractGameObject {
|
|||||||
// return pc.getBonuses().getByte("gt." + this.power.getToken());
|
// return pc.getBonuses().getByte("gt." + this.power.getToken());
|
||||||
// } else
|
// } else
|
||||||
// return pc.getBonuses().getByte("gt." + this.power.getToken());
|
// return pc.getBonuses().getByte("gt." + this.power.getToken());
|
||||||
return PowerGrant.getGrantedTrains(this.power.getToken(), pc);
|
return PowerGrantedTrains.getGrantedTrains(this.power.getToken(), pc);
|
||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,17 +21,16 @@ import java.util.ArrayList;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
|
||||||
public class PowerGrant extends AbstractGameObject {
|
public class PowerGrantedTrains {
|
||||||
|
|
||||||
private static ConcurrentHashMap<Integer, PowerGrant> grantedPowers = null;
|
private static ConcurrentHashMap<Integer, PowerGrantedTrains> grantedPowers = null;
|
||||||
private int token;
|
private int token;
|
||||||
private ConcurrentHashMap<Integer, Short> runeGrants = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
private ConcurrentHashMap<Integer, Short> runeGrants = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResultSet Constructor
|
* ResultSet Constructor
|
||||||
*/
|
*/
|
||||||
public PowerGrant(ResultSet rs) throws SQLException {
|
public PowerGrantedTrains(ResultSet rs) throws SQLException {
|
||||||
super();
|
|
||||||
this.token = rs.getInt("powerToken");
|
this.token = rs.getInt("powerToken");
|
||||||
runeGrants.put(rs.getInt("runeID"), rs.getShort("grantAmount"));
|
runeGrants.put(rs.getInt("runeID"), rs.getShort("grantAmount"));
|
||||||
}
|
}
|
||||||
@@ -44,11 +43,11 @@ public class PowerGrant extends AbstractGameObject {
|
|||||||
if (pc == null)
|
if (pc == null)
|
||||||
return (short) 0;
|
return (short) 0;
|
||||||
|
|
||||||
if (PowerGrant.grantedPowers == null)
|
if (PowerGrantedTrains.grantedPowers == null)
|
||||||
fillGrantedPowers();
|
fillGrantedPowers();
|
||||||
|
|
||||||
if (PowerGrant.grantedPowers.containsKey(token)) {
|
if (PowerGrantedTrains.grantedPowers.containsKey(token)) {
|
||||||
PowerGrant pg = PowerGrant.grantedPowers.get(token);
|
PowerGrantedTrains pg = PowerGrantedTrains.grantedPowers.get(token);
|
||||||
ConcurrentHashMap<Integer, Short> runeGrants = pg.runeGrants;
|
ConcurrentHashMap<Integer, Short> runeGrants = pg.runeGrants;
|
||||||
ArrayList<Integer> toks = new ArrayList<>();
|
ArrayList<Integer> toks = new ArrayList<>();
|
||||||
|
|
||||||
@@ -90,7 +89,7 @@ public class PowerGrant extends AbstractGameObject {
|
|||||||
|
|
||||||
public static void fillGrantedPowers() {
|
public static void fillGrantedPowers() {
|
||||||
|
|
||||||
PowerGrant.grantedPowers = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
PowerGrantedTrains.grantedPowers = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
try (Connection connection = DbManager.getConnection();
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_powergrant")) {
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_powergrant")) {
|
||||||
@@ -98,7 +97,7 @@ public class PowerGrant extends AbstractGameObject {
|
|||||||
|
|
||||||
ResultSet rs = preparedStatement.executeQuery();
|
ResultSet rs = preparedStatement.executeQuery();
|
||||||
|
|
||||||
if (PowerGrant.grantedPowers.size() > 0) {
|
if (PowerGrantedTrains.grantedPowers.size() > 0) {
|
||||||
rs.close();
|
rs.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -107,14 +106,14 @@ public class PowerGrant extends AbstractGameObject {
|
|||||||
|
|
||||||
int token = rs.getInt("powerToken");
|
int token = rs.getInt("powerToken");
|
||||||
|
|
||||||
PowerGrant pg;
|
PowerGrantedTrains pg;
|
||||||
|
|
||||||
if (PowerGrant.grantedPowers.containsKey(token)) {
|
if (PowerGrantedTrains.grantedPowers.containsKey(token)) {
|
||||||
pg = PowerGrant.grantedPowers.get(token);
|
pg = PowerGrantedTrains.grantedPowers.get(token);
|
||||||
pg.addRuneGrant(rs.getInt("runeID"), rs.getShort("grantAmount"));
|
pg.addRuneGrant(rs.getInt("runeID"), rs.getShort("grantAmount"));
|
||||||
} else {
|
} else {
|
||||||
pg = new PowerGrant(rs);
|
pg = new PowerGrantedTrains(rs);
|
||||||
PowerGrant.grantedPowers.put(token, pg);
|
PowerGrantedTrains.grantedPowers.put(token, pg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
@@ -134,8 +133,4 @@ public class PowerGrant extends AbstractGameObject {
|
|||||||
private void addRuneGrant(int runeID, short amount) {
|
private void addRuneGrant(int runeID, short amount) {
|
||||||
this.runeGrants.put(runeID, amount);
|
this.runeGrants.put(runeID, amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateDatabase() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user