Skip to content
Snippets Groups Projects
Commit 5a81b22e authored by Alexander Tim Hobelsberger's avatar Alexander Tim Hobelsberger
Browse files

UserList

parent c32b3b3a
No related branches found
No related tags found
1 merge request!10Skalierbarkeit
......@@ -228,7 +228,7 @@ io.on('connection', (socket) => {
*
* Description:
* Function will take the username from response and append it together with the socketID to map activeUsers.
* after appending, ip.emit() will send the updated userlist to all users who are currently online.
* after appending, io.emit() will send the updated userlist to all users who are currently online.
*
* @param {socket} socket
* @param {Object} response
......@@ -241,9 +241,9 @@ async function addUserToActiveUsers(response, socket) {
activeUsers.set(socket.id, response.name);
clientActiveUsers.set(activeUsers.size);
console.log(activeUsers);
var userArr = Array.from(activeUsers.values());
//console.log(userArr);
console.log(userArr);
socket.emit('updateUserlist', {
userList : userArr
});
......
......
......@@ -257,7 +257,7 @@
* @listens socket.on() 'updateUserList' event
*/
socket.on('updateUserlist', function(req) {
console.log("Update");
console.log("Update", req);
var userList = req.userList;
console.log("req", req.userList[0]);
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment