From ff7223fafef58d9f8025e97fee87cf7911d93ccf Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 14:45:59 -0700 Subject: PATH-706: Removing enforcement on frozen/unfrozen state from the linksets floater. Also, removing handlers for agent state change. --- indra/newview/llpathfindingmanager.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index e282a3e2f4..5e2a9e1213 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -292,11 +292,6 @@ bool LLPathfindingManager::isPathfindingNavMeshVersioningEnabledForCurrentRegion } #endif // DEPRECATED_UNVERSIONED_NAVMESH -bool LLPathfindingManager::isAllowAlterPermanent() -{ - return (!isPathfindingEnabledForCurrentRegion() || (getAgentState() == kAgentStateUnfrozen)); -} - bool LLPathfindingManager::isAllowViewTerrainProperties() const { LLViewerRegion* region = getCurrentRegion(); -- cgit v1.2.3 From b912c27bf44a45e607adc3b5c94d3fd8a9bbf53e Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 16:40:53 -0700 Subject: PATH-711: Implementing Leo's changes for the pathfinding console. --- indra/newview/llpathfindingmanager.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 5e2a9e1213..ae1c228c69 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -45,6 +45,7 @@ #include "llpathfindingnavmesh.h" #include "llpathfindingnavmeshstatus.h" #include "llpathfindingobject.h" +#include "llpathinglib.h" #include "llsingleton.h" #include "llsd.h" #include "lltrans.h" @@ -273,6 +274,14 @@ LLPathfindingManager::~LLPathfindingManager() { } +void LLPathfindingManager::initSystem() +{ + if (LLPathingLib::getInstance() == NULL) + { + LLPathingLib::initSystem(); + } +} + bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const { return isPathfindingEnabledForRegion(getCurrentRegion()); @@ -292,6 +301,11 @@ bool LLPathfindingManager::isPathfindingNavMeshVersioningEnabledForCurrentRegion } #endif // DEPRECATED_UNVERSIONED_NAVMESH +bool LLPathfindingManager::isPathfindingDebugEnabled() const +{ + return (LLPathingLib::getInstance() != NULL); +} + bool LLPathfindingManager::isAllowViewTerrainProperties() const { LLViewerRegion* region = getCurrentRegion(); -- cgit v1.2.3 From e738e704b88d64b8a0183f94045d229d9f498bd1 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 17:03:15 -0700 Subject: PATH-714: Removing the DEPRECATED_UNVERSIONED_NAVMESH as the viewer no longer has to support the Premium Wilderness regions on the old server code. --- indra/newview/llpathfindingmanager.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index ae1c228c69..1c3800eed6 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -293,14 +293,6 @@ bool LLPathfindingManager::isPathfindingEnabledForRegion(LLViewerRegion *pRegion return !retrieveNavMeshURL.empty(); } -#ifdef DEPRECATED_UNVERSIONED_NAVMESH -bool LLPathfindingManager::isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX() const -{ - std::string navMeshStatusURL = getNavMeshStatusURLForRegion(getCurrentRegion()); - return !navMeshStatusURL.empty(); -} -#endif // DEPRECATED_UNVERSIONED_NAVMESH - bool LLPathfindingManager::isPathfindingDebugEnabled() const { return (LLPathingLib::getInstance() != NULL); @@ -338,25 +330,10 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) else { std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion); -#ifdef DEPRECATED_UNVERSIONED_NAVMESH - if (navMeshStatusURL.empty()) - { - LLPathfindingNavMeshStatus navMeshStatus = navMeshPtr->getNavMeshStatusXXX(); - navMeshStatus.incrementNavMeshVersionXXX(); - sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, navMeshStatus); - } - else - { - navMeshPtr->handleNavMeshCheckVersion(); - LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); - LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); - } -#else // DEPRECATED_UNVERSIONED_NAVMESH llassert(!navMeshStatusURL.empty()); navMeshPtr->handleNavMeshCheckVersion(); LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); -#endif // DEPRECATED_UNVERSIONED_NAVMESH } } -- cgit v1.2.3 From 3108d4d180df16dab7b87c01334cf466ef88d349 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 18:38:06 -0700 Subject: PATH-726: Removing the DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD as the viewer no longer has to support the Premium Wilderness regions on the old server code. --- indra/newview/llpathfindingmanager.cpp | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 1c3800eed6..9893121980 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -59,7 +59,6 @@ #define CAP_SERVICE_AGENT_STATE "AgentPreferences" #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" @@ -377,9 +376,6 @@ void LLPathfindingManager::requestSetAgentState(EAgentState pRequestedAgentState { LLSD request; request[ALTER_NAVMESH_OBJECTS_FIELD] = static_cast(pRequestedAgentState == kAgentStateUnfrozen); -#ifdef DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD - request[DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD] = static_cast(pRequestedAgentState == kAgentStateUnfrozen); -#endif // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL, pRequestedAgentState); LLHTTPClient::post(agentStateURL, request, responder); @@ -661,24 +657,9 @@ void LLPathfindingManager::setAgentState(EAgentState pAgentState) void LLPathfindingManager::handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState) { -#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)) { -- cgit v1.2.3 From 42f3648814923edad8a040620cb3db233597cbb9 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 18:59:51 -0700 Subject: PATH-705: First pass at removing the agent state functionality. WIP -- still need to remove XXX_STINSON_AGENT_STATE_DELETE_ME ifdef'ed code. --- indra/newview/llpathfindingmanager.cpp | 125 +++++++-------------------------- 1 file changed, 25 insertions(+), 100 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 9893121980..f54c9892df 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -53,22 +53,24 @@ #include "llviewerregion.h" #include "llweb.h" -#define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" +#define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" -#define CAP_SERVICE_NAVMESH_STATUS "NavMeshGenerationStatus" +#define CAP_SERVICE_NAVMESH_STATUS "NavMeshGenerationStatus" -#define CAP_SERVICE_AGENT_STATE "AgentPreferences" -#define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects" +#define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties" +#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties" -#define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties" -#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties" - -#define CAP_SERVICE_CHARACTERS "CharacterProperties" +#define CAP_SERVICE_CHARACTERS "CharacterProperties" #define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavMeshStatusUpdate" -#define SIM_MESSAGE_AGENT_STATE_UPDATE "/message/AgentPreferencesUpdate" #define SIM_MESSAGE_BODY_FIELD "body" +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME +#define CAP_SERVICE_AGENT_STATE "AgentPreferences" +#define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects" +#define SIM_MESSAGE_AGENT_STATE_UPDATE "/message/AgentPreferencesUpdate" +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME + //--------------------------------------------------------------------------- // LLNavMeshSimStateChangeNode //--------------------------------------------------------------------------- @@ -81,6 +83,7 @@ public: LLHTTPRegistration gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE); +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // LLAgentStateChangeNode //--------------------------------------------------------------------------- @@ -92,6 +95,7 @@ public: }; LLHTTPRegistration gHTTPRegistrationAgentStateChangeNode(SIM_MESSAGE_AGENT_STATE_UPDATE); +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // NavMeshStatusResponder @@ -135,6 +139,7 @@ private: LLPathfindingNavMeshPtr mNavMeshPtr; }; +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // AgentStateResponder //--------------------------------------------------------------------------- @@ -154,6 +159,7 @@ private: std::string mCapabilityURL; LLPathfindingManager::EAgentState mRequestedAgentState; }; +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // LinksetsResponder @@ -262,10 +268,7 @@ private: LLPathfindingManager::LLPathfindingManager() : LLSingleton(), - mNavMeshMap(), - mAgentStateSignal(), - mAgentState(kAgentStateUnknown), - mLastKnownNonErrorAgentState(kAgentStateUnknown) + mNavMeshMap() { } @@ -336,51 +339,12 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) } } +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) { return mAgentStateSignal.connect(pAgentStateCallback); } - -LLPathfindingManager::EAgentState LLPathfindingManager::getAgentState() -{ - if (!isPathfindingEnabledForCurrentRegion()) - { - setAgentState(kAgentStateNotEnabled); - } - else - { - if (!isValidAgentState(mAgentState)) - { - requestGetAgentState(); - } - } - - return mAgentState; -} - -LLPathfindingManager::EAgentState LLPathfindingManager::getLastKnownNonErrorAgentState() const -{ - return mLastKnownNonErrorAgentState; -} - -void LLPathfindingManager::requestSetAgentState(EAgentState pRequestedAgentState) -{ - llassert(isValidAgentState(pRequestedAgentState)); - std::string agentStateURL = getAgentStateURLForCurrentRegion(); - - if (agentStateURL.empty()) - { - setAgentState(kAgentStateNotEnabled); - } - else - { - LLSD request; - request[ALTER_NAVMESH_OBJECTS_FIELD] = static_cast(pRequestedAgentState == kAgentStateUnfrozen); - - LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL, pRequestedAgentState); - LLHTTPClient::post(agentStateURL, request, responder); - } -} +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const { @@ -623,18 +587,13 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion return getNavMeshForRegion(regionUUID); } -bool LLPathfindingManager::isValidAgentState(EAgentState pAgentState) -{ - return ((pAgentState == kAgentStateFrozen) || (pAgentState == kAgentStateUnfrozen)); -} - +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME void LLPathfindingManager::requestGetAgentState() { std::string agentStateURL = getAgentStateURLForCurrentRegion(); if (agentStateURL.empty()) { - setAgentState(kAgentStateNotEnabled); } else { @@ -643,58 +602,25 @@ void LLPathfindingManager::requestGetAgentState() } } -void LLPathfindingManager::setAgentState(EAgentState pAgentState) -{ - mAgentState = pAgentState; - - if (mAgentState != kAgentStateError) - { - mLastKnownNonErrorAgentState = mAgentState; - } - - mAgentStateSignal(mAgentState); -} - void LLPathfindingManager::handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState) { 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); - if (isValidAgentState(pRequestedAgentState) && (agentState != pRequestedAgentState)) + if ((agentState != pRequestedAgentState)) { agentState = kAgentStateError; llassert(0); } - - setAgentState(agentState); } void LLPathfindingManager::handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL) { llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; - setAgentState(kAgentStateError); } +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME -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); - - LLSD substitutions, payload; - LLNotificationsUtil::add("AutomaticAgentStateUnfreeze", substitutions, payload, boost::bind(&LLPathfindingManager::handleAgentStateUserNotification, this, _1, _2)); -} - -void LLPathfindingManager::handleAgentStateUserNotification(const LLSD &pNotification, const LLSD &pResponse) -{ - if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 1) - { - LLWeb::loadURL(LLTrans::getString("Pathfinding_Wiki_URL")); - } -} std::string LLPathfindingManager::getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const { @@ -706,11 +632,6 @@ std::string LLPathfindingManager::getRetrieveNavMeshURLForRegion(LLViewerRegion return getCapabilityURLForRegion(pRegion, CAP_SERVICE_RETRIEVE_NAVMESH); } -std::string LLPathfindingManager::getAgentStateURLForCurrentRegion() const -{ - return getCapabilityURLForCurrentRegion(CAP_SERVICE_AGENT_STATE); -} - std::string LLPathfindingManager::getObjectLinksetsURLForCurrentRegion() const { return getCapabilityURLForCurrentRegion(CAP_SERVICE_OBJECT_LINKSETS); @@ -769,6 +690,7 @@ void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pConte LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(navMeshStatus); } +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // LLAgentStateChangeNode //--------------------------------------------------------------------------- @@ -782,6 +704,7 @@ void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, c llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap()); LLPathfindingManager::getInstance()->handleAgentStateUpdate(pInput.get(SIM_MESSAGE_BODY_FIELD)); } +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // NavMeshStatusResponder @@ -845,6 +768,7 @@ void NavMeshResponder::error(U32 pStatus, const std::string& pReason) mNavMeshPtr->handleNavMeshError(pStatus, pReason, mCapabilityURL, mNavMeshVersion); } +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // AgentStateResponder //--------------------------------------------------------------------------- @@ -869,6 +793,7 @@ void AgentStateResponder::error(U32 pStatus, const std::string &pReason) { LLPathfindingManager::getInstance()->handleAgentStateError(pStatus, pReason, mCapabilityURL); } +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // LinksetsResponder -- cgit v1.2.3 From de1e1db9600a03ab5b0dc3f04a5bdcee30632f05 Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 13 Jun 2012 10:50:46 -0400 Subject: WIP for path-702. --- indra/newview/llpathfindingmanager.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index f54c9892df..6d0629698a 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -52,6 +52,7 @@ #include "lluuid.h" #include "llviewerregion.h" #include "llweb.h" +#include "llpanelnavmeshrebake.h" #define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" @@ -268,7 +269,7 @@ private: LLPathfindingManager::LLPathfindingManager() : LLSingleton(), - mNavMeshMap() + mNavMeshMap(),mShowNavMeshRebake(false) { } @@ -315,7 +316,15 @@ LLPathfindingNavMesh::navmesh_slot_t LLPathfindingManager::registerNavMeshListen void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) { LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); - + //prep#s#test + LLView* rootp = LLUI::getRootView(); + LLPanel* panel_nmr_container = rootp->getChild("navmesh_rebake_container"); + LLPanelNavMeshRebake* panel_namesh_rebake = LLPanelNavMeshRebake::getInstance(); + panel_nmr_container->addChild( panel_namesh_rebake ); + panel_nmr_container->setVisible( TRUE ); + panel_namesh_rebake->reparent( rootp ); + LLPanelNavMeshRebake::getInstance()->setVisible( TRUE ); + //prep#e if (pRegion == NULL) { navMeshPtr->handleNavMeshNotEnabled(); @@ -955,3 +964,4 @@ void CharactersResponder::error(U32 pStatus, const std::string &pReason) LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList()); mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr); } + -- cgit v1.2.3 From d7b9af3ab398aedde1229e081c2b245c20a3c6d5 Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 13 Jun 2012 11:08:07 -0400 Subject: path-724: xml navmesh rebake button --- indra/newview/llpathfindingmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 6d0629698a..278269b2fa 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -318,7 +318,7 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); //prep#s#test LLView* rootp = LLUI::getRootView(); - LLPanel* panel_nmr_container = rootp->getChild("navmesh_rebake_container"); + LLPanel* panel_nmr_container = rootp->getChild("navmesh_rebake_container"); LLPanelNavMeshRebake* panel_namesh_rebake = LLPanelNavMeshRebake::getInstance(); panel_nmr_container->addChild( panel_namesh_rebake ); panel_nmr_container->setVisible( TRUE ); -- cgit v1.2.3 From 7d5c4d20b9f99b3e7d5781433ed6046678292627 Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 13 Jun 2012 13:30:26 -0400 Subject: WIP: path-722. Posting and responders for navmesh rebaking --- indra/newview/llpathfindingmanager.cpp | 95 ++++++++++++++++++++++++++++++---- 1 file changed, 85 insertions(+), 10 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 278269b2fa..fc296a4b83 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -162,6 +162,23 @@ private: }; #endif // XXX_STINSON_AGENT_STATE_DELETE_ME +//--------------------------------------------------------------------------- +// NavMeshRebakeResponder +//--------------------------------------------------------------------------- +class NavMeshRebakeResponder : public LLHTTPClient::Responder +{ +public: + NavMeshRebakeResponder( const std::string &pCapabilityURL ); + virtual ~NavMeshRebakeResponder(); + + virtual void result( const LLSD &pContent ); + virtual void error( U32 pStatus, const std::string& pReason ); + +protected: + +private: + std::string mCapabilityURL; +}; //--------------------------------------------------------------------------- // LinksetsResponder //--------------------------------------------------------------------------- @@ -269,7 +286,7 @@ private: LLPathfindingManager::LLPathfindingManager() : LLSingleton(), - mNavMeshMap(),mShowNavMeshRebake(false) + mNavMeshMap(), mShowNavMeshRebake(false) { } @@ -316,15 +333,7 @@ LLPathfindingNavMesh::navmesh_slot_t LLPathfindingManager::registerNavMeshListen void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) { LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); - //prep#s#test - LLView* rootp = LLUI::getRootView(); - LLPanel* panel_nmr_container = rootp->getChild("navmesh_rebake_container"); - LLPanelNavMeshRebake* panel_namesh_rebake = LLPanelNavMeshRebake::getInstance(); - panel_nmr_container->addChild( panel_namesh_rebake ); - panel_nmr_container->setVisible( TRUE ); - panel_namesh_rebake->reparent( rootp ); - LLPanelNavMeshRebake::getInstance()->setVisible( TRUE ); - //prep#e + if (pRegion == NULL) { navMeshPtr->handleNavMeshNotEnabled(); @@ -684,6 +693,50 @@ LLViewerRegion *LLPathfindingManager::getCurrentRegion() const return gAgent.getRegion(); } +void LLPathfindingManager::displayNavMeshRebakePanel() +{ + LLView* rootp = LLUI::getRootView(); + LLPanel* panel_nmr_container = rootp->getChild("navmesh_rebake_container"); + LLPanelNavMeshRebake* panel_namesh_rebake = LLPanelNavMeshRebake::getInstance(); + panel_nmr_container->addChild( panel_namesh_rebake ); + panel_nmr_container->setVisible( TRUE ); + panel_namesh_rebake->reparent( rootp ); + LLPanelNavMeshRebake::getInstance()->setVisible( TRUE ); +} + +void LLPathfindingManager::hideNavMeshRebakePanel() +{ + LLPanelNavMeshRebake::getInstance()->setVisible( FALSE ); +} + +void LLPathfindingManager::handleNavMeshRebakeResult( const LLSD &pContent ) +{ + +} + +void LLPathfindingManager::handleNavMeshRebakeError(U32 pStatus, const std::string &pReason, const std::string &pURL) +{ + llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; +} +//prep# +void LLPathfindingManager::triggerNavMeshRebuild() +{ + LLSD mPostData; + std::string url = getNavMeshStatusURLForRegion( getCurrentRegion() ); + + if ( url.empty() ) + { + //prep#fix#error? + } + else + { + LLSD mPostData; + mPostData["command"] = "rebuild"; + LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder( url ); + LLHTTPClient::post( url, mPostData, responder ); + } + +} //--------------------------------------------------------------------------- // LLNavMeshSimStateChangeNode //--------------------------------------------------------------------------- @@ -804,6 +857,28 @@ void AgentStateResponder::error(U32 pStatus, const std::string &pReason) } #endif // XXX_STINSON_AGENT_STATE_DELETE_ME +//--------------------------------------------------------------------------- +// navmesh rebake responder +//--------------------------------------------------------------------------- +NavMeshRebakeResponder::NavMeshRebakeResponder(const std::string &pCapabilityURL ) +: LLHTTPClient::Responder() +, mCapabilityURL( pCapabilityURL ) +{ +} + +NavMeshRebakeResponder::~NavMeshRebakeResponder() +{ +} + +void NavMeshRebakeResponder::result(const LLSD &pContent) +{ + LLPathfindingManager::getInstance()->handleNavMeshRebakeResult( pContent ); +} + +void NavMeshRebakeResponder::error(U32 pStatus, const std::string &pReason) +{ + LLPathfindingManager::getInstance()->handleNavMeshRebakeError( pStatus, pReason, mCapabilityURL ); +} //--------------------------------------------------------------------------- // LinksetsResponder //--------------------------------------------------------------------------- -- cgit v1.2.3 From 9767b5a026ba1b442ad1aa438f5957375a997c14 Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 13 Jun 2012 15:31:44 -0400 Subject: Path-722: Reset buttons to default state. --- indra/newview/llpathfindingmanager.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index fc296a4b83..7ce34fcfcb 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -333,7 +333,7 @@ LLPathfindingNavMesh::navmesh_slot_t LLPathfindingManager::registerNavMeshListen void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) { LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); - + if (pRegion == NULL) { navMeshPtr->handleNavMeshNotEnabled(); @@ -702,31 +702,30 @@ void LLPathfindingManager::displayNavMeshRebakePanel() panel_nmr_container->setVisible( TRUE ); panel_namesh_rebake->reparent( rootp ); LLPanelNavMeshRebake::getInstance()->setVisible( TRUE ); + LLPanelNavMeshRebake::getInstance()->resetButtonStates(); } -void LLPathfindingManager::hideNavMeshRebakePanel() +void LLPathfindingManager::hideNavMeshRebakePanel() { LLPanelNavMeshRebake::getInstance()->setVisible( FALSE ); } -void LLPathfindingManager::handleNavMeshRebakeResult( const LLSD &pContent ) +void LLPathfindingManager::handleNavMeshRebakeError(U32 pStatus, const std::string &pReason, const std::string &pURL) { - + llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; } -void LLPathfindingManager::handleNavMeshRebakeError(U32 pStatus, const std::string &pReason, const std::string &pURL) +void LLPathfindingManager::handleNavMeshRebakeResult( const LLSD &pContent ) { - llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; + hideNavMeshRebakePanel(); } -//prep# + void LLPathfindingManager::triggerNavMeshRebuild() { - LLSD mPostData; std::string url = getNavMeshStatusURLForRegion( getCurrentRegion() ); - if ( url.empty() ) { - //prep#fix#error? + llwarns << "Error with request due to nonexistent URL"< Date: Thu, 14 Jun 2012 16:58:11 -0400 Subject: WIP: path-722. Some agent_state_updates come through (god mode), region crossings, cleanup logic is a TBD, etc.. --- indra/newview/llpathfindingmanager.cpp | 100 ++++++++++++++++----------------- 1 file changed, 49 insertions(+), 51 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 7ce34fcfcb..16283282fb 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -53,6 +53,7 @@ #include "llviewerregion.h" #include "llweb.h" #include "llpanelnavmeshrebake.h" +#include "llenvmanager.h" #define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" @@ -66,11 +67,9 @@ #define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavMeshStatusUpdate" #define SIM_MESSAGE_BODY_FIELD "body" -#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME -#define CAP_SERVICE_AGENT_STATE "AgentPreferences" -#define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects" -#define SIM_MESSAGE_AGENT_STATE_UPDATE "/message/AgentPreferencesUpdate" -#endif // XXX_STINSON_AGENT_STATE_DELETE_ME +#define CAP_SERVICE_AGENT_STATE "AgentState" +#define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects" +#define SIM_MESSAGE_AGENT_STATE_UPDATE "/message/AgentStateUpdate" //--------------------------------------------------------------------------- // LLNavMeshSimStateChangeNode @@ -84,11 +83,10 @@ public: LLHTTPRegistration gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE); -#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME + //--------------------------------------------------------------------------- // LLAgentStateChangeNode //--------------------------------------------------------------------------- - class LLAgentStateChangeNode : public LLHTTPNode { public: @@ -96,7 +94,6 @@ public: }; LLHTTPRegistration gHTTPRegistrationAgentStateChangeNode(SIM_MESSAGE_AGENT_STATE_UPDATE); -#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // NavMeshStatusResponder @@ -140,7 +137,6 @@ private: LLPathfindingNavMeshPtr mNavMeshPtr; }; -#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // AgentStateResponder //--------------------------------------------------------------------------- @@ -148,7 +144,7 @@ private: class AgentStateResponder : public LLHTTPClient::Responder { public: - AgentStateResponder(const std::string &pCapabilityURL, LLPathfindingManager::EAgentState pRequestedAgentState = LLPathfindingManager::kAgentStateUnknown); + AgentStateResponder(const std::string &pCapabilityURL); virtual ~AgentStateResponder(); virtual void result(const LLSD &pContent); @@ -158,9 +154,8 @@ protected: private: std::string mCapabilityURL; - LLPathfindingManager::EAgentState mRequestedAgentState; }; -#endif // XXX_STINSON_AGENT_STATE_DELETE_ME + //--------------------------------------------------------------------------- // NavMeshRebakeResponder @@ -286,12 +281,27 @@ private: LLPathfindingManager::LLPathfindingManager() : LLSingleton(), - mNavMeshMap(), mShowNavMeshRebake(false) + mNavMeshMap(), + mShowNavMeshRebake(false), + mCrossingSlot() { + if ( !mCrossingSlot.connected() ) + { + mCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLPathfindingManager::onRegionBoundaryCrossed, this)); + } +} + +void LLPathfindingManager::onRegionBoundaryCrossed() +{ + displayNavMeshRebakePanel(); } LLPathfindingManager::~LLPathfindingManager() -{ +{ + if (mCrossingSlot.connected()) + { + mCrossingSlot.disconnect(); + } } void LLPathfindingManager::initSystem() @@ -357,12 +367,11 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) } } -#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) { return mAgentStateSignal.connect(pAgentStateCallback); } -#endif // XXX_STINSON_AGENT_STATE_DELETE_ME + void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const { @@ -605,39 +614,31 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion return getNavMeshForRegion(regionUUID); } -#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME void LLPathfindingManager::requestGetAgentState() { - std::string agentStateURL = getAgentStateURLForCurrentRegion(); + std::string agentStateURL = getAgentStateURLForCurrentRegion( getCurrentRegion() ); - if (agentStateURL.empty()) - { - } - else + if ( !agentStateURL.empty() ) { - LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL); - LLHTTPClient::get(agentStateURL, responder); + LLHTTPClient::ResponderPtr responder = new AgentStateResponder( agentStateURL ); + LLHTTPClient::get( agentStateURL, responder ); } } -void LLPathfindingManager::handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState) -{ - 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); - - if ((agentState != pRequestedAgentState)) - { - agentState = kAgentStateError; - llassert(0); - } +void LLPathfindingManager::handleAgentStateResult(const LLSD &pContent) +{ + displayNavMeshRebakePanel(); } void LLPathfindingManager::handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL) { llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; } -#endif // XXX_STINSON_AGENT_STATE_DELETE_ME + +std::string LLPathfindingManager::getAgentStateURLForCurrentRegion(LLViewerRegion *pRegion) const +{ + return getCapabilityURLForRegion( pRegion, CAP_SERVICE_AGENT_STATE ); +} std::string LLPathfindingManager::getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const @@ -750,21 +751,19 @@ void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pConte LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(navMeshStatus); } -#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // 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)); + LLPathfindingManager::getInstance()->handleAgentStateUpdate(); +} + +void LLPathfindingManager::handleAgentStateUpdate() +{ + displayNavMeshRebakePanel(); } -#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // NavMeshStatusResponder @@ -828,15 +827,13 @@ void NavMeshResponder::error(U32 pStatus, const std::string& pReason) mNavMeshPtr->handleNavMeshError(pStatus, pReason, mCapabilityURL, mNavMeshVersion); } -#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // AgentStateResponder //--------------------------------------------------------------------------- -AgentStateResponder::AgentStateResponder(const std::string &pCapabilityURL, LLPathfindingManager::EAgentState pRequestedAgentState) - : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), - mRequestedAgentState(pRequestedAgentState) +AgentStateResponder::AgentStateResponder(const std::string &pCapabilityURL) +: LLHTTPClient::Responder() +, mCapabilityURL(pCapabilityURL) { } @@ -846,14 +843,14 @@ AgentStateResponder::~AgentStateResponder() void AgentStateResponder::result(const LLSD &pContent) { - LLPathfindingManager::getInstance()->handleAgentStateResult(pContent, mRequestedAgentState); + LLPathfindingManager::getInstance()->handleAgentStateResult(pContent); } void AgentStateResponder::error(U32 pStatus, const std::string &pReason) { LLPathfindingManager::getInstance()->handleAgentStateError(pStatus, pReason, mCapabilityURL); } -#endif // XXX_STINSON_AGENT_STATE_DELETE_ME + //--------------------------------------------------------------------------- // navmesh rebake responder @@ -877,6 +874,7 @@ void NavMeshRebakeResponder::error(U32 pStatus, const std::string &pReason) { LLPathfindingManager::getInstance()->handleNavMeshRebakeError( pStatus, pReason, mCapabilityURL ); } + //--------------------------------------------------------------------------- // LinksetsResponder //--------------------------------------------------------------------------- -- cgit v1.2.3 From 72a2538f74fb78d031a8e41c6ca2b8f22c75dac2 Mon Sep 17 00:00:00 2001 From: prep Date: Fri, 15 Jun 2012 13:27:38 -0400 Subject: Fixed bug where rebake navmesh would get drawn ontop of loading screen. --- indra/newview/llpathfindingmanager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 16283282fb..a77d6bcc4c 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -285,10 +285,7 @@ LLPathfindingManager::LLPathfindingManager() mShowNavMeshRebake(false), mCrossingSlot() { - if ( !mCrossingSlot.connected() ) - { - mCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLPathfindingManager::onRegionBoundaryCrossed, this)); - } + } void LLPathfindingManager::onRegionBoundaryCrossed() @@ -616,6 +613,11 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion void LLPathfindingManager::requestGetAgentState() { + if ( !mCrossingSlot.connected() ) + { + mCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLPathfindingManager::onRegionBoundaryCrossed, this)); + } + std::string agentStateURL = getAgentStateURLForCurrentRegion( getCurrentRegion() ); if ( !agentStateURL.empty() ) -- cgit v1.2.3 From b59a82fc8ea5a23a886d3eb5d3c27b7c1d97d8d6 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 18 Jun 2012 17:21:42 -0700 Subject: PATH-705: Creating a path to pull in the state of the current region navmesh without downloading the navmesh binary. --- indra/newview/llpathfindingmanager.cpp | 118 ++++++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 23 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index a77d6bcc4c..674a96a439 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -102,7 +102,7 @@ LLHTTPRegistration gHTTPRegistrationAgentStateChangeNode class NavMeshStatusResponder : public LLHTTPClient::Responder { public: - NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion); + NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly); virtual ~NavMeshStatusResponder(); virtual void result(const LLSD &pContent); @@ -114,6 +114,7 @@ private: std::string mCapabilityURL; LLViewerRegion *mRegion; LLUUID mRegionUUID; + bool mIsGetStatusOnly; }; //--------------------------------------------------------------------------- @@ -282,23 +283,30 @@ private: LLPathfindingManager::LLPathfindingManager() : LLSingleton(), mNavMeshMap(), - mShowNavMeshRebake(false), - mCrossingSlot() + mCrossingSlot(), + mAgentStateSignal(), + mNavMeshSlot() { - } void LLPathfindingManager::onRegionBoundaryCrossed() { + if (mNavMeshSlot.connected()) + { + mNavMeshSlot.disconnect(); + } + LLViewerRegion *currentRegion = getCurrentRegion(); + if (currentRegion != NULL) + { + mNavMeshSlot = registerNavMeshListenerForRegion(currentRegion, boost::bind(&LLPathfindingManager::handleNavMeshStatus, this, _1, _2)); + requestGetNavMeshForRegion(currentRegion, true); + } displayNavMeshRebakePanel(); } LLPathfindingManager::~LLPathfindingManager() { - if (mCrossingSlot.connected()) - { - mCrossingSlot.disconnect(); - } + quitSystem(); } void LLPathfindingManager::initSystem() @@ -307,6 +315,40 @@ void LLPathfindingManager::initSystem() { LLPathingLib::initSystem(); } + + if ( !mCrossingSlot.connected() ) + { + mCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLPathfindingManager::onRegionBoundaryCrossed, this)); + } + + if (mNavMeshSlot.connected()) + { + mNavMeshSlot.disconnect(); + } + LLViewerRegion *currentRegion = getCurrentRegion(); + if (currentRegion != NULL) + { + mNavMeshSlot = registerNavMeshListenerForRegion(currentRegion, boost::bind(&LLPathfindingManager::handleNavMeshStatus, this, _1, _2)); + requestGetNavMeshForRegion(currentRegion, true); + } +} + +void LLPathfindingManager::quitSystem() +{ + if (mNavMeshSlot.connected()) + { + mNavMeshSlot.disconnect(); + } + + if (mCrossingSlot.connected()) + { + mCrossingSlot.disconnect(); + } + + if (LLPathingLib::getInstance() != NULL) + { + LLPathingLib::quitSystem(); + } } bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const @@ -337,7 +379,7 @@ LLPathfindingNavMesh::navmesh_slot_t LLPathfindingManager::registerNavMeshListen return navMeshPtr->registerNavMeshListener(pNavMeshCallback); } -void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) +void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, bool pIsGetStatusOnly) { LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); @@ -348,7 +390,7 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) else if (!pRegion->capabilitiesReceived()) { navMeshPtr->handleNavMeshWaitForRegionLoad(); - pRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetNavMeshForRegion, this, _1)); + pRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetNavMeshForRegion, this, _1, pIsGetStatusOnly)); } else if (!isPathfindingEnabledForRegion(pRegion)) { @@ -359,7 +401,7 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion); llassert(!navMeshStatusURL.empty()); navMeshPtr->handleNavMeshCheckVersion(); - LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); + LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion, pIsGetStatusOnly); LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); } } @@ -518,13 +560,13 @@ void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPt } } -void LLPathfindingManager::handleDeferredGetNavMeshForRegion(const LLUUID &pRegionUUID) +void LLPathfindingManager::handleDeferredGetNavMeshForRegion(const LLUUID &pRegionUUID, bool pIsGetStatusOnly) { LLViewerRegion *currentRegion = getCurrentRegion(); if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID)) { - requestGetNavMeshForRegion(currentRegion); + requestGetNavMeshForRegion(currentRegion, pIsGetStatusOnly); } } @@ -548,7 +590,7 @@ void LLPathfindingManager::handleDeferredGetCharactersForRegion(const LLUUID &pR } } -void LLPathfindingManager::handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion) +void LLPathfindingManager::handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion, bool pIsGetStatusOnly) { LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pNavMeshStatus.getRegionUUID()); @@ -562,6 +604,10 @@ void LLPathfindingManager::handleNavMeshStatusRequest(const LLPathfindingNavMesh { navMeshPtr->handleRefresh(pNavMeshStatus); } + else if (pIsGetStatusOnly) + { + navMeshPtr->handleNavMeshNewVersion(pNavMeshStatus); + } else { sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, pNavMeshStatus); @@ -613,11 +659,6 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion void LLPathfindingManager::requestGetAgentState() { - if ( !mCrossingSlot.connected() ) - { - mCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLPathfindingManager::onRegionBoundaryCrossed, this)); - } - std::string agentStateURL = getAgentStateURLForCurrentRegion( getCurrentRegion() ); if ( !agentStateURL.empty() ) @@ -696,6 +737,36 @@ LLViewerRegion *LLPathfindingManager::getCurrentRegion() const return gAgent.getRegion(); } +void LLPathfindingManager::handleNavMeshStatus(LLPathfindingNavMesh::ENavMeshRequestStatus pRequestStatus, const LLPathfindingNavMeshStatus &pNavMeshStatus) +{ + if (!pNavMeshStatus.isValid()) + { + llinfos << "STINSON DEBUG: navmesh status is invalid" << llendl; + } + else + { + switch (pNavMeshStatus.getStatus()) + { + case LLPathfindingNavMeshStatus::kPending : + llinfos << "STINSON DEBUG: navmesh status is kPending" << llendl; + break; + case LLPathfindingNavMeshStatus::kBuilding : + llinfos << "STINSON DEBUG: navmesh status is kBuilding" << llendl; + break; + case LLPathfindingNavMeshStatus::kComplete : + llinfos << "STINSON DEBUG: navmesh status is kComplete" << llendl; + break; + case LLPathfindingNavMeshStatus::kRepending : + llinfos << "STINSON DEBUG: navmesh status is kRepending" << llendl; + break; + default : + llinfos << "STINSON DEBUG: navmesh status is default" << llendl; + llassert(0); + break; + } + } +} + void LLPathfindingManager::displayNavMeshRebakePanel() { LLView* rootp = LLUI::getRootView(); @@ -771,11 +842,12 @@ void LLPathfindingManager::handleAgentStateUpdate() // NavMeshStatusResponder //--------------------------------------------------------------------------- -NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion) +NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly) : LLHTTPClient::Responder(), mCapabilityURL(pCapabilityURL), mRegion(pRegion), - mRegionUUID() + mRegionUUID(), + mIsGetStatusOnly(pIsGetStatusOnly) { if (mRegion != NULL) { @@ -793,14 +865,14 @@ void NavMeshStatusResponder::result(const LLSD &pContent) llinfos << "STINSON DEBUG: Received requested NavMeshStatus: " << pContent << llendl; #endif // XXX_STINSON_DEBUG_NAVMESH_ZONE LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, pContent); - LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion); + LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly); } void NavMeshStatusResponder::error(U32 pStatus, const std::string& pReason) { llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID); - LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion); + LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly); } //--------------------------------------------------------------------------- -- cgit v1.2.3 From 15d7f3867cc0e88258a032f6bd99daed73b1e135 Mon Sep 17 00:00:00 2001 From: prep Date: Tue, 19 Jun 2012 10:40:03 -0400 Subject: Don't display the rebake navmesh button while SL splash screen is up --- indra/newview/llpathfindingmanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 674a96a439..209176fc0b 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -54,6 +54,7 @@ #include "llweb.h" #include "llpanelnavmeshrebake.h" #include "llenvmanager.h" +#include "llstartup.h" #define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" @@ -835,7 +836,8 @@ void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, c void LLPathfindingManager::handleAgentStateUpdate() { - displayNavMeshRebakePanel(); + //Don't trigger if we are still loading in + if ( LLStartUp::getStartupState() == STATE_STARTED) { displayNavMeshRebakePanel(); } } //--------------------------------------------------------------------------- -- cgit v1.2.3 From eb341068de59c86101aa4fd4031b6cdd7e4bbdc2 Mon Sep 17 00:00:00 2001 From: prep Date: Tue, 19 Jun 2012 10:55:02 -0400 Subject: Path-722: After a successful rebake the rebake navmesh button is reenabled --- indra/newview/llpathfindingmanager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 209176fc0b..f49942ee97 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -756,6 +756,7 @@ void LLPathfindingManager::handleNavMeshStatus(LLPathfindingNavMesh::ENavMeshReq break; case LLPathfindingNavMeshStatus::kComplete : llinfos << "STINSON DEBUG: navmesh status is kComplete" << llendl; + displayNavMeshRebakePanel(); break; case LLPathfindingNavMeshStatus::kRepending : llinfos << "STINSON DEBUG: navmesh status is kRepending" << llendl; -- cgit v1.2.3