diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llinventory/lluserrelations.cpp | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/llinventory/lluserrelations.cpp')
-rw-r--r-- | linden/indra/llinventory/lluserrelations.cpp | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/linden/indra/llinventory/lluserrelations.cpp b/linden/indra/llinventory/lluserrelations.cpp new file mode 100644 index 0000000..e9248c3 --- /dev/null +++ b/linden/indra/llinventory/lluserrelations.cpp | |||
@@ -0,0 +1,108 @@ | |||
1 | /** | ||
2 | * @file lluserrealations.cpp | ||
3 | * @author Phoenix | ||
4 | * @date 2006-10-12 | ||
5 | * @brief Implementation of a simple cache of user relations. | ||
6 | * | ||
7 | * Copyright (c) 2006-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
10 | * to you under the terms of the GNU General Public License, version 2.0 | ||
11 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
12 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
14 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlife.com/developers/opensource/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | */ | ||
29 | |||
30 | #include "linden_common.h" | ||
31 | #include "lluserrelations.h" | ||
32 | |||
33 | // static | ||
34 | const U8 LLRelationship::GRANTED_VISIBLE_MASK = LLRelationship::GRANT_MODIFY_OBJECTS | LLRelationship::GRANT_MAP_LOCATION; | ||
35 | const LLRelationship LLRelationship::DEFAULT_RELATIONSHIP = LLRelationship(GRANT_ONLINE_STATUS, GRANT_ONLINE_STATUS, false); | ||
36 | |||
37 | LLRelationship::LLRelationship() : | ||
38 | mGrantToAgent(0), | ||
39 | mGrantFromAgent(0), | ||
40 | mIsOnline(false) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | LLRelationship::LLRelationship(S32 grant_to, S32 grant_from, bool is_online) : | ||
45 | mGrantToAgent(grant_to), | ||
46 | mGrantFromAgent(grant_from), | ||
47 | mIsOnline(is_online) | ||
48 | { | ||
49 | } | ||
50 | |||
51 | bool LLRelationship::isOnline() const | ||
52 | { | ||
53 | return mIsOnline; | ||
54 | } | ||
55 | |||
56 | void LLRelationship::online(bool is_online) | ||
57 | { | ||
58 | mIsOnline = is_online; | ||
59 | } | ||
60 | |||
61 | bool LLRelationship::isRightGrantedTo(S32 rights) const | ||
62 | { | ||
63 | return ((mGrantToAgent & rights) == rights); | ||
64 | } | ||
65 | |||
66 | bool LLRelationship::isRightGrantedFrom(S32 rights) const | ||
67 | { | ||
68 | return ((mGrantFromAgent & rights) == rights); | ||
69 | } | ||
70 | |||
71 | S32 LLRelationship::getRightsGrantedTo() const | ||
72 | { | ||
73 | return mGrantToAgent; | ||
74 | } | ||
75 | |||
76 | S32 LLRelationship::getRightsGrantedFrom() const | ||
77 | { | ||
78 | return mGrantFromAgent; | ||
79 | } | ||
80 | |||
81 | void LLRelationship::grantRights(S32 to_agent, S32 from_agent) | ||
82 | { | ||
83 | mGrantToAgent |= to_agent; | ||
84 | mGrantFromAgent |= from_agent; | ||
85 | } | ||
86 | |||
87 | void LLRelationship::revokeRights(S32 to_agent, S32 from_agent) | ||
88 | { | ||
89 | mGrantToAgent &= ~to_agent; | ||
90 | mGrantFromAgent &= ~from_agent; | ||
91 | } | ||
92 | |||
93 | |||
94 | |||
95 | /* | ||
96 | bool LLGrantedRights::getNextRights( | ||
97 | LLUUID& agent_id, | ||
98 | S32& to_agent, | ||
99 | S32& from_agent) const | ||
100 | { | ||
101 | rights_map_t::const_iterator iter = mRights.upper_bound(agent_id); | ||
102 | if(iter == mRights.end()) return false; | ||
103 | agent_id = (*iter).first; | ||
104 | to_agent = (*iter).second.mToAgent; | ||
105 | from_agent = (*iter).second.mFromAgent; | ||
106 | return true; | ||
107 | } | ||
108 | */ | ||