refactor: sync schema

This commit is contained in:
cha0s 2019-09-22 18:59:51 -05:00
parent 21ae93f1cc
commit fe69ceb14b
4 changed files with 10 additions and 12 deletions

View File

@ -10,14 +10,9 @@ export class SynchronizedCreatePacket extends SynchronizedPacket {
return super.pack(packet);
}
static get schema() {
const superSchema = super.schema;
static get synchronizationSchema() {
return {
...superSchema,
data: {
...superSchema.data,
spec: 'buffer',
},
};
}

View File

@ -1,4 +1,3 @@
import {SynchronizedPacket} from './synchronized.packet';
export class SynchronizedDestroyPacket extends SynchronizedPacket {
}
export class SynchronizedDestroyPacket extends SynchronizedPacket {}

View File

@ -1,4 +1,3 @@
import {SynchronizedPacket} from './synchronized.packet';
export class SynchronizedUpdatePacket extends SynchronizedPacket {
}
export class SynchronizedUpdatePacket extends SynchronizedPacket {}

View File

@ -8,10 +8,15 @@ export class SynchronizedPacket extends Packet {
data: {
synchronized: {
type: 'uint8',
id: 'uint32',
id: 'varuint',
},
...this.synchronizationSchema,
},
};
}
static get synchronizationSchema() {
return {};
}
}