Change to update world by scene and room id

This commit is contained in:
gparant 2020-05-10 19:45:17 +02:00
parent 58b65030bd
commit 8a91190d8c
2 changed files with 55 additions and 25 deletions

View file

@ -7,11 +7,12 @@ import {World} from "_Model/World";
export class ExtRooms implements ExtRoomsInterface{
userPositionMapByRoom: any;
refreshUserPosition: any;
Worlds: any;
[room: string]: SocketIO.Room;
}
let RefreshUserPositionFunction = function(rooms : ExtRooms, Io: socketIO.Server, World : World) {
let RefreshUserPositionFunction = function(rooms : ExtRooms, Io: socketIO.Server) {
let clients = Io.clients();
let socketsKey = Object.keys(Io.clients().sockets);
@ -37,10 +38,6 @@ let RefreshUserPositionFunction = function(rooms : ExtRooms, Io: socketIO.Server
dataArray = [data];
}
mapPositionUserByRoom.set(data.roomId, dataArray);
// update position in the worl
let messageUserPosition = new MessageUserPosition(data);
World.updatePosition(messageUserPosition);
}
rooms.userPositionMapByRoom = Array.from(mapPositionUserByRoom);
}