diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-03-13 16:42:07 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-03-13 16:42:07 -0700 |
commit | e1aac3718192d7ce663f9134492b4a12dc1637d0 (patch) | |
tree | d8232977912882a32445f5f848ef62aa5a90a54f /indra/newview/llpathfindingmanager.cpp | |
parent | 378ae8ce6588ce921b2aa960c08d4293c6b419e5 (diff) |
PATH-394: First pass at handling the sim-to-viewer message reporting the change from FROZEN to UNFROZEN state.
Diffstat (limited to 'indra/newview/llpathfindingmanager.cpp')
-rw-r--r-- | indra/newview/llpathfindingmanager.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
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
//---------------------------------------------------------------------------
|