-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new registration flow (#241)
* Remove obsolete functionality and revamp syncing * Add register command * Create registration commands * Restore web server * Sync player state on request * Restore sync command * Fix badge not syncing * Remove old tests * Fix date time deserialization * Fix tests * Disable linter
- Loading branch information
Showing
105 changed files
with
1,328 additions
and
3,309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
pcbridge-http/src/main/kotlin/com/projectcitybuild/pcbridge/http/RetrofitExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
package com.projectcitybuild.pcbridge.http | ||
|
||
import com.projectcitybuild.pcbridge.http.requests.MojangRequest | ||
import com.projectcitybuild.pcbridge.http.requests.PCBRequest | ||
import retrofit2.Retrofit | ||
|
||
internal fun Retrofit.pcb() = create(PCBRequest::class.java) | ||
|
||
internal fun Retrofit.mojang() = create(MojangRequest::class.java) |
32 changes: 0 additions & 32 deletions
32
pcbridge-http/src/main/kotlin/com/projectcitybuild/pcbridge/http/clients/MojangClient.kt
This file was deleted.
Oops, something went wrong.
30 changes: 18 additions & 12 deletions
30
pcbridge-http/src/main/kotlin/com/projectcitybuild/pcbridge/http/clients/PCBClientFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
.../main/kotlin/com/projectcitybuild/pcbridge/http/deserializers/LocalDateTimeTypeAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.projectcitybuild.pcbridge.http.deserializers | ||
|
||
import com.google.gson.JsonDeserializationContext | ||
import com.google.gson.JsonDeserializer | ||
import com.google.gson.JsonElement | ||
import com.google.gson.JsonPrimitive | ||
import com.google.gson.JsonSerializationContext | ||
import com.google.gson.JsonSerializer | ||
import java.lang.reflect.Type | ||
import java.time.LocalDateTime | ||
import java.time.format.DateTimeFormatter | ||
|
||
/** | ||
* Adapter for a LocalDateTime so GSON stops freaking out when it sees one. | ||
* Retrofit will use this for deserialization | ||
*/ | ||
class LocalDateTimeTypeAdapter : JsonSerializer<LocalDateTime?>, JsonDeserializer<LocalDateTime?> { | ||
private val formatter = DateTimeFormatter.ISO_DATE_TIME | ||
|
||
override fun serialize( | ||
src: LocalDateTime?, | ||
typeOfSrc: Type?, | ||
context: JsonSerializationContext?, | ||
): JsonElement { | ||
return JsonPrimitive(formatter.format(src)) | ||
} | ||
|
||
override fun deserialize( | ||
json: JsonElement?, | ||
typeOfT: Type?, | ||
context: JsonDeserializationContext?, | ||
): LocalDateTime? { | ||
return LocalDateTime.parse(json?.asString, formatter) | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
pcbridge-http/src/main/kotlin/com/projectcitybuild/pcbridge/http/parsing/ApiError.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
pcbridge-http/src/main/kotlin/com/projectcitybuild/pcbridge/http/parsing/ApiResponse.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
pcbridge-http/src/main/kotlin/com/projectcitybuild/pcbridge/http/requests/MojangRequest.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.