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)
public class GachaHistoryLog {
private int type;
private int gid;
private long time;
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.gid = gachaId;
this.time = Nebula.getCurrentTime();
this.ids = results;
}
@@ -28,7 +30,7 @@ public class GachaHistoryLog {
public GachaHistory toProto() {
var proto = GachaHistory.newInstance()
.setGid(this.getType())
.setGid(this.getGid())
.setTime(this.getTime());
for (int id : this.getIds()) {

View File

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