diff options
author | prep <prep@lindenlab.com> | 2011-11-17 13:32:04 -0500 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2011-11-17 13:32:04 -0500 |
commit | 378c076d1df5d911e07959638fbd61a9094384d2 (patch) | |
tree | d0e6f8868cc78539b05847d089200c2da68d4746 /indra/newview/llnavmeshstation.cpp | |
parent | 9f996fdc5684a3e55c9f86508979ad943e2eaded (diff) |
WIP: navmesh station posts to a url, responder receives llsd and then has the llpathing library extract and render the navmesh (if desired).
Diffstat (limited to 'indra/newview/llnavmeshstation.cpp')
-rw-r--r-- | indra/newview/llnavmeshstation.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/indra/newview/llnavmeshstation.cpp b/indra/newview/llnavmeshstation.cpp index 3a29730328..6f491c34c9 100644 --- a/indra/newview/llnavmeshstation.cpp +++ b/indra/newview/llnavmeshstation.cpp @@ -30,6 +30,7 @@ #include "LLPathingLib.h"//prep# fixme
#include "llagent.h"
#include "llviewerregion.h"
+#include "llsdutil.h"
//===============================================================================
LLNavMeshStation::LLNavMeshStation()
{
@@ -111,7 +112,17 @@ public: if ( pObserver )
{
llinfos<<"Do something immensely important w/content"<<llendl;
- LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD( content );
+ llinfos<<"LLsd buffer"<<ll_pretty_print_sd(content)<<llendl;
+
+ if ( content.has("navmesh_data") )
+ {
+ LLSD::Binary& stuff = content["navmesh_data"].asBinary();
+ LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD( stuff );
+ }
+ else
+ {
+ llwarns<<"no mesh data "<<llendl;
+ }
}
}
}
@@ -152,30 +163,16 @@ bool LLNavMeshStation::postNavMeshToServer( LLSD& data, const LLHandle<LLNavMesh //===============================================================================
void LLNavMeshStation::downloadNavMeshSrc( const LLHandle<LLNavMeshDownloadObserver>& observerHandle )
{
- mCurlRequest = new LLCurlRequest();
-
if ( mNavMeshDownloadURL.empty() )
{
llinfos << "Unable to upload navmesh because of missing URL" << llendl;
}
else
- {
- LLCurlRequest::headers_t headers;
+ {
LLSD data;
data["agent_id"] = gAgent.getID();
data["region_id"] = gAgent.getRegion()->getRegionID();
- mCurlRequest->post( mNavMeshDownloadURL, headers, data,
- new LLNavMeshDownloadResponder( observerHandle ) );
- do
- {
- mCurlRequest->process();
- //sleep for 10ms to prevent eating a whole core
- apr_sleep(10000);
- } while ( mCurlRequest->getQueued() > 0 );
+ LLHTTPClient::post(mNavMeshDownloadURL, data, new LLNavMeshDownloadResponder( observerHandle ) );
}
-
- delete mCurlRequest;
-
- mCurlRequest = NULL;
}
//===============================================================================
\ No newline at end of file |