diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-05-01 14:22:58 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-05-01 14:22:58 -0700 |
commit | 852377c676bc3a8183073e41357499f06f40fb1b (patch) | |
tree | 53e8b48d65522b74876432819bc4791796d9ab34 /indra/newview/llpathfindingmanager.cpp | |
parent | 3c18573ed0278b420e06b1c2ce5fc19232332aba (diff) |
Switching the functionality of the linksets and character request handling to no longer return values directly, but rather to report status only through the callbacks.
Diffstat (limited to 'indra/newview/llpathfindingmanager.cpp')
-rw-r--r-- | indra/newview/llpathfindingmanager.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 59cfc398f2..8ce2e71c63 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -397,18 +397,20 @@ void LLPathfindingManager::requestSetAgentState(EAgentState pRequestedAgentState } } -LLPathfindingManager::ERequestStatus LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, linksets_callback_t pLinksetsCallback) const +void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, linksets_callback_t pLinksetsCallback) const { - ERequestStatus status; + LLPathfindingLinksetListPtr emptyLinksetListPtr; std::string objectLinksetsURL = getObjectLinksetsURLForCurrentRegion(); std::string terrainLinksetsURL = getTerrainLinksetsURLForCurrentRegion(); if (objectLinksetsURL.empty() || terrainLinksetsURL.empty()) { - status = kRequestNotEnabled; + pLinksetsCallback(pRequestId, kRequestNotEnabled, emptyLinksetListPtr); } else { + pLinksetsCallback(pRequestId, kRequestStarted, emptyLinksetListPtr); + bool doRequestTerrain = isAllowViewTerrainProperties(); LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, true, doRequestTerrain)); @@ -420,22 +422,18 @@ LLPathfindingManager::ERequestStatus LLPathfindingManager::requestGetLinksets(re LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder); } - - status = kRequestStarted; } - - return status; } -LLPathfindingManager::ERequestStatus LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, LLPathfindingLinksetListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, linksets_callback_t pLinksetsCallback) const +void LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, LLPathfindingLinksetListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, linksets_callback_t pLinksetsCallback) const { - ERequestStatus status = kRequestNotEnabled; + LLPathfindingLinksetListPtr emptyLinksetListPtr; std::string objectLinksetsURL = getObjectLinksetsURLForCurrentRegion(); std::string terrainLinksetsURL = getTerrainLinksetsURLForCurrentRegion(); if (objectLinksetsURL.empty() || terrainLinksetsURL.empty()) { - status = kRequestNotEnabled; + pLinksetsCallback(pRequestId, kRequestNotEnabled, emptyLinksetListPtr); } else { @@ -448,10 +446,12 @@ LLPathfindingManager::ERequestStatus LLPathfindingManager::requestSetLinksets(re if (objectPostData.isUndefined() && terrainPostData.isUndefined()) { - status = kRequestCompleted; + pLinksetsCallback(pRequestId, kRequestCompleted, emptyLinksetListPtr); } else { + pLinksetsCallback(pRequestId, kRequestStarted, emptyLinksetListPtr); + LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, !objectPostData.isUndefined(), !terrainPostData.isUndefined())); if (!objectPostData.isUndefined()) @@ -465,32 +465,26 @@ LLPathfindingManager::ERequestStatus LLPathfindingManager::requestSetLinksets(re LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); LLHTTPClient::put(terrainLinksetsURL, terrainPostData, terrainLinksetsResponder); } - - status = kRequestStarted; } } - - return status; } -LLPathfindingManager::ERequestStatus LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, characters_callback_t pCharactersCallback) const +void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, characters_callback_t pCharactersCallback) const { - ERequestStatus status; + LLPathfindingCharacterListPtr emptyCharacterListPtr; std::string charactersURL = getCharactersURLForCurrentRegion(); if (charactersURL.empty()) { - status = kRequestNotEnabled; + pCharactersCallback(pRequestId, kRequestNotEnabled, emptyCharacterListPtr); } else { + pCharactersCallback(pRequestId, kRequestStarted, emptyCharacterListPtr); + LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback); LLHTTPClient::get(charactersURL, charactersResponder); - - status = kRequestStarted; } - - return status; } void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus) |