refactor: d/c handled automatically now :)
This commit is contained in:
parent
fc32a614a1
commit
d89c5f45d0
|
@ -62,18 +62,7 @@ function createMessageListener(avocadoServer, socket) {
|
|||
function createDisconnectionListener(avocadoServer, socket) {
|
||||
const {entity} = socket;
|
||||
return () => {
|
||||
const nearbyEntities = entity.entitiesToInform();
|
||||
entityList.removeEntity(entity);
|
||||
nearbyEntities.forEach((nearbyEntity) => {
|
||||
if (!('inform' in nearbyEntity)) {
|
||||
return;
|
||||
}
|
||||
nearbyEntity.inform({
|
||||
entityList: {
|
||||
[entity.instanceUuid]: false,
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
// Create an entity for a new connection.
|
||||
|
|
Loading…
Reference in New Issue
Block a user