diff --git a/lab/Worker.js b/lab/Worker.js new file mode 100644 index 0000000..a09b454 --- /dev/null +++ b/lab/Worker.js @@ -0,0 +1,53 @@ +define([ + "Game/Client/Networker", + "Game/Core/Protocol/Helper", + "Game/Client/GameController", + "Game/Client/User", + "Game/Core/NotificationCenter" +], + +function (Parent, ProtocolHelper, GameController, User, NotificationCenter) { + + function Worker () { + //this.socketLink = socketLink; + this.gameController = null; + this.users = {}; + + this.init(); + } + + Worker.prototype = Object.create(Parent.prototype); + + Worker.prototype.init = function () { + + + ProtocolHelper.applyCommand({ + "joinSuccess":{ + "userId":"k31HvnDM7Jy6mfmKOe3y", + "channelName":"dungeon", + "joinedUsers":[], + "spawnedPlayers":[] + } + }, this); + + ProtocolHelper.applyCommand({ + "gameCommand":{ + "spawnPlayer":{ + "id":"k31HvnDM7Jy6mfmKOe3y", + "x":150, + "y":50 + } + } + }, this); + + NotificationCenter.on("sendGameCommand", this.sendGameCommand, this); + } + + Worker.prototype.sendCommand = function (command, options) { + var message = ProtocolHelper.encodeCommand(command, options); + //this.socketLink.send(message); + } + + return Worker; + +}); \ No newline at end of file diff --git a/lab/app b/lab/app new file mode 120000 index 0000000..5df94d9 --- /dev/null +++ b/lab/app @@ -0,0 +1 @@ +../app \ No newline at end of file diff --git a/lab/client.js b/lab/client.js new file mode 100755 index 0000000..8d7a42f --- /dev/null +++ b/lab/client.js @@ -0,0 +1,19 @@ +requirejs.config({ + baseUrl: 'app', + deps: ['Lib/Utilities/Extensions'] +}); + +var inspector = {}; + +requirejs([ + "Game/Config/Settings", + "Worker.js" +], + +function (Settings, Worker) { + + var worker = new Worker(); + + inspector.worker = worker; + inspector.settings = Settings; +}); \ No newline at end of file diff --git a/lab/index.html b/lab/index.html new file mode 100755 index 0000000..988275e --- /dev/null +++ b/lab/index.html @@ -0,0 +1,34 @@ + + +
+