mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 12:25:42 +08:00
Formatting cleanup.
This commit is contained in:
@@ -117,7 +117,7 @@ namespace OpenSim.Data.Base
|
||||
return m_source.GetGuid(m_source.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public UInt32 GetUInt32(string name )
|
||||
public UInt32 GetUInt32(string name)
|
||||
{
|
||||
return (UInt32)GetInt32(name);
|
||||
}
|
||||
@@ -129,9 +129,9 @@ namespace OpenSim.Data.Base
|
||||
return int32;
|
||||
}
|
||||
|
||||
public Int64 GetInt64(string name)
|
||||
public Int64 GetInt64(string name)
|
||||
{
|
||||
int ordinal = m_source.GetOrdinal( name );
|
||||
int ordinal = m_source.GetOrdinal(name);
|
||||
long int64 = m_source.GetInt64(ordinal);
|
||||
return int64;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace OpenSim.Data.Base
|
||||
|
||||
// HACK: This is a temporary function used by TryGetValue().
|
||||
// Due to a bug in mono 1.2.6, delegate blocks cannot contain
|
||||
// a using() block. This has been fixed in SVN, so the next
|
||||
// a using block. This has been fixed in SVN, so the next
|
||||
// mono release should work.
|
||||
private void TryGetConnectionValue(DbConnection connection, TPrimaryKey primaryKey, ref TRowMapper result, ref bool success)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ namespace OpenSim.Data.Base
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
result = FromReader( CreateReader(reader));
|
||||
result = FromReader(CreateReader(reader));
|
||||
success = true;
|
||||
}
|
||||
else
|
||||
@@ -165,7 +165,7 @@ namespace OpenSim.Data.Base
|
||||
|
||||
// HACK: This is a temporary function used by Remove().
|
||||
// Due to a bug in mono 1.2.6, delegate blocks cannot contain
|
||||
// a using() block. This has been fixed in SVN, so the next
|
||||
// a using block. This has been fixed in SVN, so the next
|
||||
// mono release should work.
|
||||
protected virtual void TryDelete(DbConnection connection, TPrimaryKey id, ref int deleted)
|
||||
{
|
||||
@@ -215,7 +215,7 @@ namespace OpenSim.Data.Base
|
||||
|
||||
// HACK: This is a temporary function used by Update().
|
||||
// Due to a bug in mono 1.2.6, delegate blocks cannot contain
|
||||
// a using() block. This has been fixed in SVN, so the next
|
||||
// a using block. This has been fixed in SVN, so the next
|
||||
// mono release should work.
|
||||
protected void TryUpdate(DbConnection connection, TPrimaryKey primaryKey, TRowMapper value, ref int updated)
|
||||
{
|
||||
@@ -246,7 +246,7 @@ namespace OpenSim.Data.Base
|
||||
|
||||
// HACK: This is a temporary function used by Add().
|
||||
// Due to a bug in mono 1.2.6, delegate blocks cannot contain
|
||||
// a using() block. This has been fixed in SVN, so the next
|
||||
// a using block. This has been fixed in SVN, so the next
|
||||
// mono release should work.
|
||||
protected void TryAdd(DbConnection connection, TRowMapper value, ref int added)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenSim.Data.MSSQLMapper
|
||||
|
||||
public override object ConvertToDbType(object value)
|
||||
{
|
||||
if( value is UInt32 )
|
||||
if (value is UInt32)
|
||||
{
|
||||
UInt32 tmpVal = (UInt32) value;
|
||||
Int64 result = Convert.ToInt64(tmpVal);
|
||||
|
||||
@@ -512,7 +512,7 @@ namespace OpenSim.Data.MySQL
|
||||
retval.FirstLifeImage = tmp;
|
||||
}
|
||||
|
||||
if(reader.IsDBNull(reader.GetOrdinal("webLoginKey")))
|
||||
if (reader.IsDBNull(reader.GetOrdinal("webLoginKey")))
|
||||
{
|
||||
retval.WebLoginKey = LLUUID.Zero;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenSim.Data.MySQL
|
||||
string settingPort = iniFile.ParseFileReadValue("port");
|
||||
|
||||
m_usersTableName = iniFile.ParseFileReadValue("userstablename");
|
||||
if( m_usersTableName == null )
|
||||
if (m_usersTableName == null)
|
||||
{
|
||||
m_usersTableName = "users";
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenSim.Data.MySQLMapper
|
||||
|
||||
public override BaseDataReader CreateReader(IDataReader reader)
|
||||
{
|
||||
return new MySQLDataReader( reader );
|
||||
return new MySQLDataReader(reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,14 +97,14 @@ namespace OpenSim.Data.NHibernate
|
||||
string regex = @"no such table: Assets";
|
||||
Regex RE = new Regex(regex, RegexOptions.Multiline);
|
||||
try {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
session.Load(typeof(AssetBase), LLUUID.Zero);
|
||||
}
|
||||
} catch (ObjectNotFoundException) {
|
||||
// yes, we know it's not there, but that's ok
|
||||
} catch (ADOException e) {
|
||||
Match m = RE.Match(e.ToString());
|
||||
if(m.Success) {
|
||||
if (m.Success) {
|
||||
// We don't have this table, so create it.
|
||||
new SchemaExport(cfg).Create(true, true);
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace OpenSim.Data.NHibernate
|
||||
|
||||
override public AssetBase FetchAsset(LLUUID uuid)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
try {
|
||||
return session.Load(typeof(AssetBase), uuid) as AssetBase;
|
||||
} catch {
|
||||
@@ -125,8 +125,8 @@ namespace OpenSim.Data.NHibernate
|
||||
override public void CreateAsset(AssetBase asset)
|
||||
{
|
||||
if (!ExistsAsset(asset.FullID)) {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Save(asset);
|
||||
transaction.Commit();
|
||||
}
|
||||
@@ -137,8 +137,8 @@ namespace OpenSim.Data.NHibernate
|
||||
override public void UpdateAsset(AssetBase asset)
|
||||
{
|
||||
if (ExistsAsset(asset.FullID)) {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Update(asset);
|
||||
transaction.Commit();
|
||||
}
|
||||
|
||||
@@ -95,14 +95,14 @@ namespace OpenSim.Data.NHibernate
|
||||
string regex = @"no such table: Inventory";
|
||||
Regex RE = new Regex(regex, RegexOptions.Multiline);
|
||||
try {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
session.Load(typeof(InventoryItemBase), LLUUID.Zero);
|
||||
}
|
||||
} catch (ObjectNotFoundException) {
|
||||
// yes, we know it's not there, but that's ok
|
||||
} catch (ADOException e) {
|
||||
Match m = RE.Match(e.ToString());
|
||||
if(m.Success) {
|
||||
if (m.Success) {
|
||||
// We don't have this table, so create it.
|
||||
new SchemaExport(cfg).Create(true, true);
|
||||
}
|
||||
@@ -125,7 +125,7 @@ namespace OpenSim.Data.NHibernate
|
||||
/// <returns>A class containing item information</returns>
|
||||
public InventoryItemBase getInventoryItem(LLUUID item)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
try {
|
||||
return session.Load(typeof(InventoryItemBase), item) as InventoryItemBase;
|
||||
} catch {
|
||||
@@ -142,8 +142,8 @@ namespace OpenSim.Data.NHibernate
|
||||
public void addInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
if (!ExistsItem(item.ID)) {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Save(item);
|
||||
transaction.Commit();
|
||||
}
|
||||
@@ -161,8 +161,8 @@ namespace OpenSim.Data.NHibernate
|
||||
public void updateInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
if (ExistsItem(item.ID)) {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Update(item);
|
||||
transaction.Commit();
|
||||
}
|
||||
@@ -178,8 +178,8 @@ namespace OpenSim.Data.NHibernate
|
||||
/// <param name="item"></param>
|
||||
public void deleteInventoryItem(LLUUID itemID)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Delete(itemID);
|
||||
transaction.Commit();
|
||||
}
|
||||
@@ -194,7 +194,7 @@ namespace OpenSim.Data.NHibernate
|
||||
/// <returns>A class containing folder information</returns>
|
||||
public InventoryFolderBase getInventoryFolder(LLUUID folder)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
try {
|
||||
return session.Load(typeof(InventoryFolderBase), folder) as InventoryFolderBase;
|
||||
} catch {
|
||||
@@ -211,8 +211,8 @@ namespace OpenSim.Data.NHibernate
|
||||
public void addInventoryFolder(InventoryFolderBase folder)
|
||||
{
|
||||
if (!ExistsFolder(folder.ID)) {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Save(folder);
|
||||
transaction.Commit();
|
||||
}
|
||||
@@ -230,8 +230,8 @@ namespace OpenSim.Data.NHibernate
|
||||
public void updateInventoryFolder(InventoryFolderBase folder)
|
||||
{
|
||||
if (ExistsFolder(folder.ID)) {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Update(folder);
|
||||
transaction.Commit();
|
||||
}
|
||||
@@ -247,8 +247,8 @@ namespace OpenSim.Data.NHibernate
|
||||
/// <param name="folder"></param>
|
||||
public void deleteInventoryFolder(LLUUID folderID)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Delete(folderID.ToString());
|
||||
transaction.Commit();
|
||||
}
|
||||
@@ -324,10 +324,10 @@ namespace OpenSim.Data.NHibernate
|
||||
/// <returns>A List of InventoryItemBase items</returns>
|
||||
public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
// try {
|
||||
ICriteria criteria = session.CreateCriteria(typeof(InventoryItemBase));
|
||||
criteria.Add(Expression.Eq("Folder", folderID) );
|
||||
criteria.Add(Expression.Eq("Folder", folderID));
|
||||
List<InventoryItemBase> list = new List<InventoryItemBase>();
|
||||
foreach (InventoryItemBase item in criteria.List())
|
||||
{
|
||||
@@ -348,11 +348,11 @@ namespace OpenSim.Data.NHibernate
|
||||
// see InventoryItemBase.getUserRootFolder
|
||||
public InventoryFolderBase getUserRootFolder(LLUUID user)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
// try {
|
||||
ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase));
|
||||
criteria.Add(Expression.Eq("ParentID", LLUUID.Zero) );
|
||||
criteria.Add(Expression.Eq("Owner", user) );
|
||||
criteria.Add(Expression.Eq("ParentID", LLUUID.Zero));
|
||||
criteria.Add(Expression.Eq("Owner", user));
|
||||
foreach (InventoryFolderBase folder in criteria.List())
|
||||
{
|
||||
return folder;
|
||||
@@ -372,10 +372,10 @@ namespace OpenSim.Data.NHibernate
|
||||
/// <param name="parentID">ID of parent</param>
|
||||
private void getInventoryFolders(ref List<InventoryFolderBase> folders, LLUUID parentID)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
// try {
|
||||
ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase));
|
||||
criteria.Add(Expression.Eq("ParentID", parentID) );
|
||||
criteria.Add(Expression.Eq("ParentID", parentID));
|
||||
foreach (InventoryFolderBase item in criteria.List())
|
||||
{
|
||||
folders.Add(item);
|
||||
|
||||
@@ -88,14 +88,14 @@ namespace OpenSim.Data.NHibernate
|
||||
string regex = @"no such table: UserProfiles";
|
||||
Regex RE = new Regex(regex, RegexOptions.Multiline);
|
||||
try {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
session.Load(typeof(UserProfileData), LLUUID.Zero);
|
||||
}
|
||||
} catch (ObjectNotFoundException) {
|
||||
// yes, we know it's not there, but that's ok
|
||||
} catch (ADOException e) {
|
||||
Match m = RE.Match(e.ToString());
|
||||
if(m.Success) {
|
||||
if (m.Success) {
|
||||
// We don't have this table, so create it.
|
||||
new SchemaExport(cfg).Create(true, true);
|
||||
}
|
||||
@@ -106,7 +106,7 @@ namespace OpenSim.Data.NHibernate
|
||||
{
|
||||
UserProfileData user = null;
|
||||
try {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
|
||||
}
|
||||
// BUG: CATCHALL IS BAD.
|
||||
@@ -119,7 +119,7 @@ namespace OpenSim.Data.NHibernate
|
||||
{
|
||||
UserProfileData user;
|
||||
// TODO: I'm sure I'll have to do something silly here
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
|
||||
user.CurrentAgent = GetAgentByUUID(uuid);
|
||||
}
|
||||
@@ -129,8 +129,8 @@ namespace OpenSim.Data.NHibernate
|
||||
override public void AddNewUserProfile(UserProfileData profile)
|
||||
{
|
||||
if (!ExistsUser(profile.ID)) {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Save(profile);
|
||||
SetAgentData(profile.ID, profile.CurrentAgent, session);
|
||||
// TODO: save agent
|
||||
@@ -166,8 +166,8 @@ namespace OpenSim.Data.NHibernate
|
||||
override public bool UpdateUserProfile(UserProfileData profile)
|
||||
{
|
||||
if (ExistsUser(profile.ID)) {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Update(profile);
|
||||
SetAgentData(profile.ID, profile.CurrentAgent, session);
|
||||
transaction.Commit();
|
||||
@@ -183,8 +183,8 @@ namespace OpenSim.Data.NHibernate
|
||||
|
||||
override public void AddNewUserAgent(UserAgentData agent)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Save(agent);
|
||||
transaction.Commit();
|
||||
}
|
||||
@@ -193,8 +193,8 @@ namespace OpenSim.Data.NHibernate
|
||||
|
||||
public void UpdateUserAgent(UserAgentData agent)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
session.Update(agent);
|
||||
transaction.Commit();
|
||||
}
|
||||
@@ -206,7 +206,7 @@ namespace OpenSim.Data.NHibernate
|
||||
override public UserAgentData GetAgentByUUID(LLUUID uuid)
|
||||
{
|
||||
try {
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
return session.Load(typeof(UserAgentData), uuid) as UserAgentData;
|
||||
}
|
||||
} catch {
|
||||
@@ -216,7 +216,7 @@ namespace OpenSim.Data.NHibernate
|
||||
|
||||
override public UserProfileData GetUserByName(string fname, string lname)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
ICriteria criteria = session.CreateCriteria(typeof(UserProfileData));
|
||||
criteria.Add(Expression.Eq("FirstName", fname));
|
||||
criteria.Add(Expression.Eq("SurName", lname));
|
||||
@@ -247,11 +247,11 @@ namespace OpenSim.Data.NHibernate
|
||||
|
||||
if (querysplit.Length == 2)
|
||||
{
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
ICriteria criteria = session.CreateCriteria(typeof(UserProfileData));
|
||||
criteria.Add(Expression.Like("FirstName", querysplit[0]));
|
||||
criteria.Add(Expression.Like("SurName", querysplit[1]));
|
||||
foreach(UserProfileData profile in criteria.List())
|
||||
foreach (UserProfileData profile in criteria.List())
|
||||
{
|
||||
AvatarPickerAvatar user = new AvatarPickerAvatar();
|
||||
user.AvatarID = profile.ID;
|
||||
@@ -280,7 +280,7 @@ namespace OpenSim.Data.NHibernate
|
||||
{
|
||||
UserAppearance appearance;
|
||||
// TODO: I'm sure I'll have to do something silly here
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
appearance = session.Load(typeof(UserAppearance), user) as UserAppearance;
|
||||
}
|
||||
return appearance;
|
||||
@@ -289,7 +289,7 @@ namespace OpenSim.Data.NHibernate
|
||||
private bool ExistsAppearance(LLUUID uuid)
|
||||
{
|
||||
UserAppearance appearance;
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
appearance = session.Load(typeof(UserAppearance), uuid) as UserAppearance;
|
||||
}
|
||||
return (appearance == null) ? false : true;
|
||||
@@ -299,8 +299,8 @@ namespace OpenSim.Data.NHibernate
|
||||
override public void UpdateUserAppearance(LLUUID user, UserAppearance appearance)
|
||||
{
|
||||
bool exists = ExistsAppearance(user);
|
||||
using(ISession session = factory.OpenSession()) {
|
||||
using(ITransaction transaction = session.BeginTransaction()) {
|
||||
using (ISession session = factory.OpenSession()) {
|
||||
using (ITransaction transaction = session.BeginTransaction()) {
|
||||
if (exists) {
|
||||
session.Update(appearance);
|
||||
} else {
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Data
|
||||
PrimitiveBaseShape shape = new PrimitiveBaseShape();
|
||||
|
||||
PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper(m_schema, shape);
|
||||
mapper.FillObject( reader );
|
||||
mapper.FillObject(reader);
|
||||
|
||||
return mapper;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ namespace OpenSim.Data
|
||||
|
||||
private PrimitiveBaseShapeRowMapper CreateRowMapper(Guid sceneObjectPartId, PrimitiveBaseShape primitiveBaseShape)
|
||||
{
|
||||
PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper( m_schema, primitiveBaseShape );
|
||||
PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper(m_schema, primitiveBaseShape);
|
||||
mapper.SceneObjectPartId = sceneObjectPartId;
|
||||
return mapper;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid)));
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if(reader.Read())
|
||||
if (reader.Read())
|
||||
{
|
||||
reader.Close();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user