aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs5
-rw-r--r--OpenSim/Region/CoreModules/LightShare/LightShareModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs64
-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
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs1
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs63
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs20
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs4
14 files changed, 158 insertions, 84 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 7a0142f..f80cb34 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -264,9 +264,10 @@ namespace OpenSim
264 LoadOar); 264 LoadOar);
265 265
266 m_console.Commands.AddCommand("region", false, "save oar", 266 m_console.Commands.AddCommand("region", false, "save oar",
267 "save oar [<OAR path>]", 267 "save oar [-v|version=N] [<OAR path>]",
268 "Save a region's data to an OAR archive.", 268 "Save a region's data to an OAR archive.",
269 "The OAR path must be a filesystem path." 269 "-v|version=N generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
270 + "The OAR path must be a filesystem path."
270 + " If this is not given then the oar is saved to region.oar in the current directory.", 271 + " If this is not given then the oar is saved to region.oar in the current directory.",
271 SaveOar); 272 SaveOar);
272 273
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;
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)
diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs
index edaa07c..5295a72 100644
--- a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs
@@ -94,5 +94,6 @@ namespace OpenSim.Region.Framework.Interfaces
94 RegionSettings LoadRegionSettings(UUID regionUUID); 94 RegionSettings LoadRegionSettings(UUID regionUUID);
95 RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); 95 RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID);
96 void StoreRegionWindlightSettings(RegionLightShareData wl); 96 void StoreRegionWindlightSettings(RegionLightShareData wl);
97 void RemoveRegionWindlightSettings(UUID regionID);
97 } 98 }
98} 99}
diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs
index 0a4d531..615f377 100644
--- a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs
@@ -105,6 +105,7 @@ namespace OpenSim.Region.Framework.Interfaces
105 RegionSettings LoadRegionSettings(UUID regionUUID); 105 RegionSettings LoadRegionSettings(UUID regionUUID);
106 RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); 106 RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID);
107 void StoreRegionWindlightSettings(RegionLightShareData wl); 107 void StoreRegionWindlightSettings(RegionLightShareData wl);
108 void RemoveRegionWindlightSettings(UUID regionID);
108 109
109 void Shutdown(); 110 void Shutdown();
110 } 111 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 7a6449d..f164201 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3100,6 +3100,7 @@ namespace OpenSim.Region.Framework.Scenes
3100 UUID ownerID = _ownerID; 3100 UUID ownerID = _ownerID;
3101 UUID objectID = ParentGroup.RootPart.UUID; 3101 UUID objectID = ParentGroup.RootPart.UUID;
3102 UUID parentID = GetRootPartUUID(); 3102 UUID parentID = GetRootPartUUID();
3103
3103 UUID soundID = UUID.Zero; 3104 UUID soundID = UUID.Zero;
3104 Vector3 position = AbsolutePosition; // region local 3105 Vector3 position = AbsolutePosition; // region local
3105 ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle; 3106 ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 0390414..fe9dc56 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -171,9 +171,6 @@ namespace OpenSim.Region.Framework.Scenes
171 171
172 private float m_health = 100f; 172 private float m_health = 100f;
173 173
174 // Default AV Height
175 private float m_avHeight = 127.0f;
176
177 protected RegionInfo m_regionInfo; 174 protected RegionInfo m_regionInfo;
178 protected ulong crossingFromRegion; 175 protected ulong crossingFromRegion;
179 176
@@ -841,9 +838,10 @@ namespace OpenSim.Region.Framework.Scenes
841 } 838 }
842 839
843 float localAVHeight = 1.56f; 840 float localAVHeight = 1.56f;
844 if (m_avHeight != 127.0f) 841 if (m_appearance != null)
845 { 842 {
846 localAVHeight = m_avHeight; 843 if (m_appearance.AvatarHeight > 0)
844 localAVHeight = m_appearance.AvatarHeight;
847 } 845 }
848 846
849 float posZLimit = 0; 847 float posZLimit = 0;
@@ -872,6 +870,12 @@ namespace OpenSim.Region.Framework.Scenes
872 870
873 AddToPhysicalScene(isFlying); 871 AddToPhysicalScene(isFlying);
874 872
873 if (m_appearance != null)
874 {
875 if (m_appearance.AvatarHeight > 0)
876 SetHeight(m_appearance.AvatarHeight);
877 }
878
875 if (m_forceFly) 879 if (m_forceFly)
876 { 880 {
877 m_physicsActor.Flying = true; 881 m_physicsActor.Flying = true;
@@ -1060,10 +1064,9 @@ namespace OpenSim.Region.Framework.Scenes
1060 /// </summary> 1064 /// </summary>
1061 public void SetHeight(float height) 1065 public void SetHeight(float height)
1062 { 1066 {
1063 m_avHeight = height;
1064 if (PhysicsActor != null && !IsChildAgent) 1067 if (PhysicsActor != null && !IsChildAgent)
1065 { 1068 {
1066 Vector3 SetSize = new Vector3(0.45f, 0.6f, m_avHeight); 1069 Vector3 SetSize = new Vector3(0.45f, 0.6f, height);
1067 PhysicsActor.Size = SetSize; 1070 PhysicsActor.Size = SetSize;
1068 } 1071 }
1069 } 1072 }
@@ -1687,9 +1690,10 @@ namespace OpenSim.Region.Framework.Scenes
1687 m_parentID = 0; 1690 m_parentID = 0;
1688 SendFullUpdateToAllClients(); 1691 SendFullUpdateToAllClients();
1689 m_requestedSitTargetID = 0; 1692 m_requestedSitTargetID = 0;
1690 if ((m_physicsActor != null) && (m_avHeight > 0)) 1693 if (m_physicsActor != null && m_appearance != null)
1691 { 1694 {
1692 SetHeight(m_avHeight); 1695 if (m_appearance.AvatarHeight > 0)
1696 SetHeight(m_appearance.AvatarHeight);
1693 } 1697 }
1694 } 1698 }
1695 1699
@@ -2391,11 +2395,14 @@ namespace OpenSim.Region.Framework.Scenes
2391 if (m_appearance.Texture == null) 2395 if (m_appearance.Texture == null)
2392 return; 2396 return;
2393 2397
2394 if (LocalId == remoteAvatar.LocalId) 2398// MT: This is needed for sit. It's legal to send it to oneself, and the name
2395 { 2399// of the method is a misnomer
2396 m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID); 2400//
2397 return; 2401// if (LocalId == remoteAvatar.LocalId)
2398 } 2402// {
2403// m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID);
2404// return;
2405// }
2399 2406
2400 if (IsChildAgent) 2407 if (IsChildAgent)
2401 { 2408 {
@@ -2576,7 +2583,7 @@ namespace OpenSim.Region.Framework.Scenes
2576 cadu.ActiveGroupID = UUID.Zero.Guid; 2583 cadu.ActiveGroupID = UUID.Zero.Guid;
2577 cadu.AgentID = UUID.Guid; 2584 cadu.AgentID = UUID.Guid;
2578 cadu.alwaysrun = m_setAlwaysRun; 2585 cadu.alwaysrun = m_setAlwaysRun;
2579 cadu.AVHeight = m_avHeight; 2586 cadu.AVHeight = m_appearance.AvatarHeight;
2580 Vector3 tempCameraCenter = m_CameraCenter; 2587 Vector3 tempCameraCenter = m_CameraCenter;
2581 cadu.cameraPosition = tempCameraCenter; 2588 cadu.cameraPosition = tempCameraCenter;
2582 cadu.drawdistance = m_DrawDistance; 2589 cadu.drawdistance = m_DrawDistance;
@@ -2912,7 +2919,6 @@ namespace OpenSim.Region.Framework.Scenes
2912 2919
2913 m_CameraCenter = cAgentData.Center + offset; 2920 m_CameraCenter = cAgentData.Center + offset;
2914 2921
2915 m_avHeight = cAgentData.Size.Z;
2916 //SetHeight(cAgentData.AVHeight); 2922 //SetHeight(cAgentData.AVHeight);
2917 2923
2918 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) 2924 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0)
@@ -2937,8 +2943,6 @@ namespace OpenSim.Region.Framework.Scenes
2937 cAgent.Position = AbsolutePosition; 2943 cAgent.Position = AbsolutePosition;
2938 cAgent.Velocity = m_velocity; 2944 cAgent.Velocity = m_velocity;
2939 cAgent.Center = m_CameraCenter; 2945 cAgent.Center = m_CameraCenter;
2940 // Don't copy the size; it is inferred from apearance parameters
2941 //cAgent.Size = new Vector3(0, 0, m_avHeight);
2942 cAgent.AtAxis = m_CameraAtAxis; 2946 cAgent.AtAxis = m_CameraAtAxis;
2943 cAgent.LeftAxis = m_CameraLeftAxis; 2947 cAgent.LeftAxis = m_CameraLeftAxis;
2944 cAgent.UpAxis = m_CameraUpAxis; 2948 cAgent.UpAxis = m_CameraUpAxis;
@@ -3056,7 +3060,6 @@ namespace OpenSim.Region.Framework.Scenes
3056 m_pos = cAgent.Position; 3060 m_pos = cAgent.Position;
3057 m_velocity = cAgent.Velocity; 3061 m_velocity = cAgent.Velocity;
3058 m_CameraCenter = cAgent.Center; 3062 m_CameraCenter = cAgent.Center;
3059 //m_avHeight = cAgent.Size.Z;
3060 m_CameraAtAxis = cAgent.AtAxis; 3063 m_CameraAtAxis = cAgent.AtAxis;
3061 m_CameraLeftAxis = cAgent.LeftAxis; 3064 m_CameraLeftAxis = cAgent.LeftAxis;
3062 m_CameraUpAxis = cAgent.UpAxis; 3065 m_CameraUpAxis = cAgent.UpAxis;
@@ -3075,6 +3078,12 @@ namespace OpenSim.Region.Framework.Scenes
3075 m_setAlwaysRun = cAgent.AlwaysRun; 3078 m_setAlwaysRun = cAgent.AlwaysRun;
3076 3079
3077 m_appearance = new AvatarAppearance(cAgent.Appearance); 3080 m_appearance = new AvatarAppearance(cAgent.Appearance);
3081 if (m_physicsActor != null)
3082 {
3083 bool isFlying = m_physicsActor.Flying;
3084 RemoveFromPhysicalScene();
3085 AddToPhysicalScene(isFlying);
3086 }
3078 3087
3079/* 3088/*
3080 uint i = 0; 3089 uint i = 0;
@@ -3184,21 +3193,17 @@ namespace OpenSim.Region.Framework.Scenes
3184 /// </summary> 3193 /// </summary>
3185 public void AddToPhysicalScene(bool isFlying) 3194 public void AddToPhysicalScene(bool isFlying)
3186 { 3195 {
3196 if (m_appearance.AvatarHeight == 0)
3197 m_appearance.SetHeight();
3198
3187 PhysicsScene scene = m_scene.PhysicsScene; 3199 PhysicsScene scene = m_scene.PhysicsScene;
3188 3200
3189 Vector3 pVec = AbsolutePosition; 3201 Vector3 pVec = AbsolutePosition;
3190 3202
3191 // Old bug where the height was in centimeters instead of meters 3203 // Old bug where the height was in centimeters instead of meters
3192 if (m_avHeight == 127.0f) 3204 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec,
3193 { 3205 new Vector3(0f, 0f, m_appearance.AvatarHeight), isFlying);
3194 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, new Vector3(0f, 0f, 1.56f), 3206
3195 isFlying);
3196 }
3197 else
3198 {
3199 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec,
3200 new Vector3(0f, 0f, m_avHeight), isFlying);
3201 }
3202 scene.AddPhysicsActorTaint(m_physicsActor); 3207 scene.AddPhysicsActorTaint(m_physicsActor);
3203 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; 3208 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
3204 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; 3209 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index e661ca9..7f37878 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -1135,7 +1135,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1135 writer.WriteElementString("GroupMask", sop.GroupMask.ToString()); 1135 writer.WriteElementString("GroupMask", sop.GroupMask.ToString());
1136 writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString()); 1136 writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString());
1137 writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString()); 1137 writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString());
1138 writer.WriteElementString("Flags", sop.Flags.ToString()); 1138 WriteFlags(writer, "Flags", sop.Flags.ToString(), options);
1139 WriteUUID(writer, "CollisionSound", sop.CollisionSound, options); 1139 WriteUUID(writer, "CollisionSound", sop.CollisionSound, options);
1140 writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); 1140 writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
1141 if (sop.MediaUrl != null) 1141 if (sop.MediaUrl != null)
@@ -1188,6 +1188,20 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1188 1188
1189 } 1189 }
1190 1190
1191 static void WriteFlags(XmlTextWriter writer, string name, string flagsStr, Dictionary<string, object> options)
1192 {
1193 // Older versions of serialization can't cope with commas
1194 if (options.ContainsKey("version"))
1195 {
1196 float version = 0.5F;
1197 float.TryParse(options["version"].ToString(), out version);
1198 if (version < 0.5)
1199 flagsStr = flagsStr.Replace(",", "");
1200 }
1201
1202 writer.WriteElementString(name, flagsStr);
1203 }
1204
1191 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options) 1205 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options)
1192 { 1206 {
1193 if (tinv.Count > 0) // otherwise skip this 1207 if (tinv.Count > 0) // otherwise skip this
@@ -1275,8 +1289,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1275 writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString()); 1289 writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString());
1276 writer.WriteElementString("State", shp.State.ToString()); 1290 writer.WriteElementString("State", shp.State.ToString());
1277 1291
1278 writer.WriteElementString("ProfileShape", shp.ProfileShape.ToString()); 1292 WriteFlags(writer, "ProfileShape", shp.ProfileShape.ToString(), options);
1279 writer.WriteElementString("HollowShape", shp.HollowShape.ToString()); 1293 WriteFlags(writer, "HollowShape", shp.HollowShape.ToString(), options);
1280 1294
1281 WriteUUID(writer, "SculptTexture", shp.SculptTexture, options); 1295 WriteUUID(writer, "SculptTexture", shp.SculptTexture, options);
1282 writer.WriteElementString("SculptType", shp.SculptType.ToString()); 1296 writer.WriteElementString("SculptType", shp.SculptType.ToString());
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
index 665b39f..645566e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -455,6 +455,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
455 if (LightShareModule.EnableWindlight) 455 if (LightShareModule.EnableWindlight)
456 { 456 {
457 RegionLightShareData wl = getWindlightProfileFromRules(rules); 457 RegionLightShareData wl = getWindlightProfileFromRules(rules);
458 wl.valid = true;
458 m_host.ParentGroup.Scene.StoreWindlightProfile(wl); 459 m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
459 success = 1; 460 success = 1;
460 } 461 }
@@ -465,6 +466,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
465 } 466 }
466 return success; 467 return success;
467 } 468 }
469 public void lsClearWindlightScene()
470 {
471 if (!m_LSFunctionsEnabled)
472 {
473 LSShoutError("LightShare functions are not enabled.");
474 return;
475 }
476 if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
477 {
478 LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
479 return;
480 }
481
482 m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false;
483 if (m_host.ParentGroup.Scene.SimulationDataService != null)
484 m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID);
485 }
468 /// <summary> 486 /// <summary>
469 /// Set the current Windlight scene to a target avatar 487 /// Set the current Windlight scene to a target avatar
470 /// </summary> 488 /// </summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs
index 9aa437b..f2df094 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs
@@ -44,5 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
44 LSL_List lsGetWindlightScene(LSL_List rules); 44 LSL_List lsGetWindlightScene(LSL_List rules);
45 int lsSetWindlightScene(LSL_List rules); 45 int lsSetWindlightScene(LSL_List rules);
46 int lsSetWindlightSceneTargeted(LSL_List rules, key target); 46 int lsSetWindlightSceneTargeted(LSL_List rules, key target);
47 void lsClearWindlightScene();
47 } 48 }
48} 49}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs
index f8dbe03..143b497 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs
@@ -72,5 +72,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
72 { 72 {
73 return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); 73 return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target);
74 } 74 }
75 public void lsClearWindlightScene()
76 {
77 m_LS_Functions.lsClearWindlightScene();
78 }
75 } 79 }
76} 80}