diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Scripting')
6 files changed, 40 insertions, 28 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs index d926714..c0e3d3b 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -40,12 +40,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
40 | { | 40 | { |
41 | public class DynamicTextureModule : IRegionModule, IDynamicTextureManager | 41 | public class DynamicTextureModule : IRegionModule, IDynamicTextureManager |
42 | { | 42 | { |
43 | private readonly Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); | 43 | private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); |
44 | 44 | ||
45 | private readonly Dictionary<string, IDynamicTextureRender> RenderPlugins = | 45 | private Dictionary<string, IDynamicTextureRender> RenderPlugins = |
46 | new Dictionary<string, IDynamicTextureRender>(); | 46 | new Dictionary<string, IDynamicTextureRender>(); |
47 | 47 | ||
48 | private readonly Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>(); | 48 | private Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>(); |
49 | 49 | ||
50 | #region IDynamicTextureManager Members | 50 | #region IDynamicTextureManager Members |
51 | 51 | ||
@@ -176,14 +176,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
176 | 176 | ||
177 | public class DynamicTextureUpdater | 177 | public class DynamicTextureUpdater |
178 | { | 178 | { |
179 | public bool BlendWithOldTexture; | 179 | public bool BlendWithOldTexture = false; |
180 | public string BodyData; | 180 | public string BodyData; |
181 | public string ContentType; | 181 | public string ContentType; |
182 | public byte FrontAlpha = 255; | 182 | public byte FrontAlpha = 255; |
183 | public LLUUID LastAssetID; | 183 | public LLUUID LastAssetID; |
184 | public string Params; | 184 | public string Params; |
185 | public LLUUID PrimID; | 185 | public LLUUID PrimID; |
186 | public bool SetNewFrontAlpha; | 186 | public bool SetNewFrontAlpha = false; |
187 | public LLUUID SimUUID; | 187 | public LLUUID SimUUID; |
188 | public LLUUID UpdaterID; | 188 | public LLUUID UpdaterID; |
189 | public int UpdateTimer; | 189 | public int UpdateTimer; |
diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 4bde33b..e1339a3 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest | |||
84 | { | 84 | { |
85 | public class HttpRequestModule : IRegionModule, IHttpRequests | 85 | public class HttpRequestModule : IRegionModule, IHttpRequests |
86 | { | 86 | { |
87 | private readonly object HttpListLock = new object(); | 87 | private object HttpListLock = new object(); |
88 | private int httpTimeout = 30000; | 88 | private int httpTimeout = 30000; |
89 | private string m_name = "HttpScriptRequests"; | 89 | private string m_name = "HttpScriptRequests"; |
90 | 90 | ||
@@ -93,6 +93,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest | |||
93 | private Scene m_scene; | 93 | private Scene m_scene; |
94 | private Queue<HttpRequestClass> rpcQueue = new Queue<HttpRequestClass>(); | 94 | private Queue<HttpRequestClass> rpcQueue = new Queue<HttpRequestClass>(); |
95 | 95 | ||
96 | public HttpRequestModule() | ||
97 | { | ||
98 | } | ||
99 | |||
96 | #region IHttpRequests Members | 100 | #region IHttpRequests Members |
97 | 101 | ||
98 | public LLUUID MakeHttpRequest(string url, string parameters, string body) | 102 | public LLUUID MakeHttpRequest(string url, string parameters, string body) |
diff --git a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs index f39f16d..c828ef0 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs | |||
@@ -120,9 +120,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL | |||
120 | 120 | ||
121 | private void MakeHttpRequest(string url, LLUUID requestID) | 121 | private void MakeHttpRequest(string url, LLUUID requestID) |
122 | { | 122 | { |
123 | WebRequest request = WebRequest.Create(url); | 123 | WebRequest request = HttpWebRequest.Create(url); |
124 | RequestState state = new RequestState((HttpWebRequest) request, requestID); | 124 | RequestState state = new RequestState((HttpWebRequest) request, requestID); |
125 | IAsyncResult result = request.BeginGetResponse(HttpRequestReturn, state); | 125 | IAsyncResult result = request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state); |
126 | 126 | ||
127 | TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); | 127 | TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); |
128 | state.TimeOfRequest = (int) t.TotalSeconds; | 128 | state.TimeOfRequest = (int) t.TotalSeconds; |
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL | |||
131 | private void HttpRequestReturn(IAsyncResult result) | 131 | private void HttpRequestReturn(IAsyncResult result) |
132 | { | 132 | { |
133 | RequestState state = (RequestState) result.AsyncState; | 133 | RequestState state = (RequestState) result.AsyncState; |
134 | WebRequest request = state.Request; | 134 | WebRequest request = (WebRequest) state.Request; |
135 | HttpWebResponse response = (HttpWebResponse) request.EndGetResponse(result); | 135 | HttpWebResponse response = (HttpWebResponse) request.EndGetResponse(result); |
136 | if (response.StatusCode == HttpStatusCode.OK) | 136 | if (response.StatusCode == HttpStatusCode.OK) |
137 | { | 137 | { |
@@ -175,9 +175,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL | |||
175 | 175 | ||
176 | public class RequestState | 176 | public class RequestState |
177 | { | 177 | { |
178 | public HttpWebRequest Request; | 178 | public HttpWebRequest Request = null; |
179 | public LLUUID RequestID = LLUUID.Zero; | 179 | public LLUUID RequestID = LLUUID.Zero; |
180 | public int TimeOfRequest; | 180 | public int TimeOfRequest = 0; |
181 | 181 | ||
182 | public RequestState(HttpWebRequest request, LLUUID requestID) | 182 | public RequestState(HttpWebRequest request, LLUUID requestID) |
183 | { | 183 | { |
diff --git a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs index 8e434c7..626c60f 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -48,6 +48,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender | |||
48 | private Scene m_scene; | 48 | private Scene m_scene; |
49 | private IDynamicTextureManager m_textureManager; | 49 | private IDynamicTextureManager m_textureManager; |
50 | 50 | ||
51 | public VectorRenderModule() | ||
52 | { | ||
53 | } | ||
54 | |||
51 | #region IDynamicTextureRender Members | 55 | #region IDynamicTextureRender Members |
52 | 56 | ||
53 | public string GetContentType() | 57 | public string GetContentType() |
@@ -134,7 +138,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender | |||
134 | catch (Exception e) | 138 | catch (Exception e) |
135 | { | 139 | { |
136 | //Ckrinke: Add a WriteLine to remove the warning about 'e' defined but not used | 140 | //Ckrinke: Add a WriteLine to remove the warning about 'e' defined but not used |
137 | Console.WriteLine("Problem with Draw. Please verify parameters." + e); | 141 | Console.WriteLine("Problem with Draw. Please verify parameters." + e.ToString()); |
138 | } | 142 | } |
139 | 143 | ||
140 | if ((size < 128) || (size > 1024)) | 144 | if ((size < 128) || (size > 1024)) |
@@ -256,7 +260,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender | |||
256 | endPoint.X = (int) x; | 260 | endPoint.X = (int) x; |
257 | endPoint.Y = (int) y; | 261 | endPoint.Y = (int) y; |
258 | Image image = ImageHttpRequest(nextLine); | 262 | Image image = ImageHttpRequest(nextLine); |
259 | graph.DrawImage(image, startPoint.X, startPoint.Y, x, y); | 263 | graph.DrawImage(image, (float) startPoint.X, (float) startPoint.Y, x, y); |
260 | startPoint.X += endPoint.X; | 264 | startPoint.X += endPoint.X; |
261 | startPoint.Y += endPoint.Y; | 265 | startPoint.Y += endPoint.Y; |
262 | } | 266 | } |
@@ -349,7 +353,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender | |||
349 | 353 | ||
350 | private Bitmap ImageHttpRequest(string url) | 354 | private Bitmap ImageHttpRequest(string url) |
351 | { | 355 | { |
352 | WebRequest request = WebRequest.Create(url); | 356 | WebRequest request = HttpWebRequest.Create(url); |
353 | //Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. | 357 | //Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. |
354 | //Ckrinke Stream str = null; | 358 | //Ckrinke Stream str = null; |
355 | HttpWebResponse response = (HttpWebResponse) (request).GetResponse(); | 359 | HttpWebResponse response = (HttpWebResponse) (request).GetResponse(); |
diff --git a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs index c4c1718..e79b2bd 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -75,6 +75,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
75 | private Queue m_pendingQ; | 75 | private Queue m_pendingQ; |
76 | private Scene m_scene; | 76 | private Scene m_scene; |
77 | 77 | ||
78 | public WorldCommModule() | ||
79 | { | ||
80 | } | ||
81 | |||
78 | #region IRegionModule Members | 82 | #region IRegionModule Members |
79 | 83 | ||
80 | public void Initialise(Scene scene, IConfigSource config) | 84 | public void Initialise(Scene scene, IConfigSource config) |
@@ -320,8 +324,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
320 | public class ListenerManager | 324 | public class ListenerManager |
321 | { | 325 | { |
322 | //private Dictionary<int, ListenerInfo> m_listeners; | 326 | //private Dictionary<int, ListenerInfo> m_listeners; |
323 | private readonly Hashtable m_listeners = Hashtable.Synchronized(new Hashtable()); | ||
324 | private object ListenersLock = new object(); | 327 | private object ListenersLock = new object(); |
328 | private Hashtable m_listeners = Hashtable.Synchronized(new Hashtable()); | ||
325 | private int m_MaxListeners = 100; | 329 | private int m_MaxListeners = 100; |
326 | 330 | ||
327 | public int AddListener(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, string id, string msg) | 331 | public int AddListener(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, string id, string msg) |
@@ -481,7 +485,6 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
481 | 485 | ||
482 | public class ListenerInfo | 486 | public class ListenerInfo |
483 | { | 487 | { |
484 | private readonly LLUUID m_sourceItemID; // ID of the scenePart or avatar source of the message | ||
485 | private bool m_active; // Listener is active or not | 488 | private bool m_active; // Listener is active or not |
486 | private int m_channel; // Channel | 489 | private int m_channel; // Channel |
487 | private int m_handle; // Assigned handle of this listener | 490 | private int m_handle; // Assigned handle of this listener |
@@ -491,6 +494,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
491 | private uint m_localID; // Local ID from script engine | 494 | private uint m_localID; // Local ID from script engine |
492 | private string m_message; // The message | 495 | private string m_message; // The message |
493 | private string m_name; // Object name to filter messages from | 496 | private string m_name; // Object name to filter messages from |
497 | private LLUUID m_sourceItemID; // ID of the scenePart or avatar source of the message | ||
494 | 498 | ||
495 | public ListenerInfo(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message) | 499 | public ListenerInfo(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message) |
496 | { | 500 | { |
diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs index 4f6808e..a039d42 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs | |||
@@ -78,20 +78,20 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
78 | public class XMLRPCModule : IRegionModule, IXMLRPC | 78 | public class XMLRPCModule : IRegionModule, IXMLRPC |
79 | { | 79 | { |
80 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 80 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
81 | private readonly List<Scene> m_scenes = new List<Scene>(); | ||
82 | private readonly object XMLRPCListLock = new object(); | ||
83 | 81 | ||
84 | private string m_name = "XMLRPCModule"; | 82 | private string m_name = "XMLRPCModule"; |
85 | 83 | ||
86 | // <channel id, RPCChannelInfo> | 84 | // <channel id, RPCChannelInfo> |
87 | private Dictionary<LLUUID, RPCChannelInfo> m_openChannels; | 85 | private Dictionary<LLUUID, RPCChannelInfo> m_openChannels; |
88 | private Dictionary<LLUUID, SendRemoteDataRequest> m_pendingSRDResponses; | 86 | private Dictionary<LLUUID, SendRemoteDataRequest> m_pendingSRDResponses; |
89 | private int m_remoteDataPort; | 87 | private int m_remoteDataPort = 0; |
90 | 88 | ||
91 | private Dictionary<LLUUID, RPCRequestInfo> m_rpcPending; | 89 | private Dictionary<LLUUID, RPCRequestInfo> m_rpcPending; |
92 | private Dictionary<LLUUID, RPCRequestInfo> m_rpcPendingResponses; | 90 | private Dictionary<LLUUID, RPCRequestInfo> m_rpcPendingResponses; |
91 | private List<Scene> m_scenes = new List<Scene>(); | ||
93 | private int RemoteReplyScriptTimeout = 9000; | 92 | private int RemoteReplyScriptTimeout = 9000; |
94 | private int RemoteReplyScriptWait = 300; | 93 | private int RemoteReplyScriptWait = 300; |
94 | private object XMLRPCListLock = new object(); | ||
95 | 95 | ||
96 | #region IRegionModule Members | 96 | #region IRegionModule Members |
97 | 97 | ||
@@ -428,15 +428,15 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
428 | 428 | ||
429 | public class RPCRequestInfo | 429 | public class RPCRequestInfo |
430 | { | 430 | { |
431 | private readonly LLUUID m_ChannelKey; | 431 | private LLUUID m_ChannelKey; |
432 | private readonly string m_IntVal; | 432 | private string m_IntVal; |
433 | private readonly LLUUID m_ItemID; | 433 | private LLUUID m_ItemID; |
434 | private readonly uint m_localID; | 434 | private uint m_localID; |
435 | private readonly LLUUID m_MessageID; | 435 | private LLUUID m_MessageID; |
436 | private readonly string m_StrVal; | ||
437 | private bool m_processed; | 436 | private bool m_processed; |
438 | private int m_respInt; | 437 | private int m_respInt; |
439 | private string m_respStr; | 438 | private string m_respStr; |
439 | private string m_StrVal; | ||
440 | 440 | ||
441 | public RPCRequestInfo(uint localID, LLUUID itemID, LLUUID channelKey, string strVal, string intVal) | 441 | public RPCRequestInfo(uint localID, LLUUID itemID, LLUUID channelKey, string strVal, string intVal) |
442 | { | 442 | { |
@@ -514,9 +514,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
514 | 514 | ||
515 | public class RPCChannelInfo | 515 | public class RPCChannelInfo |
516 | { | 516 | { |
517 | private readonly LLUUID m_ChannelKey; | 517 | private LLUUID m_ChannelKey; |
518 | private readonly LLUUID m_itemID; | 518 | private LLUUID m_itemID; |
519 | private readonly uint m_localID; | 519 | private uint m_localID; |
520 | 520 | ||
521 | public RPCChannelInfo(uint localID, LLUUID itemID, LLUUID channelID) | 521 | public RPCChannelInfo(uint localID, LLUUID itemID, LLUUID channelID) |
522 | { | 522 | { |