Should allow multiple worlds (and UDP servers) to be ran in one instance, just missing backend comms and working Avatar/primitives classes.

This commit is contained in:
MW
2007-05-27 18:52:42 +00:00
parent 06387d0344
commit c746a2f9f4
62 changed files with 1623 additions and 1784 deletions

View File

@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Reflection;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim;
@@ -71,6 +72,20 @@ namespace OpenSim.Assets
}
public AssetCache(string assetServerDLLName, string assetServerURL, string assetServerKey)
{
Console.WriteLine("Creating Asset cache");
_assetServer = this.LoadAssetDll(assetServerDLLName);
_assetServer.SetServerInfo(assetServerURL, assetServerKey);
_assetServer.SetReceiver(this);
Assets = new Dictionary<libsecondlife.LLUUID, AssetInfo>();
Textures = new Dictionary<libsecondlife.LLUUID, TextureImage>();
this._assetCacheThread = new Thread(new ThreadStart(RunAssetManager));
this._assetCacheThread.IsBackground = true;
this._assetCacheThread.Start();
}
/// <summary>
///
/// </summary>
@@ -513,6 +528,34 @@ namespace OpenSim.Assets
}
#endregion
private IAssetServer LoadAssetDll(string dllName)
{
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
IAssetServer server = null;
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (pluginType.IsPublic)
{
if (!pluginType.IsAbstract)
{
Type typeInterface = pluginType.GetInterface("IAssetPlugin", true);
if (typeInterface != null)
{
IAssetPlugin plug = (IAssetPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
server = plug.GetAssetServer();
break;
}
typeInterface = null;
}
}
}
pluginAssembly = null;
return server;
}
}
public class AssetRequest