aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJonathan Freedman2010-10-07 23:47:39 -0400
committerJonathan Freedman2010-10-07 23:47:39 -0400
commit4adada6fe48a960850639628c0f90e55c848235f (patch)
tree63f616d32f35012fe278a8cdeb9b3e762ecde37a /OpenSim/Region/CoreModules
parentMerge branch 'master' of git://opensimulator.org/git/opensim (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-4adada6fe48a960850639628c0f90e55c848235f.zip
opensim-SC_OLD-4adada6fe48a960850639628c0f90e55c848235f.tar.gz
opensim-SC_OLD-4adada6fe48a960850639628c0f90e55c848235f.tar.bz2
opensim-SC_OLD-4adada6fe48a960850639628c0f90e55c848235f.tar.xz
Merge branch 'master' of git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs31
-rw-r--r--OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml2
-rw-r--r--OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs28
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs46
4 files changed, 80 insertions, 27 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index c1d6cd3..d05cfc2 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -196,13 +196,24 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
196 // currently calls this with multiple items. 196 // currently calls this with multiple items.
197 UUID ret = UUID.Zero; 197 UUID ret = UUID.Zero;
198 198
199 Dictionary<UUID, List<SceneObjectGroup>> deletes =
200 new Dictionary<UUID, List<SceneObjectGroup>>();
201
199 foreach (SceneObjectGroup g in objectGroups) 202 foreach (SceneObjectGroup g in objectGroups)
200 ret = DeleteToInventory(action, folderID, g, remoteClient); 203 {
204 if (!deletes.ContainsKey(g.OwnerID))
205 deletes[g.OwnerID] = new List<SceneObjectGroup>();
206
207 deletes[g.OwnerID].Add(g);
208 }
209
210 foreach (List<SceneObjectGroup> objlist in deletes.Values)
211 ret = DeleteToInventory(action, folderID, objlist, remoteClient);
201 212
202 return ret; 213 return ret;
203 } 214 }
204 215
205 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, 216 private UUID DeleteToInventory(DeRezAction action, UUID folderID,
206 SceneObjectGroup objectGroup, IClientAPI remoteClient) 217 SceneObjectGroup objectGroup, IClientAPI remoteClient)
207 { 218 {
208 UUID assetID = UUID.Zero; 219 UUID assetID = UUID.Zero;
@@ -315,10 +326,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
315 } 326 }
316 else 327 else
317 { 328 {
318 // Catch all. Use lost & found 329 if (remoteClient == null ||
319 // 330 objectGroup.OwnerID != remoteClient.AgentId)
331 {
332 // Taking copy of another person's item. Take to
333 // Objects folder.
334 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
335 }
336 else
337 {
338 // Catch all. Use lost & found
339 //
320 340
321 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); 341 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
342 }
322 } 343 }
323 } 344 }
324 345
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
index e85e4e9..df23eac 100644
--- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
+++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
@@ -76,6 +76,8 @@
76 <RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \ 76 <RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \
77 <RegionModule id="AuthenticationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication.AuthenticationServiceInConnectorModule" /> 77 <RegionModule id="AuthenticationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication.AuthenticationServiceInConnectorModule" />
78 <RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \ 78 <RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \
79 <RegionModule id="MapImageModule" type="OpenSim.Region.CoreModules.World.LegacyMap.MapImageModule" /> \
80 <RegionModule id="Warp3DImageModule" type="OpenSim.Region.CoreModules.World.Warp3DMap.Warp3DImageModule" /> \
79 81
80 </Extension> 82 </Extension>
81 83
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
index 8408bf9..f86c790 100644
--- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
59 public face[] trns; 59 public face[] trns;
60 } 60 }
61 61
62 public class MapImageModule : IMapImageGenerator, IRegionModule 62 public class MapImageModule : IMapImageGenerator, INonSharedRegionModule
63 { 63 {
64 private static readonly ILog m_log = 64 private static readonly ILog m_log =
65 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 65 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -67,6 +67,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
67 private Scene m_scene; 67 private Scene m_scene;
68 private IConfigSource m_config; 68 private IConfigSource m_config;
69 private IMapTileTerrainRenderer terrainRenderer; 69 private IMapTileTerrainRenderer terrainRenderer;
70 private bool m_Enabled = false;
70 71
71 #region IMapImageGenerator Members 72 #region IMapImageGenerator Members
72 73
@@ -132,9 +133,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
132 133
133 #region IRegionModule Members 134 #region IRegionModule Members
134 135
135 public void Initialise(Scene scene, IConfigSource source) 136 public void Initialise(IConfigSource source)
136 { 137 {
137 m_scene = scene;
138 m_config = source; 138 m_config = source;
139 139
140 IConfig startupConfig = m_config.Configs["Startup"]; 140 IConfig startupConfig = m_config.Configs["Startup"];
@@ -142,10 +142,24 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
142 "MapImageModule") 142 "MapImageModule")
143 return; 143 return;
144 144
145 m_Enabled = true;
146 }
147
148 public void AddRegion(Scene scene)
149 {
150 if (!m_Enabled)
151 return;
152
153 m_scene = scene;
154
145 m_scene.RegisterModuleInterface<IMapImageGenerator>(this); 155 m_scene.RegisterModuleInterface<IMapImageGenerator>(this);
146 } 156 }
147 157
148 public void PostInitialise() 158 public void RegionLoaded(Scene scene)
159 {
160 }
161
162 public void RemoveRegion(Scene scene)
149 { 163 {
150 } 164 }
151 165
@@ -158,9 +172,9 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
158 get { return "MapImageModule"; } 172 get { return "MapImageModule"; }
159 } 173 }
160 174
161 public bool IsSharedModule 175 public Type ReplaceableInterface
162 { 176 {
163 get { return false; } 177 get { return null; }
164 } 178 }
165 179
166 #endregion 180 #endregion
@@ -546,7 +560,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
546 return returnpt; 560 return returnpt;
547 } 561 }
548 562
549 public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height) 563 public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures)
550 { 564 {
551 return null; 565 return null;
552 } 566 }
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
index 803a33a..00b506e 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
@@ -49,7 +49,7 @@ using WarpRenderer = global::Warp3D.Warp3D;
49 49
50namespace OpenSim.Region.CoreModules.World.Warp3DMap 50namespace OpenSim.Region.CoreModules.World.Warp3DMap
51{ 51{
52 public class Warp3DImageModule : IMapImageGenerator, IRegionModule 52 public class Warp3DImageModule : IMapImageGenerator, INonSharedRegionModule
53 { 53 {
54 private static readonly UUID TEXTURE_METADATA_MAGIC = new UUID("802dc0e0-f080-4931-8b57-d1be8611c4f3"); 54 private static readonly UUID TEXTURE_METADATA_MAGIC = new UUID("802dc0e0-f080-4931-8b57-d1be8611c4f3");
55 private static readonly Color4 WATER_COLOR = new Color4(29, 71, 95, 216); 55 private static readonly Color4 WATER_COLOR = new Color4(29, 71, 95, 216);
@@ -62,18 +62,28 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
62 private IConfigSource m_config; 62 private IConfigSource m_config;
63 private Dictionary<UUID, Color4> m_colors = new Dictionary<UUID, Color4>(); 63 private Dictionary<UUID, Color4> m_colors = new Dictionary<UUID, Color4>();
64 private bool m_useAntiAliasing = true; // TODO: Make this a config option 64 private bool m_useAntiAliasing = true; // TODO: Make this a config option
65 private bool m_Enabled = false;
65 66
66 #region IRegionModule Members 67 #region IRegionModule Members
67 68
68 public void Initialise(Scene scene, IConfigSource source) 69 public void Initialise(IConfigSource source)
69 { 70 {
70 m_scene = scene;
71 m_config = source; 71 m_config = source;
72 72
73 IConfig startupConfig = m_config.Configs["Startup"]; 73 IConfig startupConfig = m_config.Configs["Startup"];
74 if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule") 74 if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule")
75 return; 75 return;
76 76
77 m_Enabled = true;
78 }
79
80 public void AddRegion(Scene scene)
81 {
82 if (!m_Enabled)
83 return;
84
85 m_scene = scene;
86
77 List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); 87 List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
78 if (renderers.Count > 0) 88 if (renderers.Count > 0)
79 { 89 {
@@ -88,7 +98,11 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
88 m_scene.RegisterModuleInterface<IMapImageGenerator>(this); 98 m_scene.RegisterModuleInterface<IMapImageGenerator>(this);
89 } 99 }
90 100
91 public void PostInitialise() 101 public void RegionLoaded(Scene scene)
102 {
103 }
104
105 public void RemoveRegion(Scene scene)
92 { 106 {
93 } 107 }
94 108
@@ -101,9 +115,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
101 get { return "Warp3DImageModule"; } 115 get { return "Warp3DImageModule"; }
102 } 116 }
103 117
104 public bool IsSharedModule 118 public Type ReplaceableInterface
105 { 119 {
106 get { return false; } 120 get { return null; }
107 } 121 }
108 122
109 #endregion 123 #endregion
@@ -114,16 +128,16 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
114 { 128 {
115 Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f); 129 Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f);
116 Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize); 130 Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize);
117 return CreateMapTile(viewport); 131 return CreateMapTile(viewport, false);
118 } 132 }
119 133
120 public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height) 134 public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures)
121 { 135 {
122 Viewport viewport = new Viewport(camPos, camDir, fov, (float)Constants.RegionSize, 0.1f, width, height); 136 Viewport viewport = new Viewport(camPos, camDir, fov, (float)Constants.RegionSize, 0.1f, width, height);
123 return CreateMapTile(viewport); 137 return CreateMapTile(viewport, useTextures);
124 } 138 }
125 139
126 public Bitmap CreateMapTile(Viewport viewport) 140 public Bitmap CreateMapTile(Viewport viewport, bool useTextures)
127 { 141 {
128 bool drawPrimVolume = true; 142 bool drawPrimVolume = true;
129 bool textureTerrain = true; 143 bool textureTerrain = true;
@@ -184,7 +198,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
184 CreateWater(renderer); 198 CreateWater(renderer);
185 CreateTerrain(renderer, textureTerrain); 199 CreateTerrain(renderer, textureTerrain);
186 if (drawPrimVolume) 200 if (drawPrimVolume)
187 CreateAllPrims(renderer); 201 CreateAllPrims(renderer, useTextures);
188 202
189 renderer.Render(); 203 renderer.Render();
190 Bitmap bitmap = renderer.Scene.getImage(); 204 Bitmap bitmap = renderer.Scene.getImage();
@@ -311,7 +325,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
311 renderer.SetObjectMaterial("Terrain", "TerrainColor"); 325 renderer.SetObjectMaterial("Terrain", "TerrainColor");
312 } 326 }
313 327
314 private void CreateAllPrims(WarpRenderer renderer) 328 private void CreateAllPrims(WarpRenderer renderer, bool useTextures)
315 { 329 {
316 if (m_primMesher == null) 330 if (m_primMesher == null)
317 return; 331 return;
@@ -319,14 +333,15 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
319 m_scene.ForEachSOG( 333 m_scene.ForEachSOG(
320 delegate(SceneObjectGroup group) 334 delegate(SceneObjectGroup group)
321 { 335 {
322 CreatePrim(renderer, group.RootPart); 336 CreatePrim(renderer, group.RootPart, useTextures);
323 foreach (SceneObjectPart child in group.Parts) 337 foreach (SceneObjectPart child in group.Parts)
324 CreatePrim(renderer, child); 338 CreatePrim(renderer, child, useTextures);
325 } 339 }
326 ); 340 );
327 } 341 }
328 342
329 private void CreatePrim(WarpRenderer renderer, SceneObjectPart prim) 343 private void CreatePrim(WarpRenderer renderer, SceneObjectPart prim,
344 bool useTextures)
330 { 345 {
331 const float MIN_SIZE = 2f; 346 const float MIN_SIZE = 2f;
332 347
@@ -357,6 +372,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
357 string primID = prim.UUID.ToString(); 372 string primID = prim.UUID.ToString();
358 373
359 // Create the prim faces 374 // Create the prim faces
375 // TODO: Implement the useTextures flag behavior
360 for (int i = 0; i < renderMesh.Faces.Count; i++) 376 for (int i = 0; i < renderMesh.Faces.Count; i++)
361 { 377 {
362 Face face = renderMesh.Faces[i]; 378 Face face = renderMesh.Faces[i];