diff options
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/EstateManager.cs | 78 | ||||
-rw-r--r-- | OpenSim/Region/Environment/PermissionManager.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 9 |
3 files changed, 97 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs index 3ca9796..d0dbaea 100644 --- a/OpenSim/Region/Environment/EstateManager.cs +++ b/OpenSim/Region/Environment/EstateManager.cs | |||
@@ -44,6 +44,15 @@ namespace OpenSim.Region.Environment | |||
44 | private Scene m_scene; | 44 | private Scene m_scene; |
45 | private RegionInfo m_regInfo; | 45 | private RegionInfo m_regInfo; |
46 | 46 | ||
47 | public enum EstateAccessCodex : uint | ||
48 | { | ||
49 | AccessOptions = 17, | ||
50 | AllowedGroups = 18, | ||
51 | EstateBans = 20, | ||
52 | EstateManagers = 24 | ||
53 | } | ||
54 | |||
55 | |||
47 | public EstateManager(Scene scene, RegionInfo reginfo) | 56 | public EstateManager(Scene scene, RegionInfo reginfo) |
48 | { | 57 | { |
49 | m_scene = scene; | 58 | m_scene = scene; |
@@ -146,7 +155,13 @@ namespace OpenSim.Region.Environment | |||
146 | switch (Helpers.FieldToUTF8String(packet.MethodData.Method)) | 155 | switch (Helpers.FieldToUTF8String(packet.MethodData.Method)) |
147 | { | 156 | { |
148 | case "getinfo": | 157 | case "getinfo": |
158 | |||
159 | |||
149 | sendRegionInfoPacketToAll(); | 160 | sendRegionInfoPacketToAll(); |
161 | if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId)) | ||
162 | { | ||
163 | sendDetailedEstateData(remote_client, packet); | ||
164 | } | ||
150 | break; | 165 | break; |
151 | case "setregioninfo": | 166 | case "setregioninfo": |
152 | if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId)) | 167 | if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId)) |
@@ -189,6 +204,69 @@ namespace OpenSim.Region.Environment | |||
189 | } | 204 | } |
190 | } | 205 | } |
191 | 206 | ||
207 | private void sendDetailedEstateData(IClientAPI remote_client, EstateOwnerMessagePacket packet) | ||
208 | { | ||
209 | |||
210 | LLUUID invoice = packet.MethodData.Invoice; | ||
211 | packet.AgentData.TransactionID = LLUUID.Random(); | ||
212 | packet.MethodData.Method = Helpers.StringToField("estateupdateinfo"); | ||
213 | EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[9]; | ||
214 | |||
215 | for (int i = 0; i < 9; i++) | ||
216 | { | ||
217 | returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock(); | ||
218 | } | ||
219 | |||
220 | //Sending Estate Settings | ||
221 | returnblock[0].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarFirstName + m_scene.RegionInfo.MasterAvatarLastName); | ||
222 | returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString()); | ||
223 | returnblock[2].Parameter = Helpers.IntToBytes((int)m_scene.RegionInfo.EstateSettings.estateID); | ||
224 | returnblock[3].Parameter = Helpers.IntToBytes(269516800); | ||
225 | returnblock[4].Parameter = Helpers.IntToBytes(0); | ||
226 | returnblock[5].Parameter = Helpers.IntToBytes(1); | ||
227 | returnblock[6].Parameter = Helpers.StringToField(LLUUID.Random().ToString()); | ||
228 | returnblock[7].Parameter = Helpers.IntToBytes(1160895077); | ||
229 | returnblock[8].Parameter = Helpers.IntToBytes(1); | ||
230 | packet.ParamList = returnblock; | ||
231 | remote_client.OutPacket(packet, ThrottleOutPacketType.Task); | ||
232 | |||
233 | // Stuck here at the moment The client sends a bunch of getinfo methods that need to be decoded the hard way | ||
234 | //Sending Estate Managers | ||
235 | packet = new EstateOwnerMessagePacket(); | ||
236 | packet.AgentData.TransactionID = LLUUID.Random(); | ||
237 | packet.AgentData.AgentID=remote_client.AgentId; | ||
238 | packet.AgentData.SessionID=remote_client.SessionId; | ||
239 | packet.MethodData.Invoice = invoice; | ||
240 | packet.MethodData.Method = Helpers.StringToField("setaccess"); | ||
241 | |||
242 | LLUUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.estateManagers; | ||
243 | |||
244 | returnblock = new EstateOwnerMessagePacket.ParamListBlock[6+EstateManagers.Length]; | ||
245 | |||
246 | for (int i = 0; i < (6 + EstateManagers.Length); i++) | ||
247 | { | ||
248 | returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock(); | ||
249 | } | ||
250 | int j=0; | ||
251 | returnblock[j].Parameter = Helpers.IntToBytes((int)m_scene.RegionInfo.EstateSettings.estateID); j++; | ||
252 | returnblock[j].Parameter = Helpers.IntToBytes((int)EstateAccessCodex.EstateManagers); j++; | ||
253 | returnblock[j].Parameter = Helpers.IntToBytes(0); j++; | ||
254 | returnblock[j].Parameter = Helpers.IntToBytes(0); j++; | ||
255 | returnblock[j].Parameter = Helpers.IntToBytes(0); j++; | ||
256 | returnblock[j].Parameter = Helpers.IntToBytes(EstateManagers.Length); j++; | ||
257 | for (int i = 0; i < EstateManagers.Length; i++) | ||
258 | { | ||
259 | returnblock[j].Parameter = Helpers.StringToField(EstateManagers[i].ToString()); j++; | ||
260 | } | ||
261 | packet.ParamList = returnblock; | ||
262 | remote_client.OutPacket(packet, ThrottleOutPacketType.Task); | ||
263 | |||
264 | |||
265 | |||
266 | |||
267 | |||
268 | } | ||
269 | |||
192 | private void estateSetRegionInfoHandler(EstateOwnerMessagePacket packet) | 270 | private void estateSetRegionInfoHandler(EstateOwnerMessagePacket packet) |
193 | { | 271 | { |
194 | if (packet.ParamList.Length != 9) | 272 | if (packet.ParamList.Length != 9) |
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs index 76601ec..db1cac5 100644 --- a/OpenSim/Region/Environment/PermissionManager.cs +++ b/OpenSim/Region/Environment/PermissionManager.cs | |||
@@ -83,13 +83,20 @@ namespace OpenSim.Region.Environment | |||
83 | return m_scene.RegionInfo.MasterAvatarAssignedUUID == user; | 83 | return m_scene.RegionInfo.MasterAvatarAssignedUUID == user; |
84 | } | 84 | } |
85 | 85 | ||
86 | protected virtual bool IsEstateManager(LLUUID user) | 86 | public virtual bool IsEstateManager(LLUUID user) |
87 | { | 87 | { |
88 | if (m_bypassPermissions) | 88 | if (m_bypassPermissions) |
89 | { | 89 | { |
90 | return true; | 90 | return true; |
91 | } | 91 | } |
92 | 92 | ||
93 | LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers; | ||
94 | for (int i = 0; i < estatemanagers.Length; i++) | ||
95 | { | ||
96 | if (estatemanagers[i] == user) | ||
97 | return true; | ||
98 | } | ||
99 | |||
93 | return false; | 100 | return false; |
94 | } | 101 | } |
95 | 102 | ||
@@ -414,7 +421,7 @@ namespace OpenSim.Region.Environment | |||
414 | 421 | ||
415 | #region Estate Permissions | 422 | #region Estate Permissions |
416 | 423 | ||
417 | protected virtual bool GenericEstatePermission(LLUUID user) | 424 | public virtual bool GenericEstatePermission(LLUUID user) |
418 | { | 425 | { |
419 | // Default: deny | 426 | // Default: deny |
420 | bool permission = false; | 427 | bool permission = false; |
@@ -439,8 +446,8 @@ namespace OpenSim.Region.Environment | |||
439 | { | 446 | { |
440 | // Since this is potentially going on a grid... | 447 | // Since this is potentially going on a grid... |
441 | 448 | ||
442 | //return GenericEstatePermission(AgentId); | 449 | return GenericEstatePermission(user); |
443 | return m_scene.RegionInfo.MasterAvatarAssignedUUID == user; | 450 | //return m_scene.RegionInfo.MasterAvatarAssignedUUID == user; |
444 | } | 451 | } |
445 | 452 | ||
446 | #endregion | 453 | #endregion |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 9454de0..3aa9583 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -320,7 +320,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
320 | 320 | ||
321 | // TODO: m_animations and m_animationSeqs should always be of the same length. | 321 | // TODO: m_animations and m_animationSeqs should always be of the same length. |
322 | // Move them into an object to (hopefully) avoid threading issues. | 322 | // Move them into an object to (hopefully) avoid threading issues. |
323 | m_animations.Add(Animations.AnimsLLUUID["STAND"]); | 323 | try |
324 | { | ||
325 | m_animations.Add(Animations.AnimsLLUUID["STAND"]); | ||
326 | } | ||
327 | catch (KeyNotFoundException) | ||
328 | { | ||
329 | MainLog.Instance.Warn("AVATAR", "KeyNotFound Exception playing avatar stand animation"); | ||
330 | } | ||
324 | m_animationSeqs.Add(1); | 331 | m_animationSeqs.Add(1); |
325 | 332 | ||
326 | RegisterToEvents(); | 333 | RegisterToEvents(); |