diff options
author | Jonathan Freedman | 2010-11-05 19:10:02 -0700 |
---|---|---|
committer | Jonathan Freedman | 2010-11-05 19:10:02 -0700 |
commit | 4f40374464899dad82abdb9c36ea863ceac0d83f (patch) | |
tree | a9b116ccca55fb07b8c79ab7f6fdfafc8466d740 /OpenSim/Region/CoreModules | |
parent | Merge branch 'master' into mantis5110 (diff) | |
parent | Merge branch 'master' of /var/git/opensim/ (diff) | |
download | opensim-SC-4f40374464899dad82abdb9c36ea863ceac0d83f.zip opensim-SC-4f40374464899dad82abdb9c36ea863ceac0d83f.tar.gz opensim-SC-4f40374464899dad82abdb9c36ea863ceac0d83f.tar.bz2 opensim-SC-4f40374464899dad82abdb9c36ea863ceac0d83f.tar.xz |
Merge git://github.com/opensim/opensim into mantis5110
Diffstat (limited to 'OpenSim/Region/CoreModules')
5 files changed, 78 insertions, 50 deletions
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index 412dbb6..88f392d 100644 --- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs +++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs | |||
@@ -194,7 +194,8 @@ namespace OpenSim.Region.CoreModules.World.LightShare | |||
194 | } | 194 | } |
195 | private void EventManager_OnSaveNewWindlightProfile() | 195 | private void EventManager_OnSaveNewWindlightProfile() |
196 | { | 196 | { |
197 | m_scene.ForEachScenePresence(SendProfileToClient); | 197 | if (m_scene.RegionInfo.WindlightSettings.valid) |
198 | m_scene.ForEachScenePresence(SendProfileToClient); | ||
198 | } | 199 | } |
199 | 200 | ||
200 | public void PostInitialise() | 201 | public void PostInitialise() |
diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index c23cea5..ed3e516 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs | |||
@@ -176,44 +176,44 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | |||
176 | stream = response.GetResponseStream(); | 176 | stream = response.GetResponseStream(); |
177 | if (stream != null) | 177 | if (stream != null) |
178 | { | 178 | { |
179 | Bitmap image = new Bitmap(stream); | ||
180 | Size newsize; | ||
181 | |||
182 | // TODO: make this a bit less hard coded | ||
183 | if ((image.Height < 64) && (image.Width < 64)) | ||
184 | { | ||
185 | newsize = new Size(32, 32); | ||
186 | } | ||
187 | else if ((image.Height < 128) && (image.Width < 128)) | ||
188 | { | ||
189 | newsize = new Size(64, 64); | ||
190 | } | ||
191 | else if ((image.Height < 256) && (image.Width < 256)) | ||
192 | { | ||
193 | newsize = new Size(128, 128); | ||
194 | } | ||
195 | else if ((image.Height < 512 && image.Width < 512)) | ||
196 | { | ||
197 | newsize = new Size(256, 256); | ||
198 | } | ||
199 | else if ((image.Height < 1024 && image.Width < 1024)) | ||
200 | { | ||
201 | newsize = new Size(512, 512); | ||
202 | } | ||
203 | else | ||
204 | { | ||
205 | newsize = new Size(1024, 1024); | ||
206 | } | ||
207 | |||
208 | Bitmap resize = new Bitmap(image, newsize); | ||
209 | |||
210 | try | 179 | try |
211 | { | 180 | { |
181 | Bitmap image = new Bitmap(stream); | ||
182 | Size newsize; | ||
183 | |||
184 | // TODO: make this a bit less hard coded | ||
185 | if ((image.Height < 64) && (image.Width < 64)) | ||
186 | { | ||
187 | newsize = new Size(32, 32); | ||
188 | } | ||
189 | else if ((image.Height < 128) && (image.Width < 128)) | ||
190 | { | ||
191 | newsize = new Size(64, 64); | ||
192 | } | ||
193 | else if ((image.Height < 256) && (image.Width < 256)) | ||
194 | { | ||
195 | newsize = new Size(128, 128); | ||
196 | } | ||
197 | else if ((image.Height < 512 && image.Width < 512)) | ||
198 | { | ||
199 | newsize = new Size(256, 256); | ||
200 | } | ||
201 | else if ((image.Height < 1024 && image.Width < 1024)) | ||
202 | { | ||
203 | newsize = new Size(512, 512); | ||
204 | } | ||
205 | else | ||
206 | { | ||
207 | newsize = new Size(1024, 1024); | ||
208 | } | ||
209 | |||
210 | Bitmap resize = new Bitmap(image, newsize); | ||
211 | |||
212 | imageJ2000 = OpenJPEG.EncodeFromImage(resize, true); | 212 | imageJ2000 = OpenJPEG.EncodeFromImage(resize, true); |
213 | } | 213 | } |
214 | catch (Exception) | 214 | catch (Exception) |
215 | { | 215 | { |
216 | m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); | 216 | m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Conversion Failed. Empty byte data returned!"); |
217 | } | 217 | } |
218 | } | 218 | } |
219 | else | 219 | else |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index c062833..f8a599a 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -137,16 +137,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
137 | 137 | ||
138 | m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); | 138 | m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); |
139 | 139 | ||
140 | Dictionary<string, object> serializationOptions = new Dictionary<string, object>(); | 140 | |
141 | // if (m_options.ContainsKey("version") && (string)m_options["version"] == "0") | ||
142 | // serializationOptions["old-guids"] = true; | ||
143 | |||
144 | // Write out scene object metadata | 141 | // Write out scene object metadata |
145 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) | 142 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) |
146 | { | 143 | { |
147 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); | 144 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); |
148 | 145 | ||
149 | string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, serializationOptions); | 146 | string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); |
150 | m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); | 147 | m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); |
151 | } | 148 | } |
152 | 149 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index 3182079..0567a82 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -187,20 +187,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
187 | /// <returns></returns> | 187 | /// <returns></returns> |
188 | public static string Create0p2ControlFile(Dictionary<string, object> options) | 188 | public static string Create0p2ControlFile(Dictionary<string, object> options) |
189 | { | 189 | { |
190 | int majorVersion = 0, minorVersion = 4; | 190 | int majorVersion = 0, minorVersion = 5; |
191 | 191 | ||
192 | /* | 192 | if (options.ContainsKey("version")) |
193 | if (options.ContainsKey("version") && (string)options["version"] == "0") | ||
194 | { | ||
195 | majorVersion = 0; | ||
196 | minorVersion = 3; | ||
197 | } | ||
198 | else | ||
199 | { | 193 | { |
200 | majorVersion = 1; | ||
201 | minorVersion = 0; | 194 | minorVersion = 0; |
195 | string[] parts = options["version"].ToString().Split('.'); | ||
196 | if (parts.Length >= 1) | ||
197 | majorVersion = Int32.Parse(parts[0]); | ||
198 | if (parts.Length >= 2) | ||
199 | minorVersion = Int32.Parse(parts[1]); | ||
202 | } | 200 | } |
203 | */ | ||
204 | 201 | ||
205 | m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); | 202 | m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); |
206 | // if (majorVersion == 1) | 203 | // if (majorVersion == 1) |
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index a52fea4..8df645d 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | |||
@@ -31,12 +31,14 @@ using OpenMetaverse; | |||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Framework.Interfaces; | 32 | using OpenSim.Region.Framework.Interfaces; |
33 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
34 | using System.Reflection; | ||
35 | using log4net; | ||
34 | 36 | ||
35 | namespace OpenSim.Region.CoreModules.World.Sound | 37 | namespace OpenSim.Region.CoreModules.World.Sound |
36 | { | 38 | { |
37 | public class SoundModule : IRegionModule, ISoundModule | 39 | public class SoundModule : IRegionModule, ISoundModule |
38 | { | 40 | { |
39 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 42 | ||
41 | protected Scene m_scene; | 43 | protected Scene m_scene; |
42 | 44 | ||
@@ -62,6 +64,12 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
62 | public virtual void PlayAttachedSound( | 64 | public virtual void PlayAttachedSound( |
63 | UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius) | 65 | UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius) |
64 | { | 66 | { |
67 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); | ||
68 | if (part == null) | ||
69 | return; | ||
70 | |||
71 | SceneObjectGroup grp = part.ParentGroup; | ||
72 | |||
65 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) | 73 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) |
66 | { | 74 | { |
67 | if (sp.IsChildAgent) | 75 | if (sp.IsChildAgent) |
@@ -71,12 +79,25 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
71 | if (dis > 100.0) // Max audio distance | 79 | if (dis > 100.0) // Max audio distance |
72 | return; | 80 | return; |
73 | 81 | ||
82 | if (grp.IsAttachment) | ||
83 | { | ||
84 | if (grp.GetAttachmentPoint() > 30) // HUD | ||
85 | { | ||
86 | if (sp.ControllingClient.AgentId != grp.OwnerID) | ||
87 | return; | ||
88 | } | ||
89 | |||
90 | if (sp.ControllingClient.AgentId == grp.OwnerID) | ||
91 | dis = 0; | ||
92 | } | ||
93 | |||
74 | // Scale by distance | 94 | // Scale by distance |
75 | if (radius == 0) | 95 | if (radius == 0) |
76 | gain = (float)((double)gain * ((100.0 - dis) / 100.0)); | 96 | gain = (float)((double)gain * ((100.0 - dis) / 100.0)); |
77 | else | 97 | else |
78 | gain = (float)((double)gain * ((radius - dis) / radius)); | 98 | gain = (float)((double)gain * ((radius - dis) / radius)); |
79 | 99 | ||
100 | m_log.DebugFormat("Play sound, gain {0}", gain); | ||
80 | sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); | 101 | sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); |
81 | }); | 102 | }); |
82 | } | 103 | } |
@@ -84,6 +105,18 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
84 | public virtual void TriggerSound( | 105 | public virtual void TriggerSound( |
85 | UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius) | 106 | UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius) |
86 | { | 107 | { |
108 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); | ||
109 | if (part == null) | ||
110 | return; | ||
111 | |||
112 | SceneObjectGroup grp = part.ParentGroup; | ||
113 | |||
114 | if (grp.IsAttachment && grp.GetAttachmentPoint() > 30) | ||
115 | { | ||
116 | objectID = ownerID; | ||
117 | parentID = ownerID; | ||
118 | } | ||
119 | |||
87 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) | 120 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) |
88 | { | 121 | { |
89 | if (sp.IsChildAgent) | 122 | if (sp.IsChildAgent) |