diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llagent.cpp | 96 |
1 files changed, 85 insertions, 11 deletions
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index bf54472..d825704 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp | |||
@@ -2,6 +2,8 @@ | |||
2 | * @file llagent.cpp | 2 | * @file llagent.cpp |
3 | * @brief LLAgent class implementation | 3 | * @brief LLAgent class implementation |
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 7 | * Copyright (c) 2001-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" |
@@ -48,6 +51,7 @@ | |||
48 | #include "llquaternion.h" | 51 | #include "llquaternion.h" |
49 | #include "v3math.h" | 52 | #include "v3math.h" |
50 | #include "v4math.h" | 53 | #include "v4math.h" |
54 | #include "llsdutil.h" | ||
51 | //#include "vmath.h" | 55 | //#include "vmath.h" |
52 | 56 | ||
53 | #include "imageids.h" | 57 | #include "imageids.h" |
@@ -1857,7 +1861,7 @@ void LLAgent::cameraOrbitIn(const F32 meters) | |||
1857 | if (new_distance > max_distance) | 1861 | if (new_distance > max_distance) |
1858 | { | 1862 | { |
1859 | // Unless camera is unlocked | 1863 | // Unless camera is unlocked |
1860 | if (!LLViewerCamera::sDisableCameraConstraints) | 1864 | if (!gSavedSettings.getBOOL("DisableCameraConstraints")) |
1861 | { | 1865 | { |
1862 | return; | 1866 | return; |
1863 | } | 1867 | } |
@@ -2034,7 +2038,8 @@ void LLAgent::setAFK() | |||
2034 | gAwayTimer.start(); | 2038 | gAwayTimer.start(); |
2035 | if (gAFKMenu) | 2039 | if (gAFKMenu) |
2036 | { | 2040 | { |
2037 | gAFKMenu->setLabel("Set Not Away"); | 2041 | //*TODO:Translate |
2042 | gAFKMenu->setLabel(LLString("Set Not Away")); | ||
2038 | } | 2043 | } |
2039 | } | 2044 | } |
2040 | } | 2045 | } |
@@ -2057,7 +2062,8 @@ void LLAgent::clearAFK() | |||
2057 | clearControlFlags(AGENT_CONTROL_AWAY); | 2062 | clearControlFlags(AGENT_CONTROL_AWAY); |
2058 | if (gAFKMenu) | 2063 | if (gAFKMenu) |
2059 | { | 2064 | { |
2060 | gAFKMenu->setLabel("Set Away"); | 2065 | //*TODO:Translate |
2066 | gAFKMenu->setLabel(LLString("Set Away")); | ||
2061 | } | 2067 | } |
2062 | } | 2068 | } |
2063 | } | 2069 | } |
@@ -2079,7 +2085,8 @@ void LLAgent::setBusy() | |||
2079 | mIsBusy = TRUE; | 2085 | mIsBusy = TRUE; |
2080 | if (gBusyMenu) | 2086 | if (gBusyMenu) |
2081 | { | 2087 | { |
2082 | gBusyMenu->setLabel("Set Not Busy"); | 2088 | //*TODO:Translate |
2089 | gBusyMenu->setLabel(LLString("Set Not Busy")); | ||
2083 | } | 2090 | } |
2084 | if (gFloaterMute) | 2091 | if (gFloaterMute) |
2085 | { | 2092 | { |
@@ -2096,7 +2103,8 @@ void LLAgent::clearBusy() | |||
2096 | sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_STOP); | 2103 | sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_STOP); |
2097 | if (gBusyMenu) | 2104 | if (gBusyMenu) |
2098 | { | 2105 | { |
2099 | gBusyMenu->setLabel("Set Busy"); | 2106 | //*TODO:Translate |
2107 | gBusyMenu->setLabel(LLString("Set Busy")); | ||
2100 | } | 2108 | } |
2101 | if (gFloaterMute) | 2109 | if (gFloaterMute) |
2102 | { | 2110 | { |
@@ -3773,7 +3781,7 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit) | |||
3773 | camera_position_global = focusPosGlobal + mCameraFocusOffset; | 3781 | camera_position_global = focusPosGlobal + mCameraFocusOffset; |
3774 | } | 3782 | } |
3775 | 3783 | ||
3776 | if (!LLViewerCamera::sDisableCameraConstraints && !gAgent.isGodlike()) | 3784 | if (!gSavedSettings.getBOOL("DisableCameraConstraints") && !gAgent.isGodlike()) |
3777 | { | 3785 | { |
3778 | LLViewerRegion* regionp = gWorldPointer->getRegionFromPosGlobal( | 3786 | LLViewerRegion* regionp = gWorldPointer->getRegionFromPosGlobal( |
3779 | camera_position_global); | 3787 | camera_position_global); |
@@ -3897,7 +3905,7 @@ F32 LLAgent::getCameraMinOffGround() | |||
3897 | } | 3905 | } |
3898 | else | 3906 | else |
3899 | { | 3907 | { |
3900 | if (LLViewerCamera::sDisableCameraConstraints) | 3908 | if (gSavedSettings.getBOOL("DisableCameraConstraints")) |
3901 | { | 3909 | { |
3902 | return -1000.f; | 3910 | return -1000.f; |
3903 | } | 3911 | } |
@@ -4828,7 +4836,7 @@ BOOL LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution) | |||
4828 | return FALSE; | 4836 | return FALSE; |
4829 | } | 4837 | } |
4830 | 4838 | ||
4831 | BOOL LLAgent::setGroupAcceptNotices(const LLUUID& group_id, BOOL accept_notices) | 4839 | BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile) |
4832 | { | 4840 | { |
4833 | S32 count = mGroups.count(); | 4841 | S32 count = mGroups.count(); |
4834 | for(S32 i = 0; i < count; ++i) | 4842 | for(S32 i = 0; i < count; ++i) |
@@ -4836,6 +4844,7 @@ BOOL LLAgent::setGroupAcceptNotices(const LLUUID& group_id, BOOL accept_notices) | |||
4836 | if(mGroups.get(i).mID == group_id) | 4844 | if(mGroups.get(i).mID == group_id) |
4837 | { | 4845 | { |
4838 | mGroups.get(i).mAcceptNotices = accept_notices; | 4846 | mGroups.get(i).mAcceptNotices = accept_notices; |
4847 | mGroups.get(i).mListInProfile = list_in_profile; | ||
4839 | LLMessageSystem* msg = gMessageSystem; | 4848 | LLMessageSystem* msg = gMessageSystem; |
4840 | msg->newMessage("SetGroupAcceptNotices"); | 4849 | msg->newMessage("SetGroupAcceptNotices"); |
4841 | msg->nextBlock("AgentData"); | 4850 | msg->nextBlock("AgentData"); |
@@ -4844,6 +4853,8 @@ BOOL LLAgent::setGroupAcceptNotices(const LLUUID& group_id, BOOL accept_notices) | |||
4844 | msg->nextBlock("Data"); | 4853 | msg->nextBlock("Data"); |
4845 | msg->addUUID("GroupID", group_id); | 4854 | msg->addUUID("GroupID", group_id); |
4846 | msg->addBOOL("AcceptNotices", accept_notices); | 4855 | msg->addBOOL("AcceptNotices", accept_notices); |
4856 | msg->nextBlock("NewData"); | ||
4857 | msg->addBOOL("ListInProfile", list_in_profile); | ||
4847 | sendReliableMessage(); | 4858 | sendReliableMessage(); |
4848 | return TRUE; | 4859 | return TRUE; |
4849 | } | 4860 | } |
@@ -4881,7 +4892,7 @@ void LLAgent::buildLocationString(std::string& str) | |||
4881 | 4892 | ||
4882 | // create a defult name and description for the landmark | 4893 | // create a defult name and description for the landmark |
4883 | std::string buffer; | 4894 | std::string buffer; |
4884 | if( !strcmp("", gParcelMgr->getAgentParcelName()) ) | 4895 | if( gParcelMgr->getAgentParcelName().empty() ) |
4885 | { | 4896 | { |
4886 | // the parcel doesn't have a name | 4897 | // the parcel doesn't have a name |
4887 | buffer = llformat("%.32s (%d, %d, %d)", | 4898 | buffer = llformat("%.32s (%d, %d, %d)", |
@@ -4892,7 +4903,7 @@ void LLAgent::buildLocationString(std::string& str) | |||
4892 | { | 4903 | { |
4893 | // the parcel has a name, so include it in the landmark name | 4904 | // the parcel has a name, so include it in the landmark name |
4894 | buffer = llformat("%.32s, %.32s (%d, %d, %d)", | 4905 | buffer = llformat("%.32s, %.32s (%d, %d, %d)", |
4895 | gParcelMgr->getAgentParcelName(), | 4906 | gParcelMgr->getAgentParcelName().c_str(), |
4896 | getRegion()->getName().c_str(), | 4907 | getRegion()->getName().c_str(), |
4897 | pos_x, pos_y, pos_z); | 4908 | pos_x, pos_y, pos_z); |
4898 | } | 4909 | } |
@@ -5197,6 +5208,70 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **) | |||
5197 | 5208 | ||
5198 | } | 5209 | } |
5199 | 5210 | ||
5211 | class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode | ||
5212 | { | ||
5213 | virtual void post( | ||
5214 | LLHTTPNode::ResponsePtr response, | ||
5215 | const LLSD& context, | ||
5216 | const LLSD& input) const | ||
5217 | { | ||
5218 | LLSD body = input["body"]; | ||
5219 | if(body.has("body")) | ||
5220 | body = body["body"]; | ||
5221 | LLUUID agent_id = body["AgentData"][0]["AgentID"].asUUID(); | ||
5222 | |||
5223 | if (agent_id != gAgentID) | ||
5224 | { | ||
5225 | llwarns << "processAgentGroupDataUpdate for agent other than me" << llendl; | ||
5226 | return; | ||
5227 | } | ||
5228 | |||
5229 | LLSD group_data = body["GroupData"]; | ||
5230 | |||
5231 | LLSD::array_iterator iter_group = | ||
5232 | group_data.beginArray(); | ||
5233 | LLSD::array_iterator end_group = | ||
5234 | group_data.endArray(); | ||
5235 | int group_index = 0; | ||
5236 | for(; iter_group != end_group; ++iter_group) | ||
5237 | { | ||
5238 | |||
5239 | LLGroupData group; | ||
5240 | S32 index = -1; | ||
5241 | bool need_floater_update = false; | ||
5242 | |||
5243 | group.mID = (*iter_group)["GroupID"].asUUID(); | ||
5244 | group.mPowers = ll_U64_from_sd((*iter_group)["GroupPowers"]); | ||
5245 | group.mAcceptNotices = (*iter_group)["AcceptNotices"].asBoolean(); | ||
5246 | group.mListInProfile = body["NewGroupData"][group_index]["ListInProfile"].asBoolean(); | ||
5247 | group.mInsigniaID = (*iter_group)["GroupInsigniaID"].asUUID(); | ||
5248 | group.mName = (*iter_group)["GroupName"].asString(); | ||
5249 | group.mContribution = (*iter_group)["Contribution"].asInteger(); | ||
5250 | |||
5251 | group_index++; | ||
5252 | |||
5253 | if(group.mID.notNull()) | ||
5254 | { | ||
5255 | need_floater_update = true; | ||
5256 | // Remove the group if it already exists remove it and add the new data to pick up changes. | ||
5257 | index = gAgent.mGroups.find(group); | ||
5258 | if (index != -1) | ||
5259 | { | ||
5260 | gAgent.mGroups.remove(index); | ||
5261 | } | ||
5262 | gAgent.mGroups.put(group); | ||
5263 | } | ||
5264 | if (need_floater_update) | ||
5265 | { | ||
5266 | update_group_floaters(group.mID); | ||
5267 | } | ||
5268 | } | ||
5269 | } | ||
5270 | }; | ||
5271 | |||
5272 | LLHTTPRegistration<LLAgentGroupDataUpdateViewerNode > | ||
5273 | gHTTPRegistrationAgentGroupDataUpdateViewerNode ("/message/AgentGroupDataUpdate"); | ||
5274 | |||
5200 | // static | 5275 | // static |
5201 | void LLAgent::processAgentDataUpdate(LLMessageSystem *msg, void **) | 5276 | void LLAgent::processAgentDataUpdate(LLMessageSystem *msg, void **) |
5202 | { | 5277 | { |
@@ -7289,5 +7364,4 @@ void LLAgent::parseTeleportMessages(const LLString& xml_filename) | |||
7289 | }//end for (all message sets in xml file) | 7364 | }//end for (all message sets in xml file) |
7290 | } | 7365 | } |
7291 | 7366 | ||
7292 | |||
7293 | // EOF | 7367 | // EOF |