From 20a9bf08f51351e1e0a9de94f184ff56cd572665 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 1 May 2008 18:04:42 +0000 Subject: * Rolled back a few changes. --- .../DynamicTexture/DynamicTextureModule.cs | 10 ++++----- .../Scripting/HttpRequest/ScriptsHttpRequests.cs | 6 +++++- .../Scripting/LoadImageURL/LoadImageURLModule.cs | 10 ++++----- .../Scripting/VectorRender/VectorRenderModule.cs | 10 ++++++--- .../Modules/Scripting/WorldComm/WorldCommModule.cs | 8 ++++++-- .../Modules/Scripting/XMLRPC/XMLRPCModule.cs | 24 +++++++++++----------- 6 files changed, 40 insertions(+), 28 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Scripting') 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 { public class DynamicTextureModule : IRegionModule, IDynamicTextureManager { - private readonly Dictionary RegisteredScenes = new Dictionary(); + private Dictionary RegisteredScenes = new Dictionary(); - private readonly Dictionary RenderPlugins = + private Dictionary RenderPlugins = new Dictionary(); - private readonly Dictionary Updaters = new Dictionary(); + private Dictionary Updaters = new Dictionary(); #region IDynamicTextureManager Members @@ -176,14 +176,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture public class DynamicTextureUpdater { - public bool BlendWithOldTexture; + public bool BlendWithOldTexture = false; public string BodyData; public string ContentType; public byte FrontAlpha = 255; public LLUUID LastAssetID; public string Params; public LLUUID PrimID; - public bool SetNewFrontAlpha; + public bool SetNewFrontAlpha = false; public LLUUID SimUUID; public LLUUID UpdaterID; 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 { public class HttpRequestModule : IRegionModule, IHttpRequests { - private readonly object HttpListLock = new object(); + private object HttpListLock = new object(); private int httpTimeout = 30000; private string m_name = "HttpScriptRequests"; @@ -93,6 +93,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest private Scene m_scene; private Queue rpcQueue = new Queue(); + public HttpRequestModule() + { + } + #region IHttpRequests Members 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 private void MakeHttpRequest(string url, LLUUID requestID) { - WebRequest request = WebRequest.Create(url); + WebRequest request = HttpWebRequest.Create(url); RequestState state = new RequestState((HttpWebRequest) request, requestID); - IAsyncResult result = request.BeginGetResponse(HttpRequestReturn, state); + IAsyncResult result = request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state); TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); state.TimeOfRequest = (int) t.TotalSeconds; @@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL private void HttpRequestReturn(IAsyncResult result) { RequestState state = (RequestState) result.AsyncState; - WebRequest request = state.Request; + WebRequest request = (WebRequest) state.Request; HttpWebResponse response = (HttpWebResponse) request.EndGetResponse(result); if (response.StatusCode == HttpStatusCode.OK) { @@ -175,9 +175,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL public class RequestState { - public HttpWebRequest Request; + public HttpWebRequest Request = null; public LLUUID RequestID = LLUUID.Zero; - public int TimeOfRequest; + public int TimeOfRequest = 0; public RequestState(HttpWebRequest request, LLUUID requestID) { 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 private Scene m_scene; private IDynamicTextureManager m_textureManager; + public VectorRenderModule() + { + } + #region IDynamicTextureRender Members public string GetContentType() @@ -134,7 +138,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender catch (Exception e) { //Ckrinke: Add a WriteLine to remove the warning about 'e' defined but not used - Console.WriteLine("Problem with Draw. Please verify parameters." + e); + Console.WriteLine("Problem with Draw. Please verify parameters." + e.ToString()); } if ((size < 128) || (size > 1024)) @@ -256,7 +260,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender endPoint.X = (int) x; endPoint.Y = (int) y; Image image = ImageHttpRequest(nextLine); - graph.DrawImage(image, startPoint.X, startPoint.Y, x, y); + graph.DrawImage(image, (float) startPoint.X, (float) startPoint.Y, x, y); startPoint.X += endPoint.X; startPoint.Y += endPoint.Y; } @@ -349,7 +353,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender private Bitmap ImageHttpRequest(string url) { - WebRequest request = WebRequest.Create(url); + WebRequest request = HttpWebRequest.Create(url); //Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. //Ckrinke Stream str = null; 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 private Queue m_pendingQ; private Scene m_scene; + public WorldCommModule() + { + } + #region IRegionModule Members public void Initialise(Scene scene, IConfigSource config) @@ -320,8 +324,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm public class ListenerManager { //private Dictionary m_listeners; - private readonly Hashtable m_listeners = Hashtable.Synchronized(new Hashtable()); private object ListenersLock = new object(); + private Hashtable m_listeners = Hashtable.Synchronized(new Hashtable()); private int m_MaxListeners = 100; 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 public class ListenerInfo { - private readonly LLUUID m_sourceItemID; // ID of the scenePart or avatar source of the message private bool m_active; // Listener is active or not private int m_channel; // Channel private int m_handle; // Assigned handle of this listener @@ -491,6 +494,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm private uint m_localID; // Local ID from script engine private string m_message; // The message private string m_name; // Object name to filter messages from + private LLUUID m_sourceItemID; // ID of the scenePart or avatar source of the message public ListenerInfo(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message) { 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 public class XMLRPCModule : IRegionModule, IXMLRPC { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private readonly List m_scenes = new List(); - private readonly object XMLRPCListLock = new object(); private string m_name = "XMLRPCModule"; // private Dictionary m_openChannels; private Dictionary m_pendingSRDResponses; - private int m_remoteDataPort; + private int m_remoteDataPort = 0; private Dictionary m_rpcPending; private Dictionary m_rpcPendingResponses; + private List m_scenes = new List(); private int RemoteReplyScriptTimeout = 9000; private int RemoteReplyScriptWait = 300; + private object XMLRPCListLock = new object(); #region IRegionModule Members @@ -428,15 +428,15 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public class RPCRequestInfo { - private readonly LLUUID m_ChannelKey; - private readonly string m_IntVal; - private readonly LLUUID m_ItemID; - private readonly uint m_localID; - private readonly LLUUID m_MessageID; - private readonly string m_StrVal; + private LLUUID m_ChannelKey; + private string m_IntVal; + private LLUUID m_ItemID; + private uint m_localID; + private LLUUID m_MessageID; private bool m_processed; private int m_respInt; private string m_respStr; + private string m_StrVal; public RPCRequestInfo(uint localID, LLUUID itemID, LLUUID channelKey, string strVal, string intVal) { @@ -514,9 +514,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public class RPCChannelInfo { - private readonly LLUUID m_ChannelKey; - private readonly LLUUID m_itemID; - private readonly uint m_localID; + private LLUUID m_ChannelKey; + private LLUUID m_itemID; + private uint m_localID; public RPCChannelInfo(uint localID, LLUUID itemID, LLUUID channelID) { -- cgit v1.1