aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
diff options
context:
space:
mode:
authorlbsa712007-09-19 00:30:55 +0000
committerlbsa712007-09-19 00:30:55 +0000
commit8f0b03597b0bc8ea6873af9a55495407fae1ec56 (patch)
treef9f4de38379aebf2223ad4cb10a3d9ebcfa52a4f /OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
parent* Moved SendLogoutPacket back to IClientAPI. (diff)
downloadopensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.zip
opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.gz
opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.bz2
opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.xz
* Modernized ScriptManager to new interface-based module calls.
* 'remove redundant this qualifier' ftw
Diffstat (limited to 'OpenSim/Region/Environment/Modules/DynamicTextureModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/DynamicTextureModule.cs56
1 files changed, 27 insertions, 29 deletions
diff --git a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
index bbd9810..3f737e1 100644
--- a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
@@ -1,23 +1,20 @@
1using System.Text; 1using System;
2using System.Net; 2using System.Collections.Generic;
3using System.Net.Sockets; 3using libsecondlife;
4using System.Threading; 4using OpenSim.Framework.Types;
5using System.IO; 5using OpenSim.Framework.Utilities;
6using System.Collections.Generic; 6using OpenSim.Region.Environment.Interfaces;
7using libsecondlife; 7using OpenSim.Region.Environment.Scenes;
8using OpenSim.Region.Environment.Scenes; 8
9using OpenSim.Region.Environment.Interfaces;
10using OpenSim.Framework.Interfaces;
11using OpenSim.Framework.Utilities;
12using OpenSim.Framework.Console;
13using OpenSim.Framework.Types;
14
15namespace OpenSim.Region.Environment.Modules 9namespace OpenSim.Region.Environment.Modules
16{ 10{
17 public class DynamicTextureModule :IRegionModule, IDynamicTextureManager 11 public class DynamicTextureModule : IRegionModule, IDynamicTextureManager
18 { 12 {
19 private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); 13 private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
20 private Dictionary<string, IDynamicTextureRender> RenderPlugins= new Dictionary<string, IDynamicTextureRender>(); 14
15 private Dictionary<string, IDynamicTextureRender> RenderPlugins =
16 new Dictionary<string, IDynamicTextureRender>();
17
21 private Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>(); 18 private Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>();
22 19
23 public void Initialise(Scene scene) 20 public void Initialise(Scene scene)
@@ -30,8 +27,7 @@ namespace OpenSim.Region.Environment.Modules
30 } 27 }
31 28
32 public void PostInitialise() 29 public void PostInitialise()
33 { 30 {
34
35 } 31 }
36 32
37 public void CloseDown() 33 public void CloseDown()
@@ -69,10 +65,11 @@ namespace OpenSim.Region.Environment.Modules
69 } 65 }
70 } 66 }
71 67
72 public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, string extraParams, int updateTimer) 68 public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url,
69 string extraParams, int updateTimer)
73 { 70 {
74 System.Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType); 71 Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType);
75 if (this.RenderPlugins.ContainsKey(contentType)) 72 if (RenderPlugins.ContainsKey(contentType))
76 { 73 {
77 DynamicTextureUpdater updater = new DynamicTextureUpdater(); 74 DynamicTextureUpdater updater = new DynamicTextureUpdater();
78 updater.SimUUID = simID; 75 updater.SimUUID = simID;
@@ -83,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules
83 updater.UpdaterID = LLUUID.Random(); 80 updater.UpdaterID = LLUUID.Random();
84 updater.Params = extraParams; 81 updater.Params = extraParams;
85 82
86 if (!this.Updaters.ContainsKey(updater.UpdaterID)) 83 if (!Updaters.ContainsKey(updater.UpdaterID))
87 { 84 {
88 Updaters.Add(updater.UpdaterID, updater); 85 Updaters.Add(updater.UpdaterID, updater);
89 } 86 }
@@ -94,9 +91,10 @@ namespace OpenSim.Region.Environment.Modules
94 return LLUUID.Zero; 91 return LLUUID.Zero;
95 } 92 }
96 93
97 public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, string extraParams, int updateTimer) 94 public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data,
95 string extraParams, int updateTimer)
98 { 96 {
99 if (this.RenderPlugins.ContainsKey(contentType)) 97 if (RenderPlugins.ContainsKey(contentType))
100 { 98 {
101 DynamicTextureUpdater updater = new DynamicTextureUpdater(); 99 DynamicTextureUpdater updater = new DynamicTextureUpdater();
102 updater.SimUUID = simID; 100 updater.SimUUID = simID;
@@ -107,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules
107 updater.UpdaterID = LLUUID.Random(); 105 updater.UpdaterID = LLUUID.Random();
108 updater.Params = extraParams; 106 updater.Params = extraParams;
109 107
110 if (!this.Updaters.ContainsKey(updater.UpdaterID)) 108 if (!Updaters.ContainsKey(updater.UpdaterID))
111 { 109 {
112 Updaters.Add(updater.UpdaterID, updater); 110 Updaters.Add(updater.UpdaterID, updater);
113 } 111 }
@@ -140,7 +138,7 @@ namespace OpenSim.Region.Environment.Modules
140 public void DataReceived(byte[] data, Scene scene) 138 public void DataReceived(byte[] data, Scene scene)
141 { 139 {
142 //TODO delete the last asset(data), if it was a dynamic texture 140 //TODO delete the last asset(data), if it was a dynamic texture
143 141
144 AssetBase asset = new AssetBase(); 142 AssetBase asset = new AssetBase();
145 asset.FullID = LLUUID.Random(); 143 asset.FullID = LLUUID.Random();
146 asset.Data = data; 144 asset.Data = data;
@@ -148,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules
148 asset.Type = 0; 146 asset.Type = 0;
149 scene.commsManager.AssetCache.AddAsset(asset); 147 scene.commsManager.AssetCache.AddAsset(asset);
150 148
151 this.LastAssetID = asset.FullID; 149 LastAssetID = asset.FullID;
152 150
153 SceneObjectPart part = scene.GetSceneObjectPart(PrimID); 151 SceneObjectPart part = scene.GetSceneObjectPart(PrimID);
154 part.Shape.TextureEntry = new LLObject.TextureEntry(asset.FullID).ToBytes(); 152 part.Shape.TextureEntry = new LLObject.TextureEntry(asset.FullID).ToBytes();
@@ -156,4 +154,4 @@ namespace OpenSim.Region.Environment.Modules
156 } 154 }
157 } 155 }
158 } 156 }
159} 157} \ No newline at end of file