File tree 3 files changed +16
-3
lines changed
java/fish/payara/fishmaps/player
3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 7
7
import jakarta .enterprise .context .RequestScoped ;
8
8
import jakarta .inject .Inject ;
9
9
import jakarta .inject .Named ;
10
+ import org .eclipse .microprofile .config .inject .ConfigProperty ;
10
11
11
12
import java .util .List ;
12
13
13
14
@ Named (value = "PlayerBean" )
14
15
@ RequestScoped
15
16
public class PlayerBean {
16
- private static final long MILLISECONDS_UNTIL_OFFLINE = 30000 ;
17
+ @ Inject
18
+ @ ConfigProperty (name = "millis_until_player_offline" )
19
+ private long MILLISECONDS_UNTIL_OFFLINE ;
20
+
17
21
private static final String OFFLINE_PREFIX = "Offline, last seen: " ;
18
22
19
23
@ EJB
Original file line number Diff line number Diff line change 7
7
import jakarta .servlet .http .HttpServlet ;
8
8
import jakarta .servlet .http .HttpServletRequest ;
9
9
import jakarta .servlet .http .HttpServletResponse ;
10
+ import org .eclipse .microprofile .config .inject .ConfigProperty ;
10
11
11
12
import javax .imageio .ImageIO ;
12
13
import java .awt .image .BufferedImage ;
25
26
26
27
@ WebServlet ("/images/players/*" )
27
28
public class PlayerHeadServlet extends HttpServlet {
28
- private static final String NAME_LOOKUP = "https://api.minecraftservices.com/minecraft/profile/lookup/bulk/byname" ;
29
- private static final String PROFILE_LOOKUP = "https://sessionserver.mojang.com/session/minecraft/profile/" ;
29
+ @ Inject
30
+ @ ConfigProperty (name = "mojang_name_lookup_url" , defaultValue = "https://api.minecraftservices.com/minecraft/profile/lookup/bulk/byname" )
31
+ private String NAME_LOOKUP ;
32
+
33
+ @ Inject
34
+ @ ConfigProperty (name = "mojang_profile_lookup_url" , defaultValue = "https://sessionserver.mojang.com/session/minecraft/profile/" )
35
+ private String PROFILE_LOOKUP ;
30
36
31
37
private static BufferedImage defaultImage ;
32
38
Original file line number Diff line number Diff line change
1
+ mojang_name_lookup_url =https://api.minecraftservices.com/minecraft/profile/lookup/bulk/byname
2
+ mojang_profile_lookup_url =https://sessionserver.mojang.com/session/minecraft/profile/
3
+ millis_until_player_offline =30000
You can’t perform that action at this time.
0 commit comments