summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llagent.cpp2
-rw-r--r--indra/newview/llpathfindingmanager.cpp12
-rw-r--r--indra/newview/llpathfindingnavmesh.cpp20
-rw-r--r--indra/newview/llpathfindingnavmeshstatus.cpp27
4 files changed, 49 insertions, 12 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index cbd08ad1c3..8fd6c2605f 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -88,7 +88,7 @@
#include "llworld.h"
#include "llworldmap.h"
#include "stringize.h"
-#include "llfloaterpathfindingconsole.h"
+#include "LLPathingLib.h"
using namespace LLVOAvatarDefines;
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp
index f3b9bc4b8a..251e330914 100644
--- a/indra/newview/llpathfindingmanager.cpp
+++ b/indra/newview/llpathfindingmanager.cpp
@@ -41,6 +41,7 @@
#include "llpathfindinglinkset.h"
#include "llpathfindinglinksetlist.h"
#include "llhttpnode.h"
+//#include "llpathfindingnavmeshzone.h" // XXX
#include <boost/function.hpp>
#include <boost/signals2.hpp>
@@ -57,6 +58,7 @@
#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties"
#define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavMeshStatusUpdate"
+#define SIM_MESSAGE_BODY_FIELD "body"
//---------------------------------------------------------------------------
// LLNavMeshSimStateChangeNode
@@ -628,10 +630,12 @@ LLViewerRegion *LLPathfindingManager::getCurrentRegion() const
void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const
{
#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE
- llinfos << "Received NavMeshStatusUpdate: " << pContext << llendl;
+ llinfos << "STINSON DEBUG: Received NavMeshStatusUpdate: " << pInput << llendl;
#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE
- LLPathfindingNavMeshStatus navMeshStatus(pContext);
- LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(pContext);
+ llassert(pInput.has(SIM_MESSAGE_BODY_FIELD));
+ llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap());
+ LLPathfindingNavMeshStatus navMeshStatus(pInput.get(SIM_MESSAGE_BODY_FIELD));
+ LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(navMeshStatus);
}
//---------------------------------------------------------------------------
@@ -656,7 +660,7 @@ NavMeshStatusResponder::~NavMeshStatusResponder()
void NavMeshStatusResponder::result(const LLSD &pContent)
{
#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE
- llinfos << "Received requested NavMeshStatus: " << pContent << llendl;
+ llinfos << "STINSON DEBUG: Received requested NavMeshStatus: " << pContent << llendl;
#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE
LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, pContent);
LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion);
diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp
index 138295a8cf..740d1cde24 100644
--- a/indra/newview/llpathfindingnavmesh.cpp
+++ b/indra/newview/llpathfindingnavmesh.cpp
@@ -32,6 +32,9 @@
#include <string>
+#define NAVMESH_VERSION_FIELD "navmesh_version"
+#define NAVMESH_DATA_FIELD "navmesh_data"
+
//---------------------------------------------------------------------------
// LLPathfindingNavMesh
//---------------------------------------------------------------------------
@@ -98,11 +101,24 @@ void LLPathfindingNavMesh::handleNavMeshStart(U32 pNavMeshVersion)
void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion)
{
+ if (pContent.has(NAVMESH_VERSION_FIELD))
+ {
+ llassert(pContent.get(NAVMESH_VERSION_FIELD).isInteger());
+ llassert(pContent.get(NAVMESH_VERSION_FIELD).asInteger() >= 0);
+ U32 embeddedNavMeshVersion = static_cast<U32>(pContent.get(NAVMESH_VERSION_FIELD).asInteger());
+ llassert(embeddedNavMeshVersion == pNavMeshVersion); // stinson 03/13/2012 : does this ever occur?
+ if (embeddedNavMeshVersion != pNavMeshVersion)
+ {
+ llwarns << "Mismatch between expected and embedded navmesh versions occurred" << llendl;
+ pNavMeshVersion = embeddedNavMeshVersion;
+ }
+ }
+
if (mNavMeshVersion == pNavMeshVersion)
{
- if ( pContent.has("navmesh_data") )
+ if ( pContent.has(NAVMESH_DATA_FIELD) )
{
- const LLSD::Binary &value = pContent["navmesh_data"].asBinary();
+ const LLSD::Binary &value = pContent.get(NAVMESH_DATA_FIELD).asBinary();
unsigned int binSize = value.size();
std::string newStr(reinterpret_cast<const char *>(&value[0]), binSize);
std::istringstream streamdecomp( newStr );
diff --git a/indra/newview/llpathfindingnavmeshstatus.cpp b/indra/newview/llpathfindingnavmeshstatus.cpp
index 67be0459a5..2ef892c8cd 100644
--- a/indra/newview/llpathfindingnavmeshstatus.cpp
+++ b/indra/newview/llpathfindingnavmeshstatus.cpp
@@ -33,8 +33,9 @@
#include <string>
-#define REGION_FIELD "region"
-#define STATE_FIELD "state"
+#define REGION_FIELD "region_id"
+#define DEPRECATED_STATE_FIELD "state"
+#define STATUS_FIELD "status"
#define VERSION_FIELD "version"
const std::string LLPathfindingNavMeshStatus::sStatusPending("pending");
@@ -106,9 +107,25 @@ void LLPathfindingNavMeshStatus::parseStatus(const LLSD &pContent)
llassert(pContent.get(VERSION_FIELD).asInteger() >= 0);
mVersion = static_cast<U32>(pContent.get(VERSION_FIELD).asInteger());
- llassert(pContent.has(STATE_FIELD));
- llassert(pContent.get(STATE_FIELD).isString());
- std::string status = pContent.get(STATE_FIELD).asString();
+#ifdef DEPRECATED_STATE_FIELD
+ std::string status;
+ if (pContent.has(DEPRECATED_STATE_FIELD))
+ {
+ llassert(pContent.has(DEPRECATED_STATE_FIELD));
+ llassert(pContent.get(DEPRECATED_STATE_FIELD).isString());
+ status = pContent.get(DEPRECATED_STATE_FIELD).asString();
+ }
+ else
+ {
+ llassert(pContent.has(STATUS_FIELD));
+ llassert(pContent.get(STATUS_FIELD).isString());
+ status = pContent.get(STATUS_FIELD).asString();
+ }
+#else // DEPRECATED_STATE_FIELD
+ llassert(pContent.has(STATUS_FIELD));
+ llassert(pContent.get(STATUS_FIELD).isString());
+ std::string status = pContent.get(STATUS_FIELD).asString();
+#endif // DEPRECATED_STATE_FIELD
if (LLStringUtil::compareStrings(status, sStatusPending))
{