forked from noxious/server
small clean
This commit is contained in:
@ -27,16 +27,15 @@ export default function characterZoneLoad(socket: Socket, io: Server) {
|
||||
|
||||
socket.join(zone.name);
|
||||
|
||||
const characters = await io.in(zone.name).fetchSockets();
|
||||
const socketConnectionsInRoom = await io.in(zone.name).fetchSockets();
|
||||
const characters = socketConnectionsInRoom.filter(socket => socket.id !== socket.id);
|
||||
|
||||
// update to match with model Character
|
||||
|
||||
// send over zone and characters
|
||||
io.in(zone.name).to(socket.id).emit('character:zone:load', {
|
||||
zone: zone,
|
||||
characters: characters.map(socket => ({
|
||||
id: socket.id
|
||||
})),
|
||||
characters: characters,
|
||||
});
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user