Skip to content

Commit

Permalink
fix: Servers (ex warzone) not working
Browse files Browse the repository at this point in the history
  • Loading branch information
SantioMC committed Apr 25, 2024
1 parent ce1b0d2 commit 9603e3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/kotlin/me/santio/minehututils/minehut/Minehut.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.santio.minehututils.minehut

import com.google.gson.Gson
import kong.unirest.core.Unirest
import me.santio.minehututils.minehut.api.*
import java.time.Duration
Expand Down Expand Up @@ -91,7 +92,9 @@ object Minehut {
* @return The server model, or null if the server does not exist
*/
fun server(name: String): ServerModel? {
val response = client.get("https://api.minehut.com/server/${name}?byName=true").asObject(ServerResponseModel::class.java)
val response = client.get("https://api.minehut.com/server/${name}?byName=true")
.asObject(ServerResponseModel::class.java)

return if (response.isSuccess && response.body.ok != false) { response.body.server } else null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ data class ServerModel(
@SerializedName("using_cosmetics")
val usingCosmetics: Boolean,
@SerializedName("daily_online_time")
private val dailyUptime: Map<String, Int>? = null,
private val dailyUptime: Map<String, Long>? = null,
val joins: Int,
val icon: String,
val online: Boolean,
Expand Down

0 comments on commit 9603e3e

Please sign in to comment.