aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorJonathan Freedman2010-11-05 19:10:02 -0700
committerJonathan Freedman2010-11-05 19:10:02 -0700
commit4f40374464899dad82abdb9c36ea863ceac0d83f (patch)
treea9b116ccca55fb07b8c79ab7f6fdfafc8466d740 /OpenSim/Region/CoreModules/World
parentMerge branch 'master' into mantis5110 (diff)
parentMerge branch 'master' of /var/git/opensim/ (diff)
downloadopensim-SC_OLD-4f40374464899dad82abdb9c36ea863ceac0d83f.zip
opensim-SC_OLD-4f40374464899dad82abdb9c36ea863ceac0d83f.tar.gz
opensim-SC_OLD-4f40374464899dad82abdb9c36ea863ceac0d83f.tar.bz2
opensim-SC_OLD-4f40374464899dad82abdb9c36ea863ceac0d83f.tar.xz
Merge git://github.com/opensim/opensim into mantis5110
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs19
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs35
3 files changed, 44 insertions, 17 deletions
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;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Region.Framework.Interfaces; 32using OpenSim.Region.Framework.Interfaces;
33using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
34using System.Reflection;
35using log4net;
34 36
35namespace OpenSim.Region.CoreModules.World.Sound 37namespace 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)