summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-03-13 16:42:07 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-03-13 16:42:07 -0700
commite1aac3718192d7ce663f9134492b4a12dc1637d0 (patch)
treed8232977912882a32445f5f848ef62aa5a90a54f
parent378ae8ce6588ce921b2aa960c08d4293c6b419e5 (diff)
PATH-394: First pass at handling the sim-to-viewer message reporting the change from FROZEN to UNFROZEN state.
-rw-r--r--etc/message.xml8
-rw-r--r--indra/newview/llpathfindingmanager.cpp36
-rw-r--r--indra/newview/llpathfindingmanager.h2
3 files changed, 46 insertions, 0 deletions
diff --git a/etc/message.xml b/etc/message.xml
index 244bf7fb06..7dcf99f307 100644
--- a/etc/message.xml
+++ b/etc/message.xml
@@ -555,6 +555,14 @@
<boolean>true</boolean>
</map>
+ <key>AgentPreferencesUpdate</key>
+ <map>
+ <key>flavor</key>
+ <string>llsd</string>
+ <key>trusted-sender</key>
+ <boolean>true</boolean>
+ </map>
+
<!-- UDPDeprecated Messages -->
<key>ScriptRunningReply</key>
<map>
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp
index 251e330914..46bfbe0bb0 100644
--- a/indra/newview/llpathfindingmanager.cpp
+++ b/indra/newview/llpathfindingmanager.cpp
@@ -58,6 +58,7 @@
#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties"
#define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavMeshStatusUpdate"
+#define SIM_MESSAGE_AGENT_STATE_UPDATE "/message/AgentPreferencesUpdate"
#define SIM_MESSAGE_BODY_FIELD "body"
//---------------------------------------------------------------------------
@@ -73,6 +74,18 @@ public:
LLHTTPRegistration<LLNavMeshSimStateChangeNode> gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE);
//---------------------------------------------------------------------------
+// LLAgentStateChangeNode
+//---------------------------------------------------------------------------
+
+class LLAgentStateChangeNode : public LLHTTPNode
+{
+public:
+ virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const;
+};
+
+LLHTTPRegistration<LLAgentStateChangeNode> gHTTPRegistrationAgentStateChangeNode(SIM_MESSAGE_AGENT_STATE_UPDATE);
+
+//---------------------------------------------------------------------------
// NavMeshStatusResponder
//---------------------------------------------------------------------------
@@ -570,6 +583,15 @@ void LLPathfindingManager::handleAgentStateError(U32 pStatus, const std::string
setAgentState(kAgentStateError);
}
+void LLPathfindingManager::handleAgentStateUpdate(const LLSD &pContent)
+{
+ llassert(pContent.has(ALTER_NAVMESH_OBJECTS_FIELD));
+ llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean());
+ EAgentState agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen);
+
+ setAgentState(agentState);
+}
+
std::string LLPathfindingManager::getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const
{
return getCapabilityURLForRegion(pRegion, CAP_SERVICE_NAVMESH_STATUS);
@@ -639,6 +661,20 @@ void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pConte
}
//---------------------------------------------------------------------------
+// LLAgentStateChangeNode
+//---------------------------------------------------------------------------
+
+void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const
+{
+#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE
+ llinfos << "STINSON DEBUG: Received AgentPreferencesUpdate: " << pInput << llendl;
+#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE
+ llassert(pInput.has(SIM_MESSAGE_BODY_FIELD));
+ llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap());
+ LLPathfindingManager::getInstance()->handleAgentStateUpdate(pInput.get(SIM_MESSAGE_BODY_FIELD));
+}
+
+//---------------------------------------------------------------------------
// NavMeshStatusResponder
//---------------------------------------------------------------------------
diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h
index 3a849d0290..1cfd870897 100644
--- a/indra/newview/llpathfindingmanager.h
+++ b/indra/newview/llpathfindingmanager.h
@@ -47,6 +47,7 @@ class LLPathfindingNavMeshStatus;
class LLPathfindingManager : public LLSingleton<LLPathfindingManager>
{
friend class AgentStateResponder;
+ friend class LLAgentStateChangeNode;
public:
typedef std::map<LLUUID, LLPathfindingNavMeshPtr> NavMeshMap;
@@ -108,6 +109,7 @@ private:
void setAgentState(EAgentState pAgentState);
void handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState);
void handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL);
+ void handleAgentStateUpdate(const LLSD &pContent);
std::string getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const;
std::string getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const;