Fix issues with gacha history

You may need to reset gacha history info in the database
This commit is contained in:
Melledy
2025-12-15 08:48:55 -08:00
parent 4da479a88a
commit 85b08c7593
2 changed files with 5 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ import lombok.Getter;
@Entity(value = "banner_info", useDiscriminator = false) @Entity(value = "banner_info", useDiscriminator = false)
public class GachaHistoryLog { public class GachaHistoryLog {
private int type; private int type;
private int gid;
private long time; private long time;
private IntList ids; private IntList ids;
@@ -18,8 +19,9 @@ public class GachaHistoryLog {
} }
public GachaHistoryLog(int type, IntList results) { public GachaHistoryLog(int type, int gachaId, IntList results) {
this.type = type; this.type = type;
this.gid = gachaId;
this.time = Nebula.getCurrentTime(); this.time = Nebula.getCurrentTime();
this.ids = results; this.ids = results;
} }
@@ -28,7 +30,7 @@ public class GachaHistoryLog {
public GachaHistory toProto() { public GachaHistory toProto() {
var proto = GachaHistory.newInstance() var proto = GachaHistory.newInstance()
.setGid(this.getType()) .setGid(this.getGid())
.setTime(this.getTime()); .setTime(this.getTime());
for (int id : this.getIds()) { for (int id : this.getIds()) {

View File

@@ -162,7 +162,7 @@ public class GachaModule extends GameContextModule {
player.getGachaManager().saveBanner(info); player.getGachaManager().saveBanner(info);
// Add history // Add history
var log = new GachaHistoryLog(data.getGachaType(), results); var log = new GachaHistoryLog(data.getStorageId(), data.getId(), results);
player.getGachaManager().addGachaHistory(log); player.getGachaManager().addGachaHistory(log);
// Trigger achievements // Trigger achievements