View of /branches/os-0.6.9-post-fixes/ModularRex/RexNetwork/HttpAssetProvider.cs
Parent Directory
|
Revision Log
Revision 347 -
(download)
(annotate)
Fri Mar 19 11:24:54 2010 UTC (3 years, 2 months ago) by mikkopa
File size: 1773 byte(s)
Fri Mar 19 11:24:54 2010 UTC (3 years, 2 months ago) by mikkopa
File size: 1773 byte(s)
* Added module that can serve assets through http from simulator * Added module that can add asset url to all RexObjectProperties. Urls point to simulators listener.
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Framework;
using OpenSim.Services.Interfaces;
using Nini.Config;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Server.Handlers.Asset;
using log4net;
using System.Reflection;
namespace ModularRex.RexNetwork
{
public class HttpAssetProvider : IRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IAssetService m_AssetService;
private List<Scene> m_scenes = new List<Scene>();
private bool enabled = false;
public string Name
{
get { return "HttpAssetProvider"; }
}
#region IRegionModule Members
public void Close()
{
}
public void Initialise(Scene scene, IConfigSource source)
{
m_scenes.Add(scene);
if (source.Configs["realXtend"] != null)
{
enabled = !(source.Configs["realXtend"].GetBoolean("ServeHttpAssets", false));
}
}
public bool IsSharedModule
{
get { return true; }
}
public void PostInitialise()
{
if (enabled)
{
m_AssetService = m_scenes[0].AssetService;
if (m_AssetService != null)
MainServer.Instance.AddStreamHandler(new AssetServerGetHandler(m_AssetService));
else
m_log.Error("[HttpAssetProvider]: Could not initiate HttpAssetProvider since IAssetService is null!");
}
}
#endregion
}
}
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

