Hello working

This commit is contained in:
“bobbydigitales”
2024-10-09 12:20:16 -07:00
parent 26ed3bcf84
commit dd66a5d31b
4 changed files with 22 additions and 10 deletions

View File

@@ -251,7 +251,7 @@ class wsConnection {
}
helloResponseHandler(data: any) {
debugger
let users = [];
try {
let currentUserPeers = data.userPeers[app.router.userID];
@@ -265,9 +265,9 @@ class wsConnection {
log(`Net: got ${users.length} users from bootstrap peer. ${users.join(',')}`)
for (let [userID, peerIDs] of users) {
this.peers.set(userID, [...Object.keys(peerIDs as any)]);
this.peers.set(userID, [...peerIDs]);
for (let peerID of [...Object.keys(peerIDs as any)]) {
for (let peerID of [...peerIDs]) {
if (peerID === this.peerID) {
continue;
}
@@ -449,7 +449,7 @@ class wsConnection {
this.websocket.onmessage = (event) => {
// log('ws:<-' + event.data.slice(0, 240));
debugger;
let data = JSON.parse(event.data);
let { type } = data;