Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
e6514f7a
Commit
e6514f7a
authored
May 20, 2022
by
Няшик Няшный
Committed by
Melledy
May 20, 2022
Browse files
Added banner start and end time checks
parent
16622785
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/gacha/GachaManager.java
View file @
e6514f7a
...
...
@@ -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,9 +412,14 @@ 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
())
{
if
((
banner
.
getEndTime
()
>=
currentTime
&&
banner
.
getBeginTime
()
<=
currentTime
)
||
(
banner
.
getBannerType
()
==
BannerType
.
STANDARD
))
{
proto
.
addGachaInfoList
(
banner
.
toProto
(
sessionKey
));
}
}
return
proto
.
build
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment