From 7d89e122930be39e84a6d174548fa2d12ac0484a Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 6 Sep 2008 07:52:41 +0000 Subject: * This is the fabled LibOMV update with all of the libOMV types from JHurliman * This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle. * This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big! * Essentially we're back at square 1 in the testing phase.. so lets identify things that broke. --- .../DynamicTexture/DynamicTextureModule.cs | 68 ++++++++------ .../Modules/Scripting/EMailModules/EmailModule.cs | 14 +-- .../Scripting/HttpRequest/ScriptsHttpRequests.cs | 24 ++--- .../Scripting/LoadImageURL/LoadImageURLModule.cs | 16 ++-- .../Scripting/VectorRender/VectorRenderModule.cs | 13 ++- .../Modules/Scripting/WorldComm/WorldCommModule.cs | 68 +++++++------- .../Modules/Scripting/XMLRPC/XMLRPCModule.cs | 100 ++++++++++----------- 7 files changed, 157 insertions(+), 146 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 15ce584..59d29d6 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -29,9 +29,9 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; -using libsecondlife; +using OpenMetaverse; +using OpenMetaverse.Imaging; using Nini.Config; -using OpenJPEGNet; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -40,12 +40,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture { public class DynamicTextureModule : IRegionModule, IDynamicTextureManager { - private Dictionary RegisteredScenes = new Dictionary(); + private Dictionary RegisteredScenes = new Dictionary(); private Dictionary RenderPlugins = new Dictionary(); - private Dictionary Updaters = new Dictionary(); + private Dictionary Updaters = new Dictionary(); #region IDynamicTextureManager Members @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture /// /// /// - public void ReturnData(LLUUID id, byte[] data) + public void ReturnData(UUID id, byte[] data) { if (Updaters.ContainsKey(id)) { @@ -75,13 +75,13 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture } } - public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, + public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer) { return AddDynamicTextureURL(simID, primID, contentType, url, extraParams, updateTimer, false, 255); } - public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, + public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) { if (RenderPlugins.ContainsKey(contentType)) @@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture updater.ContentType = contentType; updater.Url = url; updater.UpdateTimer = updateTimer; - updater.UpdaterID = LLUUID.Random(); + updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; @@ -107,16 +107,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); return updater.UpdaterID; } - return LLUUID.Zero; + return UUID.Zero; } - public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, + public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer) { return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, false, 255); } - public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, + public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) { if (RenderPlugins.ContainsKey(contentType)) @@ -127,7 +127,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture updater.ContentType = contentType; updater.BodyData = data; updater.UpdateTimer = updateTimer; - updater.UpdaterID = LLUUID.Random(); + updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; @@ -140,7 +140,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); return updater.UpdaterID; } - return LLUUID.Zero; + return UUID.Zero; } #endregion @@ -184,18 +184,18 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture public string BodyData; public string ContentType; public byte FrontAlpha = 255; - public LLUUID LastAssetID; + public UUID LastAssetID; public string Params; - public LLUUID PrimID; + public UUID PrimID; public bool SetNewFrontAlpha = false; - public LLUUID SimUUID; - public LLUUID UpdaterID; + public UUID SimUUID; + public UUID UpdaterID; public int UpdateTimer; public string Url; public DynamicTextureUpdater() { - LastAssetID = LLUUID.Zero; + LastAssetID = UUID.Zero; UpdateTimer = 0; BodyData = null; } @@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture if (BlendWithOldTexture) { - LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; + UUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; oldAsset = scene.AssetCache.GetAsset(lastTextureID, true); if (oldAsset != null) { @@ -231,7 +231,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture // Create a new asset for user AssetBase asset = new AssetBase(); - asset.FullID = LLUUID.Random(); + asset.FullID = UUID.Random(); asset.Data = assetData; asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); asset.Type = 0; @@ -243,10 +243,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture LastAssetID = asset.FullID; // mostly keep the values from before - LLObject.TextureEntry tmptex = part.Shape.Textures; + Primitive.TextureEntry tmptex = part.Shape.Textures; // remove the old asset from the cache - LLUUID oldID = tmptex.DefaultTexture.TextureID; + UUID oldID = tmptex.DefaultTexture.TextureID; scene.AssetCache.ExpireAsset(oldID); tmptex.DefaultTexture.TextureID = asset.FullID; @@ -259,15 +259,27 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha) { - Bitmap image1 = new Bitmap(OpenJPEG.DecodeToImage(frontImage)); - Bitmap image2 = new Bitmap(OpenJPEG.DecodeToImage(backImage)); - if (setNewAlpha) + ManagedImage managedImage; + Image image; + + if (OpenJPEG.DecodeToImage(frontImage, out managedImage, out image)) { - SetAlpha(ref image1, newAlpha); + Bitmap image1 = new Bitmap(image); + + if (OpenJPEG.DecodeToImage(backImage, out managedImage, out image)) + { + Bitmap image2 = new Bitmap(image); + + if (setNewAlpha) + SetAlpha(ref image1, newAlpha); + + Bitmap joint = MergeBitMaps(image1, image2); + + return OpenJPEG.EncodeFromImage(joint, true); + } } - Bitmap joint = MergeBitMaps(image1, image2); - return OpenJPEG.EncodeFromImage(joint, true); + return null; } public Bitmap MergeBitMaps(Bitmap front, Bitmap back) diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index bcf3e76..5a715f5 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs @@ -29,7 +29,7 @@ using System; using System.Reflection; using System.Collections.Generic; using System.Text.RegularExpressions; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules } } - private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) + private SceneObjectPart findPrim(UUID objectID, out string ObjectRegionName) { lock (m_Scenes) { @@ -179,7 +179,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules return null; } - private void resolveNamePositionRegionName(LLUUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) + private void resolveNamePositionRegionName(UUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) { string m_ObjectRegionName; SceneObjectPart part = findPrim(objectID, out m_ObjectRegionName); @@ -203,7 +203,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules /// /// /// - public void SendEmail(LLUUID objectID, string address, string subject, string body) + public void SendEmail(UUID objectID, string address, string subject, string body) { //Check if address is empty if (address == string.Empty) @@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules //Creation EmailMessage EmailMessage emailMessage = new EmailMessage(); //From - emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); + emailMessage.FromAddress = new EmailAddress(objectID.ToString()+"@"+m_HostName); //To - Only One emailMessage.AddToAddress(new EmailAddress(address)); //Subject @@ -264,7 +264,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules //Send Email Message emailMessage.Send(smtpServer); //Log - m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.UUID.ToString()); + m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.ToString()); } catch (Exception e) { @@ -280,7 +280,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules /// /// /// - public Email GetNextEmail(LLUUID objectID, string sender, string subject) + public Email GetNextEmail(UUID objectID, string sender, string subject) { return null; } diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 1eb0387..9595588 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -31,7 +31,7 @@ using System.IO; using System.Net; using System.Text; using System.Threading; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Servers; @@ -91,7 +91,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest private string m_name = "HttpScriptRequests"; // - private Dictionary m_pendingRequests; + private Dictionary m_pendingRequests; private Scene m_scene; // private Queue rpcQueue = new Queue(); @@ -101,14 +101,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest #region IHttpRequests Members - public LLUUID MakeHttpRequest(string url, string parameters, string body) + public UUID MakeHttpRequest(string url, string parameters, string body) { - return LLUUID.Zero; + return UUID.Zero; } - public LLUUID StartHttpRequest(uint localID, LLUUID itemID, string url, List parameters, Dictionary headers, string body) + public UUID StartHttpRequest(uint localID, UUID itemID, string url, List parameters, Dictionary headers, string body) { - LLUUID reqID = LLUUID.Random(); + UUID reqID = UUID.Random(); HttpRequestClass htc = new HttpRequestClass(); // Partial implementation: support for parameter flags needed @@ -163,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest return reqID; } - public void StopHttpRequest(uint m_localID, LLUUID m_itemID) + public void StopHttpRequest(uint m_localID, UUID m_itemID) { if (m_pendingRequests != null) { @@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest { lock (HttpListLock) { - foreach (LLUUID luid in m_pendingRequests.Keys) + foreach (UUID luid in m_pendingRequests.Keys) { HttpRequestClass tmpReq; @@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest return null; } - public void RemoveCompletedRequest(LLUUID id) + public void RemoveCompletedRequest(UUID id) { lock (HttpListLock) { @@ -232,7 +232,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest m_scene.RegisterModuleInterface(this); - m_pendingRequests = new Dictionary(); + m_pendingRequests = new Dictionary(); } public void PostInitialise() @@ -274,11 +274,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest public bool httpVerifyCert = true; // not implemented // Request info - public LLUUID itemID; + public UUID itemID; public uint localID; public DateTime next; public string outbound_body; - public LLUUID reqID; + public UUID reqID; public HttpWebRequest request; public string response_body; public List response_metadata; diff --git a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs index 725322b..339ad42 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -29,9 +29,9 @@ using System; using System.Drawing; using System.IO; using System.Net; -using libsecondlife; +using OpenMetaverse; +using OpenMetaverse.Imaging; using Nini.Config; -using OpenJPEGNet; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -70,13 +70,13 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL return null; } - public bool AsyncConvertUrl(LLUUID id, string url, string extraParams) + public bool AsyncConvertUrl(UUID id, string url, string extraParams) { MakeHttpRequest(url, id); return true; } - public bool AsyncConvertData(LLUUID id, string bodyData, string extraParams) + public bool AsyncConvertData(UUID id, string bodyData, string extraParams) { return false; } @@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL #endregion - private void MakeHttpRequest(string url, LLUUID requestID) + private void MakeHttpRequest(string url, UUID requestID) { WebRequest request = HttpWebRequest.Create(url); RequestState state = new RequestState((HttpWebRequest) request, requestID); @@ -177,10 +177,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL public class RequestState { public HttpWebRequest Request = null; - public LLUUID RequestID = LLUUID.Zero; + public UUID RequestID = UUID.Zero; public int TimeOfRequest = 0; - public RequestState(HttpWebRequest request, LLUUID requestID) + public RequestState(HttpWebRequest request, UUID requestID) { Request = request; RequestID = requestID; @@ -189,4 +189,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs index 27f1182..256bf27 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs @@ -31,12 +31,11 @@ using System.Drawing.Imaging; using System.Globalization; using System.IO; using System.Net; -using libsecondlife; +using OpenMetaverse; +using OpenMetaverse.Imaging; using Nini.Config; -using OpenJPEGNet; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; -using Image=System.Drawing.Image; //using Cairo; @@ -79,12 +78,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender return null; } - public bool AsyncConvertUrl(LLUUID id, string url, string extraParams) + public bool AsyncConvertUrl(UUID id, string url, string extraParams) { return false; } - public bool AsyncConvertData(LLUUID id, string bodyData, string extraParams) + public bool AsyncConvertData(UUID id, string bodyData, string extraParams) { Draw(bodyData, id, extraParams); return true; @@ -127,7 +126,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender #endregion - private void Draw(string data, LLUUID id, string extraParams) + private void Draw(string data, UUID id, string extraParams) { // TODO: this is a brutal hack. extraParams should actually be parsed reasonably. int size = 256; @@ -374,4 +373,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender return null; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs index 2f67dee..ae5eefc 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -66,7 +66,7 @@ using OpenSim.Region.Environment.Scenes; * * For LSL compliance, note the following: * (Tested again 1.21.1 on May 2, 2008) - * 1. 'id' has to be parsed into a LLUUID. None-UUID keys are + * 1. 'id' has to be parsed into a UUID. None-UUID keys are * to be replaced by the ZeroID key. (Well, TryParse does * that for us. * 2. Setting up an listen event from the same script, with the @@ -157,7 +157,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// key to filter on (user given, could be totally faked) /// msg to filter on /// number of the scripts handle - public int Listen(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, LLUUID id, string msg) + public int Listen(uint localID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg) { return m_listenerManager.AddListener(localID, itemID, hostID, channel, name, id, msg); } @@ -169,7 +169,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// UUID of the script engine /// handle returned by Listen() /// temp. activate or deactivate the Listen() - public void ListenControl(LLUUID itemID, int handle, int active) + public void ListenControl(UUID itemID, int handle, int active) { if (active == 1) m_listenerManager.Activate(itemID, handle); @@ -182,7 +182,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// /// UUID of the script engine /// handle returned by Listen() - public void ListenRemove(LLUUID itemID, int handle) + public void ListenRemove(UUID itemID, int handle) { m_listenerManager.Remove(itemID, handle); } @@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// (script engine) /// /// UUID of the script engine - public void DeleteListener(LLUUID itemID) + public void DeleteListener(UUID itemID) { m_listenerManager.DeleteListener(itemID); } @@ -210,11 +210,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// name of sender (object or avatar) /// key of sender (object or avatar) /// msg to sent - public void DeliverMessage(ChatTypeEnum type, int channel, string name, LLUUID id, string msg) + public void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg) { SceneObjectPart source = null; ScenePresence avatar = null; - LLVector3 position; + Vector3 position; source = m_scene.GetSceneObjectPart(id); if (source != null) @@ -231,7 +231,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm // Determine which listen event filters match the given set of arguments, this results // in a limited set of listeners, each belonging a host. If the host is in range, add them // to the pending queue. - foreach (ListenerInfo li in m_listenerManager.GetListeners(LLUUID.Zero, channel, name, id, msg)) + foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) { // Dont process if this message is from yourself! if (li.GetHostID().Equals(id)) @@ -331,12 +331,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm e.Message); } - public Object[] GetSerializationData(LLUUID itemID) + public Object[] GetSerializationData(UUID itemID) { return m_listenerManager.GetSerializationData(itemID); } - public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID, + public void CreateFromData(uint localID, UUID itemID, UUID hostID, Object[] data) { m_listenerManager.AddFromData(localID, itemID, hostID, data); @@ -357,7 +357,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm m_curlisteners = 0; } - public int AddListener(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, LLUUID id, string msg) + public int AddListener(uint localID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg) { // do we already have a match on this particular filter event? List coll = GetListeners(itemID, channel, name, id, msg); @@ -395,7 +395,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm return -1; } - public void Remove(LLUUID itemID, int handle) + public void Remove(UUID itemID, int handle) { lock (m_listeners) { @@ -419,7 +419,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm } } - public void DeleteListener(LLUUID itemID) + public void DeleteListener(UUID itemID) { List emptyChannels = new List(); List removedListeners = new List(); @@ -455,7 +455,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm } } - public void Activate(LLUUID itemID, int handle) + public void Activate(UUID itemID, int handle) { lock (m_listeners) { @@ -474,7 +474,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm } } - public void Dectivate(LLUUID itemID, int handle) + public void Dectivate(UUID itemID, int handle) { lock (m_listeners) { @@ -494,7 +494,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm } // non-locked access, since its always called in the context of the lock - private int GetNewHandle(LLUUID itemID) + private int GetNewHandle(UUID itemID) { List handles = new List(); @@ -521,7 +521,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm // Theres probably a more clever and efficient way to // do this, maybe with regex. // PM2008: Ha, one could even be smart and define a specialized Enumerator. - public List GetListeners(LLUUID itemID, int channel, string name, LLUUID id, string msg) + public List GetListeners(UUID itemID, int channel, string name, UUID id, string msg) { List collection = new List(); @@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm { continue; } - if (!itemID.Equals(LLUUID.Zero) && !li.GetItemID().Equals(itemID)) + if (!itemID.Equals(UUID.Zero) && !li.GetItemID().Equals(itemID)) { continue; } @@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm { continue; } - if (!li.GetID().Equals(LLUUID.Zero) && !li.GetID().Equals(id)) + if (!li.GetID().Equals(UUID.Zero) && !li.GetID().Equals(id)) { continue; } @@ -561,7 +561,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm return collection; } - public Object[] GetSerializationData(LLUUID itemID) + public Object[] GetSerializationData(UUID itemID) { List data = new List(); @@ -576,7 +576,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm return (Object[])data.ToArray(); } - public void AddFromData(uint localID, LLUUID itemID, LLUUID hostID, + public void AddFromData(uint localID, UUID itemID, UUID hostID, Object[] data) { int idx = 0; @@ -603,25 +603,25 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm private bool m_active; // Listener is active or not private int m_handle; // Assigned handle of this listener private uint m_localID; // Local ID from script engine - private LLUUID m_itemID; // ID of the host script engine - private LLUUID m_hostID; // ID of the host/scene part + private UUID m_itemID; // ID of the host script engine + private UUID m_hostID; // ID of the host/scene part private int m_channel; // Channel - private LLUUID m_id; // ID to filter messages from + private UUID m_id; // ID to filter messages from private string m_name; // Object name to filter messages from private string m_message; // The message - public ListenerInfo(int handle, uint localID, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message) + public ListenerInfo(int handle, uint localID, UUID ItemID, UUID hostID, int channel, string name, UUID id, string message) { Initialise(handle, localID, ItemID, hostID, channel, name, id, message); } - public ListenerInfo(ListenerInfo li, string name, LLUUID id, string message) + public ListenerInfo(ListenerInfo li, string name, UUID id, string message) { Initialise(li.m_handle, li.m_localID, li.m_itemID, li.m_hostID, li.m_channel, name, id, message); } - private void Initialise(int handle, uint localID, LLUUID ItemID, LLUUID hostID, int channel, string name, - LLUUID id, string message) + private void Initialise(int handle, uint localID, UUID ItemID, UUID hostID, int channel, string name, + UUID id, string message) { m_active = true; m_handle = handle; @@ -648,22 +648,22 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm return data; } - public static ListenerInfo FromData(uint localID, LLUUID ItemID, LLUUID hostID, Object[] data) + public static ListenerInfo FromData(uint localID, UUID ItemID, UUID hostID, Object[] data) { ListenerInfo linfo = new ListenerInfo((int)data[1], localID, ItemID, hostID, (int)data[2], (string)data[3], - (LLUUID)data[4], (string)data[5]); + (UUID)data[4], (string)data[5]); linfo.m_active=(bool)data[0]; return linfo; } - public LLUUID GetItemID() + public UUID GetItemID() { return m_itemID; } - public LLUUID GetHostID() + public UUID GetHostID() { return m_hostID; } @@ -708,7 +708,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm m_active = true; } - public LLUUID GetID() + public UUID GetID() { return m_id; } diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs index bde90bc..85aa344 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs @@ -31,7 +31,7 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -82,12 +82,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC private string m_name = "XMLRPCModule"; // - private Dictionary m_openChannels; - private Dictionary m_pendingSRDResponses; + private Dictionary m_openChannels; + private Dictionary m_pendingSRDResponses; private int m_remoteDataPort = 0; - private Dictionary m_rpcPending; - private Dictionary m_rpcPendingResponses; + private Dictionary m_rpcPending; + private Dictionary m_rpcPendingResponses; private List m_scenes = new List(); private int RemoteReplyScriptTimeout = 9000; private int RemoteReplyScriptWait = 300; @@ -102,10 +102,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC // get called only one time (or we lose any open channels) if (null == m_openChannels) { - m_openChannels = new Dictionary(); - m_rpcPending = new Dictionary(); - m_rpcPendingResponses = new Dictionary(); - m_pendingSRDResponses = new Dictionary(); + m_openChannels = new Dictionary(); + m_rpcPending = new Dictionary(); + m_rpcPendingResponses = new Dictionary(); + m_pendingSRDResponses = new Dictionary(); try { @@ -164,11 +164,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC /********************************************** * OpenXMLRPCChannel * - * Generate a LLUUID channel key and add it and + * Generate a UUID channel key and add it and * the prim id to dictionary * * A custom channel key can be proposed. - * Otherwise, passing LLUUID.Zero will generate + * Otherwise, passing UUID.Zero will generate * and return a random channel * * First check if there is a channel assigned for @@ -179,9 +179,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC * * ********************************************/ - public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID, LLUUID channelID) + public UUID OpenXMLRPCChannel(uint localID, UUID itemID, UUID channelID) { - LLUUID newChannel = LLUUID.Zero; + UUID newChannel = UUID.Zero; // This should no longer happen, but the check is reasonable anyway if (null == m_openChannels) @@ -201,9 +201,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC } } - if (newChannel == LLUUID.Zero) + if (newChannel == UUID.Zero) { - newChannel = (channelID == LLUUID.Zero) ? LLUUID.Random() : channelID; + newChannel = (channelID == UUID.Zero) ? UUID.Random() : channelID; RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, newChannel); lock (XMLRPCListLock) { @@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC // Delete channels based on itemID // for when a script is deleted - public void DeleteChannels(LLUUID itemID) + public void DeleteChannels(UUID itemID) { if (m_openChannels != null) { @@ -234,7 +234,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC IEnumerator tmpEnumerator = tmp.GetEnumerator(); while (tmpEnumerator.MoveNext()) - m_openChannels.Remove((LLUUID) tmpEnumerator.Current); + m_openChannels.Remove((UUID) tmpEnumerator.Current); } } } @@ -248,12 +248,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public void RemoteDataReply(string channel, string message_id, string sdata, int idata) { - LLUUID message_key = new LLUUID(message_id); - LLUUID channel_key = new LLUUID(channel); + UUID message_key = new UUID(message_id); + UUID channel_key = new UUID(channel); RPCRequestInfo rpcInfo = null; - if (message_key == LLUUID.Zero) + if (message_key == UUID.Zero) { foreach (RPCRequestInfo oneRpcInfo in m_rpcPendingResponses.Values) if (oneRpcInfo.GetChannelKey() == channel_key) @@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC * *********************************************/ - public void CloseXMLRPCChannel(LLUUID channelKey) + public void CloseXMLRPCChannel(UUID channelKey) { if (m_openChannels.ContainsKey(channelKey)) m_openChannels.Remove(channelKey); @@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC { lock (XMLRPCListLock) { - foreach (LLUUID luid in m_rpcPending.Keys) + foreach (UUID luid in m_rpcPending.Keys) { RPCRequestInfo tmpReq; @@ -322,7 +322,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return null; } - public void RemoveCompletedRequest(LLUUID id) + public void RemoveCompletedRequest(UUID id) { lock (XMLRPCListLock) { @@ -339,7 +339,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC } } - public LLUUID SendRemoteData(uint localID, LLUUID itemID, string channel, string dest, int idata, string sdata) + public UUID SendRemoteData(uint localID, UUID itemID, string channel, string dest, int idata, string sdata) { SendRemoteDataRequest req = new SendRemoteDataRequest( localID, itemID, channel, dest, idata, sdata @@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC { lock (XMLRPCListLock) { - foreach (LLUUID luid in m_pendingSRDResponses.Keys) + foreach (UUID luid in m_pendingSRDResponses.Keys) { SendRemoteDataRequest tmpReq; @@ -369,7 +369,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return null; } - public void RemoveCompletedSRDRequest(LLUUID id) + public void RemoveCompletedSRDRequest(UUID id) { lock (XMLRPCListLock) { @@ -381,7 +381,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC } } - public void CancelSRDRequests(LLUUID itemID) + public void CancelSRDRequests(UUID itemID) { if (m_pendingSRDResponses != null) { @@ -408,7 +408,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC if (GoodXML) { - LLUUID channel = new LLUUID((string) requestData["Channel"]); + UUID channel = new UUID((string) requestData["Channel"]); RPCChannelInfo rpcChanInfo; if (m_openChannels.TryGetValue(channel, out rpcChanInfo)) { @@ -462,24 +462,24 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public class RPCRequestInfo { - private LLUUID m_ChannelKey; + private UUID m_ChannelKey; private string m_IntVal; - private LLUUID m_ItemID; + private UUID m_ItemID; private uint m_localID; - private LLUUID m_MessageID; + private UUID 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) + public RPCRequestInfo(uint localID, UUID itemID, UUID channelKey, string strVal, string intVal) { m_localID = localID; m_StrVal = strVal; m_IntVal = intVal; m_ItemID = itemID; m_ChannelKey = channelKey; - m_MessageID = LLUUID.Random(); + m_MessageID = UUID.Random(); m_processed = false; m_respStr = String.Empty; m_respInt = 0; @@ -490,7 +490,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return m_processed; } - public LLUUID GetChannelKey() + public UUID GetChannelKey() { return m_ChannelKey; } @@ -525,7 +525,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return m_localID; } - public LLUUID GetItemID() + public UUID GetItemID() { return m_ItemID; } @@ -540,7 +540,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return int.Parse(m_IntVal); } - public LLUUID GetMessageID() + public UUID GetMessageID() { return m_MessageID; } @@ -548,23 +548,23 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public class RPCChannelInfo { - private LLUUID m_ChannelKey; - private LLUUID m_itemID; + private UUID m_ChannelKey; + private UUID m_itemID; private uint m_localID; - public RPCChannelInfo(uint localID, LLUUID itemID, LLUUID channelID) + public RPCChannelInfo(uint localID, UUID itemID, UUID channelID) { m_ChannelKey = channelID; m_localID = localID; m_itemID = itemID; } - public LLUUID GetItemID() + public UUID GetItemID() { return m_itemID; } - public LLUUID GetChannelID() + public UUID GetChannelID() { return m_ChannelKey; } @@ -583,15 +583,15 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public bool finished; private Thread httpThread; public int idata; - public LLUUID m_itemID; + public UUID m_itemID; public uint m_localID; - public LLUUID reqID; + public UUID reqID; public XmlRpcRequest request; public int response_idata; public string response_sdata; public string sdata; - public SendRemoteDataRequest(uint localID, LLUUID itemID, string channel, string dest, int idata, string sdata) + public SendRemoteDataRequest(uint localID, UUID itemID, string channel, string dest, int idata, string sdata) { this.channel = channel; destURL = dest; @@ -600,10 +600,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC m_itemID = itemID; m_localID = localID; - reqID = LLUUID.Random(); + reqID = UUID.Random(); } - public LLUUID process() + public UUID process() { httpThread = new Thread(SendRequest); httpThread.Name = "HttpRequestThread"; @@ -625,12 +625,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC { Hashtable param = new Hashtable(); - // Check if channel is an LLUUID + // Check if channel is an UUID // if not, use as method name - LLUUID parseUID; + UUID parseUID; string mName = "llRemoteData"; if ((channel != null) && (channel != "")) - if (!LLUUID.TryParse(channel, out parseUID)) + if (!UUID.TryParse(channel, out parseUID)) mName = channel; else param["Channel"] = channel; @@ -698,7 +698,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC } } - public LLUUID GetReqID() + public UUID GetReqID() { return reqID; } -- cgit v1.1