From ce708f69ed7878422a6a6371e44faed6857cb79a Mon Sep 17 00:00:00 2001 From: Caleb Date: Sun, 4 Sep 2022 20:22:35 -0400 Subject: Fix AO Host --- webAO/client.ts | 5 +---- webAO/client/aoHost.js | 5 ----- webAO/client/aoHost.ts | 7 +++++++ webAO/components/blip.js | 2 +- webAO/dom/resetOffset.ts | 9 +++++---- webAO/packets/handlers/handleASS.ts | 2 +- webAO/packets/handlers/handleBN.ts | 4 +++- webAO/packets/handlers/handleEI.ts | 3 ++- webAO/packets/handlers/handleLE.ts | 3 ++- webAO/packets/handlers/handleMC.ts | 3 ++- webAO/packets/handlers/handlePV.ts | 3 ++- webAO/packets/handlers/handleZZ.ts | 3 ++- webAO/viewport.ts | 2 +- 13 files changed, 29 insertions(+), 22 deletions(-) delete mode 100644 webAO/client/aoHost.js create mode 100644 webAO/client/aoHost.ts (limited to 'webAO') diff --git a/webAO/client.ts b/webAO/client.ts index 33f1802..5d5eb2c 100644 --- a/webAO/client.ts +++ b/webAO/client.ts @@ -37,10 +37,7 @@ let { ip: serverIP, mode, asset, theme } = queryParser(); const DEFAULT_HOST = "http://attorneyoffline.de/base/"; import { showname_click } from './dom/showNameClick' import { updateActionCommands } from './dom/updateActionCommands' -export let AO_HOST = asset || DEFAULT_HOST; -export const setAOhost = (val: string) => { - AO_HOST = val -} +import { AO_HOST } from './client/aoHost' let THEME: string = theme || "default"; let CHATBOX: string; diff --git a/webAO/client/aoHost.js b/webAO/client/aoHost.js deleted file mode 100644 index b387608..0000000 --- a/webAO/client/aoHost.js +++ /dev/null @@ -1,5 +0,0 @@ -import queryParser from '../utils/queryParser' -let { asset } = queryParser(); -const DEFAULT_HOST = 'http://attorneyoffline.de/base/'; -const AO_HOST = asset || DEFAULT_HOST -export default AO_HOST diff --git a/webAO/client/aoHost.ts b/webAO/client/aoHost.ts new file mode 100644 index 0000000..9b0a768 --- /dev/null +++ b/webAO/client/aoHost.ts @@ -0,0 +1,7 @@ +import queryParser from '../utils/queryParser' +let { asset } = queryParser(); +const DEFAULT_HOST = 'http://attorneyoffline.de/base/'; +export let AO_HOST = asset || DEFAULT_HOST +export const setAOhost = (val: string) => { + AO_HOST = val +} diff --git a/webAO/components/blip.js b/webAO/components/blip.js index eacbeaf..db6a784 100644 --- a/webAO/components/blip.js +++ b/webAO/components/blip.js @@ -1,4 +1,4 @@ -import AO_HOST from '../client/aoHost' +import { AO_HOST } from '../client/aoHost' /** * diff --git a/webAO/dom/resetOffset.ts b/webAO/dom/resetOffset.ts index 2cf8197..86dfd5b 100644 --- a/webAO/dom/resetOffset.ts +++ b/webAO/dom/resetOffset.ts @@ -1,5 +1,6 @@ + export function resetOffset(_event: Event) { - (document.getElementById("pair_offset")).value = "0"; - (document.getElementById("pair_y_offset")).value = "0"; - } - window.resetOffset = resetOffset; \ No newline at end of file + (document.getElementById("pair_offset")).value = "0"; + (document.getElementById("pair_y_offset")).value = "0"; +} +window.resetOffset = resetOffset; \ No newline at end of file diff --git a/webAO/packets/handlers/handleASS.ts b/webAO/packets/handlers/handleASS.ts index d0dfbd5..ea8a0d3 100644 --- a/webAO/packets/handlers/handleASS.ts +++ b/webAO/packets/handlers/handleASS.ts @@ -1,4 +1,4 @@ -import { setAOhost } from "../../client"; +import { setAOhost } from "../../client/aoHost"; /** diff --git a/webAO/packets/handlers/handleBN.ts b/webAO/packets/handlers/handleBN.ts index f7b8447..067130d 100644 --- a/webAO/packets/handlers/handleBN.ts +++ b/webAO/packets/handlers/handleBN.ts @@ -1,7 +1,9 @@ -import { AO_HOST, client, getIndexFromSelect, updateBackgroundPreview } from "../../client"; +import { client, getIndexFromSelect, updateBackgroundPreview } from "../../client"; +import { AO_HOST } from "../../client/aoHost"; import { safeTags } from "../../encoding"; import tryUrls from "../../utils/tryUrls"; + /** * Handles a background change. * @param {Array} args packet arguments diff --git a/webAO/packets/handlers/handleEI.ts b/webAO/packets/handlers/handleEI.ts index e96f0c9..c74e4d4 100644 --- a/webAO/packets/handlers/handleEI.ts +++ b/webAO/packets/handlers/handleEI.ts @@ -1,4 +1,5 @@ -import { AO_HOST, client } from '../../client' +import { client } from '../../client' +import { AO_HOST } from '../../client/aoHost'; import { prepChat, safeTags } from '../../encoding'; /** diff --git a/webAO/packets/handlers/handleLE.ts b/webAO/packets/handlers/handleLE.ts index 28f0b40..1eaeb27 100644 --- a/webAO/packets/handlers/handleLE.ts +++ b/webAO/packets/handlers/handleLE.ts @@ -1,4 +1,5 @@ -import { AO_HOST, client } from '../../client' +import { client } from '../../client' +import { AO_HOST } from '../../client/aoHost'; import { prepChat, safeTags } from '../../encoding'; /** diff --git a/webAO/packets/handlers/handleMC.ts b/webAO/packets/handlers/handleMC.ts index 28254ba..bf60eb9 100644 --- a/webAO/packets/handlers/handleMC.ts +++ b/webAO/packets/handlers/handleMC.ts @@ -1,5 +1,6 @@ import { prepChat } from "../../encoding"; -import { AO_HOST, appendICLog, client } from '../../client' +import { appendICLog, client } from '../../client' +import { AO_HOST } from "../../client/aoHost"; /** * Handles a music change to an arbitrary resource. diff --git a/webAO/packets/handlers/handlePV.ts b/webAO/packets/handlers/handlePV.ts index 5bdb702..fba2a3c 100644 --- a/webAO/packets/handlers/handlePV.ts +++ b/webAO/packets/handlers/handlePV.ts @@ -1,6 +1,7 @@ -import { AO_HOST, client, pickEmotion } from "../../client"; +import { client, pickEmotion } from "../../client"; import fileExists from "../../utils/fileExists"; import { updateActionCommands } from '../../dom/updateActionCommands' +import { AO_HOST } from "../../client/aoHost"; /** * Handles the server's assignment of a character for the player to use. diff --git a/webAO/packets/handlers/handleZZ.ts b/webAO/packets/handlers/handleZZ.ts index 1a56e49..1c1cb1d 100644 --- a/webAO/packets/handlers/handleZZ.ts +++ b/webAO/packets/handlers/handleZZ.ts @@ -1,4 +1,5 @@ -import { AO_HOST, client } from "../../client"; +import { client } from "../../client"; +import { AO_HOST } from "../../client/aoHost"; import { prepChat } from "../../encoding"; diff --git a/webAO/viewport.ts b/webAO/viewport.ts index e6b8d00..f647d86 100644 --- a/webAO/viewport.ts +++ b/webAO/viewport.ts @@ -12,7 +12,7 @@ import setEmote from "./client/setEmote"; import getAnimLength from "./utils/getAnimLength"; import { safeTags } from "./encoding"; import setCookie from "./utils/setCookie"; -import { AO_HOST } from "./client"; +import { AO_HOST } from "./client/aoHost"; interface ChatMsg { content: string; objection: number; -- cgit