* Updated MSSQL to reflect resend changes * Added the new columns in prims table. * Created a implementation for getting gestures. * Remove configurable table names for user. * Thanks Ruud Lathorp0.6.0-stable
parent
104039b6c6
commit
4daaac662f
|
@ -163,7 +163,7 @@ namespace OpenSim.Data.MSSQL
|
|||
/// <returns>A string containing the storage system name</returns>
|
||||
override public string Name
|
||||
{
|
||||
get { return "Sql OpenGridData"; }
|
||||
get { return "MSSQL OpenGridData"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -611,6 +611,32 @@ namespace OpenSim.Data.MSSQL
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all activated gesture-items in the inventory of the specified avatar.
|
||||
/// </summary>
|
||||
/// <param name="avatarID">The <see cref="UUID"/> of the avatar</param>
|
||||
/// <returns>
|
||||
/// The list of gestures (<see cref="InventoryItemBase"/>s)
|
||||
/// </returns>
|
||||
public List<InventoryItemBase> fetchActiveGestures(UUID avatarID)
|
||||
{
|
||||
using (AutoClosingSqlCommand command = database.Query("SELECT * FROM inventoryitems WHERE avatarId = @uuid AND assetType = @assetType and flags = 1"))
|
||||
{
|
||||
command.Parameters.Add(database.CreateParameter("uuid", avatarID));
|
||||
command.Parameters.Add(database.CreateParameter("assetType", (int)AssetType.Gesture));
|
||||
|
||||
using (IDataReader reader = command.ExecuteReader())
|
||||
{
|
||||
List<InventoryItemBase> gestureList = new List<InventoryItemBase>();
|
||||
while (reader.Read())
|
||||
{
|
||||
gestureList.Add(readInventoryItem(reader));
|
||||
}
|
||||
return gestureList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private methods
|
||||
|
@ -799,10 +825,6 @@ namespace OpenSim.Data.MSSQL
|
|||
}
|
||||
}
|
||||
|
||||
public List<InventoryItemBase> fetchActiveGestures (UUID avatarID)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using OpenMetaverse;
|
||||
|
@ -932,6 +933,10 @@ VALUES
|
|||
prim.Name = (String)row["Name"];
|
||||
// various text fields
|
||||
prim.Text = (String)row["Text"];
|
||||
prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]),
|
||||
Convert.ToInt32(row["ColorR"]),
|
||||
Convert.ToInt32(row["ColorG"]),
|
||||
Convert.ToInt32(row["ColorB"]));
|
||||
prim.Description = (String)row["Description"];
|
||||
prim.SitName = (String)row["SitName"];
|
||||
prim.TouchName = (String)row["TouchName"];
|
||||
|
@ -948,48 +953,47 @@ VALUES
|
|||
prim.BaseMask = Convert.ToUInt32(row["BaseMask"]);
|
||||
// vectors
|
||||
prim.OffsetPosition = new Vector3(
|
||||
Convert.ToSingle(row["PositionX"]),
|
||||
Convert.ToSingle(row["PositionY"]),
|
||||
Convert.ToSingle(row["PositionZ"])
|
||||
);
|
||||
Convert.ToSingle(row["PositionX"]),
|
||||
Convert.ToSingle(row["PositionY"]),
|
||||
Convert.ToSingle(row["PositionZ"]));
|
||||
|
||||
prim.GroupPosition = new Vector3(
|
||||
Convert.ToSingle(row["GroupPositionX"]),
|
||||
Convert.ToSingle(row["GroupPositionY"]),
|
||||
Convert.ToSingle(row["GroupPositionZ"])
|
||||
);
|
||||
Convert.ToSingle(row["GroupPositionX"]),
|
||||
Convert.ToSingle(row["GroupPositionY"]),
|
||||
Convert.ToSingle(row["GroupPositionZ"]));
|
||||
|
||||
prim.Velocity = new Vector3(
|
||||
Convert.ToSingle(row["VelocityX"]),
|
||||
Convert.ToSingle(row["VelocityY"]),
|
||||
Convert.ToSingle(row["VelocityZ"])
|
||||
);
|
||||
Convert.ToSingle(row["VelocityX"]),
|
||||
Convert.ToSingle(row["VelocityY"]),
|
||||
Convert.ToSingle(row["VelocityZ"]));
|
||||
|
||||
prim.AngularVelocity = new Vector3(
|
||||
Convert.ToSingle(row["AngularVelocityX"]),
|
||||
Convert.ToSingle(row["AngularVelocityY"]),
|
||||
Convert.ToSingle(row["AngularVelocityZ"])
|
||||
);
|
||||
Convert.ToSingle(row["AngularVelocityX"]),
|
||||
Convert.ToSingle(row["AngularVelocityY"]),
|
||||
Convert.ToSingle(row["AngularVelocityZ"]));
|
||||
|
||||
prim.Acceleration = new Vector3(
|
||||
Convert.ToSingle(row["AccelerationX"]),
|
||||
Convert.ToSingle(row["AccelerationY"]),
|
||||
Convert.ToSingle(row["AccelerationZ"])
|
||||
);
|
||||
Convert.ToSingle(row["AccelerationX"]),
|
||||
Convert.ToSingle(row["AccelerationY"]),
|
||||
Convert.ToSingle(row["AccelerationZ"]));
|
||||
|
||||
// quaternions
|
||||
prim.RotationOffset = new Quaternion(
|
||||
Convert.ToSingle(row["RotationX"]),
|
||||
Convert.ToSingle(row["RotationY"]),
|
||||
Convert.ToSingle(row["RotationZ"]),
|
||||
Convert.ToSingle(row["RotationW"])
|
||||
);
|
||||
Convert.ToSingle(row["RotationX"]),
|
||||
Convert.ToSingle(row["RotationY"]),
|
||||
Convert.ToSingle(row["RotationZ"]),
|
||||
Convert.ToSingle(row["RotationW"]));
|
||||
|
||||
prim.SitTargetPositionLL = new Vector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"])
|
||||
);
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"]));
|
||||
|
||||
prim.SitTargetOrientationLL = new Quaternion(
|
||||
Convert.ToSingle(row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(row["SitTargetOrientW"])
|
||||
);
|
||||
Convert.ToSingle(row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(row["SitTargetOrientW"]));
|
||||
|
||||
prim.PayPrice[0] = Convert.ToInt32(row["PayPrice"]);
|
||||
prim.PayPrice[1] = Convert.ToInt32(row["PayButton1"]);
|
||||
|
@ -1001,17 +1005,15 @@ VALUES
|
|||
prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]);
|
||||
prim.SoundFlags = 1; // If it's persisted at all, it's looped
|
||||
|
||||
if (row["TextureAnimation"] != null && row["TextureAnimation"] != DBNull.Value)
|
||||
if (!row.IsNull("TextureAnimation") && row["TextureAnimation"] != DBNull.Value)
|
||||
prim.TextureAnimation = (Byte[])row["TextureAnimation"];
|
||||
if (!row.IsNull("ParticleSystem"))
|
||||
prim.ParticleSystem = (Byte[])row["ParticleSystem"];
|
||||
|
||||
prim.RotationalVelocity = new Vector3(
|
||||
Convert.ToSingle(row["OmegaX"]),
|
||||
Convert.ToSingle(row["OmegaY"]),
|
||||
Convert.ToSingle(row["OmegaZ"])
|
||||
);
|
||||
|
||||
// TODO: Rotation
|
||||
// OmegaX, OmegaY, OmegaZ
|
||||
Convert.ToSingle(row["OmegaX"]),
|
||||
Convert.ToSingle(row["OmegaY"]),
|
||||
Convert.ToSingle(row["OmegaZ"]));
|
||||
|
||||
prim.SetCameraEyeOffset(new Vector3(
|
||||
Convert.ToSingle(row["CameraEyeOffsetX"]),
|
||||
|
@ -1039,6 +1041,9 @@ VALUES
|
|||
prim.SalePrice = Convert.ToInt32(row["SalePrice"]);
|
||||
prim.ObjectSaleType = Convert.ToByte(row["SaleType"]);
|
||||
|
||||
if (!row.IsNull("ClickAction"))
|
||||
prim.ClickAction = Convert.ToByte(row["ClickAction"]);
|
||||
|
||||
return prim;
|
||||
}
|
||||
|
||||
|
@ -1051,10 +1056,10 @@ VALUES
|
|||
{
|
||||
PrimitiveBaseShape s = new PrimitiveBaseShape();
|
||||
s.Scale = new Vector3(
|
||||
Convert.ToSingle(row["ScaleX"]),
|
||||
Convert.ToSingle(row["ScaleY"]),
|
||||
Convert.ToSingle(row["ScaleZ"])
|
||||
);
|
||||
Convert.ToSingle(row["ScaleX"]),
|
||||
Convert.ToSingle(row["ScaleY"]),
|
||||
Convert.ToSingle(row["ScaleZ"]));
|
||||
|
||||
// paths
|
||||
s.PCode = Convert.ToByte(row["PCode"]);
|
||||
s.PathBegin = Convert.ToUInt16(row["PathBegin"]);
|
||||
|
|
|
@ -51,9 +51,9 @@ namespace OpenSim.Data.MSSQL
|
|||
/// </summary>
|
||||
public MSSQLManager database;
|
||||
|
||||
private string m_agentsTableName;
|
||||
private string m_usersTableName;
|
||||
private string m_userFriendsTableName;
|
||||
private const string m_agentsTableName = "agents";
|
||||
private const string m_usersTableName = "users";
|
||||
private const string m_userFriendsTableName = "userfriends";
|
||||
|
||||
override public void Initialise()
|
||||
{
|
||||
|
@ -68,7 +68,6 @@ namespace OpenSim.Data.MSSQL
|
|||
/// <remarks>use mssql_connection.ini</remarks>
|
||||
override public void Initialise(string connect)
|
||||
{
|
||||
IniFile iniFile = new IniFile("mssql_connection.ini");
|
||||
|
||||
if (string.IsNullOrEmpty(connect))
|
||||
{
|
||||
|
@ -76,6 +75,8 @@ namespace OpenSim.Data.MSSQL
|
|||
}
|
||||
else
|
||||
{
|
||||
IniFile iniFile = new IniFile("mssql_connection.ini");
|
||||
|
||||
string settingDataSource = iniFile.ParseFileReadValue("data_source");
|
||||
string settingInitialCatalog = iniFile.ParseFileReadValue("initial_catalog");
|
||||
string settingPersistSecurityInfo = iniFile.ParseFileReadValue("persist_security_info");
|
||||
|
@ -85,23 +86,23 @@ namespace OpenSim.Data.MSSQL
|
|||
database = new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, settingPassword);
|
||||
}
|
||||
|
||||
m_usersTableName = iniFile.ParseFileReadValue("userstablename");
|
||||
if (m_usersTableName == null)
|
||||
{
|
||||
m_usersTableName = "users";
|
||||
}
|
||||
|
||||
m_userFriendsTableName = iniFile.ParseFileReadValue("userfriendstablename");
|
||||
if (m_userFriendsTableName == null)
|
||||
{
|
||||
m_userFriendsTableName = "userfriends";
|
||||
}
|
||||
|
||||
m_agentsTableName = iniFile.ParseFileReadValue("agentstablename");
|
||||
if (m_agentsTableName == null)
|
||||
{
|
||||
m_agentsTableName = "agents";
|
||||
}
|
||||
// m_usersTableName = iniFile.ParseFileReadValue("userstablename");
|
||||
// if (m_usersTableName == null)
|
||||
// {
|
||||
// m_usersTableName = "users";
|
||||
// }
|
||||
//
|
||||
// m_userFriendsTableName = iniFile.ParseFileReadValue("userfriendstablename");
|
||||
// if (m_userFriendsTableName == null)
|
||||
// {
|
||||
// m_userFriendsTableName = "userfriends";
|
||||
// }
|
||||
//
|
||||
// m_agentsTableName = iniFile.ParseFileReadValue("agentstablename");
|
||||
// if (m_agentsTableName == null)
|
||||
// {
|
||||
// m_agentsTableName = "agents";
|
||||
// }
|
||||
|
||||
//TODO this can be removed at one time!!!!!
|
||||
TestTables();
|
||||
|
@ -110,6 +111,9 @@ namespace OpenSim.Data.MSSQL
|
|||
database.CheckMigration(_migrationStore);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases unmanaged and - optionally - managed resources
|
||||
/// </summary>
|
||||
override public void Dispose() { }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -802,7 +802,7 @@ namespace OpenSim.Grid.GridServer
|
|||
response.Value = responseData;
|
||||
IList simProfileList = new ArrayList();
|
||||
|
||||
bool fastMode = (Config.DatabaseProvider == "OpenSim.Data.MySQL.dll");
|
||||
bool fastMode = (Config.DatabaseProvider == "OpenSim.Data.MySQL.dll" || Config.DatabaseProvider == "OpenSim.Data.MSSQL.dll");
|
||||
|
||||
if (fastMode)
|
||||
{
|
||||
|
|
|
@ -1488,6 +1488,7 @@
|
|||
<Reference name="System" localCopy="false"/>
|
||||
<Reference name="System.Xml"/>
|
||||
<Reference name="System.Data"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="OpenSim.Framework"/>
|
||||
<Reference name="OpenSim.Data"/>
|
||||
<Reference name="OpenSim.Region.Environment"/>
|
||||
|
|
Loading…
Reference in New Issue