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 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/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(); } 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