chore: blacklist client traits

This commit is contained in:
cha0s 2019-04-09 10:43:11 -04:00
parent bb171fef7e
commit 797e1d789e

View File

@ -52,12 +52,16 @@ const synchronizer = new Synchronizer({
});
const unpacker = new Unpacker();
room.on('entityAdded', (entity) => {
// Traits that shouldn't be on client.
const noClientTraits = [
'behaved',
];
// Traits that only make sense for our self entity on the client.
const selfEntityOnlyTraits = [
'controllable',
'followed',
];
for (const type of selfEntityOnlyTraits) {
for (const type of selfEntityOnlyTraits.concat(noClientTraits)) {
if (entity.is(type)) {
entity.removeTrait(type);
}