mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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) {
|
||||
QMetaObject::invokeMethod(&UserActivityLogger::getInstance(), "logAction",
|
||||
Q_ARG(QString, action),
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
float tutorialElapsedTime, QString tutorialRunID = "", int tutorialVersion = 0, QString controllerType = "");
|
||||
Q_INVOKABLE void palAction(QString action, QString target);
|
||||
Q_INVOKABLE void palOpened(float secondsOpen);
|
||||
Q_INVOKABLE void makeUserConnection(QString otherUser, bool success, QString details="");
|
||||
private:
|
||||
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)
|
||||
// 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);
|
||||
UserActivityLogger.makeUserConnection(connectingId, true, result.connection.new_connection ? "new connection" : "already connected");
|
||||
return;
|
||||
} // failed
|
||||
endHandshake();
|
||||
debug("failing with result data", result);
|
||||
// IWBNI we also did some fail sound/visual effect.
|
||||
Window.makeConnection(false, result.connection);
|
||||
UserActivityLogger.makeUserConnection(connectingId, false, result.connection);
|
||||
}
|
||||
var POLL_INTERVAL_MS = 200, POLL_LIMIT = 5;
|
||||
function handleConnectionResponseAndMaybeRepeat(error, response) {
|
||||
|
@ -573,6 +575,7 @@ function handleConnectionResponseAndMaybeRepeat(error, response) {
|
|||
} else if (error || (response.status !== 'success')) {
|
||||
debug('server fail', error, response.status);
|
||||
result = error ? {status: 'error', connection: error} : response;
|
||||
UserActivityLogger.makeUserConnection(connectingId, false, error || response);
|
||||
connectionRequestCompleted();
|
||||
} else {
|
||||
debug('server success', result);
|
||||
|
|
Loading…
Reference in a new issue