Search in sources :

Example 6 with DownloadJsonObjectCallable

use of riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable in project Armourers-Workshop by RiskyKen.

the class GuiGlobalLibraryPanelSkinInfo method checkIfLiked.

private void checkIfLiked() {
    PlushieSession plushieSession = PlushieAuth.PLUSHIE_SESSION;
    GuiGlobalLibrary globalLibrary = (GuiGlobalLibrary) parent;
    int userId = plushieSession.getServerId();
    String accessToken = "";
    int skinId = skinJson.get("id").getAsInt();
    String url = SKIN_ACTION_URL;
    url += "?userId=" + String.valueOf(userId);
    url += "&accessToken=" + accessToken;
    url += "&action=hasLike";
    url += "&skinId=" + String.valueOf(skinId);
    taskCheckIfLiked = new FutureTask<JsonObject>(new DownloadJsonObjectCallable(url));
    ((GuiGlobalLibrary) parent).jsonDownloadExecutor.execute(taskCheckIfLiked);
}
Also used : DownloadJsonObjectCallable(riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable) PlushieSession(riskyken.armourersWorkshop.common.library.global.auth.PlushieSession) JsonObject(com.google.gson.JsonObject) GuiGlobalLibrary(riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary)

Example 7 with DownloadJsonObjectCallable

use of riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable in project Armourers-Workshop by RiskyKen.

the class GuiGlobalLibraryPanelUserSkins method fetchPage.

@Override
protected void fetchPage(int pageIndex) {
    if (!downloadedPageList.contains(pageIndex)) {
        downloadedPageList.add(pageIndex);
    } else {
        return;
    }
    String searchUrl = USER_URL;
    searchUrl += "?userId=" + String.valueOf(userId);
    searchUrl += "&maxFileVersion=" + String.valueOf(Skin.FILE_VERSION);
    searchUrl += "&pageIndex=" + String.valueOf(pageIndex);
    searchUrl += "&pageSize=" + String.valueOf(skinPanelResults.getIconCount());
    pageCompletion.submit(new DownloadJsonObjectCallable(searchUrl));
}
Also used : DownloadJsonObjectCallable(riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable)

Aggregations

DownloadJsonObjectCallable (riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable)7 JsonObject (com.google.gson.JsonObject)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)3 FutureTask (java.util.concurrent.FutureTask)3 GuiGlobalLibrary (riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary)2 PlushieSession (riskyken.armourersWorkshop.common.library.global.auth.PlushieSession)2