From 2362da2ad03d84569da9cf558a84b9942afac852 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 8 Mar 2010 20:29:26 +0000 Subject: [PATCH 1/3] Add config option for switching between CSJ2K and BuggyJPEG. --- .../Agent/TextureSender/J2KDecoderModule.cs | 12 +++++++++--- bin/OpenSim.ini.example | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 5b022acf09..1386e86729 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs @@ -60,6 +60,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender #region IRegionModule + private bool m_useCSJ2K = true; + public string Name { get { return "J2KDecoderModule"; } } public bool IsSharedModule { get { return true; } } @@ -73,6 +75,12 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender m_scene = scene; scene.RegisterModuleInterface(this); + + IConfig startupConfig = source.Configs["Startup"]; + if (startupConfig != null) + { + m_useCSJ2K = startupConfig.GetBoolean("UseCSJ2K", m_useCSJ2K); + } } public void PostInitialise() @@ -144,15 +152,13 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender /// JPEG2000 data private void DoJ2KDecode(UUID assetID, byte[] j2kData) { - bool USE_CSJ2K = true; - //int DecodeTime = 0; //DecodeTime = Environment.TickCount; OpenJPEG.J2KLayerInfo[] layers; if (!TryLoadCacheForAsset(assetID, out layers)) { - if (USE_CSJ2K) + if (m_useCSJ2K) { try { diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 309ce880d6..74100f59bd 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -257,6 +257,10 @@ ; to be enabled from the console if this is set ; StartDisabled = false + ; Image decoding. Use CSJ2K for layer boundary decoding if true, + ; OpenJPEG if false + ; UseCSJ2K = true + [SMTP] enabled=false From 9ea6509a1c37108b7925f071e8d2c3727d38f6f7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 8 Mar 2010 21:08:48 +0000 Subject: [PATCH 2/3] Comment a debug message that is a tad too spammy --- OpenSim/Services/PresenceService/PresenceService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 1a3196589f..304538ab65 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs @@ -206,7 +206,7 @@ namespace OpenSim.Services.PresenceService } } - m_log.DebugFormat("[PRESENCE SERVICE]: GetAgents for {0} userIDs found {1} presences", userIDs.Length, info.Count); + // m_log.DebugFormat("[PRESENCE SERVICE]: GetAgents for {0} userIDs found {1} presences", userIDs.Length, info.Count); return info.ToArray(); } From c1352350004064a1722c2aeaaff313c4cc51181a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 7 Mar 2010 23:20:23 +0000 Subject: [PATCH 3/3] MSSQL tweaks for latest ROBUST - friends handling fixed, GridUserData placeholder added. Signed-off-by: Melanie --- OpenSim/Data/MSSQL/MSSQLFriendsData.cs | 2 +- OpenSim/Data/MSSQL/MSSQLGridUserData.cs | 68 +++++++++++++++++++ .../Data/MSSQL/Resources/001_FriendsStore.sql | 2 +- .../Data/MSSQL/Resources/001_UserAccount.sql | 14 ++++ .../Data/MSSQL/Resources/002_FriendsStore.sql | 2 +- .../Data/MSSQL/Resources/003_UserAccount.sql | 9 +++ .../Data/MSSQL/Resources/004_UserAccount.sql | 7 ++ 7 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 OpenSim/Data/MSSQL/MSSQLGridUserData.cs create mode 100644 OpenSim/Data/MSSQL/Resources/001_UserAccount.sql create mode 100644 OpenSim/Data/MSSQL/Resources/003_UserAccount.sql create mode 100644 OpenSim/Data/MSSQL/Resources/004_UserAccount.sql diff --git a/OpenSim/Data/MSSQL/MSSQLFriendsData.cs b/OpenSim/Data/MSSQL/MSSQLFriendsData.cs index 34da943f7e..af4fd9ba55 100644 --- a/OpenSim/Data/MSSQL/MSSQLFriendsData.cs +++ b/OpenSim/Data/MSSQL/MSSQLFriendsData.cs @@ -72,7 +72,7 @@ namespace OpenSim.Data.MSSQL using (SqlCommand cmd = new SqlCommand()) { - cmd.CommandText = String.Format("select a.*,b.Flags as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID = ?PrincipalID and b.Flags is not null", m_Realm); + cmd.CommandText = String.Format("select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID = @PrincipalID", m_Realm); cmd.Parameters.Add(m_database.CreateParameter("@PrincipalID", principalID.ToString())); cmd.Connection = conn; conn.Open(); diff --git a/OpenSim/Data/MSSQL/MSSQLGridUserData.cs b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs new file mode 100644 index 0000000000..b4a945c08e --- /dev/null +++ b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs @@ -0,0 +1,68 @@ +/* + * 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 System.Data; +using System.Reflection; +using System.Threading; +using log4net; +using OpenMetaverse; +using OpenSim.Framework; +using System.Data.SqlClient; + +namespace OpenSim.Data.MSSQL +{ + /// + /// A MSSQL Interface for Avatar Storage + /// + public class MSSQLGridUserData : MSSQLGenericTableHandler, + IGridUserData + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public MSSQLGridUserData(string connectionString, string realm) : + base(connectionString, realm, "UserGrid") + { + } + + public GridUserData GetGridUserData(string userID) + { + GridUserData[] ret = Get("UserID", userID); + + if (ret.Length == 0) + return null; + + return ret[0]; + } + + public bool StoreGridUserData(GridUserData data) + { + return Store(data); + } + } +} diff --git a/OpenSim/Data/MSSQL/Resources/001_FriendsStore.sql b/OpenSim/Data/MSSQL/Resources/001_FriendsStore.sql index f6480f7193..94d240b512 100644 --- a/OpenSim/Data/MSSQL/Resources/001_FriendsStore.sql +++ b/OpenSim/Data/MSSQL/Resources/001_FriendsStore.sql @@ -2,7 +2,7 @@ BEGIN TRANSACTION CREATE TABLE [Friends] ( [PrincipalID] uniqueidentifier NOT NULL, -[FriendID] varchar(255) NOT NULL, +[Friend] varchar(255) NOT NULL, [Flags] char(16) NOT NULL DEFAULT '0', [Offered] varchar(32) NOT NULL DEFAULT 0) ON [PRIMARY] diff --git a/OpenSim/Data/MSSQL/Resources/001_UserAccount.sql b/OpenSim/Data/MSSQL/Resources/001_UserAccount.sql new file mode 100644 index 0000000000..3dbf8a4925 --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/001_UserAccount.sql @@ -0,0 +1,14 @@ +CREATE TABLE [UserAccounts] ( + [PrincipalID] uniqueidentifier NOT NULL, + [ScopeID] uniqueidentifier NOT NULL, + [FirstName] [varchar](64) NOT NULL, + [LastName] [varchar](64) NOT NULL, + [Email] [varchar](64) NULL, + [ServiceURLs] [text] NULL, + [Created] [int] default NULL, + + PRIMARY KEY CLUSTERED +( + [PrincipalID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] diff --git a/OpenSim/Data/MSSQL/Resources/002_FriendsStore.sql b/OpenSim/Data/MSSQL/Resources/002_FriendsStore.sql index 7762a26894..e67d20e4b7 100644 --- a/OpenSim/Data/MSSQL/Resources/002_FriendsStore.sql +++ b/OpenSim/Data/MSSQL/Resources/002_FriendsStore.sql @@ -1,6 +1,6 @@ BEGIN TRANSACTION -INSERT INTO Friends (PrincipalID, FriendID, Flags, Offered) SELECT [ownerID], [friendID], [friendPerms], 0 FROM userfriends; +INSERT INTO Friends (PrincipalID, Friend, Flags, Offered) SELECT [ownerID], [friendID], [friendPerms], 0 FROM userfriends; COMMIT \ No newline at end of file diff --git a/OpenSim/Data/MSSQL/Resources/003_UserAccount.sql b/OpenSim/Data/MSSQL/Resources/003_UserAccount.sql new file mode 100644 index 0000000000..da0395b49c --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/003_UserAccount.sql @@ -0,0 +1,9 @@ +BEGIN TRANSACTION + +CREATE UNIQUE INDEX PrincipalID ON UserAccounts(PrincipalID); +CREATE INDEX Email ON UserAccounts(Email); +CREATE INDEX FirstName ON UserAccounts(FirstName); +CREATE INDEX LastName ON UserAccounts(LastName); +CREATE INDEX Name ON UserAccounts(FirstName,LastName); + +COMMIT \ No newline at end of file diff --git a/OpenSim/Data/MSSQL/Resources/004_UserAccount.sql b/OpenSim/Data/MSSQL/Resources/004_UserAccount.sql new file mode 100644 index 0000000000..a9a9021cc7 --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/004_UserAccount.sql @@ -0,0 +1,7 @@ +BEGIN TRANSACTION + +ALTER TABLE UserAccounts ADD UserLevel integer NOT NULL DEFAULT 0; +ALTER TABLE UserAccounts ADD UserFlags integer NOT NULL DEFAULT 0; +ALTER TABLE UserAccounts ADD UserTitle varchar(64) NOT NULL DEFAULT ''; + +COMMIT \ No newline at end of file