mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-27 05:09:17 +00:00
Added banner start and end time checks
This commit is contained in:
parent
b9eef26d8b
commit
c683effead
@ -21,6 +21,7 @@ import emu.grasscutter.data.common.ItemParamData;
|
||||
import emu.grasscutter.data.def.ItemData;
|
||||
import emu.grasscutter.database.DatabaseHelper;
|
||||
import emu.grasscutter.game.avatar.Avatar;
|
||||
import emu.grasscutter.game.gacha.GachaBanner.BannerType;
|
||||
import emu.grasscutter.game.inventory.GameItem;
|
||||
import emu.grasscutter.game.inventory.Inventory;
|
||||
import emu.grasscutter.game.inventory.ItemType;
|
||||
@ -411,8 +412,13 @@ public class GachaManager {
|
||||
private synchronized GetGachaInfoRsp createProto(String sessionKey) {
|
||||
GetGachaInfoRsp.Builder proto = GetGachaInfoRsp.newBuilder().setGachaRandom(12345);
|
||||
|
||||
long currentTime = System.currentTimeMillis() / 1000L;
|
||||
|
||||
for (GachaBanner banner : getGachaBanners().values()) {
|
||||
proto.addGachaInfoList(banner.toProto(sessionKey));
|
||||
if ((banner.getEndTime() >= currentTime && banner.getBeginTime() <= currentTime) || (banner.getBannerType() == BannerType.STANDARD))
|
||||
{
|
||||
proto.addGachaInfoList(banner.toProto(sessionKey));
|
||||
}
|
||||
}
|
||||
|
||||
return proto.build();
|
||||
|
Loading…
Reference in New Issue
Block a user