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