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.
master
Oz Linden 2011-09-14 08:54:07 -04:00
parent 961c4d3816
commit a3e092db14
6 changed files with 19 additions and 39 deletions

View File

@ -25,7 +25,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
<real>0</real>
<real>300</real>
</map>
<key>AdminMenu</key>
<map>
@ -7116,17 +7116,6 @@
<key>Value</key>
<real>0.0</real>
</map>
<key>QuitAfterSecondsOfAFK</key>
<map>
<key>Comment</key>
<string>The duration allowed after being AFK before quitting.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.0</real>
</map>
<key>QuitOnLoginActivated</key>
<map>
<key>Comment</key>

View File

@ -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<std::string, std::string> 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"));

View File

@ -318,7 +318,8 @@ public:
void setAFK();
void clearAFK();
BOOL getAFK() const;
static const F32 MIN_AFK_TIME;
//--------------------------------------------------------------------
// Run
//--------------------------------------------------------------------

View File

@ -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();

View File

@ -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();
}

View File

@ -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();