From d0019704e60da8392f505f1bb783ee668b0299b1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 23 Oct 2009 09:47:45 +0100 Subject: Adding the presence service skeleton --- OpenSim/Data/IPresenceData.cs | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 OpenSim/Data/IPresenceData.cs (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs new file mode 100644 index 0000000..ca661a2 --- /dev/null +++ b/OpenSim/Data/IPresenceData.cs @@ -0,0 +1,55 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Data +{ + public class PresenceData + { + public UUID PrincipalID; + public UUID RegionID; + public Dictionary Data; + } + + /// + /// An interface for connecting to the authentication datastore + /// + public interface IPresenceData + { + bool Store(PresenceData data); + + PresenceData Get(UUID principalID); + + bool SetDataItem(UUID principalID, string item, string value); + + bool Delete(UUID regionID); + } +} -- cgit v1.1 From a41cd1d0695c01e4096fa0b7696b415a4c7455fc Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 23 Oct 2009 13:14:29 -0700 Subject: * Unregister Mono.Addins event handlers in PluginLoader.Dispose() and always handle PluginLoader with the using pattern. This freed up 121,634,796 bytes on my system * Avoid allocating an Action object every round of the OutgoingPacketHandler * Removed unnecessary semi-colon endings from OpenSim.ini.example [InterestManagement] section --- OpenSim/Data/DataPluginFactory.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/DataPluginFactory.cs b/OpenSim/Data/DataPluginFactory.cs index 718c6b2..841f71e 100644 --- a/OpenSim/Data/DataPluginFactory.cs +++ b/OpenSim/Data/DataPluginFactory.cs @@ -119,14 +119,15 @@ namespace OpenSim.Data PluginLoaderParamFactory(connect, out pluginInitialiser, out extensionPointPath); - PluginLoader loader = new PluginLoader(pluginInitialiser); - - // loader will try to load all providers (MySQL, MSSQL, etc) - // unless it is constrainted to the correct "Provider" entry in the addin.xml - loader.Add(extensionPointPath, new PluginProviderFilter(provider)); - loader.Load(); + using (PluginLoader loader = new PluginLoader(pluginInitialiser)) + { + // loader will try to load all providers (MySQL, MSSQL, etc) + // unless it is constrainted to the correct "Provider" entry in the addin.xml + loader.Add(extensionPointPath, new PluginProviderFilter(provider)); + loader.Load(); - return loader.Plugins; + return loader.Plugins; + } } /// -- cgit v1.1 From 730930955a7edc0bfa69ff1cac93acd024cf8d24 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sun, 25 Oct 2009 00:40:21 -0700 Subject: Changing Scene.ForEachClient to use the synchronous for loop instead of Parallel. This is quite possibly the source of some deadlocking, and at the very least the synchronous version gives better stack traces * Lock the LLUDPClient RTO math * Add a helper function for backing off the RTO, and follow the optional advice in RFC 2988 to clear existing SRTT and RTTVAR values during a backoff * Removing the unused PrimitiveBaseShape.SculptImage parameter * Improved performance of SceneObjectPart instantiation * ZeroMesher now drops SculptData bytes like Meshmerizer, to allow the texture data to be GCed * Improved typecasting speed in MySQLLegacyRegionData.BuildShape() * Improved the instantiation of PrimitiveBaseShape --- OpenSim/Data/MySQL/MySQLAssetData.cs | 3 -- OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 53 ++++++++++++++--------------- 2 files changed, 26 insertions(+), 30 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index fc05d1d..4d49733 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -167,9 +167,6 @@ namespace OpenSim.Data.MySQL asset.Temporary = Convert.ToBoolean(dbReader["temporary"]); } } - - if (asset != null) - UpdateAccessTime(asset); } catch (Exception e) { diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index 801d6b9..c07963c 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs @@ -1430,37 +1430,36 @@ namespace OpenSim.Data.MySQL { PrimitiveBaseShape s = new PrimitiveBaseShape(); s.Scale = new Vector3( - Convert.ToSingle(row["ScaleX"]), - Convert.ToSingle(row["ScaleY"]), - Convert.ToSingle(row["ScaleZ"]) - ); + (float)(double)row["ScaleX"], + (float)(double)row["ScaleY"], + (float)(double)row["ScaleZ"] + ); // paths - s.PCode = Convert.ToByte(row["PCode"]); - s.PathBegin = Convert.ToUInt16(row["PathBegin"]); - s.PathEnd = Convert.ToUInt16(row["PathEnd"]); - s.PathScaleX = Convert.ToByte(row["PathScaleX"]); - s.PathScaleY = Convert.ToByte(row["PathScaleY"]); - s.PathShearX = Convert.ToByte(row["PathShearX"]); - s.PathShearY = Convert.ToByte(row["PathShearY"]); - s.PathSkew = Convert.ToSByte(row["PathSkew"]); - s.PathCurve = Convert.ToByte(row["PathCurve"]); - s.PathRadiusOffset = Convert.ToSByte(row["PathRadiusOffset"]); - s.PathRevolutions = Convert.ToByte(row["PathRevolutions"]); - s.PathTaperX = Convert.ToSByte(row["PathTaperX"]); - s.PathTaperY = Convert.ToSByte(row["PathTaperY"]); - s.PathTwist = Convert.ToSByte(row["PathTwist"]); - s.PathTwistBegin = Convert.ToSByte(row["PathTwistBegin"]); + s.PCode = (byte)(int)row["PCode"]; + s.PathBegin = (ushort)(int)row["PathBegin"]; + s.PathEnd = (ushort)(int)row["PathEnd"]; + s.PathScaleX = (byte)(int)row["PathScaleX"]; + s.PathScaleY = (byte)(int)row["PathScaleY"]; + s.PathShearX = (byte)(int)row["PathShearX"]; + s.PathShearY = (byte)(int)row["PathShearY"]; + s.PathSkew = (sbyte)(int)row["PathSkew"]; + s.PathCurve = (byte)(int)row["PathCurve"]; + s.PathRadiusOffset = (sbyte)(int)row["PathRadiusOffset"]; + s.PathRevolutions = (byte)(int)row["PathRevolutions"]; + s.PathTaperX = (sbyte)(int)row["PathTaperX"]; + s.PathTaperY = (sbyte)(int)row["PathTaperY"]; + s.PathTwist = (sbyte)(int)row["PathTwist"]; + s.PathTwistBegin = (sbyte)(int)row["PathTwistBegin"]; // profile - s.ProfileBegin = Convert.ToUInt16(row["ProfileBegin"]); - s.ProfileEnd = Convert.ToUInt16(row["ProfileEnd"]); - s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); - s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); - byte[] textureEntry = (byte[]) row["Texture"]; - s.TextureEntry = textureEntry; + s.ProfileBegin = (ushort)(int)row["ProfileBegin"]; + s.ProfileEnd = (ushort)(int)row["ProfileEnd"]; + s.ProfileCurve = (byte)(int)row["ProfileCurve"]; + s.ProfileHollow = (ushort)(int)row["ProfileHollow"]; + s.TextureEntry = (byte[])row["Texture"]; - s.ExtraParams = (byte[]) row["ExtraParams"]; + s.ExtraParams = (byte[])row["ExtraParams"]; - s.State = Convert.ToByte(row["State"]); + s.State = (byte)(int)row["State"]; return s; } -- cgit v1.1 From b498693cff9b044e8ab3c7a88a18e9d67f16461b Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 27 Oct 2009 01:46:14 -0700 Subject: * Tweak to region module loading to check for a matching constructor first instead of throwing and catching exceptions * Commenting out the MySQL startup sequence that cleans out dropped attachments under the advice that it is no longer relevant. If anything, it could be brought back as a database cleanup console command * Updated to the latest libomv 0.8.0-pre. UUID.TryParse() will no longer throw and catch exceptions for most failed UUID parses --- OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 32 ++++++++++++++++------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index c07963c..a807948 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs @@ -66,22 +66,26 @@ namespace OpenSim.Data.MySQL Migration m = new Migration(m_Connection, assem, "RegionStore"); m.Update(); + // NOTE: This is a very slow query that times out on regions with a lot of prims. + // I'm told that it is no longer relevant so it's commented out now, but if it + // is relevant it should be added as a console command instead of part of the + // startup phase // Clean dropped attachments // - try - { - using (MySqlCommand cmd = m_Connection.CreateCommand()) - { - cmd.CommandText = "delete from prims, primshapes using prims " + - "left join primshapes on prims.uuid = primshapes.uuid " + - "where PCode = 9 and State <> 0"; - ExecuteNonQuery(cmd); - } - } - catch (MySqlException ex) - { - m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message); - } + //try + //{ + // using (MySqlCommand cmd = m_Connection.CreateCommand()) + // { + // cmd.CommandText = "delete from prims, primshapes using prims " + + // "left join primshapes on prims.uuid = primshapes.uuid " + + // "where PCode = 9 and State <> 0"; + // ExecuteNonQuery(cmd); + // } + //} + //catch (MySqlException ex) + //{ + // m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message); + //} } private IDataReader ExecuteReader(MySqlCommand c) -- cgit v1.1