summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprep linden <prep@lindenlab.com>2011-09-19 11:00:34 -0400
committerprep linden <prep@lindenlab.com>2011-09-19 11:00:34 -0400
commit6350d8eb4b2396e10703b039cada3ce0d8f8ca8d (patch)
tree8c18b34d5c675f4ece390c3a528fb879e0e7190f
parent3f0a2cda29607b1114788f54c1147c3bd5c864f8 (diff)
parent187a39885c89da4975e636760afbc0003df39395 (diff)
merge
-rw-r--r--indra/newview/app_settings/settings.xml13
-rwxr-xr-xindra/newview/llagent.cpp6
-rw-r--r--indra/newview/llagent.h3
-rw-r--r--indra/newview/llappviewer.cpp18
-rw-r--r--indra/newview/llviewerjoystick.cpp11
-rw-r--r--indra/newview/llviewerwindow.cpp7
6 files changed, 19 insertions, 39 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index e4169c0cba..8804c40aff 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -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>
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<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"));
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();