Make some chr stats nullable to ease migration to PG
This commit is contained in:
@@ -179,6 +179,7 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
@@ -8462,13 +8463,13 @@ public class Character extends AbstractCharacterObject {
|
|||||||
ps.setInt(22, stats.meso());
|
ps.setInt(22, stats.meso());
|
||||||
ps.setInt(23, stats.hpMpApUsed());
|
ps.setInt(23, stats.hpMpApUsed());
|
||||||
ps.setInt(24, stats.spawnPortal());
|
ps.setInt(24, stats.spawnPortal());
|
||||||
ps.setInt(25, stats.party());
|
ps.setInt(25, Objects.requireNonNullElse(stats.party(), -1));
|
||||||
ps.setInt(26, stats.buddyCapacity());
|
ps.setInt(26, stats.buddyCapacity());
|
||||||
ps.setInt(27, stats.messenger());
|
ps.setInt(27, Objects.requireNonNullElse(stats.messenger(), 0));
|
||||||
ps.setInt(28, stats.messengerPosition());
|
ps.setInt(28, Objects.requireNonNullElse(stats.messengerPosition(), 4));
|
||||||
ps.setInt(29, stats.mountLevel());
|
ps.setInt(29, Objects.requireNonNullElse(stats.mountLevel(), 1));
|
||||||
ps.setInt(30, stats.mountExp());
|
ps.setInt(30, Objects.requireNonNullElse(stats.mountExp(), 0));
|
||||||
ps.setInt(31, stats.mountTiredness());
|
ps.setInt(31, Objects.requireNonNullElse(stats.mountTiredness(), 0));
|
||||||
ps.setInt(32, stats.equipSlots());
|
ps.setInt(32, stats.equipSlots());
|
||||||
ps.setInt(33, stats.useSlots());
|
ps.setInt(33, stats.useSlots());
|
||||||
ps.setInt(34, stats.setupSlots());
|
ps.setInt(34, stats.setupSlots());
|
||||||
@@ -8487,8 +8488,8 @@ public class Character extends AbstractCharacterObject {
|
|||||||
ps.setInt(47, stats.omokTies());
|
ps.setInt(47, stats.omokTies());
|
||||||
ps.setString(48, stats.dataString());
|
ps.setString(48, stats.dataString());
|
||||||
ps.setLong(49, stats.jailExpiration());
|
ps.setLong(49, stats.jailExpiration());
|
||||||
ps.setInt(50, stats.partnerId());
|
ps.setInt(50, Objects.requireNonNullElse(stats.partnerId(), -1));
|
||||||
ps.setInt(51, stats.marriageItemId());
|
ps.setInt(51, Objects.requireNonNullElse(stats.marriageItemId(), -1));
|
||||||
ps.setTimestamp(52, new Timestamp(stats.lastExpGainTime()));
|
ps.setTimestamp(52, new Timestamp(stats.lastExpGainTime()));
|
||||||
ps.setInt(53, stats.ariantPoints());
|
ps.setInt(53, stats.ariantPoints());
|
||||||
ps.setBoolean(54, stats.canRecvPartySearchInvite());
|
ps.setBoolean(54, stats.canRecvPartySearchInvite());
|
||||||
@@ -8531,17 +8532,27 @@ public class Character extends AbstractCharacterObject {
|
|||||||
.omokTies(omokties)
|
.omokTies(omokties)
|
||||||
.dataString(dataString)
|
.dataString(dataString)
|
||||||
.jailExpiration(jailExpiration)
|
.jailExpiration(jailExpiration)
|
||||||
.partnerId(partnerId)
|
|
||||||
.marriageItemId(marriageItemid)
|
|
||||||
.lastExpGainTime(lastExpGainTime)
|
.lastExpGainTime(lastExpGainTime)
|
||||||
.ariantPoints(ariantPoints)
|
.ariantPoints(ariantPoints)
|
||||||
.canRecvPartySearchInvite(canRecvPartySearchInvite)
|
.canRecvPartySearchInvite(canRecvPartySearchInvite)
|
||||||
.party(getPartyId())
|
|
||||||
.equipSlots(getSlots(InventoryType.EQUIP.getType()))
|
.equipSlots(getSlots(InventoryType.EQUIP.getType()))
|
||||||
.useSlots(getSlots(InventoryType.USE.getType()))
|
.useSlots(getSlots(InventoryType.USE.getType()))
|
||||||
.setupSlots(getSlots(InventoryType.SETUP.getType()))
|
.setupSlots(getSlots(InventoryType.SETUP.getType()))
|
||||||
.etcSlots(getSlots(InventoryType.ETC.getType()));
|
.etcSlots(getSlots(InventoryType.ETC.getType()));
|
||||||
|
|
||||||
|
Party party = getParty();
|
||||||
|
if (party != null) {
|
||||||
|
builder.party(party.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (partnerId > 0) {
|
||||||
|
builder.partnerId(partnerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (marriageItemid > 0) {
|
||||||
|
builder.marriageItemId(marriageItemid);
|
||||||
|
}
|
||||||
|
|
||||||
effLock.lock();
|
effLock.lock();
|
||||||
statWlock.lock();
|
statWlock.lock();
|
||||||
try {
|
try {
|
||||||
@@ -8573,19 +8584,12 @@ public class Character extends AbstractCharacterObject {
|
|||||||
if (messenger != null) {
|
if (messenger != null) {
|
||||||
builder.messenger(messenger.getId())
|
builder.messenger(messenger.getId())
|
||||||
.messengerPosition(messengerposition);
|
.messengerPosition(messengerposition);
|
||||||
} else {
|
|
||||||
builder.messenger(0)
|
|
||||||
.messengerPosition(4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maplemount != null) {
|
if (maplemount != null) {
|
||||||
builder.mountLevel(maplemount.getLevel())
|
builder.mountLevel(maplemount.getLevel())
|
||||||
.mountExp(maplemount.getExp())
|
.mountExp(maplemount.getExp())
|
||||||
.mountTiredness(maplemount.getTiredness());
|
.mountTiredness(maplemount.getTiredness());
|
||||||
} else {
|
|
||||||
builder.mountLevel(1)
|
|
||||||
.mountExp(0)
|
|
||||||
.mountTiredness(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return builder.build();
|
return builder.build();
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ public record CharacterStats(
|
|||||||
int meso,
|
int meso,
|
||||||
int hpMpApUsed,
|
int hpMpApUsed,
|
||||||
int spawnPortal,
|
int spawnPortal,
|
||||||
int party,
|
Integer party,
|
||||||
int buddyCapacity,
|
int buddyCapacity,
|
||||||
int messenger,
|
Integer messenger,
|
||||||
int messengerPosition,
|
Integer messengerPosition,
|
||||||
int mountLevel,
|
Integer mountLevel,
|
||||||
int mountExp,
|
Integer mountExp,
|
||||||
int mountTiredness,
|
Integer mountTiredness,
|
||||||
int equipSlots,
|
int equipSlots,
|
||||||
int useSlots,
|
int useSlots,
|
||||||
int setupSlots,
|
int setupSlots,
|
||||||
@@ -57,9 +57,9 @@ public record CharacterStats(
|
|||||||
int omokTies,
|
int omokTies,
|
||||||
String dataString,
|
String dataString,
|
||||||
long jailExpiration,
|
long jailExpiration,
|
||||||
int partnerId,
|
Integer partnerId,
|
||||||
int marriageItemId,
|
Integer marriageItemId,
|
||||||
long lastExpGainTime,
|
Long lastExpGainTime,
|
||||||
int ariantPoints,
|
int ariantPoints,
|
||||||
boolean canRecvPartySearchInvite
|
boolean canRecvPartySearchInvite
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||||||
|
|
||||||
public class Party {
|
public class Party {
|
||||||
|
|
||||||
private int id;
|
private final int id;
|
||||||
private Party enemy = null;
|
private Party enemy = null;
|
||||||
private int leaderId;
|
private int leaderId;
|
||||||
private final List<PartyCharacter> members = new LinkedList<>();
|
private final List<PartyCharacter> members = new LinkedList<>();
|
||||||
@@ -173,10 +173,6 @@ public class Party {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLeaderId() {
|
public int getLeaderId() {
|
||||||
return leaderId;
|
return leaderId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user