Browse Source

Moved rooms to better spot.

KrisVos130 8 năm trước cách đây
mục cha
commit
3e18a4d332
2 tập tin đã thay đổi với 9 bổ sung9 xóa
  1. 9 1
      logic/coreHandler.js
  2. 0 8
      logic/socketHandler.js

+ 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);
 			});
 		});