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. --- .../Modules/World/Archiver/ArchiveConstants.cs | 16 +- .../Modules/World/Archiver/ArchiveReadRequest.cs | 15 +- .../World/Archiver/ArchiveWriteRequestExecution.cs | 12 +- .../Archiver/ArchiveWriteRequestPreparation.cs | 32 ++-- .../Modules/World/Archiver/ArchiverModule.cs | 2 +- .../Modules/World/Archiver/AssetsArchiver.cs | 12 +- .../Modules/World/Archiver/AssetsDearchiver.cs | 6 +- .../Modules/World/Archiver/AssetsRequest.cs | 14 +- .../Modules/World/Estate/EstateManagementModule.cs | 52 +++--- .../Environment/Modules/World/Land/LandChannel.cs | 12 +- .../Modules/World/Land/LandManagementModule.cs | 71 ++++--- .../Environment/Modules/World/Land/LandObject.cs | 46 ++--- .../Environment/Modules/World/NPC/NPCAvatar.cs | 204 ++++++++++----------- .../Environment/Modules/World/NPC/NPCModule.cs | 6 +- .../Modules/World/Permissions/PermissionsModule.cs | 132 ++++++------- .../Modules/World/Serialiser/IRegionSerialiser.cs | 12 +- .../Modules/World/Serialiser/SceneXmlLoader.cs | 15 +- .../Modules/World/Serialiser/SerialiseObjects.cs | 6 +- .../Modules/World/Serialiser/SerialiserModule.cs | 8 +- .../Environment/Modules/World/Sun/SunModule.cs | 23 ++- .../Modules/World/Terrain/TerrainModule.cs | 6 +- .../World/TreePopulator/TreePopulatorModule.cs | 37 ++-- .../Modules/World/WorldMap/MapImageModule.cs | 79 ++++---- .../World/WorldMap/ShadedMapTileRenderer.cs | 5 +- .../World/WorldMap/TexturedMapTileRenderer.cs | 33 ++-- .../Modules/World/WorldMap/WorldMapModule.cs | 49 ++--- 26 files changed, 447 insertions(+), 458 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/World') diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index 012f8d4..8d74160 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs @@ -26,7 +26,7 @@ */ using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Modules.World.Archiver { @@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// The location of the archive control file /// - public static readonly string CONTROL_FILE_PATH = "archive.xml"; + public static readonly string CONTROL_FILE_PATH = "archive.Xml"; /// /// Path for the assets held in an archive @@ -48,7 +48,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Path for the assets metadata file /// - //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; + //public static readonly string ASSETS_METADATA_PATH = "assets.Xml"; /// /// Path for the prims file @@ -88,11 +88,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"; // Not sure if we'll ever see this -// disable warning: we know Script is obsolete, but need to support it -// anyhow -#pragma warning disable 0612 - ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = ASSET_EXTENSION_SEPARATOR + "script.txt"; // Not sure if we'll ever see this -#pragma warning restore 0612 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ASSET_EXTENSION_SEPARATOR + "simstate.bin"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SnapshotFolder] = ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ASSET_EXTENSION_SEPARATOR + "sound.ogg"; @@ -116,11 +111,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"] = (sbyte)AssetType.RootFolder; -// disable warning: we know Script is obsolete, but need to support it -// anyhow -#pragma warning disable 0612 - EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "script.txt"] = (sbyte)AssetType.Script; -#pragma warning restore 0612 EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "simstate.bin"] = (sbyte)AssetType.Simstate; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"] = (sbyte)AssetType.SnapshotFolder; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.ogg"] = (sbyte)AssetType.Sound; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 89f5fd7..776ea78 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs @@ -31,13 +31,12 @@ using OpenSim.Region.Environment.Modules.World.Serialiser; using OpenSim.Region.Environment.Modules.World.Terrain; using OpenSim.Framework.Communications.Cache; using System; -using Axiom.Math; using System.Collections.Generic; using System.IO; using System.IO.Compression; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; namespace OpenSim.Region.Environment.Modules.World.Archiver @@ -57,7 +56,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Used to cache lookups for valid uuids. /// - private IDictionary m_validUserUuids = new Dictionary(); + private IDictionary m_validUserUuids = new Dictionary(); public ArchiveReadRequest(Scene scene, string loadPath) { @@ -137,8 +136,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // Try to retain the original creator/owner/lastowner if their uuid is present on this grid // otherwise, use the master avatar uuid instead - LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; foreach (SceneObjectPart part in sceneObject.Children.Values) { @@ -184,7 +183,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// - private bool resolveUserUuid(LLUUID uuid) + private bool resolveUserUuid(UUID uuid) { if (!m_validUserUuids.ContainsKey(uuid)) { @@ -209,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// true if asset was successfully loaded, false otherwise private bool LoadAsset(string assetPath, byte[] data) { - // Right now we're nastily obtaining the lluuid from the filename + // Right now we're nastily obtaining the UUID from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR); @@ -231,7 +230,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); - AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); + AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); asset.Type = assetType; asset.Data = data; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 26d4797..6276d34 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -31,7 +31,7 @@ using System.IO; using System.IO.Compression; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Method called when all the necessary assets for an archive request have been received. /// - public delegate void AssetsRequestCallback(IDictionary assetsFound, ICollection assetsNotFoundUuids); + public delegate void AssetsRequestCallback(IDictionary assetsFound, ICollection assetsNotFoundUuids); /// /// Execute the write of an archive once we have received all the necessary data @@ -73,9 +73,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_savePath = savePath; } - protected internal void ReceivedAllAssets(IDictionary assetsFound, ICollection assetsNotFoundUuids) + protected internal void ReceivedAllAssets(IDictionary assetsFound, ICollection assetsNotFoundUuids) { - foreach (LLUUID uuid in assetsNotFoundUuids) + foreach (UUID uuid in assetsNotFoundUuids) { m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); } @@ -100,12 +100,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); - LLVector3 position = sceneObject.AbsolutePosition; + Vector3 position = sceneObject.AbsolutePosition; string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); string filename = string.Format( - "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", + "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.Xml", ArchiveConstants.OBJECTS_PATH, sceneObject.Name, Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), sceneObject.UUID); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index 20e15ab..a59148b 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -37,7 +37,7 @@ using System.Reflection; //using System.Text; using System.Text.RegularExpressions; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; @@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// The callback made when we request the asset for an object from the asset service. /// - public void AssetRequestCallback(LLUUID assetID, AssetBase asset) + public void AssetRequestCallback(UUID assetID, AssetBase asset) { lock (this) { @@ -100,7 +100,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// - protected AssetBase GetAsset(LLUUID uuid) + protected AssetBase GetAsset(UUID uuid) { m_waitingForObjectAsset = true; m_scene.AssetCache.GetAsset(uuid, AssetRequestCallback, true); @@ -128,20 +128,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// Dictionary in which to record the references - protected void GetScriptAssetUuids(LLUUID scriptUuid, IDictionary assetUuids) + protected void GetScriptAssetUuids(UUID scriptUuid, IDictionary assetUuids) { AssetBase scriptAsset = GetAsset(scriptUuid); if (null != scriptAsset) { - string script = Helpers.FieldToUTF8String(scriptAsset.Data); + string script = Utils.BytesToString(scriptAsset.Data); //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); MatchCollection uuidMatches = m_uuidRegex.Matches(script); //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); foreach (Match uuidMatch in uuidMatches) { - LLUUID uuid = new LLUUID(uuidMatch.Value); + UUID uuid = new UUID(uuidMatch.Value); //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); assetUuids[uuid] = 1; } @@ -153,17 +153,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// Dictionary in which to record the references - protected void GetWearableAssetUuids(LLUUID wearableAssetUuid, IDictionary assetUuids) + protected void GetWearableAssetUuids(UUID wearableAssetUuid, IDictionary assetUuids) { AssetBase assetBase = GetAsset(wearableAssetUuid); //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); - AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); + AssetWearable wearableAsset = new AssetBodypart(wearableAssetUuid, assetBase.Data); wearableAsset.Decode(); //m_log.DebugFormat( // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); - foreach (LLUUID uuid in wearableAsset.Textures.Values) + foreach (UUID uuid in wearableAsset.Textures.Values) { //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); assetUuids[uuid] = 1; @@ -176,14 +176,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// within this object). /// /// - /// - protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary assetUuids) + /// + protected void GetSceneObjectAssetUuids(UUID sceneObjectUuid, IDictionary assetUuids) { AssetBase objectAsset = GetAsset(sceneObjectUuid); if (null != objectAsset) { - string xml = Helpers.FieldToUTF8String(objectAsset.Data); + string xml = Utils.BytesToString(objectAsset.Data); SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); GetSceneObjectAssetUuids(sog, assetUuids); } @@ -196,7 +196,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// - protected void GetSceneObjectAssetUuids(SceneObjectGroup sceneObject, IDictionary assetUuids) + protected void GetSceneObjectAssetUuids(SceneObjectGroup sceneObject, IDictionary assetUuids) { m_log.DebugFormat( "[ARCHIVER]: Getting assets for object {0}, {1}", sceneObject.Name, sceneObject.UUID); @@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver try { - LLObject.TextureEntry textureEntry = part.Shape.Textures; + Primitive.TextureEntry textureEntry = part.Shape.Textures; // Get the prim's default texture. This will be used for faces which don't have their own texture assetUuids[textureEntry.DefaultTexture.TextureID] = 1; @@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // XXX: Not a great way to iterate through face textures, but there's no // other method available to tell how many faces there actually are //int i = 0; - foreach (LLObject.TextureEntryFace texture in textureEntry.FaceTextures) + foreach (Primitive.TextureEntryFace texture in textureEntry.FaceTextures) { if (texture != null) { @@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public void ArchiveRegion() { - Dictionary assetUuids = new Dictionary(); + Dictionary assetUuids = new Dictionary(); List entities = m_scene.GetEntities(); List sceneObjects = new List(); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs index 69f712c..df17ad2 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs @@ -31,7 +31,7 @@ using OpenSim.Region.Environment.Modules.World.Serialiser; using OpenSim.Region.Environment.Scenes; using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 73212ff..b49b2a4 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs @@ -29,7 +29,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; @@ -45,9 +45,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Archive assets /// - protected IDictionary m_assets; + protected IDictionary m_assets; - public AssetsArchiver(IDictionary assets) + public AssetsArchiver(IDictionary assets) { m_assets = assets; } @@ -76,7 +76,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver xtw.WriteStartElement("assets"); - foreach (LLUUID uuid in m_assets.Keys) + foreach (UUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; @@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver xtw.WriteEndDocument(); - archive.AddFile("assets.xml", sw.ToString()); + archive.AddFile("assets.Xml", sw.ToString()); } /// @@ -117,7 +117,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar //archive.AddDir("assets"); - foreach (LLUUID uuid in m_assets.Keys) + foreach (UUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs index 17abb24..b26fe4c 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs @@ -30,7 +30,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// protected void ResolveAssetData(string assetPath, byte[] data) { - // Right now we're nastily obtaining the lluuid from the filename + // Right now we're nastily obtaining the UUID from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); if (m_metadata.ContainsKey(filename)) @@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); - AssetBase asset = new AssetBase(new LLUUID(filename), metadata.Name); + AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); asset.Description = metadata.Description; asset.Type = metadata.AssetType; asset.Data = data; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs index 2164f7e..41fbc16 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs @@ -32,7 +32,7 @@ using OpenSim.Region.Environment.Scenes; using System.Collections.Generic; //using System.Reflection; using System.Threading; -using libsecondlife; +using OpenMetaverse; //using log4net; namespace OpenSim.Region.Environment.Modules.World.Archiver @@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// uuids to request /// - protected ICollection m_uuids; + protected ICollection m_uuids; /// /// Callback used when all the assets requested have been received. @@ -57,12 +57,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// Assets retrieved in this request /// - protected Dictionary m_assets = new Dictionary(); + protected Dictionary m_assets = new Dictionary(); /// /// Maintain a list of assets that could not be found. This will be passed back to the requester. /// - protected List m_notFoundAssetUuids = new List(); + protected List m_notFoundAssetUuids = new List(); /// /// Record the number of asset replies required so we know when we've finished @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// protected AssetCache m_assetCache; - protected internal AssetsRequest(ICollection uuids, AssetCache assetCache, AssetsRequestCallback assetsRequestCallback) + protected internal AssetsRequest(ICollection uuids, AssetCache assetCache, AssetsRequestCallback assetsRequestCallback) { m_uuids = uuids; m_assetsRequestCallback = assetsRequestCallback; @@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver if (m_repliesRequired == 0) m_assetsRequestCallback(m_assets, m_notFoundAssetUuids); - foreach (LLUUID uuid in m_uuids) + foreach (UUID uuid in m_uuids) { m_assetCache.GetAsset(uuid, AssetRequestCallback, true); } @@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// /// - public void AssetRequestCallback(LLUUID assetID, AssetBase asset) + public void AssetRequestCallback(UUID assetID, AssetBase asset) { if (asset != null) m_assets[assetID] = asset; diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 28347d0..976a634 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -28,7 +28,7 @@ using System; using System.Threading; using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -41,15 +41,15 @@ namespace OpenSim.Region.Environment.Modules.World.Estate { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private delegate void LookupUUIDS(List uuidLst); + private delegate void LookupUUIDS(List uuidLst); private Scene m_scene; #region Packet Data Responders - private void sendDetailedEstateData(IClientAPI remote_client, LLUUID invoice) + private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice) { - //SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant) + //SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant) uint sun = 0; if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime) @@ -119,9 +119,9 @@ namespace OpenSim.Region.Environment.Modules.World.Estate sendRegionInfoPacketToAll(); } - public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, LLUUID texture) + public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, UUID texture) { - if (texture == LLUUID.Zero) + if(texture == UUID.Zero) return; switch (corner) @@ -202,13 +202,13 @@ namespace OpenSim.Region.Environment.Modules.World.Estate m_scene.Restart(timeInSeconds); } - private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, LLUUID estateCovenantID) + private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) { m_scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; m_scene.RegionInfo.RegionSettings.Save(); } - private void handleEstateAccessDeltaRequest(IClientAPI remote_client, LLUUID invoice, int estateAccessType, LLUUID user) + private void handleEstateAccessDeltaRequest(IClientAPI remote_client, UUID invoice, int estateAccessType, UUID user) { // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc. @@ -338,17 +338,17 @@ namespace OpenSim.Region.Environment.Modules.World.Estate } } - private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message) + private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) { m_scene.SendRegionMessageFromEstateTools(senderID, sessionID, senderName, message); } - private void SendEstateBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message) + private void SendEstateBlueBoxMessage(IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) { m_scene.SendEstateMessageFromEstateTools(senderID, sessionID, senderName, message); } - private void handleEstateDebugRegionRequest(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics) + private void handleEstateDebugRegionRequest(IClientAPI remote_client, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics) { if (physics) m_scene.RegionInfo.RegionSettings.DisablePhysics = true; @@ -371,9 +371,9 @@ namespace OpenSim.Region.Environment.Modules.World.Estate m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics); } - private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, LLUUID invoice, LLUUID senderID, LLUUID prey) + private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey) { - if (prey != LLUUID.Zero) + if (prey != UUID.Zero) { ScenePresence s = m_scene.GetScenePresence(prey); if (s != null) @@ -419,7 +419,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) { Dictionary SceneData = new Dictionary(); - List uuidNameLookupList = new List(); + List uuidNameLookupList = new List(); if (reportType == 1) { @@ -491,7 +491,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate LookupUUIDS icon = (LookupUUIDS)iar.AsyncState; icon.EndInvoke(iar); } - private void LookupUUID(List uuidLst) + private void LookupUUID(List uuidLst) { LookupUUIDS d = LookupUUIDsAsync; @@ -499,9 +499,9 @@ namespace OpenSim.Region.Environment.Modules.World.Estate LookupUUIDSCompleted, d); } - private void LookupUUIDsAsync(List uuidLst) + private void LookupUUIDsAsync(List uuidLst) { - LLUUID[] uuidarr = new LLUUID[0]; + UUID[] uuidarr = new UUID[0]; lock (uuidLst) { @@ -533,7 +533,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate { RegionHandshakeArgs args = new RegionHandshakeArgs(); bool estatemanager = false; - LLUUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.EstateManagers; + UUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.EstateManagers; for (int i = 0; i < EstateManagers.Length; i++) { if (EstateManagers[i] == remoteClient.AgentId) @@ -559,14 +559,14 @@ namespace OpenSim.Region.Environment.Modules.World.Estate args.regionFlags = GetRegionFlags(); args.regionName = m_scene.RegionInfo.RegionName; - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) args.SimOwner = m_scene.RegionInfo.EstateSettings.EstateOwner; else args.SimOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID; - args.terrainBase0 = LLUUID.Zero; - args.terrainBase1 = LLUUID.Zero; - args.terrainBase2 = LLUUID.Zero; - args.terrainBase3 = LLUUID.Zero; + args.terrainBase0 = UUID.Zero; + args.terrainBase1 = UUID.Zero; + args.terrainBase2 = UUID.Zero; + args.terrainBase3 = UUID.Zero; args.terrainDetail0 = m_scene.RegionInfo.RegionSettings.TerrainTexture1; args.terrainDetail1 = m_scene.RegionInfo.RegionSettings.TerrainTexture2; args.terrainDetail2 = m_scene.RegionInfo.RegionSettings.TerrainTexture3; @@ -582,7 +582,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate ); } - public void handleEstateChangeInfo(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, UInt32 parms1, UInt32 parms2) + public void handleEstateChangeInfo(IClientAPI remoteClient, UUID invoice, UUID senderID, UInt32 parms1, UInt32 parms2) { if (parms2 == 0) { @@ -812,14 +812,14 @@ namespace OpenSim.Region.Environment.Modules.World.Estate return (uint)flags; } - public bool IsManager(LLUUID avatarID) + public bool IsManager(UUID avatarID) { if (avatarID == m_scene.RegionInfo.MasterAvatarAssignedUUID) return true; if (avatarID == m_scene.RegionInfo.EstateSettings.EstateOwner) return true; - List ems = new List(m_scene.RegionInfo.EstateSettings.EstateManagers); + List ems = new List(m_scene.RegionInfo.EstateSettings.EstateManagers); if (ems.Contains(avatarID)) return true; diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs index d519d4d..1e1291a 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land { return m_landManagementModule.GetLandObject(x_float, y_float); } - ILandObject obj = new LandObject(LLUUID.Zero, false, m_scene); + ILandObject obj = new LandObject(UUID.Zero, false, m_scene); obj.landData.Name = "NO LAND"; return obj; } @@ -100,12 +100,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land { return m_landManagementModule.GetLandObject(x, y); } - ILandObject obj = new LandObject(LLUUID.Zero, false, m_scene); + ILandObject obj = new LandObject(UUID.Zero, false, m_scene); obj.landData.Name = "NO LAND"; return obj; } - public List ParcelsNearPoint(LLVector3 position) + public List ParcelsNearPoint(Vector3 position) { if (m_landManagementModule != null) { @@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land m_landManagementModule.UpdateLandObject(localID, data); } } - public void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient) + public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) { if (m_landManagementModule != null) { @@ -168,4 +168,4 @@ namespace OpenSim.Region.Environment.Modules.World.Land #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 00994fb..e5bdafc 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -29,7 +29,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Region.Environment.Interfaces; @@ -38,7 +38,6 @@ using OpenSim.Framework; using OpenSim.Framework.Servers; using OpenSim.Framework.Communications.Capabilities; using OpenSim.Region.Physics.Manager; -using Axiom.Math; using Caps = OpenSim.Framework.Communications.Capabilities.Caps; namespace OpenSim.Region.Environment.Modules.World.Land @@ -165,10 +164,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; landIDList.Initialize(); - ILandObject fullSimParcel = new LandObject(LLUUID.Zero, false, m_scene); + ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) fullSimParcel.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; else fullSimParcel.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; @@ -176,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land AddLandObject(fullSimParcel); } - public List ParcelsNearPoint(LLVector3 position) + public List ParcelsNearPoint(Vector3 position) { List parcelsNear = new List(); for (int x = -4; x <= 4; x += 4) @@ -205,8 +204,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land "You are not allowed on this parcel because you are banned. Please go away. <3 OpenSim Developers"); avatar.PhysicsActor.Position = - new PhysicsVector(avatar.lastKnownAllowedPosition.x, avatar.lastKnownAllowedPosition.y, - avatar.lastKnownAllowedPosition.z); + new PhysicsVector(avatar.lastKnownAllowedPosition.X, avatar.lastKnownAllowedPosition.Y, + avatar.lastKnownAllowedPosition.Z); avatar.PhysicsActor.Velocity = new PhysicsVector(0, 0, 0); } else @@ -216,7 +215,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - public void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, LLUUID regionID) + public void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, UUID regionID) { if (m_scene.RegionInfo.RegionID == regionID) { @@ -353,7 +352,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } - public void handleParcelAccessRequest(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, + public void handleParcelAccessRequest(UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client) { if (landList.ContainsKey(landLocalID)) @@ -362,7 +361,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - public void handleParcelAccessUpdateRequest(LLUUID agentID, LLUUID sessionID, uint flags, int landLocalID, + public void handleParcelAccessUpdateRequest(UUID agentID, UUID sessionID, uint flags, int landLocalID, List entries, IClientAPI remote_client) { @@ -385,7 +384,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land /// public ILandObject CreateBaseLand() { - return new LandObject(LLUUID.Zero, false, m_scene); + return new LandObject(UUID.Zero, false, m_scene); } /// @@ -529,7 +528,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land public void AddPrimToLandPrimCounts(SceneObjectGroup obj) { - LLVector3 position = obj.AbsolutePosition; + Vector3 position = obj.AbsolutePosition; ILandObject landUnderPrim = GetLandObject(position.X, position.Y); if (landUnderPrim != null) { @@ -548,7 +547,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land public void FinalizeLandPrimCountUpdate() { //Get Simwide prim count for owner - Dictionary> landOwnersAndParcels = new Dictionary>(); + Dictionary> landOwnersAndParcels = new Dictionary>(); foreach (LandObject p in landList.Values) { if (!landOwnersAndParcels.ContainsKey(p.landData.OwnerID)) @@ -563,7 +562,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - foreach (LLUUID owner in landOwnersAndParcels.Keys) + foreach (UUID owner in landOwnersAndParcels.Keys) { int simArea = 0; int simPrims = 0; @@ -617,9 +616,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land /// South Point /// East Point /// North Point - /// LLUUID of user who is trying to subdivide + /// UUID of user who is trying to subdivide /// Returns true if successful - private void subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) + private void subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) { //First, lets loop through the points and make sure they are all in the same peice of land //Get the land object at start @@ -658,7 +657,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land //Lets create a new land object with bitmap activated at that point (keeping the old land objects info) ILandObject newLand = startLandObject.Copy(); newLand.landData.Name = "Subdivision of " + newLand.landData.Name; - newLand.landData.GlobalID = LLUUID.Random(); + newLand.landData.GlobalID = UUID.Random(); newLand.setLandBitmap(newLand.getSquareLandBitmap(start_x, start_y, end_x, end_y)); @@ -683,9 +682,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land /// y value in first piece of land /// x value in second peice of land /// y value in second peice of land - /// LLUUID of the avatar trying to join the land objects + /// UUID of the avatar trying to join the land objects /// Returns true if successful - private void join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) + private void join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) { end_x -= 4; end_y -= 4; @@ -770,13 +769,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); } else if (currentParcelBlock.landData.SalePrice > 0 && - (currentParcelBlock.landData.AuthBuyerID == LLUUID.Zero || + (currentParcelBlock.landData.AuthBuyerID == UUID.Zero || currentParcelBlock.landData.AuthBuyerID == remote_client.AgentId)) { //Sale Flag tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_IS_FOR_SALE); } - else if (currentParcelBlock.landData.OwnerID == LLUUID.Zero) + else if (currentParcelBlock.landData.OwnerID == UUID.Zero) { //Public Flag tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_PUBLIC); @@ -914,7 +913,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land { if (m_scene.ExternalChecks.ExternalChecksCanAbandonParcel(remote_client.AgentId, landList[local_id])) { - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; else landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; @@ -930,7 +929,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land { if (m_scene.ExternalChecks.ExternalChecksCanReclaimParcel(remote_client.AgentId, landList[local_id])) { - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; else landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; @@ -979,13 +978,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land } if (lob != null) { - LLUUID AuthorizedID = lob.landData.AuthBuyerID; + UUID AuthorizedID = lob.landData.AuthBuyerID; int saleprice = lob.landData.SalePrice; - LLUUID pOwnerID = lob.landData.OwnerID; + UUID pOwnerID = lob.landData.OwnerID; bool landforsale = ((lob.landData.Flags & (uint)(Parcel.ParcelFlags.ForSale | Parcel.ParcelFlags.ForSaleObjects | Parcel.ParcelFlags.SellParcelObjects)) != 0); - if ((AuthorizedID == LLUUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale) + if ((AuthorizedID == UUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale) { lock (e) { @@ -1027,7 +1026,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land AddLandObject(new_land); } - public void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient) + public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) { ILandObject selectedParcel = null; lock (landList) @@ -1065,7 +1064,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land #region CAPS handler - private void OnRegisterCaps(LLUUID agentID, Caps caps) + private void OnRegisterCaps(UUID agentID, Caps caps) { string capsBase = "/CAPS/" + caps.CapsObjectPath; caps.RegisterHandler("RemoteParcelRequest", @@ -1080,7 +1079,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x - // and y coordinate (each 8 bit), encoded in a LLUUID (128 bit). + // and y coordinate (each 8 bit), encoded in a UUID (128 bit). // // Request format: // @@ -1095,16 +1094,16 @@ namespace OpenSim.Region.Environment.Modules.World.Land // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx // // - private string RemoteParcelRequest(string request, string path, string param, LLUUID agentID, Caps caps) + private string RemoteParcelRequest(string request, string path, string param, UUID agentID, Caps caps) { - LLUUID parcelID = LLUUID.Zero; + UUID parcelID = UUID.Zero; try { Hashtable hash = new Hashtable(); - hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request)); + hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); if (hash.ContainsKey("region_id") && hash.ContainsKey("location")) { - LLUUID regionID = (LLUUID)hash["region_id"]; + UUID regionID = (UUID)hash["region_id"]; ArrayList list = (ArrayList)hash["location"]; uint x = (uint)(double)list[0]; uint y = (uint)(double)list[1]; @@ -1148,9 +1147,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land #endregion - private void handleParcelInfo(IClientAPI remoteClient, LLUUID parcelID) + private void handleParcelInfo(IClientAPI remoteClient, UUID parcelID) { - if (parcelID == LLUUID.Zero) + if (parcelID == UUID.Zero) return; // assume we've got the parcelID we just computed in RemoteParcelRequest diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 6388a1c..640b665 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -67,14 +67,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land set { m_landData = value; } } - public LLUUID regionUUID + public UUID regionUUID { get { return m_scene.RegionInfo.RegionID; } } #region Constructors - public LandObject(LLUUID owner_id, bool is_group_owned, Scene scene) + public LandObject(UUID owner_id, bool is_group_owned, Scene scene) { m_scene = scene; landData.OwnerID = owner_id; @@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - public void updateLandSold(LLUUID avatarID, LLUUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) + public void updateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) { LandData newData = landData.Copy(); newData.OwnerID = avatarID; @@ -226,14 +226,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land newData.ClaimDate = Util.UnixTimeSinceEpoch(); newData.ClaimPrice = claimprice; newData.SalePrice = 0; - newData.AuthBuyerID = LLUUID.Zero; + newData.AuthBuyerID = UUID.Zero; newData.Flags &= ~(uint) (Parcel.ParcelFlags.ForSale | Parcel.ParcelFlags.ForSaleObjects | Parcel.ParcelFlags.SellParcelObjects); m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); sendLandUpdateToAvatarsOverMe(); } - public bool isEitherBannedOrRestricted(LLUUID avatar) + public bool isEitherBannedOrRestricted(UUID avatar) { if (isBannedFromLand(avatar)) { @@ -246,7 +246,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return false; } - public bool isBannedFromLand(LLUUID avatar) + public bool isBannedFromLand(UUID avatar) { if ((landData.Flags & (uint) Parcel.ParcelFlags.UseBanList) > 0) { @@ -263,7 +263,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return false; } - public bool isRestrictedFromLand(LLUUID avatar) + public bool isRestrictedFromLand(UUID avatar) { if ((landData.Flags & (uint) Parcel.ParcelFlags.UseAccessList) > 0) { @@ -322,9 +322,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land #region AccessList Functions - public List createAccessListArrayByFlag(ParcelManager.AccessList flag) + public List createAccessListArrayByFlag(ParcelManager.AccessList flag) { - List list = new List(); + List list = new List(); foreach (ParcelManager.ParcelAccessEntry entry in landData.ParcelAccessList) { if (entry.Flags == flag) @@ -334,25 +334,25 @@ namespace OpenSim.Region.Environment.Modules.World.Land } if (list.Count == 0) { - list.Add(LLUUID.Zero); + list.Add(UUID.Zero); } return list; } - public void sendAccessList(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, + public void sendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client) { if (flags == (uint) ParcelManager.AccessList.Access || flags == (uint) ParcelManager.AccessList.Both) { - List avatars = createAccessListArrayByFlag(ParcelManager.AccessList.Access); + List avatars = createAccessListArrayByFlag(ParcelManager.AccessList.Access); remote_client.SendLandAccessListData(avatars,(uint) ParcelManager.AccessList.Access,landData.LocalID); } if (flags == (uint) ParcelManager.AccessList.Ban || flags == (uint) ParcelManager.AccessList.Both) { - List avatars = createAccessListArrayByFlag(ParcelManager.AccessList.Ban); + List avatars = createAccessListArrayByFlag(ParcelManager.AccessList.Ban); remote_client.SendLandAccessListData(avatars, (uint)ParcelManager.AccessList.Ban, landData.LocalID); } } @@ -361,7 +361,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land { LandData newData = landData.Copy(); - if (entries.Count == 1 && entries[0].AgentID == LLUUID.Zero) + if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) { entries.Clear(); } @@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land if (ty > 255) ty = 255; landData.AABBMin = - new LLVector3((float) (min_x * 4), (float) (min_y * 4), + new Vector3((float) (min_x * 4), (float) (min_y * 4), (float) m_scene.Heightmap[tx, ty]); tx = max_x * 4; @@ -460,7 +460,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land if (ty > 255) ty = 255; landData.AABBMax = - new LLVector3((float) (max_x * 4), (float) (max_y * 4), + new Vector3((float) (max_x * 4), (float) (max_y * 4), (float) m_scene.Heightmap[tx, ty]); landData.Area = tempArea; } @@ -694,7 +694,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land { if (m_scene.ExternalChecks.ExternalChecksCanEditParcel(remote_client.AgentId, this)) { - Dictionary primCount = new Dictionary(); + Dictionary primCount = new Dictionary(); lock (primsOverMe) { @@ -734,9 +734,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - public Dictionary getLandObjectOwners() + public Dictionary getLandObjectOwners() { - Dictionary ownersAndCount = new Dictionary(); + Dictionary ownersAndCount = new Dictionary(); lock (primsOverMe) { try @@ -771,7 +771,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land m_scene.returnObjects(objs, obj.OwnerID); } - public void returnLandObjects(uint type, LLUUID[] owners, IClientAPI remote_client) + public void returnLandObjects(uint type, UUID[] owners, IClientAPI remote_client) { List objlist = new List(); for (int i = 0; i < owners.Length; i++) @@ -814,7 +814,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land public void addPrimToCount(SceneObjectGroup obj) { - LLUUID prim_owner = obj.OwnerID; + UUID prim_owner = obj.OwnerID; int prim_count = obj.PrimCount; if (obj.IsSelected) @@ -843,7 +843,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land { if (primsOverMe.Contains(obj)) { - LLUUID prim_owner = obj.OwnerID; + UUID prim_owner = obj.OwnerID; int prim_count = obj.PrimCount; if (prim_owner == landData.OwnerID) diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index c1f5566..541ca18 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -28,8 +28,8 @@ using System; using System.Collections.Generic; using System.Net; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; @@ -39,12 +39,12 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { private readonly string m_firstname; private readonly string m_lastname; - private readonly LLVector3 m_startPos; - private readonly LLUUID m_uuid = LLUUID.Random(); + private readonly Vector3 m_startPos; + private readonly UUID m_uuid = UUID.Random(); private readonly Scene m_scene; - public NPCAvatar(string firstname, string lastname, LLVector3 position, Scene scene) + public NPCAvatar(string firstname, string lastname, Vector3 position, Scene scene) { m_firstname = firstname; m_lastname = lastname; @@ -77,34 +77,34 @@ namespace OpenSim.Region.Environment.Modules.World.NPC SendOnChatFromViewer(message, ChatTypeEnum.Broadcast); } - public void GiveMoney(LLUUID target, int amount) + public void GiveMoney(UUID target, int amount) { OnMoneyTransferRequest(m_uuid, target, amount, 1, "Payment"); } - public void InstantMessage(LLUUID target, string message) + public void InstantMessage(UUID target, string message) { - OnInstantMessage(this, m_uuid, SessionId, target, LLUUID.Combine(m_uuid, target), + OnInstantMessage(this, m_uuid, SessionId, target, UUID.Combine(m_uuid, target), (uint) Util.UnixTimeSinceEpoch(), Name, message, 0, false, 0, 0, Position, m_scene.RegionInfo.RegionID, new byte[0]); } - public void SendAgentOffline(LLUUID[] agentIDs) + public void SendAgentOffline(UUID[] agentIDs) { } - public void SendAgentOnline(LLUUID[] agentIDs) + public void SendAgentOnline(UUID[] agentIDs) { } - public void SendSitResponse(LLUUID TargetID, LLVector3 OffsetPos, LLQuaternion SitOrientation, bool autopilot, - LLVector3 CameraAtOffset, LLVector3 CameraEyeOffset, bool ForceMouseLook) + public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, + Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook) { } - public void SendAdminResponse(LLUUID Token, uint AdminLevel) + public void SendAdminResponse(UUID Token, uint AdminLevel) { } @@ -114,12 +114,12 @@ namespace OpenSim.Region.Environment.Modules.World.NPC } - public LLUUID GetDefaultAnimation(string name) + public UUID GetDefaultAnimation(string name) { - return LLUUID.Zero; + return UUID.Zero; } - public LLVector3 Position + public Vector3 Position { get { return m_scene.Entities[m_uuid].AbsolutePosition; } set { m_scene.Entities[m_uuid].AbsolutePosition = value; } @@ -222,7 +222,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event UpdateVector OnUpdatePrimGroupScale; public event StatusChange OnChildAgentStatus; public event GenericCall2 OnStopMovement; - public event Action OnRemoveAvatar; + public event Action OnRemoveAvatar; public event CreateNewInventoryItem OnCreateNewInventoryItem; public event CreateInventoryFolder OnCreateNewInventoryFolder; @@ -322,34 +322,34 @@ namespace OpenSim.Region.Environment.Modules.World.NPC #endregion - public void ActivateGesture(LLUUID assetId, LLUUID gestureId) + public void ActivateGesture(UUID assetId, UUID gestureId) { } - public void DeactivateGesture(LLUUID assetId, LLUUID gestureId) + public void DeactivateGesture(UUID assetId, UUID gestureId) { } #region Overrriden Methods IGNORE - public virtual LLVector3 StartPos + public virtual Vector3 StartPos { get { return m_startPos; } set { } } - public virtual LLUUID AgentId + public virtual UUID AgentId { get { return m_uuid; } } - public LLUUID SessionId + public UUID SessionId { - get { return LLUUID.Zero; } + get { return UUID.Zero; } } - public LLUUID SecureSessionId + public UUID SecureSessionId { - get { return LLUUID.Zero; } + get { return UUID.Zero; } } public virtual string FirstName @@ -373,9 +373,9 @@ namespace OpenSim.Region.Environment.Modules.World.NPC set { } } - public LLUUID ActiveGroupId + public UUID ActiveGroupId { - get { return LLUUID.Zero; } + get { return UUID.Zero; } } public string ActiveGroupName @@ -388,10 +388,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC get { return 0; } } - public ulong GetGroupPowers(LLUUID groupID) - { - return 0; - } + public ulong GetGroupPowers(UUID groupID) + { + return 0; + } public virtual int NextAnimationSequenceNumber { @@ -406,7 +406,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) + public virtual void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) { } @@ -422,12 +422,12 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public virtual void SendAgentDataUpdate(LLUUID agentid, LLUUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) + public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) { } - public virtual void SendKillObject(ulong regionHandle, uint localID) + public virtual void SendKiPrimitive(ulong regionHandle, uint localID) { } @@ -440,27 +440,27 @@ namespace OpenSim.Region.Environment.Modules.World.NPC } - public virtual void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) + public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) { } - public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, - LLUUID fromAgentID, byte source, byte audible) + public virtual void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, + UUID fromAgentID, byte source, byte audible) { } - public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, - LLUUID fromAgentID, byte source, byte audible) + public virtual void SendChatMessage(byte[] message, byte type, Vector3 fromPos, string fromName, + UUID fromAgentID, byte source, byte audible) { } - public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, - LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) + public virtual void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent, + UUID imSessionID, string fromName, byte dialog, uint timeStamp) { } - public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, - LLUUID imSessionID, string fromName, byte dialog, uint timeStamp, + public virtual void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent, + UUID imSessionID, string fromName, byte dialog, uint timeStamp, byte[] binaryBucket) { } @@ -476,7 +476,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public virtual void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) + public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) { } @@ -489,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC return new AgentCircuitData(); } - public virtual void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, + public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL) { } @@ -498,7 +498,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public virtual void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) + public virtual void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags) { } @@ -515,66 +515,66 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public virtual void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) + public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { } - public virtual void SendPayPrice(LLUUID objectID, int[] payPrice) + public virtual void SendPayPrice(UUID objectID, int[] payPrice) { } - public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, - uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID, LLQuaternion rotation) + public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, UUID avatarID, + uint avatarLocalID, Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation) { } public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, - LLVector3 position, LLVector3 velocity, LLQuaternion rotation) + Vector3 position, Vector3 velocity, Quaternion rotation) { } - public virtual void SendCoarseLocationUpdate(List CoarseLocations) + public virtual void SendCoarseLocationUpdate(List CoarseLocations) { } - public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) + public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint) { } - public virtual void SendDialog(string objectname, LLUUID objectID, LLUUID ownerID, string msg, LLUUID textureID, int ch, string[] buttonlabels) + public virtual void SendDialog(string objectname, UUID objectID, UUID ownerID, string msg, UUID textureID, int ch, string[] buttonlabels) { } public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, - PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel, - LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags, - LLUUID objectID, LLUUID ownerID, string text, byte[] color, + PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel, + Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, + UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, byte clickAction) { } public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, - PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel, - LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags, - LLUUID objectID, LLUUID ownerID, string text, byte[] color, + PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel, + Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, + UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, byte clickAction, byte[] textureanimation, - bool attachment, uint AttachmentPoint, LLUUID AssetId, LLUUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) + bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) { } public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, - LLVector3 position, LLQuaternion rotation, LLVector3 velocity, - LLVector3 rotationalvelocity, byte state, LLUUID AssetId) + Vector3 position, Quaternion rotation, Vector3 velocity, + Vector3 rotationalvelocity, byte state, UUID AssetId) { } public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, - LLVector3 position, LLQuaternion rotation, LLVector3 velocity, - LLVector3 rotationalvelocity) + Vector3 position, Quaternion rotation, Vector3 velocity, + Vector3 rotationalvelocity) { } - public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, + public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items, List folders, bool fetchFolders, @@ -582,7 +582,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public virtual void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) + public virtual void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item) { } @@ -590,7 +590,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public virtual void SendRemoveInventoryItem(LLUUID itemID) + public virtual void SendRemoveInventoryItem(UUID itemID) { } @@ -603,7 +603,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) + public virtual void SendTaskInventory(UUID taskID, short serial, byte[] fileName) { } @@ -618,24 +618,24 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname) + public virtual void SendNameReply(UUID profileId, string firstname, string lastname) { } - public virtual void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID) + public virtual void SendPreLoadSound(UUID objectID, UUID ownerID, UUID soundID) { } - public virtual void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, + public virtual void SendPlayAttachedSound(UUID soundID, UUID objectID, UUID ownerID, float gain, byte flags) { } - public void SendTriggeredSound(LLUUID soundID, LLUUID ownerID, LLUUID objectID, LLUUID parentID, ulong handle, LLVector3 position, float gain) + public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain) { } - public void SendAttachedSoundGainChange(LLUUID objectID, float gain) + public void SendAttachedSoundGainChange(UUID objectID, float gain) { } @@ -652,7 +652,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, + public void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, string url) { } @@ -669,7 +669,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC OnCompleteMovementToRegion(); } } - public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID) + public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) { } @@ -677,11 +677,11 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName) + public void SendXferRequest(ulong XferID, short AssetType, UUID vFileID, byte FilePath, byte[] FileName) { } - public void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) + public void SendImagePart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) { } @@ -693,16 +693,16 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID, + public void SendObjectPropertiesFamilyData(uint RequestFlags, UUID ObjectUUID, UUID OwnerID, UUID GroupID, uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, uint NextOwnerMask, int OwnershipCost, byte SaleType, int SalePrice, uint Category, - LLUUID LastOwnerID, string ObjectName, string Description) + UUID LastOwnerID, string ObjectName, string Description) { } - public void SendObjectPropertiesReply(LLUUID ItemID, ulong CreationDate, LLUUID CreatorUUID, LLUUID FolderUUID, LLUUID FromTaskUUID, - LLUUID GroupUUID, short InventorySerial, LLUUID LastOwnerUUID, LLUUID ObjectUUID, - LLUUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName, + public void SendObjectPropertiesReply(UUID ItemID, ulong CreationDate, UUID CreatorUUID, UUID FolderUUID, UUID FromTaskUUID, + UUID GroupUUID, short InventorySerial, UUID LastOwnerUUID, UUID ObjectUUID, + UUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName, string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, uint BaseMask, byte saleType, int salePrice) { @@ -713,7 +713,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC return false; } - public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel, ulong time, uint dlen, uint ylen, float phase) + public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) { } @@ -721,9 +721,9 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, Byte[] charterMember, - string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, - LLUUID partnerID) + public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, + string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, + UUID partnerID) { } @@ -762,7 +762,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC get { return m_circuitCode; } set { m_circuitCode = value; } } - public void SendBlueBoxMessage(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) + public void SendBlueBoxMessage(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message) { } @@ -783,52 +783,52 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public void SendScriptQuestion(LLUUID objectID, string taskName, string ownerName, LLUUID itemID, int question) + public void SendScriptQuestion(UUID objectID, string taskName, string ownerName, UUID itemID, int question) { } public void SendHealth(float health) { } - public void SendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID) + public void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID) { } - public void SendBannedUserList(LLUUID invoice, EstateBan[] banlist, uint estateID) + public void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID) { } public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) { } - public void SendEstateCovenantInformation(LLUUID covenant) + public void SendEstateCovenantInformation(UUID covenant) { } - public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant, string abuseEmail) + public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail) { } public void SendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) { } - public void SendLandAccessListData(List avatars, uint accessFlag, int localLandID) + public void SendLandAccessListData(List avatars, uint accessFlag, int localLandID) { } public void SendForceClientSelectObjects(List objectIDs) { } - public void SendLandObjectOwners(Dictionary ownersAndCount) + public void SendLandObjectOwners(Dictionary ownersAndCount) { } public void SendLandParcelOverlay(byte[] data, int sequence_id) { } - public void SendGroupNameReply(LLUUID groupLLUID, string GroupName) + public void SendGroupNameReply(UUID groupLLUID, string GroupName) { } - public void SendScriptRunningReply(LLUUID objectID, LLUUID itemID, bool running) + public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running) { } @@ -842,25 +842,25 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, + public void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID, byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop) { } - public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary parameters) + public void SendSetFollowCamProperties (UUID objectID, SortedDictionary parameters) { } - public void SendClearFollowCamProperties (LLUUID objectID) + public void SendClearFollowCamProperties (UUID objectID) { } - public void SendRegionHandle (LLUUID regoinID, ulong handle) + public void SendRegionHandle (UUID regoinID, ulong handle) { } - public void SendParcelInfo (RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) + public void SendParcelInfo (RegionInfo info, LandData land, UUID parcelID, uint x, uint y) { } diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs index 86472f6..7227cf0 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -40,8 +40,8 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { // if (m_enabled) // { - // NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new LLVector3(128, 128, 40), scene); - // NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new LLVector3(136, 128, 40), scene); + // NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new Vector3(128, 128, 40), scene); + // NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new Vector3(136, 128, 40), scene); // scene.AddNewClient(testAvatar, false); // scene.AddNewClient(testAvatar2, false); // } diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index b9615ec..d92f33a 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using Nini.Config; using System; using System.Collections; @@ -228,7 +228,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions #endregion #region Helper Functions - protected void SendPermissionError(LLUUID user, string reason) + protected void SendPermissionError(UUID user, string reason) { m_scene.EventManager.TriggerPermissionError(user, reason); } @@ -238,14 +238,14 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions m_log.Info("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); } - protected bool IsAdministrator(LLUUID user) + protected bool IsAdministrator(UUID user) { - if (m_scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero) + if (m_scene.RegionInfo.MasterAvatarAssignedUUID != UUID.Zero) { if (m_RegionOwnerIsGod && (m_scene.RegionInfo.MasterAvatarAssignedUUID == user)) return true; } - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) { if (m_scene.RegionInfo.EstateSettings.EstateOwner == user) return true; @@ -263,7 +263,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return false; } - protected bool IsEstateManager(LLUUID user) + protected bool IsEstateManager(UUID user) { return m_scene.RegionInfo.EstateSettings.IsEstateManager(user); } @@ -286,7 +286,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions #region Object Permissions - public uint GenerateClientFlags(LLUUID user, LLUUID objID) + public uint GenerateClientFlags(UUID user, UUID objID) { // Here's the way this works, // ObjectFlags and Permission flags are two different enumerations @@ -306,27 +306,27 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return (uint)0; uint objflags = task.GetEffectiveObjectFlags(); - LLUUID objectOwner = task.OwnerID; + UUID objectOwner = task.OwnerID; // Remove any of the objectFlags that are temporary. These will get added back if appropriate // in the next bit of code objflags &= (uint) - ~(LLObject.ObjectFlags.ObjectCopy | // Tells client you can copy the object - LLObject.ObjectFlags.ObjectModify | // tells client you can modify the object - LLObject.ObjectFlags.ObjectMove | // tells client that you can move the object (only, no mod) - LLObject.ObjectFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it - LLObject.ObjectFlags.ObjectYouOwner | // Tells client that you're the owner of the object - LLObject.ObjectFlags.ObjectAnyOwner | // Tells client that someone owns the object - LLObject.ObjectFlags.ObjectOwnerModify | // Tells client that you're the owner of the object - LLObject.ObjectFlags.ObjectYouOfficer // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set + ~(PrimFlags.ObjectCopy | // Tells client you can copy the object + PrimFlags.ObjectModify | // tells client you can modify the object + PrimFlags.ObjectMove | // tells client that you can move the object (only, no mod) + PrimFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it + PrimFlags.ObjectYouOwner | // Tells client that you're the owner of the object + PrimFlags.ObjectAnyOwner | // Tells client that someone owns the object + PrimFlags.ObjectOwnerModify | // Tells client that you're the owner of the object + PrimFlags.ObjectYouOfficer // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set ); // Creating the three ObjectFlags options for this method to choose from. // Customize the OwnerMask uint objectOwnerMask = ApplyObjectModifyMasks(task.OwnerMask, objflags); - objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectYouOwner | (uint)LLObject.ObjectFlags.ObjectAnyOwner | (uint)LLObject.ObjectFlags.ObjectOwnerModify; + objectOwnerMask |= (uint)PrimFlags.ObjectYouOwner | (uint)PrimFlags.ObjectAnyOwner | (uint)PrimFlags.ObjectOwnerModify; // Customize the GroupMask // uint objectGroupMask = ApplyObjectModifyMasks(task.GroupMask, objflags); @@ -336,8 +336,8 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions // Hack to allow collaboration until Groups and Group Permissions are implemented - if ((objectEveryoneMask & (uint)LLObject.ObjectFlags.ObjectMove) != 0) - objectEveryoneMask |= (uint)LLObject.ObjectFlags.ObjectModify; + if ((objectEveryoneMask & (uint)PrimFlags.ObjectMove) != 0) + objectEveryoneMask |= (uint)PrimFlags.ObjectModify; if (m_bypassPermissions) return objectOwnerMask; @@ -378,28 +378,28 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions if ((setPermissionMask & (uint)PermissionMask.Copy) != 0) { - objectFlagsMask |= (uint)LLObject.ObjectFlags.ObjectCopy; + objectFlagsMask |= (uint)PrimFlags.ObjectCopy; } if ((setPermissionMask & (uint)PermissionMask.Move) != 0) { - objectFlagsMask |= (uint)LLObject.ObjectFlags.ObjectMove; + objectFlagsMask |= (uint)PrimFlags.ObjectMove; } if ((setPermissionMask & (uint)PermissionMask.Modify) != 0) { - objectFlagsMask |= (uint)LLObject.ObjectFlags.ObjectModify; + objectFlagsMask |= (uint)PrimFlags.ObjectModify; } if ((setPermissionMask & (uint)PermissionMask.Transfer) != 0) { - objectFlagsMask |= (uint)LLObject.ObjectFlags.ObjectTransfer; + objectFlagsMask |= (uint)PrimFlags.ObjectTransfer; } return objectFlagsMask; } - protected bool GenericObjectPermission(LLUUID currentUser, LLUUID objId, bool denyOnLocked) + protected bool GenericObjectPermission(UUID currentUser, UUID objId, bool denyOnLocked) { // Default: deny bool permission = false; @@ -419,7 +419,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions SceneObjectGroup group = (SceneObjectGroup)m_scene.Entities[objId]; - LLUUID objectOwner = group.OwnerID; + UUID objectOwner = group.OwnerID; locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); // People shouldn't be able to do anything with locked objects, except the Administrator @@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions #endregion #region Generic Permissions - protected bool GenericCommunicationPermission(LLUUID user, LLUUID target) + protected bool GenericCommunicationPermission(UUID user, UUID target) { // Setting this to true so that cool stuff can happen until we define what determines Generic Communication Permission bool permission = true; @@ -491,7 +491,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return permission; } - public bool GenericEstatePermission(LLUUID user) + public bool GenericEstatePermission(UUID user) { // Default: deny bool permission = false; @@ -507,7 +507,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return permission; } - protected bool GenericParcelPermission(LLUUID user, ILandObject parcel) + protected bool GenericParcelPermission(UUID user, ILandObject parcel) { bool permission = false; @@ -534,7 +534,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return permission; } - protected bool GenericParcelPermission(LLUUID user, LLVector3 pos) + protected bool GenericParcelPermission(UUID user, Vector3 pos) { ILandObject parcel = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); if (parcel == null) return false; @@ -543,7 +543,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions #endregion #region Permission Checks - private bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene) + private bool CanAbandonParcel(UUID user, ILandObject parcel, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -551,7 +551,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericParcelPermission(user, parcel); } - private bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene) + private bool CanReclaimParcel(UUID user, ILandObject parcel, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -559,7 +559,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericParcelPermission(user, parcel); } - private bool CanBeGodLike(LLUUID user, Scene scene) + private bool CanBeGodLike(UUID user, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -567,7 +567,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return IsAdministrator(user); } - private bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition) + private bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -581,7 +581,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return CanRezObject(objectCount, owner, objectPosition, scene); } - private bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene) + private bool CanDeleteObject(UUID objectID, UUID deleter, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -589,7 +589,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericObjectPermission(deleter, objectID, false); } - private bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene) + private bool CanEditObject(UUID objectID, UUID editorID, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -598,7 +598,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericObjectPermission(editorID, objectID, false); } - private bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene) + private bool CanEditParcel(UUID user, ILandObject parcel, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -606,7 +606,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericParcelPermission(user, parcel); } - private bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene) + private bool CanEditScript(UUID script, UUID objectID, UUID user, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -614,7 +614,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return false; } - private bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene) + private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -622,7 +622,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return true; } - private bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene) + private bool CanInstantMessage(UUID user, UUID target, Scene startScene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -631,7 +631,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericCommunicationPermission(user, target); } - private bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene) + private bool CanInventoryTransfer(UUID user, UUID target, Scene startScene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -639,7 +639,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericCommunicationPermission(user, target); } - private bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand) + private bool CanIssueEstateCommand(UUID user, Scene requestFromScene, bool ownerCommand) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -656,7 +656,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericEstatePermission(user); } - private bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene) + private bool CanMoveObject(UUID objectID, UUID moverID, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) @@ -696,10 +696,10 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; - // LLUUID taskOwner = null; + // UUID taskOwner = null; // Added this because at this point in time it wouldn't be wise for // the administrator object permissions to take effect. - // LLUUID objectOwner = task.OwnerID; + // UUID objectOwner = task.OwnerID; // Anyone can move if ((task.RootPart.EveryoneMask & PERM_MOVE) != 0) @@ -727,7 +727,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions SceneObjectGroup group = (SceneObjectGroup)m_scene.Entities[objectID]; - LLUUID objectOwner = group.OwnerID; + UUID objectOwner = group.OwnerID; locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); @@ -747,7 +747,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return permission; } - private bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene) + private bool CanObjectEntry(UUID objectID, Vector3 newPoint, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -764,7 +764,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return false; } - if ((land.landData.Flags & ((int)Parcel.ParcelFlags.AllowAllObjectEntry)) != 0) + if ((land.landData.Flags & ((int)Parcel.ParcelFlags.AllowAPrimitiveEntry)) != 0) { return true; } @@ -793,7 +793,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return false; } - private bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene) + private bool CanReturnObject(UUID objectID, UUID returnerID, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -801,7 +801,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericObjectPermission(returnerID, objectID, false); } - private bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene) + private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -830,7 +830,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return permission; } - private bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene) + private bool CanRunConsoleCommand(UUID user, Scene requestFromScene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -839,7 +839,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return IsAdministrator(user); } - private bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene) + private bool CanRunScript(UUID script, UUID objectID, UUID user, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -847,7 +847,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return true; } - private bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene) + private bool CanSellParcel(UUID user, ILandObject parcel, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -855,7 +855,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericParcelPermission(user, parcel); } - private bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene) + private bool CanTakeObject(UUID objectID, UUID stealer, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -863,7 +863,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericObjectPermission(stealer,objectID, false); } - private bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene) + private bool CanTakeCopyObject(UUID objectID, UUID userID, Scene inScene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -883,10 +883,10 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions } SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; - // LLUUID taskOwner = null; + // UUID taskOwner = null; // Added this because at this point in time it wouldn't be wise for // the administrator object permissions to take effect. - // LLUUID objectOwner = task.OwnerID; + // UUID objectOwner = task.OwnerID; if ((task.RootPart.EveryoneMask & PERM_COPY) != 0) @@ -895,7 +895,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return permission; } - private bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene) + private bool CanTerraformLand(UUID user, Vector3 position, Scene requestFromScene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -927,7 +927,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return permission; } - private bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene) + private bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -935,7 +935,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return false; } - private bool CanViewNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene) + private bool CanViewNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -945,7 +945,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions #endregion - public bool CanLinkObject(LLUUID userID, LLUUID objectID) + public bool CanLinkObject(UUID userID, UUID objectID) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -953,7 +953,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return true; } - public bool CanDelinkObject(LLUUID userID, LLUUID objectID) + public bool CanDelinkObject(UUID userID, UUID objectID) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -961,7 +961,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return true; } - public bool CanBuyLand(LLUUID userID, ILandObject parcel, Scene scene) + public bool CanBuyLand(UUID userID, ILandObject parcel, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -969,7 +969,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return true; } - public bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public bool CanCopyInventory(UUID itemID, UUID objectID, UUID userID) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -977,7 +977,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return true; } - public bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public bool CanDeleteInventory(UUID itemID, UUID objectID, UUID userID) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -985,7 +985,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return true; } - public bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) + public bool CanCreateInventory(uint invType, UUID objectID, UUID userID) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -993,7 +993,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return true; } - public bool CanTeleport(LLUUID userID) + public bool CanTeleport(UUID userID) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs index e76d40d..bbc4acf 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using System.Collections.Generic; using System.IO; using OpenSim.Region.Environment.Scenes; @@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser /// /// /// - void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset); + void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset); /// /// Save prims in the xml format @@ -76,14 +76,14 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser /// /// Save prims in the xml2 format, optionally specifying a bounding box for which - /// prims should be saved. If both min and max vectors are LLVector3.Zero, then all prims + /// prims should be saved. If both min and max vectors are Vector3.Zero, then all prims /// are exported. /// /// /// /// /// - void SavePrimsToXml2(Scene scene, TextWriter stream, LLVector3 min, LLVector3 max); + void SavePrimsToXml2(Scene scene, TextWriter stream, Vector3 min, Vector3 max); /// /// Save a set of prims in the xml2 format @@ -94,14 +94,14 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser /// /// Save a set of prims in the xml2 format, optionally specifying a bounding box for which - /// prims should be saved. If both min and max vectors are LLVector3.Zero, then all prims + /// prims should be saved. If both min and max vectors are Vector3.Zero, then all prims /// are exported. /// /// /// /// /// - void SavePrimListToXml2(List entityList, TextWriter stream, LLVector3 min, LLVector3 max); + void SavePrimListToXml2(List entityList, TextWriter stream, Vector3 min, Vector3 max); /// /// Deserializes a scene object from its xml2 representation. This does not load the object into the scene. diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs index 22c9b29..d1cc082 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs @@ -30,8 +30,7 @@ using System.Collections.Generic; using System.IO; //using System.Reflection; using System.Xml; -using Axiom.Math; -using libsecondlife; +using OpenMetaverse; //using log4net; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; @@ -45,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) + public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset) { XmlDocument doc = new XmlDocument(); XmlNode rootNode; @@ -208,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes SavePrimListToXml2(EntityList, fileName); } - public static void SavePrimsToXml2(Scene scene, TextWriter stream, LLVector3 min, LLVector3 max) + public static void SavePrimsToXml2(Scene scene, TextWriter stream, Vector3 min, Vector3 max) { List EntityList = scene.GetEntities(); @@ -223,7 +222,7 @@ namespace OpenSim.Region.Environment.Scenes StreamWriter stream = new StreamWriter(file); try { - SavePrimListToXml2(entityList, stream, LLVector3.Zero, LLVector3.Zero); + SavePrimListToXml2(entityList, stream, Vector3.Zero, Vector3.Zero); } finally { @@ -236,7 +235,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public static void SavePrimListToXml2(List entityList, TextWriter stream, LLVector3 min, LLVector3 max) + public static void SavePrimListToXml2(List entityList, TextWriter stream, Vector3 min, Vector3 max) { int primCount = 0; stream.WriteLine("\n"); @@ -246,9 +245,9 @@ namespace OpenSim.Region.Environment.Scenes if (ent is SceneObjectGroup) { SceneObjectGroup g = (SceneObjectGroup)ent; - if (!min.Equals(LLVector3.Zero) || !max.Equals(LLVector3.Zero)) + if (!min.Equals(Vector3.Zero) || !max.Equals(Vector3.Zero)) { - LLVector3 pos = g.RootPart.GetWorldPosition(); + Vector3 pos = g.RootPart.GetWorldPosition(); if (min.X > pos.X || min.Y > pos.Y || min.Z > pos.Z) continue; if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiseObjects.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiseObjects.cs index 0d69553..ffd90bf 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiseObjects.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiseObjects.cs @@ -40,11 +40,11 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser public string WriteToFile(Scene scene, string dir) { - string targetFileName = dir + "objects.xml"; + string targetFileName = dir + "objects.Xml"; SaveSerialisedToFile(targetFileName, scene); - return "objects.xml"; + return "objects.Xml"; } #endregion @@ -122,4 +122,4 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser #endregion } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs index d722d68..e3eb377 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.IO; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Modules.Framework.InterfaceCommander; @@ -87,7 +87,7 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser #region IRegionSerialiser Members - public void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) + public void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset) { SceneXmlLoader.LoadPrimsFromXml(scene, fileName, newIDS, loadOffset); } @@ -112,7 +112,7 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser SceneXmlLoader.SavePrimsToXml2(scene, fileName); } - public void SavePrimsToXml2(Scene scene, TextWriter stream, LLVector3 min, LLVector3 max) + public void SavePrimsToXml2(Scene scene, TextWriter stream, Vector3 min, Vector3 max) { SceneXmlLoader.SavePrimsToXml2(scene, stream, min, max); } @@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser SceneXmlLoader.SavePrimListToXml2(entityList, fileName); } - public void SavePrimListToXml2(List entityList, TextWriter stream, LLVector3 min, LLVector3 max) + public void SavePrimListToXml2(List entityList, TextWriter stream, Vector3 min, Vector3 max) { SceneXmlLoader.SavePrimListToXml2(entityList, stream, min, max); } diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 9690433..826fe93 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -91,14 +91,14 @@ namespace OpenSim.Region.Environment.Modules // private double VWTimeRatio; // VW time as a ratio of real time // Working values - private LLVector3 Position = new LLVector3(0,0,0); - private LLVector3 Velocity = new LLVector3(0,0,0); - private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); + private Vector3 Position = Vector3.Zero; + private Vector3 Velocity = Vector3.Zero; + private Quaternion Tilt = Quaternion.Identity; private long LindenHourOffset = 0; private bool sunFixed = false; - private Dictionary m_rootAgents = new Dictionary(); + private Dictionary m_rootAgents = new Dictionary(); // Current time in elpased seconds since Jan 1st 1970 private ulong CurrentTime @@ -348,14 +348,14 @@ namespace OpenSim.Region.Environment.Modules // For interest we rotate it slightly about the X access. // Celestial tilt is a value that ranges .025 - Position = LLVector3.Rot(Position,Tilt); + Position *= Tilt; // Finally we shift the axis so that more of the // circle is above the horizon than below. This // makes the nights shorter than the days. Position.Z = Position.Z + (float) HorizonShift; - Position = LLVector3.Norm(Position); + Position = Vector3.Normalize(Position); // m_log.Debug("[SUN] Position("+Position.X+","+Position.Y+","+Position.Z+")"); @@ -365,7 +365,7 @@ namespace OpenSim.Region.Environment.Modules // Correct angular velocity to reflect the seasonal rotation - Magnitude = LLVector3.Mag(Position); + Magnitude = Position.Length(); if (sunFixed) { Velocity.X = 0; @@ -374,13 +374,12 @@ namespace OpenSim.Region.Environment.Modules return; } - Velocity = LLVector3.Rot(Velocity, Tilt)*((float)(1.0/Magnitude)); + Velocity = (Velocity * Tilt) * (1.0f / Magnitude); // m_log.Debug("[SUN] Velocity("+Velocity.X+","+Velocity.Y+","+Velocity.Z+")"); - } - private void ClientLoggedOut(LLUUID AgentId) + private void ClientLoggedOut(UUID AgentId) { lock (m_rootAgents) { @@ -392,7 +391,7 @@ namespace OpenSim.Region.Environment.Modules } } - private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, LLUUID regionID) + private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) { lock (m_rootAgents) { diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index 4a62446..ed4075c 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs @@ -29,7 +29,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -591,7 +591,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain float south, float east, IClientAPI remoteClient) { // Not a good permissions check, if in area mode, need to check the entire area. - if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(north, west, 0))) + if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new Vector3(north, west, 0))) { if (north == south && east == west) { @@ -648,7 +648,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. // for now check a point in the centre of the region - if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) + if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new Vector3(127, 127, 0))) { InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter } diff --git a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs index 98b3bf8..bbd7b70 100644 --- a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs @@ -29,8 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using System.Timers; -using Axiom.Math; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -49,7 +48,7 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator public double m_tree_density = 50.0; // Aim for this many per region public double m_tree_updates = 1000.0; // MS between updates - private List m_trees; + private List m_trees; #region IRegionModule Members @@ -63,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator { } - m_trees = new List(); + m_trees = new List(); m_scene = scene; m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; @@ -98,24 +97,24 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator { if (args[0] == "tree") { - LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; - if (uuid == LLUUID.Zero) + UUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; + if (uuid == UUID.Zero) uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID; m_log.Debug("[TREES]: New tree planting"); - CreateTree(uuid, new LLVector3(128.0f, 128.0f, 0.0f)); + CreateTree(uuid, new Vector3(128.0f, 128.0f, 0.0f)); } } private void growTrees() { - foreach (LLUUID tree in m_trees) + foreach (UUID tree in m_trees) { if (m_scene.Entities.ContainsKey(tree)) { SceneObjectPart s_tree = ((SceneObjectGroup) m_scene.Entities[tree]).RootPart; // 100 seconds to grow 1m - s_tree.Scale += new LLVector3(0.1f, 0.1f, 0.1f); + s_tree.Scale += new Vector3(0.1f, 0.1f, 0.1f); s_tree.SendFullUpdateToAllClients(); //s_tree.ScheduleTerseUpdate(); } @@ -128,7 +127,7 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator private void seedTrees() { - foreach (LLUUID tree in m_trees) + foreach (UUID tree in m_trees) { if (m_scene.Entities.ContainsKey(tree)) { @@ -151,7 +150,7 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator private void killTrees() { - foreach (LLUUID tree in m_trees) + foreach (UUID tree in m_trees) { double killLikelyhood = 0.0; @@ -162,7 +161,7 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator Math.Pow(selectedTree.Scale.Y, 2) + Math.Pow(selectedTree.Scale.Z, 2)); - foreach (LLUUID picktree in m_trees) + foreach (UUID picktree in m_trees) { if (picktree != tree) { @@ -187,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator m_scene.ForEachClient(delegate(IClientAPI controller) { - controller.SendKillObject(m_scene.RegionInfo.RegionHandle, + controller.SendKiPrimitive(m_scene.RegionInfo.RegionHandle, selectedTree.LocalId); }); @@ -204,7 +203,7 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator private void SpawnChild(SceneObjectPart s_tree) { - LLVector3 position = new LLVector3(); + Vector3 position = new Vector3(); position.X = s_tree.AbsolutePosition.X + (1 * (-1 * Util.RandomClass.Next(1))); if (position.X > 255) @@ -223,20 +222,20 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator position.X += (float) randX; position.Y += (float) randY; - LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; - if (uuid == LLUUID.Zero) + UUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; + if (uuid == UUID.Zero) uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID; CreateTree(uuid, position); } - private void CreateTree(LLUUID uuid, LLVector3 position) + private void CreateTree(UUID uuid, Vector3 position) { position.Z = (float) m_scene.Heightmap[(int) position.X, (int) position.Y]; SceneObjectGroup tree = - m_scene.AddTree(uuid, new LLVector3(0.1f, 0.1f, 0.1f), - LLQuaternion.Identity, + m_scene.AddTree(uuid, new Vector3(0.1f, 0.1f, 0.1f), + Quaternion.Identity, position, Tree.Cypress1, false); diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs index bfb5016..cfbe5ae 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs @@ -32,13 +32,12 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Reflection; -using Axiom.Math; using Nini.Config; +using OpenMetaverse.Imaging; using log4net; -using OpenJPEGNet; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Modules.World.WorldMap { @@ -252,7 +251,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap if (part.Shape.Textures.DefaultTexture == null) continue; - LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA; + Color4 texcolor = part.Shape.Textures.DefaultTexture.RGBA; // Not sure why some of these are null, oh well. @@ -265,7 +264,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //Try to set the map spot color try { - // If the color gets goofy somehow, skip it *shakes fist at LLColor + // If the color gets goofy somehow, skip it *shakes fist at Color4 mapdotspot = Color.FromArgb(colorr, colorg, colorb); } catch (ArgumentException) @@ -282,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // Mono Array } - LLVector3 pos = part.GetWorldPosition(); + Vector3 pos = part.GetWorldPosition(); // skip prim outside of retion if (pos.X < 0f || pos.X > 256f || pos.Y < 0f || pos.Y > 256f) @@ -312,20 +311,20 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap Vector3 tScale = new Vector3(); Vector3 axPos = new Vector3(pos.X,pos.Y,pos.Z); - LLQuaternion llrot = part.GetWorldRotation(); + Quaternion llrot = part.GetWorldRotation(); Quaternion rot = new Quaternion(llrot.W, llrot.X, llrot.Y, llrot.Z); - scale = rot * lscale; + scale = lscale * rot; // negative scales don't work in this situation - scale.x = Math.Abs(scale.x); - scale.y = Math.Abs(scale.y); - scale.z = Math.Abs(scale.z); + scale.X = Math.Abs(scale.X); + scale.Y = Math.Abs(scale.Y); + scale.Z = Math.Abs(scale.Z); // This scaling isn't very accurate and doesn't take into account the face rotation :P - int mapdrawstartX = (int)(pos.X - scale.x); - int mapdrawstartY = (int)(pos.Y - scale.y); - int mapdrawendX = (int)(pos.X + scale.x); - int mapdrawendY = (int)(pos.Y + scale.y); + int mapdrawstartX = (int)(pos.X - scale.X); + int mapdrawstartY = (int)(pos.Y - scale.Y); + int mapdrawendX = (int)(pos.X + scale.X); + int mapdrawendY = (int)(pos.Y + scale.Y); // If object is beyond the edge of the map, don't draw it to avoid errors if (mapdrawstartX < 0 || mapdrawstartX > 255 || mapdrawendX < 0 || mapdrawendX > 255 @@ -342,9 +341,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap Vector3[] FaceC = new Vector3[6]; // vertex C for Facei Vector3[] FaceD = new Vector3[6]; // vertex D for Facei - tScale = new Vector3(lscale.x, -lscale.y, lscale.z); - scale = ((rot * tScale)); - vertexes[0] = (new Vector3((pos.X + scale.x), (pos.Y + scale.y), (pos.Z + scale.z))); + tScale = new Vector3(lscale.X, -lscale.Y, lscale.Z); + scale = ((tScale * rot)); + vertexes[0] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); // vertexes[0].x = pos.X + vertexes[0].x; //vertexes[0].y = pos.Y + vertexes[0].y; //vertexes[0].z = pos.Z + vertexes[0].z; @@ -354,8 +353,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap FaceA[4] = vertexes[0]; tScale = lscale; - scale = ((rot * tScale)); - vertexes[1] = (new Vector3((pos.X + scale.x), (pos.Y + scale.y), (pos.Z + scale.z))); + scale = ((tScale * rot)); + vertexes[1] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); // vertexes[1].x = pos.X + vertexes[1].x; // vertexes[1].y = pos.Y + vertexes[1].y; @@ -365,10 +364,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap FaceA[1] = vertexes[1]; FaceC[4] = vertexes[1]; - tScale = new Vector3(lscale.x, -lscale.y, -lscale.z); - scale = ((rot * tScale)); + tScale = new Vector3(lscale.X, -lscale.Y, -lscale.Z); + scale = ((tScale * rot)); - vertexes[2] = (new Vector3((pos.X + scale.x), (pos.Y + scale.y), (pos.Z + scale.z))); + vertexes[2] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); //vertexes[2].x = pos.X + vertexes[2].x; //vertexes[2].y = pos.Y + vertexes[2].y; @@ -378,9 +377,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap FaceD[3] = vertexes[2]; FaceC[5] = vertexes[2]; - tScale = new Vector3(lscale.x, lscale.y, -lscale.z); - scale = ((rot * tScale)); - vertexes[3] = (new Vector3((pos.X + scale.x), (pos.Y + scale.y), (pos.Z + scale.z))); + tScale = new Vector3(lscale.X, lscale.Y, -lscale.Z); + scale = ((tScale * rot)); + vertexes[3] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); //vertexes[3].x = pos.X + vertexes[3].x; // vertexes[3].y = pos.Y + vertexes[3].y; @@ -390,9 +389,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap FaceC[1] = vertexes[3]; FaceA[5] = vertexes[3]; - tScale = new Vector3(-lscale.x, lscale.y, lscale.z); - scale = ((rot * tScale)); - vertexes[4] = (new Vector3((pos.X + scale.x), (pos.Y + scale.y), (pos.Z + scale.z))); + tScale = new Vector3(-lscale.X, lscale.Y, lscale.Z); + scale = ((tScale * rot)); + vertexes[4] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); // vertexes[4].x = pos.X + vertexes[4].x; // vertexes[4].y = pos.Y + vertexes[4].y; @@ -402,9 +401,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap FaceA[2] = vertexes[4]; FaceD[4] = vertexes[4]; - tScale = new Vector3(-lscale.x, lscale.y, -lscale.z); - scale = ((rot * tScale)); - vertexes[5] = (new Vector3((pos.X + scale.x), (pos.Y + scale.y), (pos.Z + scale.z))); + tScale = new Vector3(-lscale.X, lscale.Y, -lscale.Z); + scale = ((tScale * rot)); + vertexes[5] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); // vertexes[5].x = pos.X + vertexes[5].x; // vertexes[5].y = pos.Y + vertexes[5].y; @@ -414,9 +413,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap FaceC[2] = vertexes[5]; FaceB[5] = vertexes[5]; - tScale = new Vector3(-lscale.x, -lscale.y, lscale.z); - scale = ((rot * tScale)); - vertexes[6] = (new Vector3((pos.X + scale.x), (pos.Y + scale.y), (pos.Z + scale.z))); + tScale = new Vector3(-lscale.X, -lscale.Y, lscale.Z); + scale = ((tScale * rot)); + vertexes[6] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); // vertexes[6].x = pos.X + vertexes[6].x; // vertexes[6].y = pos.Y + vertexes[6].y; @@ -426,9 +425,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap FaceA[3] = vertexes[6]; FaceB[4] = vertexes[6]; - tScale = new Vector3(-lscale.x, -lscale.y, -lscale.z); - scale = ((rot * tScale)); - vertexes[7] = (new Vector3((pos.X + scale.x), (pos.Y + scale.y), (pos.Z + scale.z))); + tScale = new Vector3(-lscale.X, -lscale.Y, -lscale.Z); + scale = ((tScale * rot)); + vertexes[7] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); // vertexes[7].x = pos.X + vertexes[7].x; // vertexes[7].y = pos.Y + vertexes[7].y; @@ -533,8 +532,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //Vector3 topos = new Vector3(0, 0, 0); // float z = -point3d.z - topos.z; - returnpt.X = (int)point3d.x;//(int)((topos.x - point3d.x) / z * d); - returnpt.Y = (int)(255 - point3d.y);//(int)(255 - (((topos.y - point3d.y) / z * d))); + returnpt.X = (int)point3d.X;//(int)((topos.x - point3d.x) / z * d); + returnpt.Y = (int)(255 - point3d.Y);//(int)(255 - (((topos.y - point3d.y) / z * d))); return returnpt; } diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs index 1ee86ba..dffa72a 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs @@ -32,13 +32,12 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Reflection; -using Axiom.Math; +using OpenMetaverse; +using OpenMetaverse.Imaging; using Nini.Config; using log4net; -using OpenJPEGNet; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; -using libsecondlife; namespace OpenSim.Region.Environment.Modules.World.WorldMap { diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs index 615befc..ff8d0b9 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs @@ -32,15 +32,14 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Reflection; -using Axiom.Math; +using OpenMetaverse; using Nini.Config; using log4net; -using OpenJPEGNet; +using OpenMetaverse.Imaging; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Modules.World.Terrain; -using libsecondlife; namespace OpenSim.Region.Environment.Modules.World.WorldMap { @@ -122,15 +121,15 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // some hardcoded terrain UUIDs that work with SL 1.20 (the four default textures and "Blank"). // The color-values were choosen because they "look right" (at least to me) ;-) - private static readonly LLUUID defaultTerrainTexture1 = new LLUUID("0bc58228-74a0-7e83-89bc-5c23464bcec5"); + private static readonly UUID defaultTerrainTexture1 = new UUID("0bc58228-74a0-7e83-89bc-5c23464bcec5"); private static readonly Color defaultColor1 = Color.FromArgb(165, 137, 118); - private static readonly LLUUID defaultTerrainTexture2 = new LLUUID("63338ede-0037-c4fd-855b-015d77112fc8"); + private static readonly UUID defaultTerrainTexture2 = new UUID("63338ede-0037-c4fd-855b-015d77112fc8"); private static readonly Color defaultColor2 = Color.FromArgb(69, 89, 49); - private static readonly LLUUID defaultTerrainTexture3 = new LLUUID("303cd381-8560-7579-23f1-f0a880799740"); + private static readonly UUID defaultTerrainTexture3 = new UUID("303cd381-8560-7579-23f1-f0a880799740"); private static readonly Color defaultColor3 = Color.FromArgb(162, 154, 141); - private static readonly LLUUID defaultTerrainTexture4 = new LLUUID("53a2f406-4895-1d13-d541-d2e3b86bc19c"); + private static readonly UUID defaultTerrainTexture4 = new UUID("53a2f406-4895-1d13-d541-d2e3b86bc19c"); private static readonly Color defaultColor4 = Color.FromArgb(200, 200, 200); - private static readonly LLUUID blankTerrainTexture = new LLUUID("5748decc-f629-461c-9a36-a35a221fe21f"); + private static readonly UUID blankTerrainTexture = new UUID("5748decc-f629-461c-9a36-a35a221fe21f"); #endregion @@ -142,14 +141,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // added when the terrain textures are changed in the estate dialog and a new map is generated (and will stay in // that map until the region-server restarts. This could be considered a memory-leak, but it's a *very* small one. // TODO does it make sense to use a "real" cache and regenerate missing entries on fetch? - private Dictionary m_mapping; + private Dictionary m_mapping; public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; // m_config = source; // not used currently - m_mapping = new Dictionary(); + m_mapping = new Dictionary(); m_mapping.Add(defaultTerrainTexture1, defaultColor1); m_mapping.Add(defaultTerrainTexture2, defaultColor2); m_mapping.Add(defaultTerrainTexture3, defaultColor3); @@ -164,12 +163,18 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // TODO (- on "map" command: We are in the command-line thread, we will wait for completion anyway) // TODO (- on "automatic" update after some change: We are called from the mapUpdateTimer here and // will wait anyway) - private Bitmap fetchTexture(LLUUID id) + private Bitmap fetchTexture(UUID id) { AssetBase asset = m_scene.AssetCache.GetAsset(id, true); m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null); if (asset == null) return null; - return new Bitmap(OpenJPEG.DecodeToImage(asset.Data)); + + ManagedImage managedImage; + Image image; + if (OpenJPEG.DecodeToImage(asset.Data, out managedImage, out image)) + return new Bitmap(image); + else + return null; } // Compute the average color of a texture. @@ -196,8 +201,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // return either the average color of the texture, or the defaultColor if the texturID is invalid // or the texture couldn't be found - private Color computeAverageColor(LLUUID textureID, Color defaultColor) { - if (textureID == LLUUID.Zero) return defaultColor; // not set + private Color computeAverageColor(UUID textureID, Color defaultColor) { + if (textureID == UUID.Zero) return defaultColor; // not set if (m_mapping.ContainsKey(textureID)) return m_mapping[textureID]; // one of the predefined textures Bitmap bmp = fetchTexture(textureID); diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 2430822..ec9b79c 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs @@ -32,8 +32,8 @@ using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Reflection; -using libsecondlife; -using OpenJPEGNet; +using OpenMetaverse; +using OpenMetaverse.Imaging; using log4net; using Nini.Config; using OpenSim.Framework; @@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap #endregion - public void OnRegisterCaps(LLUUID agentID, Caps caps) + public void OnRegisterCaps(UUID agentID, Caps caps) { m_log.DebugFormat("[VOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); string capsBase = "/CAPS/" + caps.CapsObjectPath; @@ -127,7 +127,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap /// /// public string MapLayerRequest(string request, string path, string param, - LLUUID agentID, Caps caps) + UUID agentID, Caps caps) { //try //{ @@ -197,7 +197,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap LLSDMapLayer mapLayer = new LLSDMapLayer(); mapLayer.Right = 5000; mapLayer.Top = 5000; - mapLayer.ImageID = new LLUUID("00000000-0000-1111-9999-000000000006"); + mapLayer.ImageID = new UUID("00000000-0000-1111-9999-000000000006"); return mapLayer; } @@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //doFriendListUpdateOnline(client.AgentId); client.OnRequestMapBlocks += RequestMapBlocks; } - private void ClientLoggedOut(LLUUID AgentId) + private void ClientLoggedOut(UUID AgentId) { } @@ -248,15 +248,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap m_log.Info("[WEBMAP]: Sending map image jpeg"); Hashtable reply = new Hashtable(); int statuscode = 200; - - byte[] jpeg; - + byte[] jpeg = new byte[0]; if (myMapImageJPEG.Length == 0) { MemoryStream imgstream = new MemoryStream(); Bitmap mapTexture = new Bitmap(1,1); - System.Drawing.Image image = (System.Drawing.Image)mapTexture; + ManagedImage managedImage; + Image image = (Image)mapTexture; try { @@ -268,21 +267,24 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); // Decode image to System.Drawing.Image - image = OpenJPEG.DecodeToImage(mapasset.Data); + if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image)) + { + // Save to bitmap + mapTexture = new Bitmap(image); - // Save to bitmap - mapTexture = new Bitmap(image); + ImageCodecInfo myImageCodecInfo; - ImageCodecInfo myImageCodecInfo; + Encoder myEncoder; - Encoder myEncoder; + EncoderParameter myEncoderParameter; + EncoderParameters myEncoderParameters = new EncoderParameters(); - EncoderParameter myEncoderParameter; - EncoderParameters myEncoderParameters = new EncoderParameters(); + myImageCodecInfo = GetEncoderInfo("image/jpeg"); - myImageCodecInfo = GetEncoderInfo("image/jpeg"); + myEncoder = Encoder.Quality; - myEncoder = Encoder.Quality; + myEncoderParameter = new EncoderParameter(myEncoder, 95L); + myEncoderParameters.Param[0] = myEncoderParameter; myEncoderParameter = new EncoderParameter(myEncoder, 95L); myEncoderParameters.Param[0] = myEncoderParameter; @@ -290,14 +292,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // Save bitmap to stream mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); - // Write the stream to a byte array for output - jpeg = imgstream.ToArray(); - myMapImageJPEG = jpeg; + // Write the stream to a byte array for output + jpeg = imgstream.ToArray(); + myMapImageJPEG = jpeg; + } } catch (Exception) { // Dummy! - jpeg = new byte[0]; m_log.Warn("[WEBMAP]: Unable to generate Map image"); } finally @@ -314,7 +316,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // Use cached version so we don't have to loose our mind jpeg = myMapImageJPEG; } - //jpeg = new byte[0]; reply["str_response_string"] = Convert.ToBase64String(jpeg); reply["int_response_code"] = statuscode; -- cgit v1.1