feat: client and server traits
This commit is contained in:
parent
ca26fb4828
commit
0f737601fb
|
@ -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) {
|
||||
|
|
|
@ -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(
|
||||
);
|
|
@ -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',
|
||||
|
|
|
@ -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'),
|
||||
],
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue
Block a user