Skip to content

Commit

Permalink
Handle gamemode
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPresso committed Jul 27, 2024
1 parent 3ed306b commit 146a6ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package me.alexpresso.zuninja.classes.mode;

public enum GameMode {
NORMAL,
HARDCORE
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import me.alexpresso.zuninja.classes.mode.GameMode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -25,6 +26,8 @@ public class RequestServiceImpl implements RequestService {
private String apiBaseUrl;
@Value(value = "${zunivers.frontBaseUrl}")
private String frontBaseUrl;
@Value(value = "${toolkit.gameMode}")
private GameMode gameMode;


public RequestServiceImpl() {
Expand All @@ -51,7 +54,8 @@ public Object request(final String uri, final String method, final Object data,
"sec-fetch-dest", "empty",
"sec-fetch-mode", "cors",
"sec-fetch-site", "same-site",
"user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
"user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"x-zunivers-rulesettype", this.gameMode.name()
).uri(URI.create(String.format("https://%s%s", this.apiBaseUrl, uri)));

if (method.equalsIgnoreCase("GET")) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ spring.neo4j:

toolkit:
discordTags: ${DISCORD_TAGS:alexpresso}
gameMode: NORMAL
runAutomatedTasks: ${RUN_AUTOMATED_TASKS:false}

zunivers:
Expand Down

0 comments on commit 146a6ca

Please sign in to comment.