added jasmine in the back
This commit is contained in:
parent
f7434ba64a
commit
ded19549c7
7 changed files with 69 additions and 8 deletions
|
@ -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)){
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue