mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-03 17:01:34 +02:00
Merge pull request #10132 from davidkelly/dk/analyticsForConnections
initial analytics for connections
This commit is contained in:
commit
34a2cefb98
3 changed files with 14 additions and 0 deletions
|
@ -61,6 +61,16 @@ void UserActivityLoggerScriptingInterface::palOpened(float secondsOpened) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UserActivityLoggerScriptingInterface::makeUserConnection(QString otherID, bool success, QString detailsString) {
|
||||||
|
QJsonObject payload;
|
||||||
|
payload["otherUser"] = otherID;
|
||||||
|
payload["success"] = success;
|
||||||
|
if (detailsString.length() > 0) {
|
||||||
|
payload["details"] = detailsString;
|
||||||
|
}
|
||||||
|
logAction("makeUserConnection", payload);
|
||||||
|
}
|
||||||
|
|
||||||
void UserActivityLoggerScriptingInterface::logAction(QString action, QJsonObject details) {
|
void UserActivityLoggerScriptingInterface::logAction(QString action, QJsonObject details) {
|
||||||
QMetaObject::invokeMethod(&UserActivityLogger::getInstance(), "logAction",
|
QMetaObject::invokeMethod(&UserActivityLogger::getInstance(), "logAction",
|
||||||
Q_ARG(QString, action),
|
Q_ARG(QString, action),
|
||||||
|
|
|
@ -29,6 +29,7 @@ public:
|
||||||
float tutorialElapsedTime, QString tutorialRunID = "", int tutorialVersion = 0, QString controllerType = "");
|
float tutorialElapsedTime, QString tutorialRunID = "", int tutorialVersion = 0, QString controllerType = "");
|
||||||
Q_INVOKABLE void palAction(QString action, QString target);
|
Q_INVOKABLE void palAction(QString action, QString target);
|
||||||
Q_INVOKABLE void palOpened(float secondsOpen);
|
Q_INVOKABLE void palOpened(float secondsOpen);
|
||||||
|
Q_INVOKABLE void makeUserConnection(QString otherUser, bool success, QString details="");
|
||||||
private:
|
private:
|
||||||
void logAction(QString action, QJsonObject details = {});
|
void logAction(QString action, QJsonObject details = {});
|
||||||
};
|
};
|
||||||
|
|
|
@ -543,12 +543,14 @@ function connectionRequestCompleted() { // Final result is in. Do effects.
|
||||||
// don't change state (so animation continues while gripped)
|
// don't change state (so animation continues while gripped)
|
||||||
// but do send a notification, by calling the slot that emits the signal for it
|
// but do send a notification, by calling the slot that emits the signal for it
|
||||||
Window.makeConnection(true, result.connection.new_connection ? "You and " + result.connection.username + " are now connected!" : result.connection.username);
|
Window.makeConnection(true, result.connection.new_connection ? "You and " + result.connection.username + " are now connected!" : result.connection.username);
|
||||||
|
UserActivityLogger.makeUserConnection(connectingId, true, result.connection.new_connection ? "new connection" : "already connected");
|
||||||
return;
|
return;
|
||||||
} // failed
|
} // failed
|
||||||
endHandshake();
|
endHandshake();
|
||||||
debug("failing with result data", result);
|
debug("failing with result data", result);
|
||||||
// IWBNI we also did some fail sound/visual effect.
|
// IWBNI we also did some fail sound/visual effect.
|
||||||
Window.makeConnection(false, result.connection);
|
Window.makeConnection(false, result.connection);
|
||||||
|
UserActivityLogger.makeUserConnection(connectingId, false, result.connection);
|
||||||
}
|
}
|
||||||
var POLL_INTERVAL_MS = 200, POLL_LIMIT = 5;
|
var POLL_INTERVAL_MS = 200, POLL_LIMIT = 5;
|
||||||
function handleConnectionResponseAndMaybeRepeat(error, response) {
|
function handleConnectionResponseAndMaybeRepeat(error, response) {
|
||||||
|
@ -573,6 +575,7 @@ function handleConnectionResponseAndMaybeRepeat(error, response) {
|
||||||
} else if (error || (response.status !== 'success')) {
|
} else if (error || (response.status !== 'success')) {
|
||||||
debug('server fail', error, response.status);
|
debug('server fail', error, response.status);
|
||||||
result = error ? {status: 'error', connection: error} : response;
|
result = error ? {status: 'error', connection: error} : response;
|
||||||
|
UserActivityLogger.makeUserConnection(connectingId, false, error || response);
|
||||||
connectionRequestCompleted();
|
connectionRequestCompleted();
|
||||||
} else {
|
} else {
|
||||||
debug('server success', result);
|
debug('server success', result);
|
||||||
|
|
Loading…
Reference in a new issue