refactor: d/c handled automatically now :)

This commit is contained in:
cha0s 2019-03-20 22:53:02 -05:00
parent fc32a614a1
commit d89c5f45d0

View File

@ -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.