textures on auth

This commit is contained in:
_Bastler
2022-03-13 09:27:35 +01:00
parent 0e1ba49a3e
commit 366231df98
+15 -1
View File
@@ -331,7 +331,7 @@ class ConnectionManager {
throw new Error("No Auth code provided"); 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 }, params: { code, nonce, token, playUri: this.currentRoom?.key },
}).then((res) => { }).then((res) => {
return res.data; return res.data;
@@ -345,6 +345,20 @@ class ConnectionManager {
gameManager.setPlayerName(username); 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) { if (locale) {
try { try {
if (locales.indexOf(locale) == -1) { if (locales.indexOf(locale) == -1) {