use of riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable in project Armourers-Workshop by RiskyKen.
the class GuiGlobalLibraryPanelSearchResults method fetchPage.
protected void fetchPage(int pageIndex) {
if (!downloadedPageList.contains(pageIndex)) {
downloadedPageList.add(pageIndex);
} else {
return;
}
try {
String searchUrl = SEARCH_URL;
searchUrl += "?search=" + URLEncoder.encode(search, "UTF-8");
searchUrl += "&maxFileVersion=" + String.valueOf(Skin.FILE_VERSION);
searchUrl += "&pageIndex=" + String.valueOf(pageIndex);
searchUrl += "&pageSize=" + String.valueOf(skinPanelResults.getIconCount());
pageCompletion.submit(new DownloadJsonObjectCallable(searchUrl));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
use of riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable in project Armourers-Workshop by RiskyKen.
the class PlushieAuth method checkBetaCode.
public static FutureTask<JsonObject> checkBetaCode(UUID uuid) {
String searchUrl;
try {
searchUrl = BETA_CODE_CHECK_URL + "?code=" + URLEncoder.encode(uuid.toString(), "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
}
FutureTask<JsonObject> futureTask = new FutureTask<JsonObject>(new DownloadJsonObjectCallable(searchUrl));
JSON_DOWNLOAD_EXECUTOR.execute(futureTask);
return futureTask;
}
use of riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable in project Armourers-Workshop by RiskyKen.
the class GlobalSkinLibraryUtils method deleteSkin.
public static FutureTask<JsonObject> deleteSkin(Executor executor, int userId, String accessToken, int skinId) {
Validate.notNull(executor);
Validate.notNull(userId);
Validate.notNull(accessToken);
String searchUrl = USER_SKIN_DELETE_URL + "?userId=" + String.valueOf(userId) + "&accessToken=" + accessToken + "&skinId=" + String.valueOf(skinId);
FutureTask<JsonObject> futureTask = new FutureTask<JsonObject>(new DownloadJsonObjectCallable(searchUrl));
executor.execute(futureTask);
return futureTask;
}
use of riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable in project Armourers-Workshop by RiskyKen.
the class PlushieAuth method isPlayerInBeta.
public static FutureTask<JsonObject> isPlayerInBeta(UUID uuid) {
String searchUrl;
try {
searchUrl = BETA_CHECK_URL + "?uuid=" + URLEncoder.encode(uuid.toString(), "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
}
FutureTask<JsonObject> futureTask = new FutureTask<JsonObject>(new DownloadJsonObjectCallable(searchUrl));
JSON_DOWNLOAD_EXECUTOR.execute(futureTask);
return futureTask;
}
use of riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable in project Armourers-Workshop by RiskyKen.
the class GuiGlobalLibraryPanelSkinInfo method setSkinLike.
private void setSkinLike(boolean like) {
if (authenticateUser()) {
PlushieSession plushieSession = PlushieAuth.PLUSHIE_SESSION;
GuiGlobalLibrary globalLibrary = (GuiGlobalLibrary) parent;
int userId = plushieSession.getServerId();
String accessToken = plushieSession.getAccessToken();
int skinId = skinJson.get("id").getAsInt();
String url = "https://plushie.moe/armourers_workshop/user-skin-action.php";
url += "?userId=" + String.valueOf(userId);
url += "&accessToken=" + accessToken;
if (like) {
url += "&action=like";
} else {
url += "&action=unlike";
}
url += "&skinId=" + String.valueOf(skinId);
taskDoLiked = new FutureTask<JsonObject>(new DownloadJsonObjectCallable(url));
((GuiGlobalLibrary) parent).jsonDownloadExecutor.execute(taskDoLiked);
}
}
Aggregations