summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-02-05 22:04:40 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-02-05 22:04:40 +0200
commite3e1672ac40dd4f1f4e458ed09cd7279f0a45fc3 (patch)
tree8e64e6074c11005fbb1dac606c176e4470de03e4 /indra/newview/llappviewer.cpp
parentaa52c852d600aa6b2ea17cdd86f53972c95cca4a (diff)
parent6762f60d78277cf27afd8353aa531afb26bd560c (diff)
Merge branch 'DRTVWR-599-maint-Z' into release/maint-yz
# Conflicts: # indra/newview/llchiclet.h
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index ec411a680f..96986ae046 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -143,7 +143,6 @@
// Third party library includes
#include <boost/bind.hpp>
-#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/regex.hpp>
#include <boost/throw_exception.hpp>
@@ -1207,7 +1206,7 @@ bool LLAppViewer::init()
LLSD item(LeapCommand);
LeapCommand.append(item);
}
- BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand))
+ for (const auto& leap : llsd::inArray(LeapCommand))
{
LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;
// We don't have any better description of this plugin than the
@@ -2357,7 +2356,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
LL_ERRS() << "Invalid settings location list" << LL_ENDL;
}
- BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups)
+ for (const SettingsGroup& group : mSettingsLocationList->groups)
{
// skip settings groups that aren't the one we requested
if (group.name() != location_key) continue;
@@ -2369,7 +2368,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
return false;
}
- BOOST_FOREACH(const SettingsFile& file, group.files)
+ for (const SettingsFile& file : group.files)
{
LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name()
<< " - from location " << location_key << LL_ENDL;
@@ -2433,11 +2432,11 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
std::string LLAppViewer::getSettingsFilename(const std::string& location_key,
const std::string& file)
{
- BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups)
+ for (const SettingsGroup& group : mSettingsLocationList->groups)
{
if (group.name() == location_key)
{
- BOOST_FOREACH(const SettingsFile& settings_file, group.files)
+ for (const SettingsFile& settings_file : group.files)
{
if (settings_file.name() == file)
{
@@ -3017,7 +3016,7 @@ void LLAppViewer::initStrings()
// Now that we've set "[sourceid]", have to go back through
// default_trans_args and reinitialize all those other keys because some
// of them, in turn, reference "[sourceid]".
- BOOST_FOREACH(std::string key, default_trans_args)
+ for (const std::string& key : default_trans_args)
{
std::string brackets(key), nobrackets(key);
// Invalid to inspect key[0] if key is empty(). But then, the entire
@@ -4682,16 +4681,23 @@ void LLAppViewer::idle()
// When appropriate, update agent location to the simulator.
F32 agent_update_time = agent_update_timer.getElapsedTimeF32();
F32 agent_force_update_time = mLastAgentForceUpdate + agent_update_time;
- BOOL force_update = gAgent.controlFlagsDirty()
- || (mLastAgentControlFlags != gAgent.getControlFlags())
- || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND));
- if (force_update || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND)))
+ bool timed_out = agent_update_time > (1.0f / (F32)AGENT_UPDATES_PER_SECOND);
+ BOOL force_send =
+ // if there is something to send
+ (gAgent.controlFlagsDirty() && timed_out)
+ // if something changed
+ || (mLastAgentControlFlags != gAgent.getControlFlags())
+ // keep alive
+ || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND));
+ // timing out doesn't warranty that an update will be sent,
+ // just that it will be checked.
+ if (force_send || timed_out)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
// Send avatar and camera info
mLastAgentControlFlags = gAgent.getControlFlags();
- mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time;
- send_agent_update(force_update);
+ mLastAgentForceUpdate = force_send ? 0 : agent_force_update_time;
+ send_agent_update(force_send);
agent_update_timer.reset();
}
}