aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StreamerMode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StreamerMode.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StreamerMode.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StreamerMode.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StreamerMode.java
index 40b75e50..ed08ebe2 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StreamerMode.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StreamerMode.java
@@ -2,9 +2,6 @@ package io.github.moulberry.notenoughupdates.miscfeatures;
import io.github.moulberry.notenoughupdates.util.Utils;
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -14,15 +11,15 @@ public class StreamerMode {
public static String filterLobbyNames(String line) {
Matcher matcher = lobbyPattern.matcher(line);
- if(matcher.find() && matcher.groupCount() == 2) {
+ if (matcher.find() && matcher.groupCount() == 2) {
String lobbyType = matcher.group(1);
String lobbyId = matcher.group(2);
- long lobbyNum = Long.parseLong(lobbyId.substring(0, lobbyId.length()-1));
+ long lobbyNum = Long.parseLong(lobbyId.substring(0, lobbyId.length() - 1));
- long obfLobbyNum = (lobbyNum*9182739 + 11) % 500;
- char obfLobbyLetter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt((int)(obfLobbyNum%26));
+ long obfLobbyNum = (lobbyNum * 9182739 + 11) % 500;
+ char obfLobbyLetter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt((int) (obfLobbyNum % 26));
- line = line.replaceAll("(mini|mega|m|M)([0-9]{1,3}[A-Z])", lobbyType+obfLobbyNum+obfLobbyLetter);
+ line = line.replaceAll("(mini|mega|m|M)([0-9]{1,3}[A-Z])", lobbyType + obfLobbyNum + obfLobbyLetter);
}
return line;
}