* debugged quite a lot of db-related strangeness and various refactoring goofs

afrisby
lbsa71 2007-07-17 00:07:26 +00:00
parent 497ab5d7ab
commit 47ea453b32
4 changed files with 143 additions and 177 deletions

View File

@ -440,17 +440,10 @@ namespace OpenSim.Region.Environment.Scenes
/// Loads the World's objects
/// </summary>
public void LoadPrimsFromStorage()
{
try
{
MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives");
this.localStorage.LoadPrimitives(this);
}
catch (Exception e)
{
MainLog.Instance.Warn("World.cs: LoadPrimsFromStorage() - Failed with exception " + e.ToString());
}
}
/// <summary>
/// Loads a specific object from storage

View File

@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Scenes
public TerrainEngine Terrain;
public string m_datastore;
protected string m_datastore;
public ILocalStorage localStorage;
protected object m_syncRoot = new object();
@ -75,8 +75,6 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="dllName">Storage Library</param>
/// <returns>Successful or not</returns>
public bool LoadStorageDLL(string dllName)
{
try
{
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
ILocalStorage store = null;
@ -105,12 +103,7 @@ namespace OpenSim.Region.Environment.Scenes
pluginAssembly = null;
this.localStorage = store;
return (store == null);
}
catch (Exception e)
{
MainLog.Instance.Warn("World.cs: LoadStorageDLL() - Failed with exception " + e.ToString());
return false;
}
}

View File

@ -22,10 +22,6 @@ namespace SimpleApp
{
class Program : RegionApplicationBase, conscmd_callback
{
public MyWorld m_scene;
private SceneObject m_sceneObject;
public MyNpcCharacter m_character;
protected override LogBase CreateLog()
{
return new LogBase(null, "SimpleApp", this, false);
@ -40,19 +36,20 @@ namespace SimpleApp
LocalAssetServer assetServer = new LocalAssetServer();
assetServer.SetServerInfo("http://localhost:8003/", "");
AssetCache m_assetCache = new AssetCache(assetServer);
m_assetCache = new AssetCache(assetServer);
}
public void Run()
{
base.StartUp();
CommunicationsLocal m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer);
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer);
ScenePresence.PhysicsEngineFlying = true;
IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000);
RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost");
regionInfo.DataStore = "simpleapp_datastore.yap";
UDPServer udpServer;
@ -64,10 +61,10 @@ namespace SimpleApp
shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
LLVector3 pos = new LLVector3(138, 129, 27);
m_sceneObject = new MySceneObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape);
SceneObject m_sceneObject = new MySceneObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape);
scene.AddEntity(m_sceneObject);
m_character = new MyNpcCharacter();
MyNpcCharacter m_character = new MyNpcCharacter();
scene.AddNewClient(m_character, false);
m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit.");
@ -107,7 +104,7 @@ namespace SimpleApp
{
Program app = new Program();
app.StartUp();
app.Run();
}
}
}

View File

@ -64,22 +64,15 @@ namespace OpenSim.Region.GridInterfaces.Local
this._assetRequests = new BlockingQueue<ARequest>();
yapfile = File.Exists("regionassets.yap");
MainLog.Instance.Verbose( "Local Asset Server class created");
try
{
MainLog.Instance.Verbose("Local Asset Server class created");
db = Db4oFactory.OpenFile("regionassets.yap");
MainLog.Instance.Verbose( "Db4 Asset database creation");
}
catch (Exception e)
{
db.Close();
MainLog.Instance.WriteLine(LogPriority.MEDIUM, "Db4 Asset server :Constructor - Exception occured");
MainLog.Instance.Warn(e.ToString());
}
MainLog.Instance.Verbose("Db4 Asset database creation");
if (!yapfile)
{
this.SetUpAssetDatabase();
}
this._localAssetServerThread = new Thread(new ThreadStart(RunRequests));
this._localAssetServerThread.IsBackground = true;
this._localAssetServerThread.Start();
@ -122,7 +115,7 @@ namespace OpenSim.Region.GridInterfaces.Local
{
if (db != null)
{
MainLog.Instance.Verbose( "Closing local asset server database");
MainLog.Instance.Verbose("Closing local asset server database");
db.Close();
}
}
@ -163,10 +156,7 @@ namespace OpenSim.Region.GridInterfaces.Local
private void SetUpAssetDatabase()
{
try
{
MainLog.Instance.Verbose( "Setting up asset database");
MainLog.Instance.Verbose("Setting up asset database");
AssetBase Image = new AssetBase();
Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001");
@ -267,13 +257,6 @@ namespace OpenSim.Region.GridInterfaces.Local
db.Set(store);
db.Commit();
}
catch (Exception e)
{
Console.WriteLine("exception loading default assets into database");
Console.WriteLine(e.Message);
}
}
private void LoadAsset(AssetBase info, bool image, string filename)
{