aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <romangraef@gmail.com>2022-09-28 10:45:59 +0200
committerGitHub <noreply@github.com>2022-09-28 10:45:59 +0200
commita38f1a3f6fac894f62ed6f80a332a167a030ea4c (patch)
treec390727aff7ba8f268561a1178b291354be68293 /src/main/java/at/hannibal2/skyhanni/utils
parent57a4971ab247be746ebb5cdad6ecb20d05936147 (diff)
downloadskyhanni-a38f1a3f6fac894f62ed6f80a332a167a030ea4c.tar.gz
skyhanni-a38f1a3f6fac894f62ed6f80a332a167a030ea4c.tar.bz2
skyhanni-a38f1a3f6fac894f62ed6f80a332a167a030ea4c.zip
Add coroutines into ApiKeyGrabber.kt (#5)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt b/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt
index b66120f82..5584da0fe 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.utils
+import at.hannibal2.skyhanni.SkyHanniMod
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import org.apache.http.client.config.RequestConfig
@@ -19,7 +20,7 @@ object APIUtil {
private val parser = JsonParser()
val builder: HttpClientBuilder =
- HttpClients.custom().setUserAgent("SkyHanni")
+ HttpClients.custom().setUserAgent("SkyHanni/${SkyHanniMod.VERSION}")
.setDefaultHeaders(
mutableListOf(
BasicHeader("Pragma", "no-cache"),
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index 039cf0e21..52a58c4a6 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -84,4 +84,8 @@ object StringUtils {
val incrementedLastChar = (lastChar.code + 1).toChar()
return inputWithoutLastChar + incrementedLastChar
}
+ fun UUID.toDashlessUUID(): String {
+ return toString().replace("-", "")
+ }
+
} \ No newline at end of file