diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-03-06 11:01:29 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-03-06 11:01:29 -0800 |
commit | 49477cec951a658d2014afd7ac7c3920d6844a50 (patch) | |
tree | 848a7cabd4bbbb86074bc4308a1175128fdad208 /indra | |
parent | c0d44f10f92b43396b6e1bda4da21324e914f030 (diff) |
Updating the freeze/unfreeze service with the new field names. Also, still supporting the old field names until fully deprecated from all server builds.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpathfindingmanager.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 5c9293a28a..a59dda74ac 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -42,7 +42,8 @@ #define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc"
#define CAP_SERVICE_AGENT_STATE "AgentPreferences"
-#define ALTER_PERMANENT_OBJECTS_FIELD "alter_permanent_objects"
+#define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects"
+#define DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD "alter_permanent_objects"
#define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties"
#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties"
@@ -218,7 +219,10 @@ void LLPathfindingManager::requestSetAgentState(EAgentState pRequestedAgentState else
{
LLSD request;
- request[ALTER_PERMANENT_OBJECTS_FIELD] = static_cast<LLSD::Boolean>(pRequestedAgentState == kAgentStateUnfrozen);
+ request[ALTER_NAVMESH_OBJECTS_FIELD] = static_cast<LLSD::Boolean>(pRequestedAgentState == kAgentStateUnfrozen);
+#ifdef DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD
+ request[DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD] = static_cast<LLSD::Boolean>(pRequestedAgentState == kAgentStateUnfrozen);
+#endif // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD
LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL, pRequestedAgentState);
LLHTTPClient::post(agentStateURL, request, responder);
@@ -335,9 +339,24 @@ void LLPathfindingManager::setAgentState(EAgentState pAgentState) void LLPathfindingManager::handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState)
{
- llassert(pContent.has(ALTER_PERMANENT_OBJECTS_FIELD));
- llassert(pContent.get(ALTER_PERMANENT_OBJECTS_FIELD).isBoolean());
- EAgentState agentState = (pContent.get(ALTER_PERMANENT_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen);
+#ifndef DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD
+ 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);
+#else // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD
+ EAgentState agentState = kAgentStateUnknown;
+ if (pContent.has(ALTER_NAVMESH_OBJECTS_FIELD))
+ {
+ llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean());
+ agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen);
+ }
+ else
+ {
+ llassert(pContent.has(DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD));
+ llassert(pContent.get(DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD).isBoolean());
+ agentState = (pContent.get(DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen);
+ }
+#endif // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD
if (isValidAgentState(pRequestedAgentState) && (agentState != pRequestedAgentState))
{
|