From 2fc9f42ea6befc7e73212cb9788f738f1d098d2d Mon Sep 17 00:00:00 2001 From: AdityaHirapara Date: Fri, 6 Apr 2018 21:30:58 +0530 Subject: [PATCH] remove unnecessary files and variables --- globals.js | 1 - utils.js | 25 ------------------------- 2 files changed, 26 deletions(-) delete mode 100644 utils.js diff --git a/globals.js b/globals.js index 8c682f57..86f5a139 100644 --- a/globals.js +++ b/globals.js @@ -2,4 +2,3 @@ global.onlineUsers = []; global.availableUsers = []; global.rooms = []; -global.queue = []; diff --git a/utils.js b/utils.js deleted file mode 100644 index 753b1e94..00000000 --- a/utils.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -require('./globals.js'); - -function makeUserObject(socket) { - return new Promise((resolve, reject) => { - let newUser = { - "userID": socket.id, - "inRoom": false - } - resolve(newUser); - }); -} - -function makeRoom(queue) { - // Return a room object from here which we will add to our global rooms. The object format should be like: - return { - "roomID": 234234, // A random number which should be unique for every room. Figure out the logic. You can use any external npm module. - "users" : [queue[0], queue[1]] // This will be an array containing the first objefct from the queue above and a object at random index in queue apart from first one. - } -} - -module.exports = { - makeUserObject, - makeRoom -}