feat: client and server traits

This commit is contained in:
cha0s 2019-04-14 20:39:27 -05:00
parent ca26fb4828
commit 0f737601fb
5 changed files with 17 additions and 12 deletions

View File

@ -51,6 +51,7 @@ room.on('entityAdded', (entity) => {
// Traits that shouldn't be on client.
const noClientTraits = [
'behaved',
'informed',
];
// If there's no physics, then remove physical trait.
if (!room.world) {

View File

@ -7,8 +7,8 @@ import {Trait} from '@avocado/entity';
import {Rectangle, Vector} from '@avocado/math';
import {Packer, Synchronizer} from '@avocado/state';
import {KeysPacket} from '../packet/keys';
import {StatePacket} from '../packet/state';
import {KeysPacket} from '../../common/packet/keys';
import {StatePacket} from '../../common/packet/state';
const decorate = compose(
);

View File

@ -34,6 +34,9 @@ config.devServer = {
watchContentBase: true,
};
config.devtool = 'eval-source-map';
config.module.rules[1].use.options.paths.push(
path.resolve(__dirname, 'client'),
);
config.node = {
fs: 'empty',
path: 'empty',

View File

@ -18,16 +18,14 @@ const config = {
},
{
test: /register-traits.js/,
use: [
{
loader: './generate-trait-defs',
options: {
paths: [
path.resolve(__dirname, 'common'),
],
}
},
],
use: {
loader: './generate-trait-defs',
options: {
paths: [
path.resolve(__dirname, 'common'),
],
}
},
},
],
},

View File

@ -19,6 +19,9 @@ config.externals = [
whitelist: /@avocado/,
}),
];
config.module.rules[1].use.options.paths.push(
path.resolve(__dirname, 'server'),
);
const nodeArgs = [];
if (process.argv.find((arg) => '--prof' === arg)) {
nodeArgs.push('--prof');