diff options
author | Melanie | 2010-03-18 20:09:04 +0000 |
---|---|---|
committer | Melanie | 2010-03-18 20:09:04 +0000 |
commit | 4c2a51b1b5e2169e0f336c56a023c35bcc334cbd (patch) | |
tree | 9fbaf708764f315034a283fd8fedc8afe0864d75 /OpenSim/Region/CoreModules | |
parent | Merge branch 'careminster' into careminster-presence-refactor (diff) | |
parent | Flesh out the new permission method (diff) | |
download | opensim-SC-4c2a51b1b5e2169e0f336c56a023c35bcc334cbd.zip opensim-SC-4c2a51b1b5e2169e0f336c56a023c35bcc334cbd.tar.gz opensim-SC-4c2a51b1b5e2169e0f336c56a023c35bcc334cbd.tar.bz2 opensim-SC-4c2a51b1b5e2169e0f336c56a023c35bcc334cbd.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules')
13 files changed, 193 insertions, 103 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 967c0a1..37cdaae 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -642,7 +642,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
642 | { | 642 | { |
643 | UuidGatherer gatherer = new UuidGatherer(m_AssetService); | 643 | UuidGatherer gatherer = new UuidGatherer(m_AssetService); |
644 | 644 | ||
645 | Dictionary<UUID, int> assets = new Dictionary<UUID, int>(); | 645 | Dictionary<UUID, AssetType> assets = new Dictionary<UUID, AssetType>(); |
646 | foreach (Scene s in m_Scenes) | 646 | foreach (Scene s in m_Scenes) |
647 | { | 647 | { |
648 | StampRegionStatusFile(s.RegionInfo.RegionID); | 648 | StampRegionStatusFile(s.RegionInfo.RegionID); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 3614915..9df6074 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | |||
@@ -89,60 +89,57 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule | |||
89 | get { return true; } | 89 | get { return true; } |
90 | } | 90 | } |
91 | 91 | ||
92 | private void KillAvatar(uint killerObjectLocalID, ScenePresence DeadAvatar) | 92 | private void KillAvatar(uint killerObjectLocalID, ScenePresence deadAvatar) |
93 | { | 93 | { |
94 | string deadAvatarMessage; | ||
95 | ScenePresence killingAvatar = null; | ||
96 | string killingAvatarMessage; | ||
97 | |||
94 | if (killerObjectLocalID == 0) | 98 | if (killerObjectLocalID == 0) |
95 | DeadAvatar.ControllingClient.SendAgentAlertMessage("You committed suicide!", true); | 99 | deadAvatarMessage = "You committed suicide!"; |
96 | else | 100 | else |
97 | { | 101 | { |
98 | bool foundResult = false; | 102 | // Try to get the avatar responsible for the killing |
99 | string resultstring = String.Empty; | 103 | killingAvatar = deadAvatar.Scene.GetScenePresence(killerObjectLocalID); |
100 | ScenePresence[] allav = DeadAvatar.Scene.GetScenePresences(); | 104 | if (killingAvatar == null) |
101 | try | ||
102 | { | 105 | { |
103 | for (int i = 0; i < allav.Length; i++) | 106 | // Try to get the object which was responsible for the killing |
107 | SceneObjectPart part = deadAvatar.Scene.GetSceneObjectPart(killerObjectLocalID); | ||
108 | if (part == null) | ||
104 | { | 109 | { |
105 | ScenePresence av = allav[i]; | 110 | // Cause of death: Unknown |
106 | 111 | deadAvatarMessage = "You died!"; | |
107 | if (av.LocalId == killerObjectLocalID) | ||
108 | { | ||
109 | av.ControllingClient.SendAlertMessage("You fragged " + DeadAvatar.Firstname + " " + DeadAvatar.Lastname); | ||
110 | resultstring = av.Firstname + " " + av.Lastname; | ||
111 | foundResult = true; | ||
112 | } | ||
113 | } | 112 | } |
114 | } catch (InvalidOperationException) | 113 | else |
115 | { | ||
116 | |||
117 | } | ||
118 | |||
119 | if (!foundResult) | ||
120 | { | ||
121 | SceneObjectPart part = DeadAvatar.Scene.GetSceneObjectPart(killerObjectLocalID); | ||
122 | if (part != null) | ||
123 | { | 114 | { |
124 | ScenePresence av = DeadAvatar.Scene.GetScenePresence(part.OwnerID); | 115 | // Try to find the avatar wielding the killing object |
125 | if (av != null) | 116 | killingAvatar = deadAvatar.Scene.GetScenePresence(part.OwnerID); |
126 | { | 117 | if (killingAvatar == null) |
127 | av.ControllingClient.SendAlertMessage("You fragged " + DeadAvatar.Firstname + " " + DeadAvatar.Lastname); | 118 | deadAvatarMessage = String.Format("You impaled yourself on {0} owned by {1}!", part.Name, deadAvatar.Scene.GetUserName(part.OwnerID)); |
128 | resultstring = av.Firstname + " " + av.Lastname; | ||
129 | DeadAvatar.ControllingClient.SendAgentAlertMessage("You got killed by " + resultstring + "!", true); | ||
130 | } | ||
131 | else | 119 | else |
132 | { | 120 | { |
133 | string killer = DeadAvatar.Scene.GetUserName(part.OwnerID); | 121 | killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); |
134 | DeadAvatar.ControllingClient.SendAgentAlertMessage("You impaled yourself on " + part.Name + " owned by " + killer +"!", true); | 122 | deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); |
135 | } | 123 | } |
136 | //DeadAvatar.Scene. part.ObjectOwner | ||
137 | } | ||
138 | else | ||
139 | { | ||
140 | DeadAvatar.ControllingClient.SendAgentAlertMessage("You died!", true); | ||
141 | } | 124 | } |
142 | } | 125 | } |
126 | else | ||
127 | { | ||
128 | killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); | ||
129 | deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); | ||
130 | } | ||
143 | } | 131 | } |
144 | DeadAvatar.Health = 100; | 132 | try |
145 | DeadAvatar.Scene.TeleportClientHome(DeadAvatar.UUID, DeadAvatar.ControllingClient); | 133 | { |
134 | deadAvatar.ControllingClient.SendAgentAlertMessage(deadAvatarMessage, true); | ||
135 | if(killingAvatar != null) | ||
136 | killingAvatar.ControllingClient.SendAlertMessage("You fragged " + deadAvatar.Firstname + " " + deadAvatar.Lastname); | ||
137 | } | ||
138 | catch (InvalidOperationException) | ||
139 | { } | ||
140 | |||
141 | deadAvatar.Health = 100; | ||
142 | deadAvatar.Scene.TeleportClientHome(deadAvatar.UUID, deadAvatar.ControllingClient); | ||
146 | } | 143 | } |
147 | 144 | ||
148 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) | 145 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index b8e013c..c31266c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -87,31 +87,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
87 | 87 | ||
88 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) | 88 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) |
89 | { | 89 | { |
90 | ScenePresence[] presenceList = m_scene.GetScenePresences(); | 90 | ScenePresence presence = m_scene.GetScenePresence(firstName, lastName); |
91 | 91 | if(presence != null) | |
92 | for (int i = 0; i < presenceList.Length; i++) | 92 | presence.ControllingClient.SendAgentAlertMessage(message, modal); |
93 | { | ||
94 | ScenePresence presence = presenceList[i]; | ||
95 | |||
96 | if (presence.Firstname == firstName && presence.Lastname == lastName) | ||
97 | { | ||
98 | presence.ControllingClient.SendAgentAlertMessage(message, modal); | ||
99 | break; | ||
100 | } | ||
101 | } | ||
102 | } | 93 | } |
103 | 94 | ||
104 | public void SendGeneralAlert(string message) | 95 | public void SendGeneralAlert(string message) |
105 | { | 96 | { |
106 | ScenePresence[] presenceList = m_scene.GetScenePresences(); | 97 | m_scene.ForEachScenePresence(delegate(ScenePresence presence) |
107 | |||
108 | for (int i = 0; i < presenceList.Length; i++) | ||
109 | { | 98 | { |
110 | ScenePresence presence = presenceList[i]; | ||
111 | |||
112 | if (!presence.IsChildAgent) | 99 | if (!presence.IsChildAgent) |
113 | presence.ControllingClient.SendAlertMessage(message); | 100 | presence.ControllingClient.SendAlertMessage(message); |
114 | } | 101 | }); |
115 | } | 102 | } |
116 | 103 | ||
117 | public void SendDialogToUser( | 104 | public void SendDialogToUser( |
@@ -179,14 +166,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
179 | public void SendNotificationToUsersInRegion( | 166 | public void SendNotificationToUsersInRegion( |
180 | UUID fromAvatarID, string fromAvatarName, string message) | 167 | UUID fromAvatarID, string fromAvatarName, string message) |
181 | { | 168 | { |
182 | ScenePresence[] presences = m_scene.GetScenePresences(); | 169 | m_scene.ForEachScenePresence(delegate(ScenePresence presence) |
183 | |||
184 | for (int i = 0; i < presences.Length; i++) | ||
185 | { | 170 | { |
186 | ScenePresence presence = presences[i]; | ||
187 | if (!presence.IsChildAgent) | 171 | if (!presence.IsChildAgent) |
188 | presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message); | 172 | presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message); |
189 | } | 173 | }); |
190 | } | 174 | } |
191 | 175 | ||
192 | /// <summary> | 176 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index ef10104..cfe3caa 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
73 | /// <value> | 73 | /// <value> |
74 | /// Used to collect the uuids of the assets that we need to save into the archive | 74 | /// Used to collect the uuids of the assets that we need to save into the archive |
75 | /// </value> | 75 | /// </value> |
76 | protected Dictionary<UUID, int> m_assetUuids = new Dictionary<UUID, int>(); | 76 | protected Dictionary<UUID, AssetType> m_assetUuids = new Dictionary<UUID, AssetType>(); |
77 | 77 | ||
78 | /// <value> | 78 | /// <value> |
79 | /// Used to collect the uuids of the users that we need to save into the archive | 79 | /// Used to collect the uuids of the users that we need to save into the archive |
@@ -305,7 +305,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
305 | } | 305 | } |
306 | 306 | ||
307 | new AssetsRequest( | 307 | new AssetsRequest( |
308 | new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys, | 308 | new AssetsArchiver(m_archiveWriter), m_assetUuids, |
309 | m_scene.AssetService, ReceivedAllAssets).Execute(); | 309 | m_scene.AssetService, ReceivedAllAssets).Execute(); |
310 | } | 310 | } |
311 | 311 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 664f38d..58ce550 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -150,7 +150,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
150 | if (asset != null) | 150 | if (asset != null) |
151 | { | 151 | { |
152 | // OK, now fetch the inside. | 152 | // OK, now fetch the inside. |
153 | Dictionary<UUID, int> ids = new Dictionary<UUID, int>(); | 153 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); |
154 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); | 154 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); |
155 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); | 155 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); |
156 | foreach (UUID uuid in ids.Keys) | 156 | foreach (UUID uuid in ids.Keys) |
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
173 | AssetBase asset = m_scene.AssetService.Get(assetID.ToString()); | 173 | AssetBase asset = m_scene.AssetService.Get(assetID.ToString()); |
174 | if (asset != null) | 174 | if (asset != null) |
175 | { | 175 | { |
176 | Dictionary<UUID, int> ids = new Dictionary<UUID, int>(); | 176 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); |
177 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, string.Empty); | 177 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, string.Empty); |
178 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); | 178 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); |
179 | foreach (UUID uuid in ids.Keys) | 179 | foreach (UUID uuid in ids.Keys) |
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 643764f..678e772 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -285,24 +285,22 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
285 | return; | 285 | return; |
286 | } | 286 | } |
287 | 287 | ||
288 | byte[] assetData; | 288 | byte[] assetData = null; |
289 | AssetBase oldAsset = null; | 289 | AssetBase oldAsset = null; |
290 | 290 | ||
291 | if (BlendWithOldTexture) | 291 | if (BlendWithOldTexture) |
292 | { | 292 | { |
293 | UUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; | 293 | Primitive.TextureEntryFace defaultFace = part.Shape.Textures.DefaultTexture; |
294 | oldAsset = scene.AssetService.Get(lastTextureID.ToString()); | 294 | if (defaultFace != null) |
295 | if (oldAsset != null) | ||
296 | { | ||
297 | assetData = BlendTextures(data, oldAsset.Data, SetNewFrontAlpha, FrontAlpha); | ||
298 | } | ||
299 | else | ||
300 | { | 295 | { |
301 | assetData = new byte[data.Length]; | 296 | oldAsset = scene.AssetService.Get(defaultFace.TextureID.ToString()); |
302 | Array.Copy(data, assetData, data.Length); | 297 | |
298 | if (oldAsset != null) | ||
299 | assetData = BlendTextures(data, oldAsset.Data, SetNewFrontAlpha, FrontAlpha); | ||
303 | } | 300 | } |
304 | } | 301 | } |
305 | else | 302 | |
303 | if (assetData == null) | ||
306 | { | 304 | { |
307 | assetData = new byte[data.Length]; | 305 | assetData = new byte[data.Length]; |
308 | Array.Copy(data, assetData, data.Length); | 306 | Array.Copy(data, assetData, data.Length); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 783d606..e32dbb3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -166,6 +166,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
166 | return m_sceneList[0]; | 166 | return m_sceneList[0]; |
167 | } | 167 | } |
168 | 168 | ||
169 | public ISimulationService GetInnerService() | ||
170 | { | ||
171 | return this; | ||
172 | } | ||
173 | |||
169 | /** | 174 | /** |
170 | * Agent-related communications | 175 | * Agent-related communications |
171 | */ | 176 | */ |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 4d82a05..9e8454f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -156,6 +156,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
156 | return m_localBackend.GetScene(handle); | 156 | return m_localBackend.GetScene(handle); |
157 | } | 157 | } |
158 | 158 | ||
159 | public ISimulationService GetInnerService() | ||
160 | { | ||
161 | return m_localBackend; | ||
162 | } | ||
163 | |||
159 | /** | 164 | /** |
160 | * Agent-related communications | 165 | * Agent-related communications |
161 | */ | 166 | */ |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index b61b341..b25636f 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
100 | /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception> | 100 | /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception> |
101 | public void ArchiveRegion() | 101 | public void ArchiveRegion() |
102 | { | 102 | { |
103 | Dictionary<UUID, int> assetUuids = new Dictionary<UUID, int>(); | 103 | Dictionary<UUID, AssetType> assetUuids = new Dictionary<UUID, AssetType>(); |
104 | 104 | ||
105 | List<EntityBase> entities = m_scene.GetEntities(); | 105 | List<EntityBase> entities = m_scene.GetEntities(); |
106 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 106 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
@@ -142,18 +142,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
142 | 142 | ||
143 | // Make sure that we also request terrain texture assets | 143 | // Make sure that we also request terrain texture assets |
144 | RegionSettings regionSettings = m_scene.RegionInfo.RegionSettings; | 144 | RegionSettings regionSettings = m_scene.RegionInfo.RegionSettings; |
145 | 145 | ||
146 | if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) | 146 | if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) |
147 | assetUuids[regionSettings.TerrainTexture1] = 1; | 147 | assetUuids[regionSettings.TerrainTexture1] = AssetType.Texture; |
148 | 148 | ||
149 | if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) | 149 | if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) |
150 | assetUuids[regionSettings.TerrainTexture2] = 1; | 150 | assetUuids[regionSettings.TerrainTexture2] = AssetType.Texture; |
151 | 151 | ||
152 | if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) | 152 | if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) |
153 | assetUuids[regionSettings.TerrainTexture3] = 1; | 153 | assetUuids[regionSettings.TerrainTexture3] = AssetType.Texture; |
154 | 154 | ||
155 | if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) | 155 | if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) |
156 | assetUuids[regionSettings.TerrainTexture4] = 1; | 156 | assetUuids[regionSettings.TerrainTexture4] = AssetType.Texture; |
157 | 157 | ||
158 | TarArchiveWriter archiveWriter = new TarArchiveWriter(m_saveStream); | 158 | TarArchiveWriter archiveWriter = new TarArchiveWriter(m_saveStream); |
159 | 159 | ||
@@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
168 | m_requestId); | 168 | m_requestId); |
169 | 169 | ||
170 | new AssetsRequest( | 170 | new AssetsRequest( |
171 | new AssetsArchiver(archiveWriter), assetUuids.Keys, | 171 | new AssetsArchiver(archiveWriter), assetUuids, |
172 | m_scene.AssetService, awre.ReceivedAllAssets).Execute(); | 172 | m_scene.AssetService, awre.ReceivedAllAssets).Execute(); |
173 | } | 173 | } |
174 | } | 174 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index c9fce91..4215f97 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
74 | /// <value> | 74 | /// <value> |
75 | /// uuids to request | 75 | /// uuids to request |
76 | /// </value> | 76 | /// </value> |
77 | protected ICollection<UUID> m_uuids; | 77 | protected IDictionary<UUID, AssetType> m_uuids; |
78 | 78 | ||
79 | /// <value> | 79 | /// <value> |
80 | /// Callback used when all the assets requested have been received. | 80 | /// Callback used when all the assets requested have been received. |
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
104 | protected AssetsArchiver m_assetsArchiver; | 104 | protected AssetsArchiver m_assetsArchiver; |
105 | 105 | ||
106 | protected internal AssetsRequest( | 106 | protected internal AssetsRequest( |
107 | AssetsArchiver assetsArchiver, ICollection<UUID> uuids, | 107 | AssetsArchiver assetsArchiver, IDictionary<UUID, AssetType> uuids, |
108 | IAssetService assetService, AssetsRequestCallback assetsRequestCallback) | 108 | IAssetService assetService, AssetsRequestCallback assetsRequestCallback) |
109 | { | 109 | { |
110 | m_assetsArchiver = assetsArchiver; | 110 | m_assetsArchiver = assetsArchiver; |
@@ -132,9 +132,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
132 | return; | 132 | return; |
133 | } | 133 | } |
134 | 134 | ||
135 | foreach (UUID uuid in m_uuids) | 135 | foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids) |
136 | { | 136 | { |
137 | m_assetService.Get(uuid.ToString(), this, AssetRequestCallback); | 137 | m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); |
138 | } | 138 | } |
139 | 139 | ||
140 | m_requestCallbackTimer.Enabled = true; | 140 | m_requestCallbackTimer.Enabled = true; |
@@ -157,7 +157,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
157 | // Calculate which uuids were not found. This is an expensive way of doing it, but this is a failure | 157 | // Calculate which uuids were not found. This is an expensive way of doing it, but this is a failure |
158 | // case anyway. | 158 | // case anyway. |
159 | List<UUID> uuids = new List<UUID>(); | 159 | List<UUID> uuids = new List<UUID>(); |
160 | foreach (UUID uuid in m_uuids) | 160 | foreach (UUID uuid in m_uuids.Keys) |
161 | { | 161 | { |
162 | uuids.Add(uuid); | 162 | uuids.Add(uuid); |
163 | } | 163 | } |
@@ -200,6 +200,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | protected void PreAssetRequestCallback(string fetchedAssetID, object assetType, AssetBase fetchedAsset) | ||
204 | { | ||
205 | // Check for broken asset types and fix them with the AssetType gleaned by UuidGatherer | ||
206 | if (fetchedAsset != null && fetchedAsset.Type == (sbyte)AssetType.Unknown) | ||
207 | { | ||
208 | AssetType type = (AssetType)assetType; | ||
209 | m_log.InfoFormat("[ARCHIVER]: Rewriting broken asset type for {0} to {1}", fetchedAsset.ID, type); | ||
210 | fetchedAsset.Type = (sbyte)type; | ||
211 | } | ||
212 | |||
213 | AssetRequestCallback(fetchedAssetID, this, fetchedAsset); | ||
214 | } | ||
215 | |||
203 | /// <summary> | 216 | /// <summary> |
204 | /// Called back by the asset cache when it has the asset | 217 | /// Called back by the asset cache when it has the asset |
205 | /// </summary> | 218 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index e3bab2d..464d922 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -469,12 +469,10 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
469 | private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID) | 469 | private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID) |
470 | { | 470 | { |
471 | // Get a fresh list that will not change as people get teleported away | 471 | // Get a fresh list that will not change as people get teleported away |
472 | ScenePresence[] presences = m_scene.GetScenePresences(); | 472 | List<ScenePresence> presences = m_scene.GetScenePresences(); |
473 | 473 | ||
474 | for (int i = 0; i < presences.Length; i++) | 474 | foreach(ScenePresence p in presences) |
475 | { | 475 | { |
476 | ScenePresence p = presences[i]; | ||
477 | |||
478 | if (p.UUID != senderID) | 476 | if (p.UUID != senderID) |
479 | { | 477 | { |
480 | // make sure they are still there, we could be working down a long list | 478 | // make sure they are still there, we could be working down a long list |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 38fc250..4dbdb01 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -1276,13 +1276,104 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1276 | 1276 | ||
1277 | private bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene) | 1277 | private bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene) |
1278 | { | 1278 | { |
1279 | if (objects.Count == 0) | ||
1280 | return false; | ||
1281 | |||
1282 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1279 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1283 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1280 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1284 | 1281 | ||
1285 | return GenericObjectPermission(user, objects[0].UUID, false); | 1282 | GroupPowers powers; |
1283 | ILandObject l; | ||
1284 | |||
1285 | ScenePresence sp = scene.GetScenePresence(user); | ||
1286 | if (sp == null) | ||
1287 | return false; | ||
1288 | |||
1289 | IClientAPI client = sp.ControllingClient; | ||
1290 | |||
1291 | foreach (SceneObjectGroup g in new List<SceneObjectGroup>(objects)) | ||
1292 | { | ||
1293 | // Any user can return their own objects at any time | ||
1294 | // | ||
1295 | if (GenericObjectPermission(user, g.UUID, false)) | ||
1296 | continue; | ||
1297 | |||
1298 | // This is a short cut for efficiency. If land is non-null, | ||
1299 | // then all objects are on that parcel and we can save | ||
1300 | // ourselves the checking for each prim. Much faster. | ||
1301 | // | ||
1302 | if (land != null) | ||
1303 | { | ||
1304 | l = land; | ||
1305 | } | ||
1306 | else | ||
1307 | { | ||
1308 | Vector3 pos = g.AbsolutePosition; | ||
1309 | |||
1310 | l = scene.LandChannel.GetLandObject(pos.X, pos.Y); | ||
1311 | } | ||
1312 | |||
1313 | // If it's not over any land, then we can't do a thing | ||
1314 | if (l == null) | ||
1315 | { | ||
1316 | objects.Remove(g); | ||
1317 | continue; | ||
1318 | } | ||
1319 | |||
1320 | // If we own the land outright, then allow | ||
1321 | // | ||
1322 | if (l.LandData.OwnerID == user) | ||
1323 | continue; | ||
1324 | |||
1325 | // Group voodoo | ||
1326 | // | ||
1327 | if (land.LandData.IsGroupOwned) | ||
1328 | { | ||
1329 | powers = (GroupPowers)client.GetGroupPowers(land.LandData.GroupID); | ||
1330 | // Not a group member, or no rights at all | ||
1331 | // | ||
1332 | if (powers == (GroupPowers)0) | ||
1333 | { | ||
1334 | objects.Remove(g); | ||
1335 | continue; | ||
1336 | } | ||
1337 | |||
1338 | // Group deeded object? | ||
1339 | // | ||
1340 | if (g.OwnerID == l.LandData.GroupID && | ||
1341 | (powers & GroupPowers.ReturnGroupOwned) == (GroupPowers)0) | ||
1342 | { | ||
1343 | objects.Remove(g); | ||
1344 | continue; | ||
1345 | } | ||
1346 | |||
1347 | // Group set object? | ||
1348 | // | ||
1349 | if (g.GroupID == l.LandData.GroupID && | ||
1350 | (powers & GroupPowers.ReturnGroupSet) == (GroupPowers)0) | ||
1351 | { | ||
1352 | objects.Remove(g); | ||
1353 | continue; | ||
1354 | } | ||
1355 | |||
1356 | if ((powers & GroupPowers.ReturnNonGroup) == (GroupPowers)0) | ||
1357 | { | ||
1358 | objects.Remove(g); | ||
1359 | continue; | ||
1360 | } | ||
1361 | |||
1362 | // So we can remove all objects from this group land. | ||
1363 | // Fine. | ||
1364 | // | ||
1365 | continue; | ||
1366 | } | ||
1367 | |||
1368 | // By default, we can't remove | ||
1369 | // | ||
1370 | objects.Remove(g); | ||
1371 | } | ||
1372 | |||
1373 | if (objects.Count == 0) | ||
1374 | return false; | ||
1375 | |||
1376 | return true; | ||
1286 | } | 1377 | } |
1287 | 1378 | ||
1288 | private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene) | 1379 | private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene) |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index 285d36a..b71b5f6 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs | |||
@@ -251,13 +251,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
251 | // if you want tree blocks on the map comment the above line and uncomment the below line | 251 | // if you want tree blocks on the map comment the above line and uncomment the below line |
252 | //mapdotspot = Color.PaleGreen; | 252 | //mapdotspot = Color.PaleGreen; |
253 | 253 | ||
254 | if (part.Shape.Textures == null) | 254 | Primitive.TextureEntry textureEntry = part.Shape.Textures; |
255 | continue; | ||
256 | 255 | ||
257 | if (part.Shape.Textures.DefaultTexture == null) | 256 | if (textureEntry == null || textureEntry.DefaultTexture == null) |
258 | continue; | 257 | continue; |
259 | 258 | ||
260 | Color4 texcolor = part.Shape.Textures.DefaultTexture.RGBA; | 259 | Color4 texcolor = textureEntry.DefaultTexture.RGBA; |
261 | 260 | ||
262 | // Not sure why some of these are null, oh well. | 261 | // Not sure why some of these are null, oh well. |
263 | 262 | ||