Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
telemersion
Telemersive Gateway
Commits
cc7c50e8
Commit
cc7c50e8
authored
Apr 24, 2021
by
maybites
Browse files
remove update code for peerList and fixed bug
parent
b33376b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
code/peerList.js
View file @
cc7c50e8
...
...
@@ -62,17 +62,7 @@ function append(_peerName, _peerID, _peerLocalIPv4, _peerPublicIPv4)
if
(
myPeerList
.
contains
(
_peerID
)){
// we make a sanity check if nothing has changed
var
localPeer
=
myPeerList
.
get
(
_peerID
);
if
(
localPeer
.
get
(
"
peerName
"
)
!==
_peerName
||
localPeer
.
get
(
"
peerLocalIPv4
"
)
!==
_peerLocalIPv4
||
localPeer
.
get
(
"
peerPublicIPv4
"
)
!==
_peerPublicIPv4
){
// something changed.
dpost
(
"
update peer (
"
+
_peerName
+
"
)
"
);
localPeer
.
set
(
"
peerName
"
,
_peerName
);
localPeer
.
set
(
"
peerLocalIPv4
"
,
_peerLocalIPv4
);
localPeer
.
set
(
"
peerPublicIPv4
"
,
_peerPublicIPv4
);
localPeer
.
set
(
"
verified
"
,
2
);
// this indicates a changed peer
}
localPeer
.
set
(
"
verified
"
,
1
);
// this indicates an existing peer
myPeerList
.
set
(
_peerID
,
localPeer
);
}
// since in the last step a peer might have been removed because of a change we test again
...
...
@@ -126,23 +116,6 @@ function done()
}
}
}
// update Slots with new peer
slots
.
forEach
(
update
);
}
function
update
(
_peerID
,
_index
)
{
var
localPeer
=
myPeerList
.
get
(
_peerID
);
if
(
localPeer
.
get
(
"
verified
"
)
===
2
){
messnamed
(
"
pl_
"
+
_peerID
,
"
peerName
"
,
localPeer
.
get
(
"
peerName
"
));
messnamed
(
"
pl_
"
+
_peerID
,
"
peerLocalIP
"
,
localPeer
.
get
(
"
peerLocalIPv4
"
));
messnamed
(
"
pl_
"
+
_peerID
,
"
peerPublicIP
"
,
localPeer
.
get
(
"
peerPublicIPv4
"
));
messnamed
(
"
pl_
"
+
_peerID
,
"
roomName
"
,
myRoomName
);
messnamed
(
"
pl_
"
+
_peerID
,
"
roomID
"
,
myRoomID
);
messnamed
(
"
pl_
"
+
_peerID
,
"
slot
"
,
_index
);
localPeer
.
set
(
"
verified
"
,
1
);
// this indicates an verified peer
myPeerList
.
set
(
_peerID
,
localPeer
);
}
}
function
createPeer
(
_peerID
){
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment