diff options
| -rw-r--r-- | indra/newview/llappviewer.cpp | 12 | ||||
| -rw-r--r-- | indra/newview/llviewerregion.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/llviewerregion.h | 3 |
3 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f269138e9b..62315ac561 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5456,10 +5456,18 @@ void LLAppViewer::idle() else { // Recompute canonical controller state (also populates the internal - // state consumed below) and send it to the server when it changed. + // state consumed below) and send it to the server when it changed, + // but only if the agent's region advertises support for it (the + // "GameControlEnabled" simulator feature). While unsupported the + // resend deadline is left untouched, so the first frame after the + // feature appears sends immediately. if (LLGameControl::computeFinalStateAndCheckForChanges()) { - sendGameControlData(); + LLViewerRegion* regionp = gAgent.getRegion(); + if (regionp && regionp->gameControlEnabled()) + { + sendGameControlData(); + } } // Drive the local avatar from the controller. In Avatar/Captive diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 83452e2f12..bdd110c97b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -3772,6 +3772,13 @@ bool LLViewerRegion::groupChatPostLinksEnabled() const return ( mSimulatorFeatures.has("GroupChatPostLinksEnabled") && mSimulatorFeatures["GroupChatPostLinksEnabled"].asBoolean()); } + +bool LLViewerRegion::gameControlEnabled() const +{ + return ( mSimulatorFeatures.has("GameControlEnabled") && + mSimulatorFeatures["GameControlEnabled"].asBoolean()); +} + /* Static Functions */ void log_capabilities(const CapabilityMap &capmap) diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index d5bd6479eb..caaebd37c3 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -353,6 +353,9 @@ public: bool groupChatPostLinksEnabled() const; + // does the simulator accept GameControlData messages? + bool gameControlEnabled() const; + typedef enum { CACHE_MISS_TYPE_TOTAL = 0, // total cache miss - object not in cache |
