mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-23 07:53:20 +08:00
Merge remote-tracking branch 'origin/unstable' into unstable
This commit is contained in:
commit
f277f59725
@ -66,8 +66,7 @@ export function setTargetPlayer(player: number, token: string | null = null): vo
|
|||||||
*/
|
*/
|
||||||
export async function setServerDetails(newAddress: string | null, newPort: string | number | null): Promise<void> {
|
export async function setServerDetails(newAddress: string | null, newPort: string | number | null): Promise<void> {
|
||||||
if (!getWindowDetails().disable) {
|
if (!getWindowDetails().disable) {
|
||||||
if (typeof newPort == "number")
|
if (typeof newPort == "number") newPort = newPort.toString();
|
||||||
newPort = newPort.toString();
|
|
||||||
|
|
||||||
// Apply the new details.
|
// Apply the new details.
|
||||||
if (newAddress != null) {
|
if (newAddress != null) {
|
||||||
|
@ -174,11 +174,8 @@ export function getWindowDetails(): WindowDetails {
|
|||||||
const { address, port, disable } = details;
|
const { address, port, disable } = details;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
address: (address as string).includes("DETAILS_ADDRESS")
|
address: (address as string).includes("DETAILS_ADDRESS") ? "127.0.0.1" : address,
|
||||||
? "127.0.0.1" : address,
|
port: (port as string).includes("DETAILS_PORT") ? 443 : parseInt(port),
|
||||||
port: (port as string).includes("DETAILS_PORT")
|
disable: (disable as string).includes("DETAILS_DISABLE") ? false : disable == "true"
|
||||||
? 443 : parseInt(port),
|
|
||||||
disable: (disable as string).includes("DETAILS_DISABLE")
|
|
||||||
? false : disable == "true"
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package emu.grasscutter.server.http.documentation;
|
package emu.grasscutter.server.http.documentation;
|
||||||
|
|
||||||
|
import static emu.grasscutter.config.Configuration.HANDBOOK;
|
||||||
|
|
||||||
import emu.grasscutter.Grasscutter;
|
import emu.grasscutter.Grasscutter;
|
||||||
import emu.grasscutter.auth.AuthenticationSystem.AuthenticationRequest;
|
import emu.grasscutter.auth.AuthenticationSystem.AuthenticationRequest;
|
||||||
import emu.grasscutter.server.http.Router;
|
import emu.grasscutter.server.http.Router;
|
||||||
@ -11,8 +13,6 @@ import io.javalin.Javalin;
|
|||||||
import io.javalin.http.ContentType;
|
import io.javalin.http.ContentType;
|
||||||
import io.javalin.http.Context;
|
import io.javalin.http.Context;
|
||||||
|
|
||||||
import static emu.grasscutter.config.Configuration.HANDBOOK;
|
|
||||||
|
|
||||||
/** Handles requests for the new GM Handbook. */
|
/** Handles requests for the new GM Handbook. */
|
||||||
public final class HandbookHandler implements Router {
|
public final class HandbookHandler implements Router {
|
||||||
private String handbook;
|
private String handbook;
|
||||||
|
Loading…
Reference in New Issue
Block a user