Skip to content

Commit 7c55e8b

Browse files
merging changes to push to dev before starting
1 parent 4afc56b commit 7c55e8b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
build/*.js
1+
build
22
npm-debug.log
33
.DS_Store
44
.env

server/server.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const ws = require('ws');
2+
3+
4+
const users = {}
5+
6+
/**
7+
* contains each room created by the client
8+
* key: room (possible the generated id), values: [users] (each user is the socket, socket.send)
9+
* {roomID: [...users]}
10+
*/
11+
const rooms = new Map();
12+
13+
onConnection
14+
//do stuff..
15+
16+
onMessage
17+
18+
handleLeaveRoom
19+
//delete room when nobody is longer in.
20+
21+
onClose

0 commit comments

Comments
 (0)