29 using System.Collections;
30 using System.Collections.Generic;
31 using System.Collections.Specialized;
33 using System.Drawing.Imaging;
34 using System.Reflection;
41 using OpenMetaverse.StructuredData;
42 using OpenMetaverse.Imaging;
43 using OpenSim.Framework;
44 using OpenSim.Framework.Servers;
45 using OpenSim.Framework.Servers.HttpServer;
46 using OpenSim.Region.Framework.Interfaces;
47 using OpenSim.Region.Framework.Scenes;
48 using OpenSim.Services.Interfaces;
50 using OpenSim.Capabilities.Handlers;
52 namespace OpenSim.
Region.ClientStack.Linden
54 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"UploadBakedTextureModule")]
57 private static readonly ILog m_log =
58 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
63 private static readonly
string m_uploadBakedTexturePath =
"0010/";
65 private Scene m_scene;
66 private bool m_persistBakedTextures;
73 IConfig config = source.Configs[
"ClientStack.LindenCaps"];
77 m_URL = config.GetString(
"Cap_UploadBakedTexture", string.Empty);
79 IConfig appearanceConfig = source.Configs[
"Appearance"];
80 if (appearanceConfig != null)
81 m_persistBakedTextures = appearanceConfig.GetBoolean(
"PersistBakedTextures", m_persistBakedTextures);
92 s.EventManager.OnRegisterCaps -= RegisterCaps;
93 s.EventManager.OnNewPresence -= RegisterNewPresence;
94 s.EventManager.OnRemovePresence -= DeRegisterPresence;
95 m_BakedTextureModule = null;
101 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
102 m_scene.EventManager.OnNewPresence += RegisterNewPresence;
103 m_scene.EventManager.OnRemovePresence += DeRegisterPresence;
107 private void DeRegisterPresence(UUID agentId)
265 public string Name {
get {
return "UploadBakedTextureModule"; } }
267 public Type ReplaceableInterface
275 if (m_URL ==
"localhost")
278 caps, m_scene.AssetService, m_persistBakedTextures);
280 caps.RegisterHandler(
281 "UploadBakedTexture",
284 "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath,
286 "UploadBakedTexture",
287 agentID.ToString()));
292 caps.RegisterHandler(
"UploadBakedTexture", m_URL);
void AddRegion(Scene s)
This is called whenever a Scene is added. For shared modules, this can happen several times...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void RemoveRegion(Scene s)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
string UploadBakedTexture(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
Handle a request from the client for a Uri to upload a baked texture.
OpenSim.Framework.Capabilities.Caps Caps
OpenSim.Framework.Capabilities.Caps Caps
void RegionLoaded(Scene s)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
void RegisterCaps(UUID agentID, Caps caps)
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...