* debugged quite a lot of db-related strangeness and various refactoring goofs
parent
497ab5d7ab
commit
47ea453b32
|
@ -440,17 +440,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// Loads the World's objects
|
/// Loads the World's objects
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void LoadPrimsFromStorage()
|
public void LoadPrimsFromStorage()
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives");
|
MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives");
|
||||||
this.localStorage.LoadPrimitives(this);
|
this.localStorage.LoadPrimitives(this);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
MainLog.Instance.Warn("World.cs: LoadPrimsFromStorage() - Failed with exception " + e.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads a specific object from storage
|
/// Loads a specific object from storage
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public TerrainEngine Terrain;
|
public TerrainEngine Terrain;
|
||||||
|
|
||||||
public string m_datastore;
|
protected string m_datastore;
|
||||||
public ILocalStorage localStorage;
|
public ILocalStorage localStorage;
|
||||||
|
|
||||||
protected object m_syncRoot = new object();
|
protected object m_syncRoot = new object();
|
||||||
|
@ -75,8 +75,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="dllName">Storage Library</param>
|
/// <param name="dllName">Storage Library</param>
|
||||||
/// <returns>Successful or not</returns>
|
/// <returns>Successful or not</returns>
|
||||||
public bool LoadStorageDLL(string dllName)
|
public bool LoadStorageDLL(string dllName)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
|
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
|
||||||
ILocalStorage store = null;
|
ILocalStorage store = null;
|
||||||
|
@ -105,12 +103,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
pluginAssembly = null;
|
pluginAssembly = null;
|
||||||
this.localStorage = store;
|
this.localStorage = store;
|
||||||
return (store == null);
|
return (store == null);
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
MainLog.Instance.Warn("World.cs: LoadStorageDLL() - Failed with exception " + e.ToString());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,6 @@ namespace SimpleApp
|
||||||
{
|
{
|
||||||
class Program : RegionApplicationBase, conscmd_callback
|
class Program : RegionApplicationBase, conscmd_callback
|
||||||
{
|
{
|
||||||
public MyWorld m_scene;
|
|
||||||
private SceneObject m_sceneObject;
|
|
||||||
public MyNpcCharacter m_character;
|
|
||||||
|
|
||||||
protected override LogBase CreateLog()
|
protected override LogBase CreateLog()
|
||||||
{
|
{
|
||||||
return new LogBase(null, "SimpleApp", this, false);
|
return new LogBase(null, "SimpleApp", this, false);
|
||||||
|
@ -40,19 +36,20 @@ namespace SimpleApp
|
||||||
LocalAssetServer assetServer = new LocalAssetServer();
|
LocalAssetServer assetServer = new LocalAssetServer();
|
||||||
assetServer.SetServerInfo("http://localhost:8003/", "");
|
assetServer.SetServerInfo("http://localhost:8003/", "");
|
||||||
|
|
||||||
AssetCache m_assetCache = new AssetCache(assetServer);
|
m_assetCache = new AssetCache(assetServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
base.StartUp();
|
base.StartUp();
|
||||||
|
|
||||||
CommunicationsLocal m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer);
|
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer);
|
||||||
|
|
||||||
ScenePresence.PhysicsEngineFlying = true;
|
ScenePresence.PhysicsEngineFlying = true;
|
||||||
|
|
||||||
IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000);
|
IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000);
|
||||||
RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost");
|
RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost");
|
||||||
|
regionInfo.DataStore = "simpleapp_datastore.yap";
|
||||||
|
|
||||||
UDPServer udpServer;
|
UDPServer udpServer;
|
||||||
|
|
||||||
|
@ -64,10 +61,10 @@ namespace SimpleApp
|
||||||
shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
|
shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
|
||||||
LLVector3 pos = new LLVector3(138, 129, 27);
|
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);
|
scene.AddEntity(m_sceneObject);
|
||||||
|
|
||||||
m_character = new MyNpcCharacter();
|
MyNpcCharacter m_character = new MyNpcCharacter();
|
||||||
scene.AddNewClient(m_character, false);
|
scene.AddNewClient(m_character, false);
|
||||||
|
|
||||||
m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit.");
|
m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit.");
|
||||||
|
@ -107,7 +104,7 @@ namespace SimpleApp
|
||||||
{
|
{
|
||||||
Program app = new Program();
|
Program app = new Program();
|
||||||
|
|
||||||
app.StartUp();
|
app.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,21 +65,14 @@ namespace OpenSim.Region.GridInterfaces.Local
|
||||||
yapfile = File.Exists("regionassets.yap");
|
yapfile = File.Exists("regionassets.yap");
|
||||||
|
|
||||||
MainLog.Instance.Verbose("Local Asset Server class created");
|
MainLog.Instance.Verbose("Local Asset Server class created");
|
||||||
try
|
|
||||||
{
|
|
||||||
db = Db4oFactory.OpenFile("regionassets.yap");
|
db = Db4oFactory.OpenFile("regionassets.yap");
|
||||||
MainLog.Instance.Verbose("Db4 Asset database creation");
|
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());
|
|
||||||
}
|
|
||||||
if (!yapfile)
|
if (!yapfile)
|
||||||
{
|
{
|
||||||
this.SetUpAssetDatabase();
|
this.SetUpAssetDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
this._localAssetServerThread = new Thread(new ThreadStart(RunRequests));
|
this._localAssetServerThread = new Thread(new ThreadStart(RunRequests));
|
||||||
this._localAssetServerThread.IsBackground = true;
|
this._localAssetServerThread.IsBackground = true;
|
||||||
this._localAssetServerThread.Start();
|
this._localAssetServerThread.Start();
|
||||||
|
@ -163,9 +156,6 @@ namespace OpenSim.Region.GridInterfaces.Local
|
||||||
|
|
||||||
private void SetUpAssetDatabase()
|
private void SetUpAssetDatabase()
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
MainLog.Instance.Verbose("Setting up asset database");
|
MainLog.Instance.Verbose("Setting up asset database");
|
||||||
|
|
||||||
AssetBase Image = new AssetBase();
|
AssetBase Image = new AssetBase();
|
||||||
|
@ -267,13 +257,6 @@ namespace OpenSim.Region.GridInterfaces.Local
|
||||||
db.Set(store);
|
db.Set(store);
|
||||||
db.Commit();
|
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)
|
private void LoadAsset(AssetBase info, bool image, string filename)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue