From a3e092db14cd0ca785ae46b99f6e275eedc0ddc1 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 14 Sep 2011 08:54:07 -0400 Subject: STORM-1578 (viewer side only), STORM-1589 Remove the viewer side automatic logout after extended away time. Note, however, that the server still logs you out after 30 minutes away: see SVC 7251. Allow more time (10 seconds vs 2 seconds) after initiating Away status during which mouse movements do not remove the Away status. --- indra/newview/app_settings/settings.xml | 13 +------------ indra/newview/llagent.cpp | 6 +++++- indra/newview/llagent.h | 3 ++- indra/newview/llappviewer.cpp | 18 ++++-------------- indra/newview/llviewerjoystick.cpp | 11 ++++------- indra/newview/llviewerwindow.cpp | 7 +++---- 6 files changed, 19 insertions(+), 39 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 60025707a4..f4535f12f8 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -25,7 +25,7 @@ Type S32 Value - 0 + 300 AdminMenu @@ -7116,17 +7116,6 @@ Value 0.0 - QuitAfterSecondsOfAFK - - Comment - The duration allowed after being AFK before quitting. - Persist - 1 - Type - F32 - Value - 0.0 - QuitOnLoginActivated Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 642a1907f0..296ae8f10b 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -107,7 +107,6 @@ const F64 CHAT_AGE_FAST_RATE = 3.0; const F32 MIN_FIDGET_TIME = 8.f; // seconds const F32 MAX_FIDGET_TIME = 20.f; // seconds - // The agent instance. LLAgent gAgent; @@ -115,6 +114,9 @@ LLAgent gAgent; // Statics // +/// minimum time after setting away state before coming back based on movement +const F32 LLAgent::MIN_AFK_TIME = 10.0f; + const F32 LLAgent::TYPING_TIMEOUT_SECS = 5.f; std::map LLAgent::sTeleportErrorMessages; @@ -1165,6 +1167,7 @@ void LLAgent::setAFK() { sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_START); setControlFlags(AGENT_CONTROL_AWAY | AGENT_CONTROL_STOP); + LL_INFOS("AFK") << "Setting Away" << LL_ENDL; gAwayTimer.start(); if (gAFKMenu) { @@ -1188,6 +1191,7 @@ void LLAgent::clearAFK() { sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_STOP); clearControlFlags(AGENT_CONTROL_AWAY); + LL_INFOS("AFK") << "Clearing Away" << LL_ENDL; if (gAFKMenu) { gAFKMenu->setLabel(LLTrans::getString("AvatarSetAway")); diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 67ed1923c0..5e23ced424 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -318,7 +318,8 @@ public: void setAFK(); void clearAFK(); BOOL getAFK() const; - + static const F32 MIN_AFK_TIME; + //-------------------------------------------------------------------- // Run //-------------------------------------------------------------------- diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4e1ef59765..2e1108d42c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -247,7 +247,6 @@ extern BOOL gDebugGL; //////////////////////////////////////////////////////////// // All from the last globals push... -const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() F32 gSimFrames; @@ -430,8 +429,11 @@ static bool app_metrics_qa_mode = false; void idle_afk_check() { // check idle timers - if (gSavedSettings.getS32("AFKTimeout") && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getS32("AFKTimeout"))) + F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32(); + F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); + if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) { + LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL; gAgent.setAFK(); } } @@ -4186,18 +4188,6 @@ void LLAppViewer::idle() } } - // debug setting to quit after N seconds of being AFK - 0 to never do this - F32 qas_afk = gSavedSettings.getF32("QuitAfterSecondsOfAFK"); - if (qas_afk > 0.f) - { - // idle time is more than setting - if ( gAwayTriggerTimer.getElapsedTimeF32() > qas_afk ) - { - // go ahead and just quit gracefully - LLAppViewer::instance()->requestQuit(); - } - } - // Must wait until both have avatar object and mute list, so poll // here. request_initial_instant_messages(); diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index fbf11f20db..f6e840adcd 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -51,9 +51,6 @@ #define RY_I 5 #define RZ_I 3 -// minimum time after setting away state before coming back -const F32 MIN_AFK_TIME = 2.f; - F32 LLViewerJoystick::sLastDelta[] = {0,0,0,0,0,0,0}; F32 LLViewerJoystick::sDelta[] = {0,0,0,0,0,0,0}; @@ -551,7 +548,7 @@ void LLViewerJoystick::moveObjects(bool reset) if (!is_zero) { // Clear AFK state if moved beyond the deadzone - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -725,7 +722,7 @@ void LLViewerJoystick::moveAvatar(bool reset) if (!is_zero) { // Clear AFK state if moved beyond the deadzone - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -941,7 +938,7 @@ void LLViewerJoystick::moveFlycam(bool reset) } // Clear AFK state if moved beyond the deadzone - if (!is_zero && gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (!is_zero && gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -1001,7 +998,7 @@ bool LLViewerJoystick::toggleFlycam() gAgentCamera.changeCameraToDefault(); } - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 5893259d96..a7f4209e69 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -240,8 +240,6 @@ BOOL gDisplayBadge = FALSE; static const U8 NO_FACE = 255; BOOL gQuietSnapshot = FALSE; -const F32 MIN_AFK_TIME = 2.f; // minimum time after setting away state before coming back - static const F32 MIN_DISPLAY_SCALE = 0.75f; std::string LLViewerWindow::sSnapshotBaseName; @@ -1214,7 +1212,7 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask mWindow->showCursorFromMouseMove(); - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -1302,7 +1300,7 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated) // Let the voice chat code check for its PTT key. Note that this never affects event processing. LLVoiceClient::getInstance()->keyDown(key, mask); - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -1352,6 +1350,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated) { mActive = FALSE; + // if the user has chosen to go Away automatically after some time, then go Away when minimizing if (gSavedSettings.getS32("AFKTimeout")) { gAgent.setAFK(); -- cgit v1.2.3