Change to update world by scene and room id
This commit is contained in:
parent
58b65030bd
commit
8a91190d8c
2 changed files with 55 additions and 25 deletions
|
@ -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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue