Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
commit
4b8af2e1aa
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// A MSSQL Interface for Avatar Storage
|
||||
/// </summary>
|
||||
public class MSSQLGridUserData : MSSQLGenericTableHandler<GridUserData>,
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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<IJ2KDecoder>(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
|
|||
/// <param name="j2kData">JPEG2000 data</param>
|
||||
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
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue