repo: janusweb
action: commit
revision: 
path_from: 
revision_from: b5378e3bed90f9c5586457140758428e667719d7:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit b5378e3bed90f9c5586457140758428e667719d7
Author: James Baicoianu 
Date:   Sun Oct 16 19:07:46 2016 -0700

    Parse remote player avatar definitions

diff --git a/scripts/remoteplayer.js b/scripts/remoteplayer.js
index ac8cbc5e64e0e29165c8b485123169153517a551..
index ..93e109dd3b3828fa2e67e135057b59a9ea7936cc 100644
--- a/scripts/remoteplayer.js
+++ b/scripts/remoteplayer.js
@@ -2,6 +2,7 @@ elation.require(['engine.things.generic', 'engine.things.maskgenerator', 'engine
 elation.component.add('engine.things.remoteplayer', function() {
   this.postinit = function() {
     this.defineProperties({
+      janus: { type: 'object' },
       startposition: {type: 'vector3', default: new THREE.Vector3()},
       pickable: {type: 'boolean', default: false},
       collidable: {type: 'boolean', default: false},
@@ -76,12 +77,10 @@ elation.component.add('engine.things.remoteplayer', function() {
     //console.log(avatar);
     if (!this.avatarcode || this.avatarcode != avatar) {
       this.avatarcode = avatar;
-      if (this.avatarroom) {
-        this.avatarroom.die();
-      }
+      var things = this.janus.parser.parse(avatar);
       //this.avatarroom = this.spawn('janusroom', null, { source: avatar });
       //console.log(this.avatarroom);
-console.log('avatar changed:', this, avatar);
+console.log('avatar changed:', this, things, avatar);
     }

   }

-----END OF PAGE-----