From e83893c8bcb26d0af191df7e19c5059c80896f51 Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 29 Jan 2013 06:12:04 -0500 Subject: [PATCH 1/4] * This Checks the asset of each wearable asynchronously and repairs if it's required. --- .../AvatarFactory/AvatarFactoryModule.cs | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index a9d11d54be..1adff7e6aa 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -691,7 +691,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory case WearableType.Shape: case WearableType.Skin: //case WearableType.Underpants: - TryAndRepair((WearableType)i, invService, userID, appearance); + TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); resetwearable = true; m_log.Warn("[AVFACTORY]: UUID.Zero Wearables, passing fake values."); resetwearable = true; @@ -711,7 +711,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory case WearableType.Shape: case WearableType.Skin: //case WearableType.Underpants: - TryAndRepair((WearableType)i, invService, userID, appearance); + TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i); resetwearable = true; @@ -727,6 +727,17 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory if (baseItem != null) { appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID); + int unmodifiedWearableIndexForClosure = i; + m_scene.AssetService.Get(baseItem.AssetID.ToString(), this, + delegate(string x, object y, AssetBase z) + { + if (z == null) + { + TryAndRepairBrokenWearable( + (WearableType)unmodifiedWearableIndexForClosure, invService, + userID, appearance); + } + }); } else { @@ -734,7 +745,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", appearance.Wearables[i][j].ItemID, (WearableType)i); - TryAndRepair((WearableType)i, invService, userID, appearance); + TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); resetwearable = true; } @@ -746,7 +757,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes)); - TryAndRepair(WearableType.Eyes, invService, userID, appearance); + TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); resetwearable = true; } else @@ -756,7 +767,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory m_log.WarnFormat("[AVFACTORY]: Eyes are UUID.Zero are broken, {0} {1}", appearance.Wearables[(int) WearableType.Eyes][0].ItemID, appearance.Wearables[(int) WearableType.Eyes][0].AssetID); - TryAndRepair(WearableType.Eyes, invService, userID, appearance); + TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); resetwearable = true; } @@ -767,7 +778,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { m_log.WarnFormat("[AVFACTORY]: {0} shape is Null, passing existing values.", (WearableType.Shape)); - TryAndRepair(WearableType.Shape, invService, userID, appearance); + TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance); resetwearable = true; } else @@ -777,7 +788,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory m_log.WarnFormat("[AVFACTORY]: Shape is UUID.Zero and broken, {0} {1}", appearance.Wearables[(int)WearableType.Shape][0].ItemID, appearance.Wearables[(int)WearableType.Shape][0].AssetID); - TryAndRepair(WearableType.Shape, invService, userID, appearance); + TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance); resetwearable = true; } @@ -788,7 +799,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { m_log.WarnFormat("[AVFACTORY]: {0} Hair is Null, passing existing values.", (WearableType.Hair)); - TryAndRepair(WearableType.Hair, invService, userID, appearance); + TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance); resetwearable = true; } else @@ -798,7 +809,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory m_log.WarnFormat("[AVFACTORY]: Hair is UUID.Zero and broken, {0} {1}", appearance.Wearables[(int)WearableType.Hair][0].ItemID, appearance.Wearables[(int)WearableType.Hair][0].AssetID); - TryAndRepair(WearableType.Hair, invService, userID, appearance); + TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance); resetwearable = true; } @@ -809,7 +820,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { m_log.WarnFormat("[AVFACTORY]: {0} Skin is Null, passing existing values.", (WearableType.Skin)); - TryAndRepair(WearableType.Skin, invService, userID, appearance); + TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance); resetwearable = true; } else @@ -819,7 +830,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory m_log.WarnFormat("[AVFACTORY]: Skin is UUID.Zero and broken, {0} {1}", appearance.Wearables[(int)WearableType.Skin][0].ItemID, appearance.Wearables[(int)WearableType.Skin][0].AssetID); - TryAndRepair(WearableType.Skin, invService, userID, appearance); + TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance); resetwearable = true; } @@ -841,7 +852,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); } } - private void TryAndRepair(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance) + private void TryAndRepairBrokenWearable(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance) { UUID defaultwearable = GetDefaultItem(type); if (defaultwearable != UUID.Zero) From 128910a68139080fbf5ea53db9c756496b605fd9 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 5 Feb 2013 05:40:51 +0100 Subject: [PATCH 2/4] Make scripts shout a error but not stop when button count is overrun on llDialog --- .../Shared/Api/Implementation/LSL_Api.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 53c6e5cf20..01a649baf1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4724,7 +4724,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api UUID av = new UUID(); if (!UUID.TryParse(agent,out av)) { - //LSLError("First parameter to llDialog needs to be a key"); return; } @@ -7222,20 +7221,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if (buttons.Length > 12) { - LSLError("No more than 12 buttons can be shown"); - return; + ShoutError("button list too long, must be 12 or fewer entries"); } - string[] buts = new string[buttons.Length]; - for (int i = 0; i < buttons.Length; i++) + int length = buttons.Length; + if (length > 12) + length = 12; + + string[] buts = new string[length]; + for (int i = 0; i < length; i++) { if (buttons.Data[i].ToString() == String.Empty) { - LSLError("button label cannot be blank"); + ShoutError("button label cannot be blank"); return; } if (buttons.Data[i].ToString().Length > 24) { - llWhisper(ScriptBaseClass.DEBUG_CHANNEL, "button label cannot be longer than 24 characters"); + ShoutError("button label cannot be longer than 24 characters"); return; } buts[i] = buttons.Data[i].ToString(); From 598f891d703593bde4b96472b5d1b1ce6aaf4c74 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 6 Feb 2013 04:03:32 +0100 Subject: [PATCH 3/4] Move SoubleQueu to Util. Change HTTP inv to prioritize COF. Determine COF for SP --- .../WebFetchInvDescHandler.cs | 2 +- OpenSim/Framework/Util.cs | 108 ++++++++++++++++++ .../Linden/Caps/WebFetchInvDescModule.cs | 77 +++++++++++-- .../ClientStack/Linden/UDP/LLUDPServer.cs | 108 ------------------ OpenSim/Region/Framework/Scenes/Scene.cs | 7 ++ .../Region/Framework/Scenes/ScenePresence.cs | 2 + prebuild.xml | 3 +- 7 files changed, 190 insertions(+), 117 deletions(-) diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs index 9a6ca8640a..11a269882b 100644 --- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs @@ -435,4 +435,4 @@ namespace OpenSim.Capabilities.Handlers return llsdItem; } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index e76a37b9a1..48f3f8b0d2 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2097,4 +2097,112 @@ namespace OpenSim.Framework } #endregion } + + public class DoubleQueue where T:class + { + private Queue m_lowQueue = new Queue(); + private Queue m_highQueue = new Queue(); + + private object m_syncRoot = new object(); + private Semaphore m_s = new Semaphore(0, 1); + + public DoubleQueue() + { + } + + public virtual int Count + { + get { return m_highQueue.Count + m_lowQueue.Count; } + } + + public virtual void Enqueue(T data) + { + Enqueue(m_lowQueue, data); + } + + public virtual void EnqueueLow(T data) + { + Enqueue(m_lowQueue, data); + } + + public virtual void EnqueueHigh(T data) + { + Enqueue(m_highQueue, data); + } + + private void Enqueue(Queue q, T data) + { + lock (m_syncRoot) + { + m_lowQueue.Enqueue(data); + m_s.WaitOne(0); + m_s.Release(); + } + } + + public virtual T Dequeue() + { + return Dequeue(Timeout.Infinite); + } + + public virtual T Dequeue(int tmo) + { + return Dequeue(TimeSpan.FromMilliseconds(tmo)); + } + + public virtual T Dequeue(TimeSpan wait) + { + T res = null; + + if (!Dequeue(wait, ref res)) + return null; + + return res; + } + + public bool Dequeue(int timeout, ref T res) + { + return Dequeue(TimeSpan.FromMilliseconds(timeout), ref res); + } + + public bool Dequeue(TimeSpan wait, ref T res) + { + if (!m_s.WaitOne(wait)) + return false; + + lock (m_syncRoot) + { + if (m_highQueue.Count > 0) + res = m_highQueue.Dequeue(); + else + res = m_lowQueue.Dequeue(); + + if (m_highQueue.Count == 0 && m_lowQueue.Count == 0) + return true; + + try + { + m_s.Release(); + } + catch + { + } + + return true; + } + } + + public virtual void Clear() + { + + lock (m_syncRoot) + { + // Make sure sem count is 0 + m_s.WaitOne(0); + + m_lowQueue.Clear(); + m_highQueue.Clear(); + } + } + } } diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 04cd4748af..a823dd81aa 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -39,10 +39,13 @@ using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Framework.Capabilities; using OpenSim.Services.Interfaces; using Caps = OpenSim.Framework.Capabilities.Caps; using OpenSim.Capabilities.Handlers; using OpenSim.Framework.Monitoring; +using OpenMetaverse; +using OpenMetaverse.StructuredData; namespace OpenSim.Region.ClientStack.Linden { @@ -52,11 +55,13 @@ namespace OpenSim.Region.ClientStack.Linden [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "WebFetchInvDescModule")] public class WebFetchInvDescModule : INonSharedRegionModule { - struct aPollRequest + class aPollRequest { public PollServiceInventoryEventArgs thepoll; public UUID reqID; public Hashtable request; + public ScenePresence presence; + public List folders; } private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -71,8 +76,8 @@ namespace OpenSim.Region.ClientStack.Linden private Dictionary m_capsDict = new Dictionary(); private static Thread[] m_workerThreads = null; - private static OpenMetaverse.BlockingQueue m_queue = - new OpenMetaverse.BlockingQueue(); + private static DoubleQueue m_queue = + new DoubleQueue(); #region ISharedRegionModule Members @@ -143,12 +148,18 @@ namespace OpenSim.Region.ClientStack.Linden private class PollServiceInventoryEventArgs : PollServiceEventArgs { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Dictionary responses = new Dictionary(); - public PollServiceInventoryEventArgs(UUID pId) : + private Scene m_scene; + + public PollServiceInventoryEventArgs(Scene scene, UUID pId) : base(null, null, null, null, pId, int.MaxValue) { + m_scene = scene; + HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; GetEvents = (x, y) => { @@ -167,12 +178,64 @@ namespace OpenSim.Region.ClientStack.Linden Request = (x, y) => { + ScenePresence sp = m_scene.GetScenePresence(Id); + if (sp == null) + { + m_log.ErrorFormat("[INVENTORY]: Unable to find ScenePresence for {0}", Id); + return; + } + aPollRequest reqinfo = new aPollRequest(); reqinfo.thepoll = this; reqinfo.reqID = x; reqinfo.request = y; + reqinfo.presence = sp; + reqinfo.folders = new List(); - m_queue.Enqueue(reqinfo); + // Decode the request here + string request = y["body"].ToString(); + + request = request.Replace("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"); + + request = request.Replace("fetch_folders0", "fetch_folders0"); + request = request.Replace("fetch_folders1", "fetch_folders1"); + + Hashtable hash = new Hashtable(); + try + { + hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); + } + catch (LLSD.LLSDParseException e) + { + m_log.ErrorFormat("[INVENTORY]: Fetch error: {0}{1}" + e.Message, e.StackTrace); + m_log.Error("Request: " + request); + return; + } + + ArrayList foldersrequested = (ArrayList)hash["folders"]; + + bool highPriority = false; + + for (int i = 0; i < foldersrequested.Count; i++) + { + Hashtable inventoryhash = (Hashtable)foldersrequested[i]; + string folder = inventoryhash["folder_id"].ToString(); + UUID folderID; + if (UUID.TryParse(folder, out folderID)) + { + if (!reqinfo.folders.Contains(folderID)) + { + if (sp.COF != UUID.Zero && sp.COF == folderID) + highPriority = true; + reqinfo.folders.Add(folderID); + } + } + } + + if (highPriority) + m_queue.EnqueueHigh(reqinfo); + else + m_queue.EnqueueLow(reqinfo); }; NoEvents = (x, y) => @@ -208,7 +271,7 @@ namespace OpenSim.Region.ClientStack.Linden response["reusecontext"] = false; response["str_response_string"] = m_webFetchHandler.FetchInventoryDescendentsRequest( - requestinfo.request["body"].ToString(), String.Empty, String.Empty, null, null); + requestinfo.request["body"].ToString(), String.Empty, String.Empty, null, null); lock (responses) responses[requestID] = response; @@ -220,7 +283,7 @@ namespace OpenSim.Region.ClientStack.Linden string capUrl = "/CAPS/" + UUID.Random() + "/"; // Register this as a poll service - PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(agentID); + PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(m_scene, agentID); args.Type = PollServiceEventArgs.EventType.Inventory; MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 6c72edca08..d49f1f703f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1903,112 +1903,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } } - - internal class DoubleQueue where T:class - { - private Queue m_lowQueue = new Queue(); - private Queue m_highQueue = new Queue(); - - private object m_syncRoot = new object(); - private Semaphore m_s = new Semaphore(0, 1); - - public DoubleQueue() - { - } - - public virtual int Count - { - get { return m_highQueue.Count + m_lowQueue.Count; } - } - - public virtual void Enqueue(T data) - { - Enqueue(m_lowQueue, data); - } - - public virtual void EnqueueLow(T data) - { - Enqueue(m_lowQueue, data); - } - - public virtual void EnqueueHigh(T data) - { - Enqueue(m_highQueue, data); - } - - private void Enqueue(Queue q, T data) - { - lock (m_syncRoot) - { - m_lowQueue.Enqueue(data); - m_s.WaitOne(0); - m_s.Release(); - } - } - - public virtual T Dequeue() - { - return Dequeue(Timeout.Infinite); - } - - public virtual T Dequeue(int tmo) - { - return Dequeue(TimeSpan.FromMilliseconds(tmo)); - } - - public virtual T Dequeue(TimeSpan wait) - { - T res = null; - - if (!Dequeue(wait, ref res)) - return null; - - return res; - } - - public bool Dequeue(int timeout, ref T res) - { - return Dequeue(TimeSpan.FromMilliseconds(timeout), ref res); - } - - public bool Dequeue(TimeSpan wait, ref T res) - { - if (!m_s.WaitOne(wait)) - return false; - - lock (m_syncRoot) - { - if (m_highQueue.Count > 0) - res = m_highQueue.Dequeue(); - else - res = m_lowQueue.Dequeue(); - - if (m_highQueue.Count == 0 && m_lowQueue.Count == 0) - return true; - - try - { - m_s.Release(); - } - catch - { - } - - return true; - } - } - - public virtual void Clear() - { - - lock (m_syncRoot) - { - // Make sure sem count is 0 - m_s.WaitOne(0); - - m_lowQueue.Clear(); - m_highQueue.Clear(); - } - } - } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c7a38f7f8a..e58aadcb77 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2970,6 +2970,13 @@ namespace OpenSim.Region.Framework.Scenes SubscribeToClientEvents(client); sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance, type); + InventoryFolderBase cof = InventoryService.GetFolderForType(client.AgentId, (AssetType)46); + if (cof == null) + sp.COF = UUID.Zero; + else + sp.COF = cof.ID; + + m_log.DebugFormat("[SCENE]: COF for {0} is {1}", client.AgentId, sp.COF); m_eventManager.TriggerOnNewPresence(sp); sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 471caa27cb..91f9c0bb40 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -443,6 +443,8 @@ namespace OpenSim.Region.Framework.Scenes get { return (IClientCore)ControllingClient; } } + public UUID COF { get; set; } + // public Vector3 ParentPosition { get; set; } /// diff --git a/prebuild.xml b/prebuild.xml index fa2172268c..fba7b27a04 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1597,9 +1597,10 @@ + - + From bbda7b94b3fe2350d5413879388cfce7309ca907 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Feb 2013 03:40:48 +0000 Subject: [PATCH 4/4] Rename Bounciness to Restitution --- OpenSim/Data/MySQL/MySQLSimulationData.cs | 4 ++-- .../ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 2 +- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 +++--- .../Framework/Scenes/Serialization/SceneObjectSerializer.cs | 6 +++--- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 01b9299035..d5a4f46d12 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1339,7 +1339,7 @@ namespace OpenSim.Data.MySQL prim.Density = (float)(double)row["Density"]; prim.GravityModifier = (float)(double)row["GravityModifier"]; prim.Friction = (float)(double)row["Friction"]; - prim.Bounciness = (float)(double)row["Restitution"]; + prim.Restitution = (float)(double)row["Restitution"]; SOPVehicle vehicle = null; @@ -1725,7 +1725,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("Density", (double)prim.Density); cmd.Parameters.AddWithValue("GravityModifier", (double)prim.GravityModifier); cmd.Parameters.AddWithValue("Friction", (double)prim.Friction); - cmd.Parameters.AddWithValue("Restitution", (double)prim.Bounciness); + cmd.Parameters.AddWithValue("Restitution", (double)prim.Restitution); if (prim.VehicleParams != null) cmd.Parameters.AddWithValue("Vehicle", prim.VehicleParams.ToXml2()); diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index b06788b199..2bb3d38dc6 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -1317,7 +1317,7 @@ namespace OpenSim.Region.ClientStack.Linden object_data["PhysicsShapeType"] = obj.PhysicsShapeType; object_data["Density"] = obj.Density; object_data["Friction"] = obj.Friction; - object_data["Restitution"] = obj.Bounciness; + object_data["Restitution"] = obj.Restitution; object_data["GravityMultiplier"] = obj.GravityModifier; resp[uuid.ToString()] = object_data; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f2b016045b..ca15e3e3ef 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2654,7 +2654,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP byte physshapetype = part.PhysicsShapeType; float density = part.Density; float friction = part.Friction; - float bounce = part.Bounciness; + float bounce = part.Restitution; float gravmod = part.GravityModifier; eq.partPhysicsProperties(localid, physshapetype, density, friction, bounce, gravmod,AgentId); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8528edc616..0d2da03a52 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1729,7 +1729,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public float Bounciness + public float Restitution { get { return m_bounce; } set @@ -4493,8 +4493,8 @@ namespace OpenSim.Region.Framework.Scenes GravityModifier = physdata.GravitationModifier; if(Friction != physdata.Friction) Friction = physdata.Friction; - if(Bounciness != physdata.Bounce) - Bounciness = physdata.Bounce; + if(Restitution != physdata.Bounce) + Restitution = physdata.Bounce; } /// /// Update the flags on this prim. This covers properties such as phantom, physics and temporary. diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 123c158e2c..2984782bf1 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -633,7 +633,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization private static void ProcessBounce(SceneObjectPart obj, XmlTextReader reader) { - obj.Bounciness = reader.ReadElementContentAsFloat("Bounce", String.Empty); + obj.Restitution = reader.ReadElementContentAsFloat("Bounce", String.Empty); } private static void ProcessGravityModifier(SceneObjectPart obj, XmlTextReader reader) @@ -1363,8 +1363,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("Density", sop.Density.ToString().ToLower()); if (sop.Friction != 0.6f) writer.WriteElementString("Friction", sop.Friction.ToString().ToLower()); - if (sop.Bounciness != 0.5f) - writer.WriteElementString("Bounce", sop.Bounciness.ToString().ToLower()); + if (sop.Restitution != 0.5f) + writer.WriteElementString("Bounce", sop.Restitution.ToString().ToLower()); if (sop.GravityModifier != 1.0f) writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower()); WriteVector(writer, "CameraEyeOffset", sop.GetCameraEyeOffset()); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 01a649baf1..66857645dc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7845,7 +7845,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api physdata.PhysShapeType = (PhysShapeType)part.PhysicsShapeType; physdata.Density = part.Density; physdata.Friction = part.Friction; - physdata.Bounce = part.Bounciness; + physdata.Bounce = part.Restitution; physdata.GravitationModifier = part.GravityModifier; if ((material_bits & (int)ScriptBaseClass.DENSITY) != 0) @@ -8238,7 +8238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ExtraPhysicsData physdata = new ExtraPhysicsData(); physdata.Density = part.Density; - physdata.Bounce = part.Bounciness; + physdata.Bounce = part.Restitution; physdata.GravitationModifier = part.GravityModifier; physdata.PhysShapeType = (PhysShapeType)shape_type;