perf: numeric IDs
This commit is contained in:
parent
042034d5d8
commit
e06b3d5089
|
@ -10,7 +10,7 @@ export class DamagePacket extends EntityPacket {
|
|||
damageSpec: {
|
||||
affinity: 'uint8',
|
||||
},
|
||||
from: 'string',
|
||||
from: 'uint32',
|
||||
isDamage: 'bool',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -205,7 +205,7 @@ export class Vulnerable extends Trait {
|
|||
isDamage,
|
||||
amount,
|
||||
damageSpec,
|
||||
from: entity.instanceUuid,
|
||||
from: entity.numericUid,
|
||||
};
|
||||
this.entity.emit('tookDamage', damage);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ export class SelfEntityPacket extends Packet {
|
|||
static get schema() {
|
||||
return {
|
||||
...super.schema,
|
||||
data: 'string',
|
||||
data: 'uint32',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ export default class Game {
|
|||
this.room.addEntityToLayer(entity, 0);
|
||||
// Initial information.
|
||||
const packets = this.synchronizer.packetsForUpdate(true);
|
||||
packets.unshift(new SelfEntityPacket(entity.instanceUuid));
|
||||
packets.unshift(new SelfEntityPacket(entity.numericUid));
|
||||
entity.inform(packets);
|
||||
// Listen for events.
|
||||
socket.on('packet', this.createPacketListener(socket));
|
||||
|
|
Loading…
Reference in New Issue
Block a user