summaryrefslogtreecommitdiff
path: root/indra/newview/llhomelocationresponder.cpp
diff options
context:
space:
mode:
authorNyx Linden <nyx@lindenlab.com>2013-06-18 16:15:03 -0400
committerNyx Linden <nyx@lindenlab.com>2013-06-18 16:15:03 -0400
commit69b062b90889fe581de0d10d60b979cb7883b4a0 (patch)
tree6286fc967bc0f551a9e67b8377bdfbc743f090b2 /indra/newview/llhomelocationresponder.cpp
parentc67db8e75511de879c69de0faf06a88ac3cc731d (diff)
parent425ff28e4bc38ba3f7bfeade4a72dce4eba63b54 (diff)
merge with viewer-release
Diffstat (limited to 'indra/newview/llhomelocationresponder.cpp')
-rwxr-xr-xindra/newview/llhomelocationresponder.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/indra/newview/llhomelocationresponder.cpp b/indra/newview/llhomelocationresponder.cpp
index 37428c4a44..b1286cccf2 100755
--- a/indra/newview/llhomelocationresponder.cpp
+++ b/indra/newview/llhomelocationresponder.cpp
@@ -33,71 +33,76 @@
#include "llagent.h"
#include "llviewerregion.h"
-void LLHomeLocationResponder::result( const LLSD& content )
+void LLHomeLocationResponder::httpSuccess()
{
+ const LLSD& content = getContent();
LLVector3 agent_pos;
bool error = true;
-
+
do {
-
+
// was the call to /agent/<agent-id>/home-location successful?
// If not, we keep error set to true
if( ! content.has("success") )
{
break;
}
-
+
if( 0 != strncmp("true", content["success"].asString().c_str(), 4 ) )
{
break;
}
-
+
// did the simulator return a "justified" home location?
// If no, we keep error set to true
if( ! content.has( "HomeLocation" ) )
{
break;
}
-
+
if( ! content["HomeLocation"].has("LocationPos") )
{
break;
}
-
+
if( ! content["HomeLocation"]["LocationPos"].has("X") )
{
break;
}
agent_pos.mV[VX] = content["HomeLocation"]["LocationPos"]["X"].asInteger();
-
+
if( ! content["HomeLocation"]["LocationPos"].has("Y") )
{
break;
}
agent_pos.mV[VY] = content["HomeLocation"]["LocationPos"]["Y"].asInteger();
-
+
if( ! content["HomeLocation"]["LocationPos"].has("Z") )
{
break;
}
agent_pos.mV[VZ] = content["HomeLocation"]["LocationPos"]["Z"].asInteger();
-
+
error = false;
} while( 0 );
-
- if( ! error )
+
+ if( error )
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Invalid server response content", content);
+ }
+ else
{
llinfos << "setting home position" << llendl;
-
+
LLViewerRegion *viewer_region = gAgent.getRegion();
gAgent.setHomePosRegion( viewer_region->getHandle(), agent_pos );
}
}
-void LLHomeLocationResponder::errorWithContent( U32 status, const std::string& reason, const LLSD& content )
+void LLHomeLocationResponder::httpFailure()
{
- llwarns << "LLHomeLocationResponder error [status:" << status << "]: " << content << llendl;
+ llwarns << dumpResponse() << llendl;
}