aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/DynamicTextureModule.cs280
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs4
5 files changed, 145 insertions, 145 deletions
diff --git a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
index 3f737e1..0fd03d3 100644
--- a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
@@ -6,152 +6,152 @@ using OpenSim.Framework.Utilities;
6using OpenSim.Region.Environment.Interfaces; 6using OpenSim.Region.Environment.Interfaces;
7using OpenSim.Region.Environment.Scenes; 7using OpenSim.Region.Environment.Scenes;
8 8
9namespace OpenSim.Region.Environment.Modules 9namespace OpenSim.Region.Environment.Modules
10{ 10{
11 public class DynamicTextureModule : IRegionModule, IDynamicTextureManager 11 public class DynamicTextureModule : IRegionModule, IDynamicTextureManager
12 { 12 {
13 private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); 13 private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
14 14
15 private Dictionary<string, IDynamicTextureRender> RenderPlugins = 15 private Dictionary<string, IDynamicTextureRender> RenderPlugins =
16 new Dictionary<string, IDynamicTextureRender>(); 16 new Dictionary<string, IDynamicTextureRender>();
17 17
18 private Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>(); 18 private Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>();
19 19
20 public void Initialise(Scene scene) 20 public void Initialise(Scene scene)
21 { 21 {
22 if (!RegisteredScenes.ContainsKey(scene.RegionInfo.SimUUID)) 22 if (!RegisteredScenes.ContainsKey(scene.RegionInfo.SimUUID))
23 { 23 {
24 RegisteredScenes.Add(scene.RegionInfo.SimUUID, scene); 24 RegisteredScenes.Add(scene.RegionInfo.SimUUID, scene);
25 scene.RegisterModuleInterface<IDynamicTextureManager>(this); 25 scene.RegisterModuleInterface<IDynamicTextureManager>(this);
26 } 26 }
27 } 27 }
28 28
29 public void PostInitialise() 29 public void PostInitialise()
30 {
31 }
32
33 public void CloseDown()
34 {
35 }
36
37 public string GetName()
30 { 38 {
31 } 39 return "DynamicTextureModule";
32 40 }
33 public void CloseDown() 41
34 { 42 public bool IsSharedModule()
35 } 43 {
36 44 return true;
37 public string GetName() 45 }
38 { 46
39 return "DynamicTextureModule"; 47 public void RegisterRender(string handleType, IDynamicTextureRender render)
40 } 48 {
41 49 if (!RenderPlugins.ContainsKey(handleType))
42 public bool IsSharedModule() 50 {
43 { 51 RenderPlugins.Add(handleType, render);
44 return true; 52 }
45 } 53 }
46 54
47 public void RegisterRender(string handleType, IDynamicTextureRender render) 55 public void ReturnData(LLUUID id, byte[] data)
48 { 56 {
49 if (!RenderPlugins.ContainsKey(handleType)) 57 if (Updaters.ContainsKey(id))
50 { 58 {
51 RenderPlugins.Add(handleType, render); 59 DynamicTextureUpdater updater = Updaters[id];
52 } 60 if (RegisteredScenes.ContainsKey(updater.SimUUID))
53 } 61 {
54 62 Scene scene = RegisteredScenes[updater.SimUUID];
55 public void ReturnData(LLUUID id, byte[] data) 63 updater.DataReceived(data, scene);
56 { 64 }
57 if (Updaters.ContainsKey(id)) 65 }
58 { 66 }
59 DynamicTextureUpdater updater = Updaters[id]; 67
60 if (RegisteredScenes.ContainsKey(updater.SimUUID))
61 {
62 Scene scene = RegisteredScenes[updater.SimUUID];
63 updater.DataReceived(data, scene);
64 }
65 }
66 }
67
68 public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, 68 public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url,
69 string extraParams, int updateTimer) 69 string extraParams, int updateTimer)
70 { 70 {
71 Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType); 71 Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType);
72 if (RenderPlugins.ContainsKey(contentType)) 72 if (RenderPlugins.ContainsKey(contentType))
73 { 73 {
74 DynamicTextureUpdater updater = new DynamicTextureUpdater(); 74 DynamicTextureUpdater updater = new DynamicTextureUpdater();
75 updater.SimUUID = simID; 75 updater.SimUUID = simID;
76 updater.PrimID = primID; 76 updater.PrimID = primID;
77 updater.ContentType = contentType; 77 updater.ContentType = contentType;
78 updater.Url = url; 78 updater.Url = url;
79 updater.UpdateTimer = updateTimer; 79 updater.UpdateTimer = updateTimer;
80 updater.UpdaterID = LLUUID.Random(); 80 updater.UpdaterID = LLUUID.Random();
81 updater.Params = extraParams; 81 updater.Params = extraParams;
82 82
83 if (!Updaters.ContainsKey(updater.UpdaterID)) 83 if (!Updaters.ContainsKey(updater.UpdaterID))
84 { 84 {
85 Updaters.Add(updater.UpdaterID, updater); 85 Updaters.Add(updater.UpdaterID, updater);
86 } 86 }
87 87
88 RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); 88 RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams);
89 return updater.UpdaterID; 89 return updater.UpdaterID;
90 } 90 }
91 return LLUUID.Zero; 91 return LLUUID.Zero;
92 } 92 }
93 93
94 public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, 94 public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data,
95 string extraParams, int updateTimer) 95 string extraParams, int updateTimer)
96 { 96 {
97 if (RenderPlugins.ContainsKey(contentType)) 97 if (RenderPlugins.ContainsKey(contentType))
98 { 98 {
99 DynamicTextureUpdater updater = new DynamicTextureUpdater(); 99 DynamicTextureUpdater updater = new DynamicTextureUpdater();
100 updater.SimUUID = simID; 100 updater.SimUUID = simID;
101 updater.PrimID = primID; 101 updater.PrimID = primID;
102 updater.ContentType = contentType; 102 updater.ContentType = contentType;
103 updater.BodyData = data; 103 updater.BodyData = data;
104 updater.UpdateTimer = updateTimer; 104 updater.UpdateTimer = updateTimer;
105 updater.UpdaterID = LLUUID.Random(); 105 updater.UpdaterID = LLUUID.Random();
106 updater.Params = extraParams; 106 updater.Params = extraParams;
107 107
108 if (!Updaters.ContainsKey(updater.UpdaterID)) 108 if (!Updaters.ContainsKey(updater.UpdaterID))
109 { 109 {
110 Updaters.Add(updater.UpdaterID, updater); 110 Updaters.Add(updater.UpdaterID, updater);
111 } 111 }
112 112
113 RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); 113 RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams);
114 return updater.UpdaterID; 114 return updater.UpdaterID;
115 } 115 }
116 return LLUUID.Zero; 116 return LLUUID.Zero;
117 } 117 }
118 118
119 public class DynamicTextureUpdater 119 public class DynamicTextureUpdater
120 { 120 {
121 public LLUUID SimUUID; 121 public LLUUID SimUUID;
122 public LLUUID UpdaterID; 122 public LLUUID UpdaterID;
123 public string ContentType; 123 public string ContentType;
124 public string Url; 124 public string Url;
125 public string BodyData; 125 public string BodyData;
126 public LLUUID PrimID; 126 public LLUUID PrimID;
127 public int UpdateTimer; 127 public int UpdateTimer;
128 public LLUUID LastAssetID; 128 public LLUUID LastAssetID;
129 public string Params; 129 public string Params;
130 130
131 public DynamicTextureUpdater() 131 public DynamicTextureUpdater()
132 { 132 {
133 LastAssetID = LLUUID.Zero; 133 LastAssetID = LLUUID.Zero;
134 UpdateTimer = 0; 134 UpdateTimer = 0;
135 BodyData = null; 135 BodyData = null;
136 } 136 }
137 137
138 public void DataReceived(byte[] data, Scene scene) 138 public void DataReceived(byte[] data, Scene scene)
139 { 139 {
140 //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
141 141
142 AssetBase asset = new AssetBase(); 142 AssetBase asset = new AssetBase();
143 asset.FullID = LLUUID.Random(); 143 asset.FullID = LLUUID.Random();
144 asset.Data = data; 144 asset.Data = data;
145 asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); 145 asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000);
146 asset.Type = 0; 146 asset.Type = 0;
147 scene.commsManager.AssetCache.AddAsset(asset); 147 scene.commsManager.AssetCache.AddAsset(asset);
148 148
149 LastAssetID = asset.FullID; 149 LastAssetID = asset.FullID;
150 150
151 SceneObjectPart part = scene.GetSceneObjectPart(PrimID); 151 SceneObjectPart part = scene.GetSceneObjectPart(PrimID);
152 part.Shape.TextureEntry = new LLObject.TextureEntry(asset.FullID).ToBytes(); 152 part.Shape.TextureEntry = new LLObject.TextureEntry(asset.FullID).ToBytes();
153 part.ScheduleFullUpdate(); 153 part.ScheduleFullUpdate();
154 } 154 }
155 } 155 }
156 } 156 }
157} \ No newline at end of file 157} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index cff832e..90736f4 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -35,7 +35,7 @@ using Axiom.Math;
35using libsecondlife; 35using libsecondlife;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Communications; 37using OpenSim.Framework.Communications;
38using OpenSim.Framework.Communications.Caches; 38using OpenSim.Framework.Communications.Cache;
39using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
40using OpenSim.Framework.Interfaces; 40using OpenSim.Framework.Interfaces;
41using OpenSim.Framework.Servers; 41using OpenSim.Framework.Servers;
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index fc81d5f..b3cd99c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -28,7 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework.Communications.Caches; 31using OpenSim.Framework.Communications.Cache;
32using OpenSim.Framework.Console; 32using OpenSim.Framework.Console;
33using OpenSim.Framework.Interfaces; 33using OpenSim.Framework.Interfaces;
34using OpenSim.Framework.Types; 34using OpenSim.Framework.Types;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index c1c678f..890008d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Region.Environment.Scenes
80 } 80 }
81 } 81 }
82 82
83 public LLVector3 AbsolutePosition 83 public override LLVector3 AbsolutePosition
84 { 84 {
85 get { return m_rootPart.GroupPosition; } 85 get { return m_rootPart.GroupPosition; }
86 set 86 set
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 4d2c8e2..b8ef17b 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -138,7 +138,7 @@ namespace OpenSim.Region.Environment.Scenes
138 get { return m_controllingClient; } 138 get { return m_controllingClient; }
139 } 139 }
140 140
141 public LLVector3 AbsolutePosition 141 public override LLVector3 AbsolutePosition
142 { 142 {
143 get 143 get
144 { 144 {
@@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Scenes
172 } 172 }
173 } 173 }
174 174
175 public LLVector3 Velocity 175 public override LLVector3 Velocity
176 { 176 {
177 get 177 get
178 { 178 {