Skip to content

Commit

Permalink
set production url, add unix newline support, remove debugging logs, …
Browse files Browse the repository at this point in the history
…update ModTheSpire.json
  • Loading branch information
avolny committed Oct 7, 2020
1 parent bf681b9 commit 871333c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/main/java/str_exporter/BackendBroadcaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class BackendBroadcaster {

public static final Logger logger = LogManager.getLogger(BackendBroadcaster.class.getName());

private static final String EBS_URL = "https://localhost:8081";
// private static final String EBS_URL = "https://slaytherelics.xyz:8081";
// private static final String EBS_URL = "https://localhost:8081";
private static final String EBS_URL = "https://slaytherelics.xyz:8080";

// private static final long CHECK_QUEUE_PERIOD_MILLIS = 100;
// private static BackendBroadcaster instance = new BackendBroadcaster();
Expand Down Expand Up @@ -116,7 +116,7 @@ private void broadcastMessage(String msg) {

if (!response.toString().equals("Success"))
logger.info("message not broadcasted succesfully, response: " + response.toString());
logger.info("broadcasted message, response: " + response.toString());
// logger.info("broadcasted message, response: " + response.toString());

} catch (Exception e) {
e.printStackTrace();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/str_exporter/SlayTheRelicsExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

@SpireInitializer
Expand Down Expand Up @@ -109,11 +110,10 @@ public static void initialize()
path = Paths.get("slaytherelics_config.txt.txt");

String data = new String(Files.readAllBytes(path));
List<String> lines = Files.readAllLines(path);

String[] lines = data.split("\r\n");

login = lines[0].split(":")[1];
secret = lines[1].split(":")[1];
login = lines.get(0).split(":")[1];
secret = lines.get(1).split(":")[1];

logger.info("slaytherelics_config.txt was succesfully loaded");

Expand All @@ -139,7 +139,7 @@ private void broadcastTips() {
long start = System.nanoTime();
String tips_json = tipsJsonBuilder.buildJson();
long end = System.nanoTime();
logger.info("tips json builder took " + (end - start) / 1e6 + " milliseconds");
// logger.info("tips json builder took " + (end - start) / 1e6 + " milliseconds");
// logger.info(tips_json);
tipsBroadcaster.queueMessage(tips_json);
}
Expand All @@ -148,7 +148,7 @@ private void broadcastDeck() {
long start = System.nanoTime();
String deck_json = deckJsonBuilder.buildJson();
long end = System.nanoTime();
logger.info("deck json builder took " + (end - start) / 1e6 + " milliseconds");
// logger.info("deck json builder took " + (end - start) / 1e6 + " milliseconds");
// logger.info(deck_json);
deckBroadcaster.queueMessage(deck_json);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/str_exporter/StringCompression.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static String compress(String s, String delims) {

long end = System.nanoTime();

SlayTheRelicsExporter.logger.info(String.format("compression, original len: %s new len: %s ratio %.2f, duration %.2f ms", uncompressedLength, compressedLength, compressedLength * 1f / uncompressedLength, (end-start)/1e6));
// SlayTheRelicsExporter.logger.info(String.format("compression, original len: %s new len: %s ratio %.2f, duration %.2f ms", uncompressedLength, compressedLength, compressedLength * 1f / uncompressedLength, (end-start)/1e6));
return s;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/ModTheSpire.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"modid": "SlayTheRelicsExporter",
"name": "Slay the Relics Exporter",
"author_list": ["LordAddy"],
"description": "This mod exports data to Slay the Relics Twitch extension. \n\nThis mod in combination with the extension displays tooltips for viewers on stream for relics, potions, player/monster powers, orbs, even some custom tooltips from some mods. \nThe viewers just need to hover over the respective item just as if they were in the game themselves.\n\nSee the extension config on Twitch for setup instructions (search 'Slay the Relics').",
"version": "1.1.0",
"sts_version": "01-27-2020",
"description": "This mod exports data to Slay the Relics Twitch extension. \n\nThis mod in combination with the extension displays deck view and tooltips for viewers on stream for relics, potions, player/monster powers, orbs, even some custom tooltips from some mods. \nThe viewers just need to hover over the respective item just as if they were in the game themselves.\n\nSee the extension config on Twitch for setup instructions (search 'Slay the Relics').",
"version": "1.2.0",
"sts_version": "07-30-2020",
"mts_version": "3.15.0",
"dependencies": ["basemod"]
}

0 comments on commit 871333c

Please sign in to comment.