Removing dead code

This commit is contained in:
David Négrier 2021-07-15 17:11:48 +02:00
parent c9fa9b9a92
commit f217fc8aad
2 changed files with 0 additions and 96 deletions

View file

@ -83,44 +83,6 @@ export class Room {
return baseUrl;
}
/**
* @deprecated
*/
public static getIdFromIdentifier(
identifier: string,
baseUrl: string,
currentInstance: string
): { roomId: string; hash: string | null } {
let roomId = "";
let hash = null;
if (!identifier.startsWith("/_/") && !identifier.startsWith("/@/")) {
//relative file link
//Relative identifier can be deep enough to rewrite the base domain, so we cannot use the variable 'baseUrl' as the actual base url for the URL objects.
//We instead use 'workadventure' as a dummy base value.
const baseUrlObject = new URL(baseUrl);
const absoluteExitSceneUrl = new URL(
identifier,
"http://workadventure/_/" + currentInstance + "/" + baseUrlObject.hostname + baseUrlObject.pathname
);
roomId = absoluteExitSceneUrl.pathname; //in case of a relative url, we need to create a public roomId
roomId = roomId.substring(1); //remove the leading slash
hash = absoluteExitSceneUrl.hash;
hash = hash.substring(1); //remove the leading diese
if (!hash.length) {
hash = null;
}
} else {
//absolute room Id
const parts = identifier.split("#");
roomId = parts[0];
roomId = roomId.substring(1); //remove the leading slash
if (parts.length > 1) {
hash = parts[1];
}
}
return { roomId, hash };
}
private async getMapDetail(): Promise<MapDetail | RoomRedirect> {
const result = await Axios.get(`${PUSHER_URL}/map`, {
params: {