mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 21:42:24 +02:00
check your own location data on failure, and notify if it is wrong
This commit is contained in:
parent
92481bf475
commit
eca7292651
1 changed files with 17 additions and 1 deletions
|
@ -600,6 +600,22 @@
|
|||
debug("failing with result data", result);
|
||||
// IWBNI we also did some fail sound/visual effect.
|
||||
Window.makeConnection(false, result.connection);
|
||||
if (Account.isLoggedIn()) { // Give extra failure info
|
||||
request(location.metaverseServerUrl + '/api/v1/users/' + Account.username + '/location', function (error, response) {
|
||||
var message = '';
|
||||
if (error || response.status !== 'success') {
|
||||
message = 'Unable to get location.';
|
||||
} else if (!response.data || !response.data.location) {
|
||||
message = "Unexpected location value: " + JSON.stringify(response);
|
||||
} else if (response.data.location.node_id !== cleanId(MyAvatar.sessionUUID)) {
|
||||
message = 'Session identification does not match database. Maybe you are logged in on another machine? That would prevent handshakes.' + JSON.stringify(response) + MyAvatar.sessionUUID;
|
||||
}
|
||||
if (message) {
|
||||
Window.makeConnection(false, message);
|
||||
}
|
||||
debug("account location:", message || 'ok');
|
||||
});
|
||||
}
|
||||
UserActivityLogger.makeUserConnection(connectingId, false, result.connection);
|
||||
}
|
||||
var POLL_INTERVAL_MS = 200, POLL_LIMIT = 5;
|
||||
|
@ -612,7 +628,7 @@
|
|||
debug(response, 'pollCount', pollCount);
|
||||
if (pollCount++ >= POLL_LIMIT) { // server will expire, but let's not wait that long.
|
||||
debug('POLL LIMIT REACHED; TIMEOUT: expired message generated by CLIENT');
|
||||
result = {status: 'error', connection: 'no-partner-found'};
|
||||
result = {status: 'error', connection: 'No logged-in partner found.'};
|
||||
connectionRequestCompleted();
|
||||
} else { // poll
|
||||
Script.setTimeout(function () {
|
||||
|
|
Loading…
Reference in a new issue