mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge pull request #10384 from davidkelly/dk/minorHandshakeImprovement
Some minor handshake improvements
This commit is contained in:
commit
d40984b475
1 changed files with 18 additions and 5 deletions
|
@ -122,7 +122,8 @@
|
||||||
function debug() {
|
function debug() {
|
||||||
var stateString = "<" + STATE_STRINGS[state] + ">";
|
var stateString = "<" + STATE_STRINGS[state] + ">";
|
||||||
var connecting = "[" + connectingId + "/" + connectingHandJointIndex + "]";
|
var connecting = "[" + connectingId + "/" + connectingHandJointIndex + "]";
|
||||||
print.apply(null, [].concat.apply([LABEL, stateString, JSON.stringify(waitingList), connecting],
|
var current = "[" + currentHand + "/" + currentHandJointIndex + "]"
|
||||||
|
print.apply(null, [].concat.apply([LABEL, stateString, current, JSON.stringify(waitingList), connecting],
|
||||||
[].map.call(arguments, JSON.stringify)));
|
[].map.call(arguments, JSON.stringify)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -759,7 +760,10 @@
|
||||||
break;
|
break;
|
||||||
case "done":
|
case "done":
|
||||||
delete waitingList[senderID];
|
delete waitingList[senderID];
|
||||||
if (state === STATES.CONNECTING && connectingId === senderID) {
|
if (connectionId !== senderID) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (state === STATES.CONNECTING) {
|
||||||
// if they are done, and didn't connect us, terminate our
|
// if they are done, and didn't connect us, terminate our
|
||||||
// connecting
|
// connecting
|
||||||
if (message.connectionId !== MyAvatar.sessionUUID) {
|
if (message.connectionId !== MyAvatar.sessionUUID) {
|
||||||
|
@ -768,11 +772,20 @@
|
||||||
// value for isKeyboard, as we should not change the animation
|
// value for isKeyboard, as we should not change the animation
|
||||||
// state anyways (if any)
|
// state anyways (if any)
|
||||||
startHandshake();
|
startHandshake();
|
||||||
|
} else {
|
||||||
|
// they just created a connection request to us, and we are connecting to
|
||||||
|
// them, so lets just stop connecting and make connection..
|
||||||
|
makeConnection(connectingId);
|
||||||
|
stopConnecting();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if waiting or inactive, lets clear the connecting id. If in makingConnection,
|
if (state == STATES.MAKING_CONNECTION) {
|
||||||
// do nothing
|
// we are making connection, they just started, so lets reset the
|
||||||
if (state !== STATES.MAKING_CONNECTION && connectingId === senderID) {
|
// poll count just in case
|
||||||
|
pollCount = 0;
|
||||||
|
} else {
|
||||||
|
// if waiting or inactive, lets clear the connecting id. If in makingConnection,
|
||||||
|
// do nothing
|
||||||
clearConnecting();
|
clearConnecting();
|
||||||
if (state !== STATES.INACTIVE) {
|
if (state !== STATES.INACTIVE) {
|
||||||
startHandshake();
|
startHandshake();
|
||||||
|
|
Loading…
Reference in a new issue