Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
Deep PDB integration
Browse files Browse the repository at this point in the history
Northernside committed Jun 3, 2023
1 parent 9882d84 commit 917c2ff
Showing 1 changed file with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public class UUIDCollectorConfiguration extends AddonConfig {
@MethodOrder(after = "getCollection")
@TextFieldSetting
private final ConfigProperty<String> collectionServer = new ConfigProperty<>(
"https://db.lilo-lookup.de/api/");
"https://users.northernsi.de/");
@MethodOrder(after = "collectionServer")
@TextFieldSetting
private final ConfigProperty<String> authenticationKey = new ConfigProperty<>("Your AuthKey");
@@ -57,22 +57,9 @@ public void uploadUUIDs() {
UUIDCollector.tempCollection);
String usersJson = new Gson().toJson(usersRequestModel);
Request.ofString()
.url(this.collectionServer.get() + "user/index?key=" + authenticationKey.get())
.url(this.collectionServer.get() + "api/donate/" + authenticationKey.get())
.json(usersJson)
.async().execute(result -> {
if (result.getStatusCode() != 200) {
Notification errorNotification = Notification.builder()
.icon(Component.icon(
Icon.url("https://cdn.ebio.gg/logos/logo.png").aspectRatio(10, 10))
.getIcon())
.title(Component.text("Error " + result.getStatusCode()))
.text(Component.text("The collection server responded with an error."))
.duration(4500)
.build();

Laby.labyAPI().minecraft().executeOnRenderThread(
() -> Laby.labyAPI().notificationController().push(errorNotification));
} else {
Notification uploadedNotification = Notification.builder()
.icon(Component.icon(
Icon.url("https://cdn.ebio.gg/logos/logo.png").aspectRatio(10, 10))
@@ -85,7 +72,6 @@ public void uploadUUIDs() {
Laby.labyAPI().notificationController().push(uploadedNotification);
UUIDCollector.tempCollection.clear();
InCollectionHUD.updateInCollection(0);
}
});
} catch (Exception ex) {
ex.printStackTrace();

0 comments on commit 917c2ff

Please sign in to comment.