2
0
Эх сурвалжийг харах

Moved rooms to better spot.

KrisVos130 8 жил өмнө
parent
commit
3e18a4d332

+ 9 - 1
logic/coreHandler.js

@@ -237,7 +237,15 @@ module.exports = {
 	},
 
 	rooms: function (cb) {
-		cb(stations);
+		var _rooms = stations.map(function(result) {
+			return {
+				id: result.getId(),
+				displayName: result.getDisplayName(),
+				description: result.getDescription(),
+				users: result.getUsers()
+			}
+		});
+		cb(_rooms);
 	},
 
 	handleRoomJoin: function (id, cb) {

+ 0 - 8
logic/socketHandler.js

@@ -24,14 +24,6 @@ module.exports = function (base, io) {
 
 		socket.on('getRooms', function () {
 			base.rooms(function (result) {
-				var rooms = result.map(function(result) {
-					return {
-						id: result.getId(),
-						displayName: result.getDisplayName(),
-						description: result.getDescription(),
-						users: result.getUsers()
-					}
-				});
 				socket.emit('rooms', result);
 			});
 		});