Merge remote-tracking branch 'origin/unstable' into unstable

# Conflicts:
#	src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java
This commit is contained in:
KingRainbow44 2023-05-31 00:51:39 -04:00
commit 959f0ad261
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
3 changed files with 9 additions and 12 deletions

View File

@ -136,9 +136,9 @@ export type CommandResponse = {
};
export type WindowDetails = {
address: string,
port: number,
disable: boolean
address: string;
port: number;
disable: boolean;
};
/**

View File

@ -174,11 +174,8 @@ export function getWindowDetails(): WindowDetails {
const { address, port, disable } = details;
return {
address: address == "{{DETAILS_ADDRESS}}" ?
"127.0.0.1" : address,
port: port == "{{DETAILS_PORT}}" ?
443 : parseInt(port),
disable: disable == "{{DETAILS_DISABLE}}" ?
false : disable == "true"
address: address == "{{DETAILS_ADDRESS}}" ? "127.0.0.1" : address,
port: port == "{{DETAILS_PORT}}" ? 443 : parseInt(port),
disable: disable == "{{DETAILS_DISABLE}}" ? false : disable == "true"
};
}

View File

@ -1,5 +1,7 @@
package emu.grasscutter.server.http.documentation;
import static emu.grasscutter.config.Configuration.HANDBOOK;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.auth.AuthenticationSystem.AuthenticationRequest;
import emu.grasscutter.server.http.Router;
@ -11,8 +13,6 @@ import io.javalin.Javalin;
import io.javalin.http.ContentType;
import io.javalin.http.Context;
import static emu.grasscutter.config.Configuration.HANDBOOK;
/** Handles requests for the new GM Handbook. */
public final class HandbookHandler implements Router {
private String handbook;
@ -32,7 +32,7 @@ public final class HandbookHandler implements Router {
this.handbook
.replace("{{DETAILS_ADDRESS}}", server.address)
.replace("{{DETAILS_PORT}}", String.valueOf(server.port))
.replace("{{DETAILS_DISABLE}}", Boolean.toString(!server.canChange));
.replace("{{DETAILS_DISABLE}}", Boolean.toString(server.canChange));
}
}