Merge branch 'master' of https://github.com/thecodingmachine/workadventure into feature/back-players-proximity

This commit is contained in:
David MAECHLER 2020-04-06 23:02:01 +02:00
commit af5d2a5a97
9 changed files with 176 additions and 10 deletions

View file

@ -16,14 +16,14 @@ let RefreshUserPositionFunction = function(rooms : ExtRooms, Io: socketIO.Server
//create mapping with all users in all rooms
let mapPositionUserByRoom = new Map();
for(let i = 0; i < socketsKey.length; i++){
let socket = clients.sockets[socketsKey[i]];
if(!(socket as ExSocketInterface).position){
let socket = clients.sockets[socketsKey[i]] as ExSocketInterface;
if(!socket.position){
continue;
}
let data = {
userId : (socket as ExSocketInterface).userId,
roomId : (socket as ExSocketInterface).roomId,
position : (socket as ExSocketInterface).position,
userId : socket.userId,
roomId : socket.roomId,
position : socket.position,
};
let dataArray = <any>[];
if(mapPositionUserByRoom.get(data.roomId)){

View file

@ -5,7 +5,7 @@ export class Message {
constructor(message: string) {
let data = JSON.parse(message);
if(!data.userId || !data.roomId){
throw Error("userId and roomId cannot be null");
throw Error("userId or roomId cannot be null");
}
this.userId = data.userId;
this.roomId = data.roomId;