From 366231df9809abdd55c37afa06901a24a76205df Mon Sep 17 00:00:00 2001 From: _Bastler <_Bastler@bstly.de> Date: Sun, 13 Mar 2022 09:27:35 +0100 Subject: [PATCH] textures on auth --- front/src/Connexion/ConnectionManager.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/front/src/Connexion/ConnectionManager.ts b/front/src/Connexion/ConnectionManager.ts index 5951c689..c0aed225 100644 --- a/front/src/Connexion/ConnectionManager.ts +++ b/front/src/Connexion/ConnectionManager.ts @@ -331,7 +331,7 @@ class ConnectionManager { throw new Error("No Auth code provided"); } } - const { authToken, userUuid, email, username, locale } = await Axios.get(`${PUSHER_URL}/login-callback`, { + const { authToken, userUuid, email, username, locale, textures } = await Axios.get(`${PUSHER_URL}/login-callback`, { params: { code, nonce, token, playUri: this.currentRoom?.key }, }).then((res) => { return res.data; @@ -345,6 +345,20 @@ class ConnectionManager { gameManager.setPlayerName(username); } + const layers: string[] = []; + if (textures) { + let i = 0; + for (const layerItem of textures) { + if (layerItem !== undefined) { + layers.push(layerItem.id); + } + i++; + } + if (layers.length > 0) { + gameManager.setCharacterLayers(layers); + } + } + if (locale) { try { if (locales.indexOf(locale) == -1) {