mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
* Optimised using statements and namespace references across entire project (this took a while to run).
This commit is contained in:
@@ -26,11 +26,10 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Framework;
|
||||
using libsecondlife;
|
||||
using OpenSim.Data.Base;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
|
||||
namespace OpenSim.Region.Modules.AvatarFactory
|
||||
{
|
||||
@@ -52,7 +51,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
|
||||
|
||||
m_keyFieldMapper = rowMapperSchema.AddMapping<Guid>("UUID",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.ScenePresenceID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.ScenePresenceID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.ScenePresenceID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<uint>("Serial",
|
||||
delegate(AppearanceRowMapper mapper) { return (uint)mapper.Object.WearablesSerial; },
|
||||
@@ -64,127 +63,127 @@ namespace OpenSim.Region.Modules.AvatarFactory
|
||||
{
|
||||
if (mapper.Object.Wearables == null)
|
||||
{
|
||||
mapper.Object.Wearables = new OpenSim.Framework.AvatarWearable[13];
|
||||
mapper.Object.Wearables = new AvatarWearable[13];
|
||||
for (int i = 0; i < 13; i++)
|
||||
{
|
||||
mapper.Object.Wearables[i] = new AvatarWearable();
|
||||
}
|
||||
}
|
||||
mapper.Object.Wearables[0].ItemID = new libsecondlife.LLUUID(value.ToString());
|
||||
mapper.Object.Wearables[0].ItemID = new LLUUID(value.ToString());
|
||||
});
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset0",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[0].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[0].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[0].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem1",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[1].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[1].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[1].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset1",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[1].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[1].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[1].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem2",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[2].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[2].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[2].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset2",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[2].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[2].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[2].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem3",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[3].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[3].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[3].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset3",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[3].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[3].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[3].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem4",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[4].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[4].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[4].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset4",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[4].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[4].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[4].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem5",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[5].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[5].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[5].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset5",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[5].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[5].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[5].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem6",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[6].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[6].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[6].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset6",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[6].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[6].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[6].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem7",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[7].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[7].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[7].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset7",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[7].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[7].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[7].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem8",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[8].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[8].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[8].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset8",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[8].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[8].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[8].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem9",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[9].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[9].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[9].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset9",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[9].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[9].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[9].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem10",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[10].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[10].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[10].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset10",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[10].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[10].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[10].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem11",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[11].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[11].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[11].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset11",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[11].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[11].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[11].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableItem12",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[12].ItemID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[12].ItemID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
delegate(AppearanceRowMapper mapper, Guid value) { mapper.Object.Wearables[12].ItemID = new LLUUID(value.ToString()); });
|
||||
|
||||
rowMapperSchema.AddMapping<Guid>("WearableAsset12",
|
||||
delegate(AppearanceRowMapper mapper) { return mapper.Object.Wearables[12].AssetID.UUID; },
|
||||
delegate(AppearanceRowMapper mapper, Guid value)
|
||||
{ mapper.Object.Wearables[12].AssetID = new libsecondlife.LLUUID(value.ToString()); });
|
||||
{ mapper.Object.Wearables[12].AssetID = new LLUUID(value.ToString()); });
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using libsecondlife;
|
||||
using Nini.Config;
|
||||
using OpenSim.Data.Base;
|
||||
using OpenSim.Data.MapperFactory;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Data.Base;
|
||||
using OpenSim.Data.MapperFactory;
|
||||
|
||||
namespace OpenSim.Region.Modules.AvatarFactory
|
||||
{
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Timers;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Region.Environment.Modules.ExportSerialiser;
|
||||
|
||||
using PumaCode.SvnDotNet.SubversionSharp;
|
||||
using OpenSim.Region.Environment.Modules.Terrain;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using PumaCode.SvnDotNet.AprSharp;
|
||||
|
||||
using PumaCode.SvnDotNet.SubversionSharp;
|
||||
using Slash=System.IO.Path;
|
||||
|
||||
namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
{
|
||||
public class SvnBackupModule : IRegionModule
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private SvnClient m_svnClient;
|
||||
private bool m_enabled = false;
|
||||
@@ -26,7 +29,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
|
||||
private TimeSpan m_svnperiod = new TimeSpan(0, 0, 15, 0, 0);
|
||||
private bool m_svnAutoSave = false;
|
||||
private System.Timers.Timer m_timer = new System.Timers.Timer();
|
||||
private Timer m_timer = new Timer();
|
||||
|
||||
private IRegionSerialiser m_serialiser;
|
||||
private List<Scene> m_scenes = new List<Scene>();
|
||||
@@ -87,7 +90,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
{
|
||||
scene.LoadPrimsFromXml2(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID.ToString() +
|
||||
Slash.DirectorySeparatorChar + "objects.xml");
|
||||
scene.RequestModuleInterface<OpenSim.Region.Environment.Modules.Terrain.ITerrainModule>().LoadFromFile(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID.ToString() +
|
||||
scene.RequestModuleInterface<ITerrainModule>().LoadFromFile(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID.ToString() +
|
||||
Slash.DirectorySeparatorChar + "heightmap.r32");
|
||||
m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ").");
|
||||
}
|
||||
@@ -104,16 +107,16 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
|
||||
private void CheckoutSvnPartial(string subdir)
|
||||
{
|
||||
if (!System.IO.Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
|
||||
System.IO.Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);
|
||||
if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
|
||||
Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);
|
||||
|
||||
m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, Svn.Revision.Head, Svn.Revision.Head, true, false);
|
||||
}
|
||||
|
||||
private void CheckoutSvnPartial(string subdir, SvnRevision revision)
|
||||
{
|
||||
if (!System.IO.Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
|
||||
System.IO.Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);
|
||||
if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
|
||||
Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);
|
||||
|
||||
m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, revision, revision, true, false);
|
||||
}
|
||||
@@ -138,7 +141,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
{
|
||||
foreach (SvnClientCommitItem2 item in commitItems)
|
||||
{
|
||||
m_log.Debug("[SVNBACKUP]: ... " + System.IO.Path.GetFileName(item.Path.ToString()) + " (" + item.Kind.ToString() + ") r" + item.Revision.ToString());
|
||||
m_log.Debug("[SVNBACKUP]: ... " + Path.GetFileName(item.Path.ToString()) + " (" + item.Kind.ToString() + ") r" + item.Revision.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +280,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
if (m_svnAutoSave == true)
|
||||
{
|
||||
m_timer.Interval = m_svnperiod.TotalMilliseconds;
|
||||
m_timer.Elapsed += new System.Timers.ElapsedEventHandler(m_timer_Elapsed);
|
||||
m_timer.Elapsed += new ElapsedEventHandler(m_timer_Elapsed);
|
||||
m_timer.AutoReset = true;
|
||||
m_timer.Start();
|
||||
}
|
||||
@@ -300,7 +303,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
}
|
||||
}
|
||||
|
||||
void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
void m_timer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
SaveAllRegions();
|
||||
}
|
||||
@@ -322,8 +325,8 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
|
||||
private void CreateSvnDirectory()
|
||||
{
|
||||
if (!System.IO.Directory.Exists(m_svndir))
|
||||
System.IO.Directory.CreateDirectory(m_svndir);
|
||||
if (!Directory.Exists(m_svndir))
|
||||
Directory.CreateDirectory(m_svndir);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
|
||||
Reference in New Issue
Block a user