aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/newview/llviewerregion.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerregion.cpp90
1 files changed, 90 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index 6378b01..0a8d9a8 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -2,6 +2,8 @@
2 * @file llviewerregion.cpp 2 * @file llviewerregion.cpp
3 * @brief Implementation of the LLViewerRegion class. 3 * @brief Implementation of the LLViewerRegion class.
4 * 4 *
5 * $LicenseInfo:firstyear=2000&license=viewergpl$
6 *
5 * Copyright (c) 2000-2007, Linden Research, Inc. 7 * Copyright (c) 2000-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
@@ -51,6 +54,7 @@
51#include "llfloaterregioninfo.h" 54#include "llfloaterregioninfo.h"
52#include "llhttpnode.h" 55#include "llhttpnode.h"
53#include "llnetmap.h" 56#include "llnetmap.h"
57#include "llsdutil.h"
54#include "llstartup.h" 58#include "llstartup.h"
55#include "llviewerobjectlist.h" 59#include "llviewerobjectlist.h"
56#include "llviewerparceloverlay.h" 60#include "llviewerparceloverlay.h"
@@ -447,6 +451,7 @@ std::string LLViewerRegion::regionFlagsToString(U32 flags)
447 return result; 451 return result;
448} 452}
449 453
454// *TODO:Translate
450char* SIM_ACCESS_STR[] = { "Free Trial", 455char* SIM_ACCESS_STR[] = { "Free Trial",
451 "PG", 456 "PG",
452 "Mature", 457 "Mature",
@@ -825,6 +830,88 @@ BOOL LLViewerRegion::isOwnedGroup(const LLVector3& pos)
825 } 830 }
826} 831}
827 832
833// the new TCP coarse location handler node
834class CoarseLocationUpdate : public LLHTTPNode
835{
836public:
837 virtual void post(
838 ResponsePtr responder,
839 const LLSD& context,
840 const LLSD& input) const
841 {
842 LLHost host(input["sender"].asString());
843 LLViewerRegion* region = gWorldp->getRegion(host);
844 if( !region )
845 {
846 return;
847 }
848
849 S32 target_index = input["body"]["Index"][0]["Prey"].asInteger();
850 S32 you_index = input["body"]["Index"][0]["You" ].asInteger();
851
852 LLDynamicArray<U32>* avatar_locs = &region->mMapAvatars;
853 LLDynamicArray<LLUUID>* avatar_ids = &region->mMapAvatarIDs;
854 avatar_locs->reset();
855 avatar_ids->reset();
856
857 //llinfos << "coarse locations agent[0] " << input["body"]["AgentData"][0]["AgentID"].asUUID() << llendl;
858 //llinfos << "my agent id = " << gAgent.getID() << llendl;
859 //llinfos << ll_pretty_print_sd(input) << llendl;
860
861 LLSD
862 locs = input["body"]["Location"],
863 agents = input["body"]["AgentData"];
864 LLSD::array_iterator
865 locs_it = locs.beginArray(),
866 agents_it = agents.beginArray();
867 BOOL has_agent_data = input["body"].has("AgentData");
868
869 for(int i=0;
870 locs_it != locs.endArray();
871 i++, locs_it++, agents_it++)
872 {
873 U8
874 x = locs_it->get("X").asInteger(),
875 y = locs_it->get("Y").asInteger(),
876 z = locs_it->get("Z").asInteger();
877 // treat the target specially for the map, and don't add you or the target
878 if(i == target_index)
879 {
880 LLVector3d global_pos(region->getOriginGlobal());
881 global_pos.mdV[VX] += (F64)x;
882 global_pos.mdV[VY] += (F64)y;
883 global_pos.mdV[VZ] += (F64)z * 4.0;
884 LLAvatarTracker::instance().setTrackedCoarseLocation(global_pos);
885 }
886 else if( i != you_index)
887 {
888 U32 loc = x << 16 | y << 8 | z; loc = loc;
889 U32 pos = 0x0;
890 pos |= x;
891 pos <<= 8;
892 pos |= y;
893 pos <<= 8;
894 pos |= z;
895 avatar_locs->put(pos);
896 //llinfos << "next pos: " << x << "," << y << "," << z << ": " << pos << llendl;
897 if(has_agent_data) // for backwards compatibility with old message format
898 {
899 LLUUID agent_id(agents_it->get("AgentID").asUUID());
900 //llinfos << "next agent: " << agent_id.asString() << llendl;
901 avatar_ids->put(agent_id);
902 }
903 }
904 }
905 }
906};
907
908// build the coarse location HTTP node under the "/message" URL
909LLHTTPRegistration<CoarseLocationUpdate>
910 gHTTPRegistrationCoarseLocationUpdate(
911 "/message/CoarseLocationUpdate");
912
913
914// the deprecated coarse location handler
828void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg) 915void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg)
829{ 916{
830 //llinfos << "CoarseLocationUpdate" << llendl; 917 //llinfos << "CoarseLocationUpdate" << llendl;
@@ -1274,9 +1361,11 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1274 capabilityNames.append("UntrustedSimulatorMessage"); 1361 capabilityNames.append("UntrustedSimulatorMessage");
1275 capabilityNames.append("ParcelVoiceInfoRequest"); 1362 capabilityNames.append("ParcelVoiceInfoRequest");
1276 capabilityNames.append("ChatSessionRequest"); 1363 capabilityNames.append("ChatSessionRequest");
1364 capabilityNames.append("ViewerStats");
1277 capabilityNames.append("ProvisionVoiceAccountRequest"); 1365 capabilityNames.append("ProvisionVoiceAccountRequest");
1278 capabilityNames.append("ServerReleaseNotes"); 1366 capabilityNames.append("ServerReleaseNotes");
1279 capabilityNames.append("CopyInventoryFromNotecard"); 1367 capabilityNames.append("CopyInventoryFromNotecard");
1368 capabilityNames.append("DispatchRegionInfo");
1280 1369
1281 llinfos << "posting to seed " << url << llendl; 1370 llinfos << "posting to seed " << url << llendl;
1282 1371
@@ -1325,3 +1414,4 @@ void LLViewerRegion::logActiveCapabilities() const
1325 llinfos << "Dumped " << count << " entries." << llendl; 1414 llinfos << "Dumped " << count << " entries." << llendl;
1326} 1415}
1327 1416
1417