From f38a26a1ffd0e95aeffa229ae4fc9a08be98cfbe Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 5 Sep 2018 09:04:17 -0700 Subject: [PATCH] updating location of oops dialog script --- interface/resources/serverless/redirect.json | 4 +- scripts/system/oopsEntityScript.js | 41 -------------------- 2 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 scripts/system/oopsEntityScript.js diff --git a/interface/resources/serverless/redirect.json b/interface/resources/serverless/redirect.json index 17799b952d..1bb2aa80c7 100644 --- a/interface/resources/serverless/redirect.json +++ b/interface/resources/serverless/redirect.json @@ -625,7 +625,7 @@ "lastEdited": 1536108160862286, "lastEditedBy": "{4656d4a8-5e61-4230-ab34-2888d7945bd6}", "locked": true, - "modelURL": "https://raw.githubusercontent.com/wayne-chen/hifi/404DomainRedirect/interface/resources/meshes/redirect/oopsDialog_protocol.fbx", + "modelURL": "", "name": "Oops Dialog", "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", "position": { @@ -648,7 +648,7 @@ "y": 0.4957197904586792, "z": -7.62939453125e-05 }, - "script": "https://raw.githubusercontent.com/wayne-chen/hifi/404DomainRedirect/scripts/system/oopsEntityScript.js", + "script": "https://hifi-content.s3.amazonaws.com/wayne/404redirectionScripts/oopsEntityScript.js", "scriptTimestamp": 1536102551825, "type": "Model", "userData": "{\"grabbableKey\":{\"grabbable\":false}}" diff --git a/scripts/system/oopsEntityScript.js b/scripts/system/oopsEntityScript.js deleted file mode 100644 index bf10fbb9dd..0000000000 --- a/scripts/system/oopsEntityScript.js +++ /dev/null @@ -1,41 +0,0 @@ -(function() { - var PROTOCOL_MISMATCH = 1; - var NOT_AUTHORIZED = 3; - - this.entityID = Uuid.NULL; - this.preload = function(entityID) { - this.entityID = entityID; - }; - function pingError() { - if(this.entityID === undefined) { - var entities = Entities.findEntitiesByName("Oops Dialog", MyAvatar.position, 10); - if(entities.length > 0) { - this.entityID = entities[0]; - } - } - var error = location.lastDomainConnectionError; - var newModel = ""; - var hostedSite = Script.resourcesPath() + "meshes/redirect"; - if (error === PROTOCOL_MISMATCH) { - newModel = "oopsDialog_protocol"; - } else if (error === NOT_AUTHORIZED) { - newModel = "oopsDialog_auth"; - } else { - newModel = "oopsDialog_vague"; - } - var props = Entities.getEntityProperties(this.entityID, ["modelURL"]); - var newModelURL = hostedSite + newModel + ".fbx"; - if(props.modelURL !== newModelURL) { - var newFileURL = newModelURL + "/" + newModel + ".png"; - var newTextures = {"file16": newFileURL, "file17": newFileURL}; - Entities.editEntity(this.entityID, {modelURL: newModelURL, originalTextures: JSON.stringify(newTextures)}); - } - }; - var ping = Script.setInterval(pingError, 5000); - - function cleanup() { - Script.clearInterval(ping); - }; - - Script.scriptEnding.connect(cleanup); -});