From 147fc3680f9ecd7f0d3fac6bb2d05ccf77b7cf88 Mon Sep 17 00:00:00 2001 From: Kyle Andrews Date: Sat, 1 Jun 2019 14:06:41 -0400 Subject: [PATCH] Updates server IP address --- docs/SocketManager.ts | 2 +- docs/assets/scripts/globals.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/SocketManager.ts b/docs/SocketManager.ts index 9f7b31b..47227e4 100644 --- a/docs/SocketManager.ts +++ b/docs/SocketManager.ts @@ -6,7 +6,7 @@ import * as io from 'socket.io-client'; export class SocketManager extends Module{ public static index:string = 'SocketManager'; - private static readonly SERVER:string = '165.22.7.23'; + private static readonly SERVER:string = '134.209.117.116'; private static readonly PORT:string = '6502'; /** Socket */ diff --git a/docs/assets/scripts/globals.js b/docs/assets/scripts/globals.js index ce4478c..87e54e5 100644 --- a/docs/assets/scripts/globals.js +++ b/docs/assets/scripts/globals.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{1:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Env_1=__webpack_require__(2),uuid=__webpack_require__(30),device_manager_1=__webpack_require__(33),Application=function(){function Application(){new device_manager_1.default(Env_1.Env.isDebug,!0),document.documentElement.classList.remove("dom-is-loading")}return Application.mountModules=function(){Array.from(document.body.querySelectorAll("[data-module]:not([data-uuid])")).forEach(function(requestedModule){var moduleIndex=requestedModule.dataset.module;Application.createModule(moduleIndex,requestedModule)}),Application.manageLazyParents()},Application.manageLazyParents=function(){Application.modules.forEach(function(module){module.futureParent&&(module.parent=Application.getModuleByUUID(module.futureParent.getAttribute("data-uuid")),module.parent&&(module.futureParent=null,module.parent.register(module)))})},Application.createModule=function(index,view){var newModule=null;try{var id=uuid();(newModule=new modules[index].prototype.constructor(view,id)).mount()}catch(e){void 0!==modules[index]&&console.error("Failed to create module",e)}return newModule&&(Application.modules.push(newModule),newModule.afterMount()),newModule},Application.destroyModule=function(uuid){var _this=this;uuid?this.modules.forEach(function(module){if(module.uuid===uuid){var index=_this.modules.indexOf(module);module.beforeDestroy(),module.destroy(),_this.modules.splice(index,1)}}):console.warn("No UUID provided")},Application.getModuleByUUID=function(uuid){if(!uuid)return console.warn("No UUID provided"),null;var returnModule=null;return this.modules.forEach(function(module){module.uuid===uuid&&(returnModule=module)}),returnModule},Application.modules=[],Application}();exports.Application=Application,new Application,Application.mountModules()},2:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Env=function(){function Env(){window.location.hostname.match(/.local/)?Env.setDebug(!0):null!==document.documentElement.getAttribute("debug")&&Env.setDebug(!0)}return Env.setDebug=function(status){Env.isDebug=status},Env.startLoading=function(){document.documentElement.classList.add("dom-is-loading")},Env.stopLoading=function(){document.documentElement.classList.remove("dom-is-loading")},Env.isDebug=!0,Env}();exports.Env=Env,new Env},34:function(module,exports,__webpack_require__){"use strict";var extendStatics,__extends=this&&this.__extends||(extendStatics=function(d,b){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])})(d,b)},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)});Object.defineProperty(exports,"__esModule",{value:!0});var Module_1=__webpack_require__(7),Application_1=__webpack_require__(1),Env_1=__webpack_require__(2),io=__webpack_require__(35),SocketManager=function(_super){function SocketManager(view,uuid){var _this=_super.call(this,view,uuid)||this;return Env_1.Env.isDebug&&console.log("%c[Module Manager] %ccreated new %c"+SocketManager.index+" %cmodule with an ID of %c"+uuid,"color:#4882fd","color:#eee","color:#48eefd","color:#eee","color:#48eefd"),_this}return __extends(SocketManager,_super),SocketManager.recieve=function(eventName,callback){return this._socket.connected?(this._socket.on(eventName,function(data){callback(data)}),!0):(Env_1.Env.isDebug&&console.warn("Event failed to be emitted, the socket is not currently connect to the server."),!1)},SocketManager.emit=function(eventName,eventObject){return this._socket.connected?(this._socket.emit(eventName,eventObject),!0):(Env_1.Env.isDebug&&console.warn("Event failed to be emitted, the socket is not currently connect to the server."),!1)},SocketManager.connectionFailed=function(){Env_1.Env.isDebug&&console.log("Server connection could not be establised with the server at "+SocketManager.SERVER+":"+SocketManager.PORT),this._socketErrorMessage.classList.add("is-visible")},SocketManager.handleConnection=function(){Env_1.Env.isDebug&&console.log("Server connection establised with "+SocketManager.SERVER+":"+SocketManager.PORT)},SocketManager.connect=function(){var _this=this;return new Promise(function(resolve,reject){_this._socket=io.connect(SocketManager.SERVER+":"+SocketManager.PORT),_this._socket.once("connect",function(socket){resolve(socket)}),_this._socket.once("connect_error",function(){reject(new Error("connect_error"))}),_this._socket.once("connect_timeout",function(){reject(new Error("connect_timeout"))})})},SocketManager.prototype.afterMount=function(){SocketManager.connect().then(function(){SocketManager.handleConnection()}).catch(function(){SocketManager.connectionFailed()})},SocketManager.prototype.beforeDestroy=function(){},SocketManager.index="SocketManager",SocketManager.SERVER="165.22.7.23",SocketManager.PORT="6502",SocketManager._socketErrorMessage=document.body.querySelector(".js-socket-error-message"),SocketManager}(Module_1.Module);exports.SocketManager=SocketManager,modules[SocketManager.index]=SocketManager,Env_1.Env.isDebug&&console.log("%c[Module Manager] %cmodule %c"+SocketManager.index+" %chas finished loading","color:#4882fd","color:#eee","color:#48eefd","color:#eee"),Application_1.Application.mountModules()},59:function(module,exports){},7:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Application_1=__webpack_require__(1),Module=function(){function Module(view,uuid){this.view=view,this.uuid=uuid,this.parent=null,this.submodules=[],this.futureParent=null}return Module.prototype.register=function(submodule){this.submodules.push(submodule)},Module.prototype.mount=function(){this.view.dataset.uuid=this.uuid;var parent=this.view.closest('[data-module]:not([data-uuid="'+this.uuid+'"])');parent&&(this.parent=Application_1.Application.getModuleByUUID(parent.getAttribute("data-uuid")),this.parent?this.parent.register(this):this.futureParent=parent)},Module.prototype.afterMount=function(){},Module.prototype.seppuku=function(){Application_1.Application.destroyModule(this.uuid)},Module.prototype.beforeDestroy=function(){},Module.prototype.destroy=function(){if(this.submodules.length)for(var i=this.submodules.length-1;i>=0;i--)Application_1.Application.destroyModule(this.submodules[i].uuid);this.view.remove()},Module}();exports.Module=Module}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{1:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Env_1=__webpack_require__(2),uuid=__webpack_require__(30),device_manager_1=__webpack_require__(33),Application=function(){function Application(){new device_manager_1.default(Env_1.Env.isDebug,!0),document.documentElement.classList.remove("dom-is-loading")}return Application.mountModules=function(){Array.from(document.body.querySelectorAll("[data-module]:not([data-uuid])")).forEach(function(requestedModule){var moduleIndex=requestedModule.dataset.module;Application.createModule(moduleIndex,requestedModule)}),Application.manageLazyParents()},Application.manageLazyParents=function(){Application.modules.forEach(function(module){module.futureParent&&(module.parent=Application.getModuleByUUID(module.futureParent.getAttribute("data-uuid")),module.parent&&(module.futureParent=null,module.parent.register(module)))})},Application.createModule=function(index,view){var newModule=null;try{var id=uuid();(newModule=new modules[index].prototype.constructor(view,id)).mount()}catch(e){void 0!==modules[index]&&console.error("Failed to create module",e)}return newModule&&(Application.modules.push(newModule),newModule.afterMount()),newModule},Application.destroyModule=function(uuid){var _this=this;uuid?this.modules.forEach(function(module){if(module.uuid===uuid){var index=_this.modules.indexOf(module);module.beforeDestroy(),module.destroy(),_this.modules.splice(index,1)}}):console.warn("No UUID provided")},Application.getModuleByUUID=function(uuid){if(!uuid)return console.warn("No UUID provided"),null;var returnModule=null;return this.modules.forEach(function(module){module.uuid===uuid&&(returnModule=module)}),returnModule},Application.modules=[],Application}();exports.Application=Application,new Application,Application.mountModules()},2:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Env=function(){function Env(){window.location.hostname.match(/.local/)?Env.setDebug(!0):null!==document.documentElement.getAttribute("debug")&&Env.setDebug(!0)}return Env.setDebug=function(status){Env.isDebug=status},Env.startLoading=function(){document.documentElement.classList.add("dom-is-loading")},Env.stopLoading=function(){document.documentElement.classList.remove("dom-is-loading")},Env.isDebug=!0,Env}();exports.Env=Env,new Env},34:function(module,exports,__webpack_require__){"use strict";var extendStatics,__extends=this&&this.__extends||(extendStatics=function(d,b){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])})(d,b)},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)});Object.defineProperty(exports,"__esModule",{value:!0});var Module_1=__webpack_require__(7),Application_1=__webpack_require__(1),Env_1=__webpack_require__(2),io=__webpack_require__(35),SocketManager=function(_super){function SocketManager(view,uuid){var _this=_super.call(this,view,uuid)||this;return Env_1.Env.isDebug&&console.log("%c[Module Manager] %ccreated new %c"+SocketManager.index+" %cmodule with an ID of %c"+uuid,"color:#4882fd","color:#eee","color:#48eefd","color:#eee","color:#48eefd"),_this}return __extends(SocketManager,_super),SocketManager.recieve=function(eventName,callback){return this._socket.connected?(this._socket.on(eventName,function(data){callback(data)}),!0):(Env_1.Env.isDebug&&console.warn("Event failed to be emitted, the socket is not currently connect to the server."),!1)},SocketManager.emit=function(eventName,eventObject){return this._socket.connected?(this._socket.emit(eventName,eventObject),!0):(Env_1.Env.isDebug&&console.warn("Event failed to be emitted, the socket is not currently connect to the server."),!1)},SocketManager.connectionFailed=function(){Env_1.Env.isDebug&&console.log("Server connection could not be establised with the server at "+SocketManager.SERVER+":"+SocketManager.PORT),this._socketErrorMessage.classList.add("is-visible")},SocketManager.handleConnection=function(){Env_1.Env.isDebug&&console.log("Server connection establised with "+SocketManager.SERVER+":"+SocketManager.PORT)},SocketManager.connect=function(){var _this=this;return new Promise(function(resolve,reject){_this._socket=io.connect(SocketManager.SERVER+":"+SocketManager.PORT),_this._socket.once("connect",function(socket){resolve(socket)}),_this._socket.once("connect_error",function(){reject(new Error("connect_error"))}),_this._socket.once("connect_timeout",function(){reject(new Error("connect_timeout"))})})},SocketManager.prototype.afterMount=function(){SocketManager.connect().then(function(){SocketManager.handleConnection()}).catch(function(){SocketManager.connectionFailed()})},SocketManager.prototype.beforeDestroy=function(){},SocketManager.index="SocketManager",SocketManager.SERVER="134.209.117.116",SocketManager.PORT="6502",SocketManager._socketErrorMessage=document.body.querySelector(".js-socket-error-message"),SocketManager}(Module_1.Module);exports.SocketManager=SocketManager,modules[SocketManager.index]=SocketManager,Env_1.Env.isDebug&&console.log("%c[Module Manager] %cmodule %c"+SocketManager.index+" %chas finished loading","color:#4882fd","color:#eee","color:#48eefd","color:#eee"),Application_1.Application.mountModules()},59:function(module,exports){},7:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Application_1=__webpack_require__(1),Module=function(){function Module(view,uuid){this.view=view,this.uuid=uuid,this.parent=null,this.submodules=[],this.futureParent=null}return Module.prototype.register=function(submodule){this.submodules.push(submodule)},Module.prototype.mount=function(){this.view.dataset.uuid=this.uuid;var parent=this.view.closest('[data-module]:not([data-uuid="'+this.uuid+'"])');parent&&(this.parent=Application_1.Application.getModuleByUUID(parent.getAttribute("data-uuid")),this.parent?this.parent.register(this):this.futureParent=parent)},Module.prototype.afterMount=function(){},Module.prototype.seppuku=function(){Application_1.Application.destroyModule(this.uuid)},Module.prototype.beforeDestroy=function(){},Module.prototype.destroy=function(){if(this.submodules.length)for(var i=this.submodules.length-1;i>=0;i--)Application_1.Application.destroyModule(this.submodules[i].uuid);this.view.remove()},Module}();exports.Module=Module}}]); \ No newline at end of file