mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-22 17:24:45 +01:00
Fix issues with gacha history
You may need to reset gacha history info in the database
This commit is contained in:
@@ -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()) {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user