refactor: initial inform

This commit is contained in:
cha0s 2019-10-01 22:43:20 -05:00
parent 995bbac48c
commit d6b3bf389c

View File

@ -58,6 +58,8 @@ export default class Game {
}
});
Promise.resolve(entity.hydrate()).then(() => {
// Flush AABB for visibility.
entity.tick(0);
// Sync world time.
entity.addSynchronized(this.worldTime);
// Add entity to room.
@ -65,6 +67,8 @@ export default class Game {
this.room.addEntityToLayer(entity, 0);
entity.addSynchronized(this.room);
}
entity.queuePacket(new SelfEntityPacket(entity.numericUid));
entity.inform();
});
// Listen for events.
socket.on('packet', this.createPacketListener(socket));