diff options
author | Melanie | 2012-04-11 23:35:27 +0100 |
---|---|---|
committer | Melanie | 2012-04-11 23:35:27 +0100 |
commit | 4a67e8b98fd6ec2b2a7e390256e0c3ef7aa21753 (patch) | |
tree | 28253aa39e6bf11e8f814d6818f727e5f27eb036 /OpenSim/Region/CoreModules | |
parent | Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into ... (diff) | |
parent | HGFriendsModule: Type casts to fix compile error (diff) | |
download | opensim-SC-4a67e8b98fd6ec2b2a7e390256e0c3ef7aa21753.zip opensim-SC-4a67e8b98fd6ec2b2a7e390256e0c3ef7aa21753.tar.gz opensim-SC-4a67e8b98fd6ec2b2a7e390256e0c3ef7aa21753.tar.bz2 opensim-SC-4a67e8b98fd6ec2b2a7e390256e0c3ef7aa21753.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Framework/Interfaces/IEstateModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules')
4 files changed, 64 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index f64c161..fc6325d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | protected void InitModule(IConfigSource config) | 165 | protected virtual void InitModule(IConfigSource config) |
166 | { | 166 | { |
167 | IConfig friendsConfig = config.Configs["Friends"]; | 167 | IConfig friendsConfig = config.Configs["Friends"]; |
168 | if (friendsConfig != null) | 168 | if (friendsConfig != null) |
@@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
546 | } | 546 | } |
547 | } | 547 | } |
548 | 548 | ||
549 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) | 549 | protected virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) |
550 | { | 550 | { |
551 | if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered) | 551 | if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered) |
552 | { | 552 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 9a6d277..3728b85 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -50,6 +50,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
50 | { | 50 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | private int m_levelHGFriends = 0; | ||
54 | |||
53 | IUserManagement m_uMan; | 55 | IUserManagement m_uMan; |
54 | public IUserManagement UserManagementModule | 56 | public IUserManagement UserManagementModule |
55 | { | 57 | { |
@@ -87,6 +89,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
87 | m_StatusNotifier = new HGStatusNotifier(this); | 89 | m_StatusNotifier = new HGStatusNotifier(this); |
88 | } | 90 | } |
89 | 91 | ||
92 | protected override void InitModule(IConfigSource config) | ||
93 | { | ||
94 | base.InitModule(config); | ||
95 | |||
96 | // Additionally to the base method | ||
97 | IConfig friendsConfig = config.Configs["HGFriendsModule"]; | ||
98 | if (friendsConfig != null) | ||
99 | { | ||
100 | m_levelHGFriends = friendsConfig.GetInt("LevelHGFriends", 0); | ||
101 | |||
102 | // TODO: read in all config variables pertaining to | ||
103 | // HG friendship permissions | ||
104 | } | ||
105 | } | ||
106 | |||
90 | #endregion | 107 | #endregion |
91 | 108 | ||
92 | #region IFriendsSimConnector | 109 | #region IFriendsSimConnector |
@@ -105,6 +122,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
105 | 122 | ||
106 | #endregion | 123 | #endregion |
107 | 124 | ||
125 | protected override void OnInstantMessage(IClientAPI client, GridInstantMessage im) | ||
126 | { | ||
127 | if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered) | ||
128 | { | ||
129 | // we got a friendship offer | ||
130 | UUID principalID = new UUID(im.fromAgentID); | ||
131 | UUID friendID = new UUID(im.toAgentID); | ||
132 | |||
133 | // Check if friendID is foreigner and if principalID has the permission | ||
134 | // to request friendships with foreigners. If not, return immediately. | ||
135 | if (!UserManagementModule.IsLocalGridUser(friendID)) | ||
136 | { | ||
137 | ScenePresence avatar = null; | ||
138 | ((Scene)client.Scene).TryGetScenePresence(principalID, out avatar); | ||
139 | |||
140 | if (avatar == null) | ||
141 | return; | ||
142 | |||
143 | if (avatar.UserLevel < m_levelHGFriends) | ||
144 | { | ||
145 | client.SendAgentAlertMessage("Unable to send friendship invitation to foreigner. Insufficient permissions.", false); | ||
146 | return; | ||
147 | } | ||
148 | } | ||
149 | } | ||
150 | |||
151 | base.OnInstantMessage(client, im); | ||
152 | } | ||
153 | |||
108 | protected override void OnApproveFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders) | 154 | protected override void OnApproveFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders) |
109 | { | 155 | { |
110 | // Update the local cache. Yes, we need to do it right here | 156 | // Update the local cache. Yes, we need to do it right here |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 1e743c3..366e02d 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -168,12 +168,18 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
168 | sendRegionInfoPacketToAll(); | 168 | sendRegionInfoPacketToAll(); |
169 | } | 169 | } |
170 | 170 | ||
171 | public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, UUID texture) | 171 | public void setEstateTerrainBaseTexture(int level, UUID texture) |
172 | { | ||
173 | setEstateTerrainBaseTexture(null, level, texture); | ||
174 | sendRegionHandshakeToAll(); | ||
175 | } | ||
176 | |||
177 | public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int level, UUID texture) | ||
172 | { | 178 | { |
173 | if (texture == UUID.Zero) | 179 | if (texture == UUID.Zero) |
174 | return; | 180 | return; |
175 | 181 | ||
176 | switch (corner) | 182 | switch (level) |
177 | { | 183 | { |
178 | case 0: | 184 | case 0: |
179 | Scene.RegionInfo.RegionSettings.TerrainTexture1 = texture; | 185 | Scene.RegionInfo.RegionSettings.TerrainTexture1 = texture; |
@@ -193,6 +199,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
193 | sendRegionInfoPacketToAll(); | 199 | sendRegionInfoPacketToAll(); |
194 | } | 200 | } |
195 | 201 | ||
202 | public void setEstateTerrainTextureHeights(int corner, float lowValue, float highValue) | ||
203 | { | ||
204 | setEstateTerrainTextureHeights(null, corner, lowValue, highValue); | ||
205 | } | ||
206 | |||
196 | public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue) | 207 | public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue) |
197 | { | 208 | { |
198 | switch (corner) | 209 | switch (corner) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 509c4d7..9b2ddfd 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -447,7 +447,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
447 | { | 447 | { |
448 | bool isMember; | 448 | bool isMember; |
449 | if (m_groupMemberCache.TryGetValue(avatar, out isMember)) | 449 | if (m_groupMemberCache.TryGetValue(avatar, out isMember)) |
450 | { | ||
451 | m_groupMemberCache.Update(avatar, isMember, m_groupMemberCacheTimeout); | ||
450 | return isMember; | 452 | return isMember; |
453 | } | ||
451 | 454 | ||
452 | IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); | 455 | IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); |
453 | if (groupsModule == null) | 456 | if (groupsModule == null) |