mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-22 20:04:56 +01:00
Run IntelliJ IDEA code formatter
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
package emu.grasscutter.server.http.objects;
|
||||
|
||||
public class ComboTokenReqJson {
|
||||
public int app_id;
|
||||
public int channel_id;
|
||||
public String data;
|
||||
public String device;
|
||||
public String sign;
|
||||
|
||||
public static class LoginTokenData {
|
||||
public String uid;
|
||||
public String token;
|
||||
public boolean guest;
|
||||
}
|
||||
public int app_id;
|
||||
public int channel_id;
|
||||
public String data;
|
||||
public String device;
|
||||
public String sign;
|
||||
|
||||
public static class LoginTokenData {
|
||||
public String uid;
|
||||
public String token;
|
||||
public boolean guest;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package emu.grasscutter.server.http.objects;
|
||||
|
||||
public class ComboTokenResJson {
|
||||
public String message;
|
||||
public int retcode;
|
||||
public LoginData data = new LoginData();
|
||||
|
||||
public static class LoginData {
|
||||
public int account_type = 1;
|
||||
public boolean heartbeat;
|
||||
public String combo_id;
|
||||
public String combo_token;
|
||||
public String open_id;
|
||||
public String data = "{\"guest\":false}";
|
||||
public String fatigue_remind = null; // ?
|
||||
}
|
||||
public String message;
|
||||
public int retcode;
|
||||
public LoginData data = new LoginData();
|
||||
|
||||
public static class LoginData {
|
||||
public int account_type = 1;
|
||||
public boolean heartbeat;
|
||||
public String combo_id;
|
||||
public String combo_token;
|
||||
public String open_id;
|
||||
public String data = "{\"guest\":false}";
|
||||
public String fatigue_remind = null; // ?
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
package emu.grasscutter.server.http.objects;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.Grasscutter.ServerDebugMode;
|
||||
import io.javalin.http.Context;
|
||||
import io.javalin.http.Handler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.DISPATCH_INFO;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
public final class HttpJsonResponse implements Handler {
|
||||
private final String response;
|
||||
private final String[] missingRoutes = { // TODO: When http requests for theses routes are found please remove it from this list and update the route request type in the DispatchServer
|
||||
"/common/hk4e_global/announcement/api/getAlertPic",
|
||||
"/common/hk4e_global/announcement/api/getAlertAnn",
|
||||
"/common/hk4e_global/announcement/api/getAnnList",
|
||||
"/common/hk4e_global/announcement/api/getAnnContent",
|
||||
"/hk4e_global/mdk/shopwindow/shopwindow/listPriceTier",
|
||||
"/log/sdk/upload",
|
||||
"/sdk/upload",
|
||||
"/perf/config/verify",
|
||||
"/log",
|
||||
"/crash/dataUpload"
|
||||
"/common/hk4e_global/announcement/api/getAlertPic",
|
||||
"/common/hk4e_global/announcement/api/getAlertAnn",
|
||||
"/common/hk4e_global/announcement/api/getAnnList",
|
||||
"/common/hk4e_global/announcement/api/getAnnContent",
|
||||
"/hk4e_global/mdk/shopwindow/shopwindow/listPriceTier",
|
||||
"/log/sdk/upload",
|
||||
"/sdk/upload",
|
||||
"/perf/config/verify",
|
||||
"/log",
|
||||
"/crash/dataUpload"
|
||||
};
|
||||
|
||||
public HttpJsonResponse(String response) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package emu.grasscutter.server.http.objects;
|
||||
|
||||
public class LoginAccountRequestJson {
|
||||
public String account;
|
||||
public String password;
|
||||
public boolean is_crypto;
|
||||
public String account;
|
||||
public String password;
|
||||
public boolean is_crypto;
|
||||
}
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
package emu.grasscutter.server.http.objects;
|
||||
|
||||
public class LoginResultJson {
|
||||
public String message;
|
||||
public int retcode;
|
||||
public VerifyData data = new VerifyData();
|
||||
|
||||
public static class VerifyData {
|
||||
public VerifyAccountData account = new VerifyAccountData();
|
||||
public boolean device_grant_required = false;
|
||||
public String realname_operation = "NONE";
|
||||
public boolean realperson_required = false;
|
||||
public boolean safe_mobile_required = false;
|
||||
}
|
||||
|
||||
public static class VerifyAccountData {
|
||||
public String uid;
|
||||
public String name = "";
|
||||
public String email = "";
|
||||
public String mobile = "";
|
||||
public String is_email_verify = "0";
|
||||
public String realname = "";
|
||||
public String identity_card = "";
|
||||
public String token;
|
||||
public String safe_mobile = "";
|
||||
public String facebook_name = "";
|
||||
public String twitter_name = "";
|
||||
public String game_center_name = "";
|
||||
public String google_name = "";
|
||||
public String apple_name = "";
|
||||
public String sony_name = "";
|
||||
public String tap_name = "";
|
||||
public String country = "US";
|
||||
public String reactivate_ticket = "";
|
||||
public String area_code = "**";
|
||||
public String device_grant_ticket = "";
|
||||
}
|
||||
public String message;
|
||||
public int retcode;
|
||||
public VerifyData data = new VerifyData();
|
||||
|
||||
public static class VerifyData {
|
||||
public VerifyAccountData account = new VerifyAccountData();
|
||||
public boolean device_grant_required = false;
|
||||
public String realname_operation = "NONE";
|
||||
public boolean realperson_required = false;
|
||||
public boolean safe_mobile_required = false;
|
||||
}
|
||||
|
||||
public static class VerifyAccountData {
|
||||
public String uid;
|
||||
public String name = "";
|
||||
public String email = "";
|
||||
public String mobile = "";
|
||||
public String is_email_verify = "0";
|
||||
public String realname = "";
|
||||
public String identity_card = "";
|
||||
public String token;
|
||||
public String safe_mobile = "";
|
||||
public String facebook_name = "";
|
||||
public String twitter_name = "";
|
||||
public String game_center_name = "";
|
||||
public String google_name = "";
|
||||
public String apple_name = "";
|
||||
public String sony_name = "";
|
||||
public String tap_name = "";
|
||||
public String country = "US";
|
||||
public String reactivate_ticket = "";
|
||||
public String area_code = "**";
|
||||
public String device_grant_ticket = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package emu.grasscutter.server.http.objects;
|
||||
|
||||
public class LoginTokenRequestJson {
|
||||
public String uid;
|
||||
public String token;
|
||||
public String uid;
|
||||
public String token;
|
||||
}
|
||||
|
||||
@@ -6,21 +6,13 @@ import io.javalin.http.ContentType;
|
||||
import io.javalin.http.Context;
|
||||
import io.javalin.http.Handler;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.DISPATCH_INFO;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.DISPATCH_INFO;
|
||||
|
||||
public class WebStaticVersionResponse implements Handler {
|
||||
|
||||
@Override
|
||||
public void handle(Context ctx) throws IOException {
|
||||
String requestFor = ctx.path().substring(ctx.path().lastIndexOf("-") + 1);
|
||||
|
||||
getPageResources("/webstatic/" + requestFor, ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
private static void getPageResources(String path, Context ctx) {
|
||||
try (InputStream filestream = FileUtils.readResourceAsStream(path)) {
|
||||
ContentType fromExtension = ContentType.getContentTypeByExtension(path.substring(path.lastIndexOf(".") + 1));
|
||||
@@ -33,4 +25,11 @@ public class WebStaticVersionResponse implements Handler {
|
||||
ctx.status(404);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(Context ctx) throws IOException {
|
||||
String requestFor = ctx.path().substring(ctx.path().lastIndexOf("-") + 1);
|
||||
|
||||
getPageResources("/webstatic/" + requestFor, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user