Working on integration of the woka-list with the new admin endpoint.

This commit is contained in:
David Négrier
2022-02-24 21:09:19 +01:00
parent 0543232bc3
commit da469b64d2
14 changed files with 79 additions and 68 deletions
+15 -2
View File
@@ -43,9 +43,22 @@ export class SelectCharacterScene extends AbstractCharacterScene {
}
preload() {
const wokaMetadataKey = "woka-list";
const wokaMetadataKey = "woka/list";
this.cache.json.remove(wokaMetadataKey);
this.load.json(wokaMetadataKey, `${PUSHER_URL}/${wokaMetadataKey}`);
// FIXME: window.location.href is wrong. We need the URL of the main room (so we need to apply any redirect before!)
this.load.json(
wokaMetadataKey,
`${PUSHER_URL}/${wokaMetadataKey}/` + encodeURIComponent(window.location.href),
undefined,
{
responseType: "text",
headers: {
Authorization: localUserStore.getAuthToken() ?? "",
},
withCredentials: true,
}
);
this.load.once(`filecomplete-json-${wokaMetadataKey}`, () => {
this.playerTextures.loadPlayerTexturesMetadata(this.cache.json.get(wokaMetadataKey));
this.loadSelectSceneCharacters()