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. --- OpenSim/Region/Application/OpenSim.cs | 4 +- OpenSim/Region/Application/OpenSimBase.cs | 28 +- OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs | 2 +- .../Region/ClientStack/LindenUDP/LLClientView.cs | 768 ++++++++++----------- .../ClientStack/LindenUDP/LLPacketHandler.cs | 10 +- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 10 +- .../Region/ClientStack/LindenUDP/LLPacketServer.cs | 8 +- OpenSim/Region/ClientStack/LindenUDP/LLQueItem.cs | 2 +- .../Region/ClientStack/LindenUDP/LLUDPServer.cs | 4 +- .../Region/ClientStack/RegionApplicationBase.cs | 6 +- .../Communications/Local/LocalBackEndServices.cs | 26 +- .../Communications/Local/LocalInventoryService.cs | 8 +- .../Communications/Local/LocalLoginService.cs | 12 +- .../Communications/Local/LocalUserServices.cs | 4 +- .../Region/Communications/OGS1/OGS1GridServices.cs | 74 +- .../Communications/OGS1/OGS1InterSimComms.cs | 34 +- .../Communications/OGS1/OGS1InventoryService.cs | 18 +- .../OGS1/OGS1SecureInventoryService.cs | 32 +- .../Region/Communications/OGS1/OGS1UserServices.cs | 82 +-- OpenSim/Region/DataSnapshot/DataRequestHandler.cs | 4 +- OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 6 +- OpenSim/Region/DataSnapshot/EstateSnapshot.cs | 6 +- OpenSim/Region/DataSnapshot/LandSnapshot.cs | 20 +- OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | 32 +- OpenSim/Region/DataSnapshot/SnapshotStore.cs | 4 +- .../Interfaces/IAgentAssetTransactions.cs | 8 +- .../Environment/Interfaces/IAvatarFactory.cs | 6 +- .../Interfaces/IDynamicTextureManager.cs | 16 +- .../Region/Environment/Interfaces/IEmailModule.cs | 6 +- .../Environment/Interfaces/IEstateDataStore.cs | 4 +- .../Region/Environment/Interfaces/IEstateModule.cs | 4 +- .../Region/Environment/Interfaces/IHttpRequests.cs | 10 +- .../Environment/Interfaces/IInventoryModule.cs | 6 +- .../Region/Environment/Interfaces/ILandChannel.cs | 6 +- .../Region/Environment/Interfaces/ILandObject.cs | 18 +- .../Environment/Interfaces/IRegionDataStore.cs | 20 +- .../Region/Environment/Interfaces/IScriptModule.cs | 4 +- .../Region/Environment/Interfaces/IWorldComm.cs | 16 +- OpenSim/Region/Environment/Interfaces/IXMLRPC.cs | 16 +- .../Agent/AssetDownload/AssetDownloadModule.cs | 30 +- .../AssetTransaction/AgentAssetsTransactions.cs | 34 +- .../AssetTransaction/AssetTransactionModule.cs | 24 +- .../Agent/TextureDownload/TextureDownloadModule.cs | 10 +- .../Agent/TextureDownload/TextureNotFoundSender.cs | 10 +- .../TextureDownload/UserTextureDownloadService.cs | 14 +- .../Modules/Agent/TextureSender/TextureSender.cs | 6 +- .../Environment/Modules/Agent/Xfer/XferModule.cs | 4 +- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 26 +- .../Environment/Modules/Avatar/Chat/ChatModule.cs | 26 +- .../Modules/Avatar/Chat/IRCBridgeModule.cs | 10 +- .../Currency/SampleMoney/SampleMoneyModule.cs | 138 ++-- .../Modules/Avatar/Friends/FriendsModule.cs | 106 +-- .../Modules/Avatar/Groups/GroupsModule.cs | 36 +- .../Avatar/InstantMessage/InstantMessageModule.cs | 104 +-- .../Modules/Avatar/Inventory/InventoryModule.cs | 24 +- .../Avatar/Profiles/AvatarProfilesModule.cs | 6 +- .../Voice/AsterixVoice/AsteriskVoiceModule.cs | 10 +- .../Avatar/Voice/SIPVoice/SIPVoiceModule.cs | 10 +- .../ContentManagementSystem/AuraMetaEntity.cs | 20 +- .../ContentManagementSystem/BeamMetaEntity.cs | 22 +- .../ContentManagementSystem/CMController.cs | 36 +- .../ContentManagementSystem/CMEntityCollection.cs | 20 +- .../Modules/ContentManagementSystem/CMModel.cs | 20 +- .../Modules/ContentManagementSystem/CMView.cs | 12 +- .../ContentManagementEntity.cs | 26 +- .../ContentManagementModule.cs | 6 +- .../ContentManagementSystem/FileSystemDatabase.cs | 30 +- .../Modules/ContentManagementSystem/GitDatabase.cs | 38 +- .../ContentManagementSystem/IContentDatabase.cs | 23 +- .../Modules/ContentManagementSystem/MetaEntity.cs | 22 +- .../ContentManagementSystem/PointMetaEntity.cs | 36 +- .../SceneObjectGroupDiff.cs | 28 +- .../Modules/InterGrid/OpenGridProtocolModule.cs | 86 +-- .../DynamicTexture/DynamicTextureModule.cs | 68 +- .../Modules/Scripting/EMailModules/EmailModule.cs | 14 +- .../Scripting/HttpRequest/ScriptsHttpRequests.cs | 24 +- .../Scripting/LoadImageURL/LoadImageURLModule.cs | 16 +- .../Scripting/VectorRender/VectorRenderModule.cs | 13 +- .../Modules/Scripting/WorldComm/WorldCommModule.cs | 68 +- .../Modules/Scripting/XMLRPC/XMLRPCModule.cs | 100 +-- .../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 +- OpenSim/Region/Environment/Scenes/Animation.cs | 8 +- OpenSim/Region/Environment/Scenes/AnimationSet.cs | 18 +- .../Region/Environment/Scenes/AvatarAnimations.cs | 12 +- OpenSim/Region/Environment/Scenes/EntityBase.cs | 61 +- OpenSim/Region/Environment/Scenes/EntityList.cs | 21 +- OpenSim/Region/Environment/Scenes/EventManager.cs | 88 +-- .../Environment/Scenes/IScenePresenceBody.cs | 4 +- OpenSim/Region/Environment/Scenes/InnerScene.cs | 117 ++-- .../Region/Environment/Scenes/Scene.Inventory.cs | 202 +++--- .../Environment/Scenes/Scene.PacketHandlers.cs | 38 +- OpenSim/Region/Environment/Scenes/Scene.cs | 303 ++++---- OpenSim/Region/Environment/Scenes/SceneBase.cs | 10 +- .../Scenes/SceneCommunicationService.cs | 70 +- .../Environment/Scenes/SceneExternalChecks.cs | 160 ++--- OpenSim/Region/Environment/Scenes/SceneManager.cs | 12 +- .../Scenes/SceneObjectGroup.Inventory.cs | 10 +- .../Region/Environment/Scenes/SceneObjectGroup.cs | 319 ++++----- .../Scenes/SceneObjectPart.Inventory.cs | 48 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 698 +++++++++---------- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 398 ++++++----- .../Environment/Scenes/Scripting/IScriptHost.cs | 11 +- .../Environment/Scenes/Scripting/NullScriptHost.cs | 19 +- .../Region/Environment/Scenes/SimStatsReporter.cs | 2 +- OpenSim/Region/Environment/Scenes/UndoState.cs | 10 +- OpenSim/Region/Environment/Types/UpdateQueue.cs | 12 +- .../Region/Examples/SimpleModule/ComplexObject.cs | 54 +- .../Examples/SimpleModule/CpuCounterObject.cs | 6 +- .../Examples/SimpleModule/FileSystemObject.cs | 6 +- .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 198 +++--- .../Region/Examples/SimpleModule/RegionModule.cs | 20 +- OpenSim/Region/Interfaces/IMoneyModule.cs | 8 +- .../Modules/AvatarFactory/AvatarFactoryModule.cs | 14 +- .../Modules/SvnSerialiser/SvnBackupModule.cs | 4 +- .../BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 2 +- .../Region/Physics/BulletXPlugin/BulletXPlugin.cs | 58 +- OpenSim/Region/Physics/Manager/PhysicsActor.cs | 2 +- .../Region/Physics/Manager/PhysicsPluginManager.cs | 88 ++- OpenSim/Region/Physics/Manager/PhysicsScene.cs | 2 +- OpenSim/Region/Physics/Manager/PhysicsVector.cs | 2 +- OpenSim/Region/Physics/Meshing/Extruder.cs | 13 +- OpenSim/Region/Physics/Meshing/HelperTypes.cs | 110 +-- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 3 +- OpenSim/Region/Physics/Meshing/PrimMesher.cs | 11 +- OpenSim/Region/Physics/Meshing/SculptMesh.cs | 7 +- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 3 +- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 96 +-- OpenSim/Region/Physics/OdePlugin/ODETestClass.cs | 4 +- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 51 +- OpenSim/Region/Physics/POSPlugin/POSCharacter.cs | 2 +- OpenSim/Region/Physics/POSPlugin/POSPlugin.cs | 1 - OpenSim/Region/Physics/POSPlugin/POSPrim.cs | 2 +- OpenSim/Region/Physics/POSPlugin/POSScene.cs | 17 +- OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | 12 +- .../Region/ScriptEngine/Common/BuilIn_Commands.cs | 4 +- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 586 ++++++++-------- OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 2 +- .../ScriptEngine/Common/OSSL_BuilIn_Commands.cs | 29 +- .../Common/ScriptEngineBase/AsyncCommandManager.cs | 4 +- .../AsyncCommandPlugins/Dataserver.cs | 14 +- .../AsyncCommandPlugins/SensorRepeat.cs | 42 +- .../ScriptEngineBase/AsyncCommandPlugins/Timer.cs | 8 +- .../Common/ScriptEngineBase/EventManager.cs | 64 +- .../Common/ScriptEngineBase/EventQueueManager.cs | 10 +- .../ScriptEngineBase/EventQueueThreadClass.cs | 4 +- .../Common/ScriptEngineBase/ScriptManager.cs | 48 +- .../ScriptEngine/Common/ScriptServerInterfaces.cs | 58 +- OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs | 4 +- .../DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 2 +- .../ScriptEngine/DotNetEngine/ScriptManager.cs | 12 +- .../Region/ScriptEngine/Interfaces/IScriptApi.cs | 4 +- .../ScriptEngine/Interfaces/IScriptEngine.cs | 18 +- .../ScriptEngine/Interfaces/IScriptInstance.cs | 12 +- .../ScriptEngine/RemoteServer/EventManager.cs | 70 +- .../Api/Implementation/AsyncCommandManager.cs | 8 +- .../Shared/Api/Implementation/LSL_Api.cs | 559 ++++++++------- .../Shared/Api/Implementation/OSSL_Api.cs | 31 +- .../Api/Implementation/Plugins/Dataserver.cs | 14 +- .../Shared/Api/Implementation/Plugins/Listener.cs | 6 +- .../Api/Implementation/Plugins/SensorRepeat.cs | 50 +- .../Shared/Api/Implementation/Plugins/Timer.cs | 12 +- .../Shared/CodeTools/LSL2CSConverter.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/Helpers.cs | 28 +- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 30 +- .../Shared/Instance/ScriptSerializer.cs | 20 +- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 2 +- .../Region/ScriptEngine/XEngine/EventManager.cs | 35 +- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 86 +-- 193 files changed, 4375 insertions(+), 4555 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 6829bef..edb29db 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -32,7 +32,7 @@ using System.IO; using System.Net; using System.Reflection; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -776,7 +776,7 @@ namespace OpenSim { m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); - LLVector3 loadOffset = new LLVector3(0, 0, 0); + Vector3 loadOffset = new Vector3(0, 0, 0); if (cmdparams.Length > 0) { bool generateNewIDS = false; diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 4003001..86db865 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -32,7 +32,7 @@ using System.Net; using System.Reflection; using System.Text; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -64,7 +64,7 @@ namespace OpenSim /// /// The file used to load and save prim backup xml if no filename has been specified /// - protected const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.xml"; + protected const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.Xml"; /// /// The file used to load and save an opensim archive if no filename has been specified @@ -178,17 +178,17 @@ namespace OpenSim } else { - if (File.Exists("OpenSim.xml")) + if (File.Exists("OpenSim.Xml")) { //check for a xml config file - Application.iniFilePath = "OpenSim.xml"; + Application.iniFilePath = "OpenSim.Xml"; m_config.Source = new XmlConfigSource(); m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); m_config.Source.Merge(configSource); } else { - //Application.iniFilePath = "OpenSim.xml"; + //Application.iniFilePath = "OpenSim.Xml"; // m_config.ConfigSource = new XmlConfigSource(); // no default config files, so set default values, and save it m_config.Source.Merge(DefaultConfig()); @@ -437,7 +437,7 @@ namespace OpenSim m_sceneManager.OnRestartSim += handleRestartRegion; } - public LLUUID CreateUser(string tempfirstname, string templastname, string tempPasswd, uint regX, uint regY) + public UUID CreateUser(string tempfirstname, string templastname, string tempPasswd, uint regX, uint regY) { return m_commsManager.AddUser(tempfirstname, templastname, tempPasswd, regX, regY); } @@ -532,18 +532,18 @@ namespace OpenSim // and has to happen before the region is registered with the grid. scene.CreateTerrainTexture(false); - try - { + //try + //{ scene.RegisterRegionWithGrid(); - } - catch (Exception e) - { - m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e); + //} + //catch (Exception e) + //{ + // m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e); // Carrying on now causes a lot of confusion down the // line - we need to get the user's attention - System.Environment.Exit(1); - } + // System.Environment.Exit(1); + //} // We need to do this after we've initialized the // scripting engines. diff --git a/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs b/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs index d7d9128..8197ec7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Text; -using libsecondlife.Packets; +using OpenMetaverse.Packets; namespace OpenSim.Region.ClientStack.LindenUDP { diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 2a0190b..5e22e2d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -33,9 +33,8 @@ using System.Reflection; using System.Text; using System.Threading; using System.Timers; -using Axiom.Math; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -62,12 +61,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP // } /* static variables */ - public static TerrainManager TerrainManager = new TerrainManager(new SecondLife()); - public static SynchronizeClientHandler SynchronizeClient = null; /* private variables */ - private readonly LLUUID m_sessionId; - private LLUUID m_secureSessionId = LLUUID.Zero; + private readonly UUID m_sessionId; + private UUID m_secureSessionId = UUID.Zero; //private AgentAssetUpload UploadAssets; private int m_debug = 0; private readonly AssetCache m_assetCache; @@ -81,16 +78,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP //private int m_lastPacketsReceived = 0; //private byte[] ZeroOutBuffer = new byte[4096]; - private readonly LLUUID m_agentId; + private readonly UUID m_agentId; private readonly uint m_circuitCode; private int m_moneyBalance; private IPacketHandler m_PacketHandler; private int m_animationSequenceNumber = 1; - private byte[] m_channelVersion = Helpers.StringToField("OpenSimulator 0.5"); // Dummy value needed by libSL + private byte[] m_channelVersion = Utils.StringToBytes("OpenSimulator 0.5"); // Dummy value needed by libSL - private Dictionary m_defaultAnimations = new Dictionary(); + private Dictionary m_defaultAnimations = new Dictionary(); private bool m_SendLogoutPacketWhenClosing = true; @@ -112,13 +109,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected string m_firstName; protected string m_lastName; protected Thread m_clientThread; - protected LLVector3 m_startpos; + protected Vector3 m_startpos; protected EndPoint m_userEndPoint; protected EndPoint m_proxyEndPoint; - protected LLUUID m_activeGroupID = LLUUID.Zero; + protected UUID m_activeGroupID = UUID.Zero; protected string m_activeGroupName = String.Empty; protected ulong m_activeGroupPowers = 0; - protected Dictionary m_groupPowers = new Dictionary(); + protected Dictionary m_groupPowers = new Dictionary(); /* Instantiated Designated Event Delegates */ //- used so we don't create new objects for each incoming packet and then toss it out later */ @@ -264,7 +261,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /* Properties */ - public LLUUID SecureSessionId + public UUID SecureSessionId { get { return m_secureSessionId; } } @@ -274,23 +271,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP get { return m_scene; } } - public LLUUID SessionId + public UUID SessionId { get { return m_sessionId; } } - public LLVector3 StartPos + public Vector3 StartPos { get { return m_startpos; } set { m_startpos = value; } } - public LLUUID AgentId + public UUID AgentId { get { return m_agentId; } } - public LLUUID ActiveGroupId + public UUID ActiveGroupId { get { return m_activeGroupID; } } @@ -305,7 +302,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP get { return m_activeGroupPowers; } } - public ulong GetGroupPowers(LLUUID groupID) + public ulong GetGroupPowers(UUID groupID) { if (m_groupPowers.ContainsKey(groupID)) return m_groupPowers[groupID]; @@ -380,11 +377,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP /* METHODS */ public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, - AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP) + AgentCircuitManager authenSessions, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) { m_moneyBalance = 1000; - m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion()); + m_channelVersion = Utils.StringToBytes(scene.GetSimulatorVersion()); InitDefaultAnimations(); @@ -509,7 +506,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP kupack.UserInfo.SessionID = SessionId; kupack.TargetBlock.TargetIP = (uint)0; kupack.TargetBlock.TargetPort = (ushort)0; - kupack.UserInfo.Reason = Helpers.StringToField(message); + kupack.UserInfo.Reason = Utils.StringToBytes(message); OutPacket(kupack, ThrottleOutPacketType.Task); // You must sleep here or users get no message! Thread.Sleep(500); @@ -760,7 +757,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_firstName = sessionInfo.LoginInfo.First; m_lastName = sessionInfo.LoginInfo.Last; - if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero) + if (sessionInfo.LoginInfo.SecureSession != UUID.Zero) { m_secureSessionId = sessionInfo.LoginInfo.SecureSession; } @@ -868,7 +865,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event UpdateVector OnUpdatePrimGroupScale; public event StatusChange OnChildAgentStatus; public event GenericCall2 OnStopMovement; - public event Action OnRemoveAvatar; + public event Action OnRemoveAvatar; public event RequestMapBlocks OnRequestMapBlocks; public event RequestMapName OnMapNameRequest; public event TeleportLocationRequest OnTeleportLocationRequest; @@ -964,10 +961,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP // voire si c'est necessaire - 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 Scene/Avatar to Client @@ -994,7 +991,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handshake.RegionInfo.WaterHeight = args.waterHeight; handshake.RegionInfo.RegionFlags = args.regionFlags; - handshake.RegionInfo.SimName = Helpers.StringToField(args.regionName); + handshake.RegionInfo.SimName = Utils.StringToBytes(args.regionName); handshake.RegionInfo.SimOwner = args.SimOwner; handshake.RegionInfo.TerrainBase0 = args.terrainBase0; handshake.RegionInfo.TerrainBase1 = args.terrainBase1; @@ -1004,7 +1001,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handshake.RegionInfo.TerrainDetail1 = args.terrainDetail1; handshake.RegionInfo.TerrainDetail2 = args.terrainDetail2; handshake.RegionInfo.TerrainDetail3 = args.terrainDetail3; - handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting? + handshake.RegionInfo.CacheID = UUID.Random(); //I guess this is for the client to remember an old setting? OutPacket(handshake, ThrottleOutPacketType.Task); } @@ -1013,7 +1010,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) + public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) { AgentMovementCompletePacket mov = (AgentMovementCompletePacket)PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete); mov.SimData.ChannelVersion = m_channelVersion; @@ -1044,14 +1041,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, - LLUUID fromAgentID, byte source, byte audible) + public void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, + UUID fromAgentID, byte source, byte audible) { - SendChatMessage(Helpers.StringToField(message), type, fromPos, fromName, fromAgentID, source, audible); + SendChatMessage(Utils.StringToBytes(message), type, fromPos, fromName, fromAgentID, source, audible); } - public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, - LLUUID fromAgentID, byte source, byte audible) + public void SendChatMessage(byte[] message, byte type, Vector3 fromPos, string fromName, + UUID fromAgentID, byte source, byte audible) { ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator); reply.ChatData.Audible = audible; @@ -1059,7 +1056,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP reply.ChatData.ChatType = type; reply.ChatData.SourceType = source; reply.ChatData.Position = fromPos; - reply.ChatData.FromName = Helpers.StringToField(fromName); + reply.ChatData.FromName = Utils.StringToBytes(fromName); reply.ChatData.OwnerID = fromAgentID; reply.ChatData.SourceID = fromAgentID; @@ -1071,8 +1068,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, - LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) + public void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent, + UUID imSessionID, string fromName, byte dialog, uint timeStamp) { SendInstantMessage( fromAgent, fromAgentSession, message, toAgent, @@ -1084,8 +1081,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, - LLUUID imSessionID, string fromName, byte dialog, uint timeStamp, + public void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent, + UUID imSessionID, string fromName, byte dialog, uint timeStamp, byte[] binaryBucket) { if (((Scene)(this.m_scene)).ExternalChecks.ExternalChecksCanInstantMessage(fromAgent, toAgent)) @@ -1095,17 +1092,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP msg.AgentData.AgentID = fromAgent; msg.AgentData.SessionID = fromAgentSession; - msg.MessageBlock.FromAgentName = Helpers.StringToField(fromName); + msg.MessageBlock.FromAgentName = Utils.StringToBytes(fromName); msg.MessageBlock.Dialog = dialog; msg.MessageBlock.FromGroup = false; msg.MessageBlock.ID = imSessionID; msg.MessageBlock.Offline = 0; msg.MessageBlock.ParentEstateID = 0; - msg.MessageBlock.Position = new LLVector3(); - msg.MessageBlock.RegionID = LLUUID.Random(); + msg.MessageBlock.Position = new Vector3(); + msg.MessageBlock.RegionID = UUID.Random(); msg.MessageBlock.Timestamp = timeStamp; msg.MessageBlock.ToAgentID = toAgent; - msg.MessageBlock.Message = Helpers.StringToField(message); + msg.MessageBlock.Message = Utils.StringToBytes(message); msg.MessageBlock.BinaryBucket = binaryBucket; OutPacket(msg, ThrottleOutPacketType.Task); @@ -1188,7 +1185,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP patches[0] = patchx + 0 + patchy * 16; - LayerDataPacket layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); + LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(map, patches); layerpack.Header.Zerocoded = true; OutPacket(layerpack, ThrottleOutPacketType.Land); @@ -1242,10 +1239,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP return agentData; } - public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint externalIPEndPoint, + public void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, IPEndPoint externalIPEndPoint, string capsURL) { - LLVector3 look = new LLVector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10); + Vector3 look = new Vector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10); //CrossedRegionPacket newSimPack = (CrossedRegionPacket)PacketPool.Instance.GetPacket(PacketType.CrossedRegion); CrossedRegionPacket newSimPack = new CrossedRegionPacket(); @@ -1264,7 +1261,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8; newSimPack.RegionData.SimIP += (uint)byteIP[0]; newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port; - newSimPack.RegionData.SeedCapability = Helpers.StringToField(capsURL); + newSimPack.RegionData.SeedCapability = Utils.StringToBytes(capsURL); // Hack to get this out immediately and skip throttles OutPacket(newSimPack, ThrottleOutPacketType.Unknown); @@ -1289,7 +1286,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP mapReply.Data[i].X = mapBlocks2[i].X; mapReply.Data[i].Y = mapBlocks2[i].Y; mapReply.Data[i].WaterHeight = mapBlocks2[i].WaterHeight; - mapReply.Data[i].Name = Helpers.StringToField(mapBlocks2[i].Name); + mapReply.Data[i].Name = Utils.StringToBytes(mapBlocks2[i].Name); mapReply.Data[i].RegionFlags = mapBlocks2[i].RegionFlags; mapReply.Data[i].Access = mapBlocks2[i].Access; mapReply.Data[i].Agents = mapBlocks2[i].Agents; @@ -1319,7 +1316,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } - public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) + public void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags) { TeleportLocalPacket tpLocal = (TeleportLocalPacket)PacketPool.Instance.GetPacket(PacketType.TeleportLocal); tpLocal.Info.AgentID = AgentId; @@ -1342,7 +1339,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP teleport.Info.RegionHandle = regionHandle; teleport.Info.SimAccess = simAccess; - teleport.Info.SeedCapability = Helpers.StringToField(capsURL); + teleport.Info.SeedCapability = Utils.StringToBytes(capsURL); IPAddress oIP = newRegionEndPoint.Address; byte[] byteIP = oIP.GetAddressBytes(); @@ -1367,7 +1364,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { TeleportFailedPacket tpFailed = (TeleportFailedPacket)PacketPool.Instance.GetPacket(PacketType.TeleportFailed); tpFailed.Info.AgentID = AgentId; - tpFailed.Info.Reason = Helpers.StringToField(reason); + tpFailed.Info.Reason = Utils.StringToBytes(reason); // Hack to get this out immediately and skip throttles OutPacket(tpFailed, ThrottleOutPacketType.Unknown); @@ -1386,7 +1383,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(tpStart, ThrottleOutPacketType.Unknown); } - public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); money.MoneyData.AgentID = AgentId; @@ -1397,7 +1394,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(money, ThrottleOutPacketType.Task); } - public void SendPayPrice(LLUUID objectID, int[] payPrice) + public void SendPayPrice(UUID objectID, int[] payPrice) { if (payPrice[0] == 0 && payPrice[1] == 0 && @@ -1431,7 +1428,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(pc, ThrottleOutPacketType.Unknown); } - public void SendKillObject(ulong regionHandle, uint localID) + public void SendKiPrimitive(ulong regionHandle, uint localID) { KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); // TODO: don't create new blocks if recycling an old packet @@ -1453,7 +1450,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// The items contained in the folder identified by folderID /// Do we need to send folder information? /// Do we need to send item information? - public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items, + public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items, List folders, bool fetchFolders, bool fetchItems) { @@ -1501,17 +1498,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP descend.ItemData[i].AssetID = item.AssetID; descend.ItemData[i].CreatorID = item.Creator; descend.ItemData[i].BaseMask = item.BasePermissions; - descend.ItemData[i].Description = Helpers.StringToField(item.Description); + descend.ItemData[i].Description = Utils.StringToBytes(item.Description); descend.ItemData[i].EveryoneMask = item.EveryOnePermissions; descend.ItemData[i].OwnerMask = item.CurrentPermissions; descend.ItemData[i].FolderID = item.Folder; descend.ItemData[i].InvType = (sbyte)item.InvType; - descend.ItemData[i].Name = Helpers.StringToField(item.Name); + descend.ItemData[i].Name = Utils.StringToBytes(item.Name); descend.ItemData[i].NextOwnerMask = item.NextPermissions; descend.ItemData[i].OwnerID = item.Owner; descend.ItemData[i].Type = (sbyte)item.AssetType; - //descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); + //descend.ItemData[i].GroupID = new UUID("00000000-0000-0000-0000-000000000000"); descend.ItemData[i].GroupID = item.GroupID; descend.ItemData[i].GroupOwned = item.GroupOwned; descend.ItemData[i].GroupMask = 0; @@ -1585,7 +1582,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock(); descend.FolderData[i].FolderID = folder.ID; - descend.FolderData[i].Name = Helpers.StringToField(folder.Name); + descend.FolderData[i].Name = Utils.StringToBytes(folder.Name); descend.FolderData[i].ParentID = folder.ParentID; descend.FolderData[i].Type = (sbyte)folder.Type; @@ -1621,7 +1618,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } - private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID) + private InventoryDescendentsPacket CreateInventoryDescendentsPacket(UUID ownerID, UUID folderID) { InventoryDescendentsPacket descend = (InventoryDescendentsPacket)PacketPool.Instance.GetPacket(PacketType.InventoryDescendents); descend.Header.Zerocoded = true; @@ -1633,7 +1630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return descend; } - public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) + public void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item) { uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply); @@ -1647,17 +1644,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP inventoryReply.InventoryData[0].BaseMask = item.BasePermissions; inventoryReply.InventoryData[0].CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; - inventoryReply.InventoryData[0].Description = Helpers.StringToField(item.Description); + inventoryReply.InventoryData[0].Description = Utils.StringToBytes(item.Description); inventoryReply.InventoryData[0].EveryoneMask = item.EveryOnePermissions; inventoryReply.InventoryData[0].FolderID = item.Folder; inventoryReply.InventoryData[0].InvType = (sbyte)item.InvType; - inventoryReply.InventoryData[0].Name = Helpers.StringToField(item.Name); + inventoryReply.InventoryData[0].Name = Utils.StringToBytes(item.Name); inventoryReply.InventoryData[0].NextOwnerMask = item.NextPermissions; inventoryReply.InventoryData[0].OwnerID = item.Owner; inventoryReply.InventoryData[0].OwnerMask = item.CurrentPermissions; inventoryReply.InventoryData[0].Type = (sbyte)item.AssetType; - //inventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); + //inventoryReply.InventoryData[0].GroupID = new UUID("00000000-0000-0000-0000-000000000000"); inventoryReply.InventoryData[0].GroupID = item.GroupID; inventoryReply.InventoryData[0].GroupOwned = item.GroupOwned; inventoryReply.InventoryData[0].GroupMask = 0; @@ -1686,12 +1683,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory); bulkUpdate.AgentData.AgentID = AgentId; - bulkUpdate.AgentData.TransactionID = LLUUID.Random(); + bulkUpdate.AgentData.TransactionID = UUID.Random(); bulkUpdate.FolderData = new BulkUpdateInventoryPacket.FolderDataBlock[1]; bulkUpdate.FolderData[0] = new BulkUpdateInventoryPacket.FolderDataBlock(); - bulkUpdate.FolderData[0].FolderID = LLUUID.Zero; - bulkUpdate.FolderData[0].ParentID = LLUUID.Zero; + bulkUpdate.FolderData[0].FolderID = UUID.Zero; + bulkUpdate.FolderData[0].ParentID = UUID.Zero; bulkUpdate.FolderData[0].Type = -1; bulkUpdate.FolderData[0].Name = new byte[0]; @@ -1702,17 +1699,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP bulkUpdate.ItemData[0].CreatorID = item.Creator; bulkUpdate.ItemData[0].BaseMask = item.BasePermissions; bulkUpdate.ItemData[0].CreationDate = 1000; - bulkUpdate.ItemData[0].Description = Helpers.StringToField(item.Description); + bulkUpdate.ItemData[0].Description = Utils.StringToBytes(item.Description); bulkUpdate.ItemData[0].EveryoneMask = item.EveryOnePermissions; bulkUpdate.ItemData[0].FolderID = item.Folder; bulkUpdate.ItemData[0].InvType = (sbyte)item.InvType; - bulkUpdate.ItemData[0].Name = Helpers.StringToField(item.Name); + bulkUpdate.ItemData[0].Name = Utils.StringToBytes(item.Name); bulkUpdate.ItemData[0].NextOwnerMask = item.NextPermissions; bulkUpdate.ItemData[0].OwnerID = item.Owner; bulkUpdate.ItemData[0].OwnerMask = item.CurrentPermissions; bulkUpdate.ItemData[0].Type = (sbyte)item.AssetType; - //bulkUpdate.ItemData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); + //bulkUpdate.ItemData[0].GroupID = new UUID("00000000-0000-0000-0000-000000000000"); bulkUpdate.ItemData[0].GroupID = item.GroupID; bulkUpdate.ItemData[0].GroupOwned = item.GroupOwned; bulkUpdate.ItemData[0].GroupMask = 0; @@ -1750,17 +1747,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP InventoryReply.InventoryData[0].AssetID = Item.AssetID; InventoryReply.InventoryData[0].CreatorID = Item.Creator; InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions; - InventoryReply.InventoryData[0].Description = Helpers.StringToField(Item.Description); + InventoryReply.InventoryData[0].Description = Utils.StringToBytes(Item.Description); InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions; InventoryReply.InventoryData[0].FolderID = Item.Folder; InventoryReply.InventoryData[0].InvType = (sbyte)Item.InvType; - InventoryReply.InventoryData[0].Name = Helpers.StringToField(Item.Name); + InventoryReply.InventoryData[0].Name = Utils.StringToBytes(Item.Name); InventoryReply.InventoryData[0].NextOwnerMask = Item.NextPermissions; InventoryReply.InventoryData[0].OwnerID = Item.Owner; InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions; InventoryReply.InventoryData[0].Type = (sbyte)Item.AssetType; - //InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); + //InventoryReply.InventoryData[0].GroupID = new UUID("00000000-0000-0000-0000-000000000000"); InventoryReply.InventoryData[0].GroupID = Item.GroupID; InventoryReply.InventoryData[0].GroupOwned = Item.GroupOwned; InventoryReply.InventoryData[0].GroupMask = 0; @@ -1781,7 +1778,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(InventoryReply, ThrottleOutPacketType.Asset); } - public void SendRemoveInventoryItem(LLUUID itemID) + public void SendRemoveInventoryItem(UUID itemID) { RemoveInventoryItemPacket remove = (RemoveInventoryItemPacket)PacketPool.Instance.GetPacket(PacketType.RemoveInventoryItem); // TODO: don't create new blocks if recycling an old packet @@ -1807,7 +1804,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(scriptcontrol, ThrottleOutPacketType.Task); } - public void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) + public void SendTaskInventory(UUID taskID, short serial, byte[] fileName) { ReplyTaskInventoryPacket replytask = (ReplyTaskInventoryPacket)PacketPool.Instance.GetPacket(PacketType.ReplyTaskInventory); replytask.InventoryData.TaskID = taskID; @@ -1872,7 +1869,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(replyPacket, ThrottleOutPacketType.Task); } - public void SendAgentDataUpdate(LLUUID agentid, LLUUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) + public void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) { m_activeGroupID = activegroupid; @@ -1882,11 +1879,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP AgentDataUpdatePacket sendAgentDataUpdate = (AgentDataUpdatePacket)PacketPool.Instance.GetPacket(PacketType.AgentDataUpdate); sendAgentDataUpdate.AgentData.ActiveGroupID = activegroupid; sendAgentDataUpdate.AgentData.AgentID = agentid; - sendAgentDataUpdate.AgentData.FirstName = Helpers.StringToField(firstname); - sendAgentDataUpdate.AgentData.GroupName = Helpers.StringToField(groupname); + sendAgentDataUpdate.AgentData.FirstName = Utils.StringToBytes(firstname); + sendAgentDataUpdate.AgentData.GroupName = Utils.StringToBytes(groupname); sendAgentDataUpdate.AgentData.GroupPowers = grouppowers; - sendAgentDataUpdate.AgentData.GroupTitle = Helpers.StringToField(grouptitle); - sendAgentDataUpdate.AgentData.LastName = Helpers.StringToField(lastname); + sendAgentDataUpdate.AgentData.GroupTitle = Utils.StringToBytes(grouptitle); + sendAgentDataUpdate.AgentData.LastName = Utils.StringToBytes(lastname); OutPacket(sendAgentDataUpdate, ThrottleOutPacketType.Task); } @@ -1898,7 +1895,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendAlertMessage(string message) { AlertMessagePacket alertPack = (AlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AlertMessage); - alertPack.AlertData.Message = Helpers.StringToField(message); + alertPack.AlertData.Message = Utils.StringToBytes(message); OutPacket(alertPack, ThrottleOutPacketType.Task); } @@ -1924,46 +1921,46 @@ namespace OpenSim.Region.ClientStack.LindenUDP { AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); alertPack.AgentData.AgentID = AgentId; - alertPack.AlertData.Message = Helpers.StringToField(message); + alertPack.AlertData.Message = Utils.StringToBytes(message); alertPack.AlertData.Modal = modal; return alertPack; } - 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) { LoadURLPacket loadURL = (LoadURLPacket)PacketPool.Instance.GetPacket(PacketType.LoadURL); - loadURL.Data.ObjectName = Helpers.StringToField(objectname); + loadURL.Data.ObjectName = Utils.StringToBytes(objectname); loadURL.Data.ObjectID = objectID; loadURL.Data.OwnerID = ownerID; loadURL.Data.OwnerIsGroup = groupOwned; - loadURL.Data.Message = Helpers.StringToField(message); - loadURL.Data.URL = Helpers.StringToField(url); + loadURL.Data.Message = Utils.StringToBytes(message); + loadURL.Data.URL = Utils.StringToBytes(url); OutPacket(loadURL, ThrottleOutPacketType.Task); } - public void SendDialog(string objectname, LLUUID objectID, LLUUID ownerID, string msg, LLUUID textureID, int ch, string[] buttonlabels) + public void SendDialog(string objectname, UUID objectID, UUID ownerID, string msg, UUID textureID, int ch, string[] buttonlabels) { ScriptDialogPacket dialog = (ScriptDialogPacket)PacketPool.Instance.GetPacket(PacketType.ScriptDialog); dialog.Data.ObjectID = objectID; - dialog.Data.ObjectName = Helpers.StringToField(objectname); - dialog.Data.FirstName = Helpers.StringToField(this.FirstName); - dialog.Data.LastName = Helpers.StringToField(this.LastName); - dialog.Data.Message = Helpers.StringToField(msg); + dialog.Data.ObjectName = Utils.StringToBytes(objectname); + dialog.Data.FirstName = Utils.StringToBytes(this.FirstName); + dialog.Data.LastName = Utils.StringToBytes(this.LastName); + dialog.Data.Message = Utils.StringToBytes(msg); dialog.Data.ImageID = textureID; dialog.Data.ChatChannel = ch; ScriptDialogPacket.ButtonsBlock[] buttons = new ScriptDialogPacket.ButtonsBlock[buttonlabels.Length]; for (int i = 0; i < buttonlabels.Length; i++) { buttons[i] = new ScriptDialogPacket.ButtonsBlock(); - buttons[i].ButtonLabel = Helpers.StringToField(buttonlabels[i]); + buttons[i].ButtonLabel = Utils.StringToBytes(buttonlabels[i]); } dialog.Buttons = buttons; OutPacket(dialog, ThrottleOutPacketType.Task); } - public void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID) + public void SendPreLoadSound(UUID objectID, UUID ownerID, UUID soundID) { PreloadSoundPacket preSound = (PreloadSoundPacket)PacketPool.Instance.GetPacket(PacketType.PreloadSound); // TODO: don't create new blocks if recycling an old packet @@ -1976,7 +1973,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(preSound, ThrottleOutPacketType.Task); } - public void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags) + public void SendPlayAttachedSound(UUID soundID, UUID objectID, UUID ownerID, float gain, byte flags) { AttachedSoundPacket sound = (AttachedSoundPacket)PacketPool.Instance.GetPacket(PacketType.AttachedSound); sound.DataBlock.SoundID = soundID; @@ -1988,7 +1985,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(sound, ThrottleOutPacketType.Task); } - 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) { SoundTriggerPacket sound = (SoundTriggerPacket)PacketPool.Instance.GetPacket(PacketType.SoundTrigger); sound.SoundData.SoundID = soundID; @@ -2002,7 +1999,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(sound, ThrottleOutPacketType.Task); } - public void SendAttachedSoundGainChange(LLUUID objectID, float gain) + public void SendAttachedSoundGainChange(UUID objectID, float gain) { AttachedSoundGainChangePacket sound = (AttachedSoundGainChangePacket)PacketPool.Instance.GetPacket(PacketType.AttachedSoundGainChange); sound.DataBlock.ObjectID = objectID; @@ -2011,7 +2008,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(sound, ThrottleOutPacketType.Task); } - public void SendSunPos(LLVector3 Position, LLVector3 Velocity, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) + public void SendSunPos(Vector3 Position, Vector3 Velocity, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) { SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage); viewertime.TimeInfo.SunDirection = Position; @@ -2039,7 +2036,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP int sunPhase = (phase + 2) / 2; if ((sunPhase < 6) || (sunPhase > 36)) { - viewertime.TimeInfo.SunDirection = new LLVector3(0f, 0.8f, -0.8f); + viewertime.TimeInfo.SunDirection = new Vector3(0f, 0.8f, -0.8f); Console.WriteLine("sending night"); } else @@ -2067,37 +2064,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP { yValue *= -1; } - viewertime.TimeInfo.SunDirection = new LLVector3(0f, yValue, 0.3f); + viewertime.TimeInfo.SunDirection = new Vector3(0f, yValue, 0.3f); Console.WriteLine("sending sun update " + yValue); } - viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f); + viewertime.TimeInfo.SunAngVelocity = new Vector3(0, 0.0f, 10.0f); viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch(); viewertime.Header.Reliable = false; OutPacket(viewertime, ThrottleOutPacketType.Task); */ } - 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) { AvatarPropertiesReplyPacket avatarReply = (AvatarPropertiesReplyPacket)PacketPool.Instance.GetPacket(PacketType.AvatarPropertiesReply); avatarReply.AgentData.AgentID = AgentId; avatarReply.AgentData.AvatarID = avatarID; if (aboutText != null) - avatarReply.PropertiesData.AboutText = Helpers.StringToField(aboutText); + avatarReply.PropertiesData.AboutText = Utils.StringToBytes(aboutText); else - avatarReply.PropertiesData.AboutText = Helpers.StringToField(""); - avatarReply.PropertiesData.BornOn = Helpers.StringToField(bornOn); + avatarReply.PropertiesData.AboutText = Utils.StringToBytes(""); + avatarReply.PropertiesData.BornOn = Utils.StringToBytes(bornOn); avatarReply.PropertiesData.CharterMember = charterMember; if (flAbout != null) - avatarReply.PropertiesData.FLAboutText = Helpers.StringToField(flAbout); + avatarReply.PropertiesData.FLAboutText = Utils.StringToBytes(flAbout); else - avatarReply.PropertiesData.FLAboutText = Helpers.StringToField(""); + avatarReply.PropertiesData.FLAboutText = Utils.StringToBytes(""); avatarReply.PropertiesData.Flags = flags; avatarReply.PropertiesData.FLImageID = flImageID; avatarReply.PropertiesData.ImageID = imageID; - avatarReply.PropertiesData.ProfileURL = Helpers.StringToField(profileURL); + avatarReply.PropertiesData.ProfileURL = Utils.StringToBytes(profileURL); avatarReply.PropertiesData.PartnerID = partnerID; OutPacket(avatarReply, ThrottleOutPacketType.Task); } @@ -2140,7 +2137,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) + public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) { AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); // TODO: don't create new blocks if recycling an old packet @@ -2160,7 +2157,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(avp, ThrottleOutPacketType.Task); } - public void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) + public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) { AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation); // TODO: don't create new blocks if recycling an old packet @@ -2194,8 +2191,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, - uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID, LLQuaternion rotation) + public void SendAvatarData(ulong regionHandle, string firstName, string lastName, UUID avatarID, + uint avatarLocalID, Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation) { ObjectUpdatePacket objupdate = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); // TODO: don't create new blocks if recycling an old packet @@ -2209,9 +2206,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP objupdate.ObjectData[0].FullID = avatarID; objupdate.ObjectData[0].ParentID = parentID; objupdate.ObjectData[0].NameValue = - Helpers.StringToField("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName); + Utils.StringToBytes("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName); - LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z); + Vector3 pos2 = new Vector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z); byte[] pb = pos2.GetBytes(); Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); @@ -2230,11 +2227,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, - LLVector3 velocity, LLQuaternion rotation) + public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, + Vector3 velocity, Quaternion rotation) { if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) - rotation = LLQuaternion.Identity; + rotation = Quaternion.Identity; ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateAvatarImprovedBlock(localID, position, velocity, rotation); @@ -2251,7 +2248,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(terse, ThrottleOutPacketType.Task); } - public void SendCoarseLocationUpdate(List CoarseLocations) + public void SendCoarseLocationUpdate(List CoarseLocations) { CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); // TODO: don't create new blocks if recycling an old packet @@ -2286,7 +2283,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) + public void AttachObject(uint localID, Quaternion rotation, byte attachPoint) { ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach); @@ -2305,8 +2302,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP public 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, + 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[] textureanim = new byte[0]; @@ -2314,19 +2311,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, vel, acc, rotation, rvel, flags, objectID, ownerID, text, color, parentID, particleSystem, - clickAction, textureanim, false, (uint)0, LLUUID.Zero, LLUUID.Zero, 0, 0, 0); + clickAction, textureanim, false, (uint)0, UUID.Zero, UUID.Zero, 0, 0, 0); } public void SendPrimitiveToClient( ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, - LLVector3 pos, LLVector3 velocity, LLVector3 acceleration, LLQuaternion rotation, LLVector3 rotational_velocity, + Vector3 pos, Vector3 velocity, Vector3 acceleration, Quaternion rotation, Vector3 rotational_velocity, uint flags, - LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, - byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, LLUUID AssetId, LLUUID SoundId, double SoundGain, byte SoundFlags, double SoundRadius) + UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, + byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, UUID AssetId, UUID SoundId, double SoundGain, byte SoundFlags, double SoundRadius) { if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) - rotation = LLQuaternion.Identity; + rotation = Quaternion.Identity; ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); @@ -2344,13 +2341,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP outPacket.ObjectData[0].OwnerID = ownerID; // Anything more than 254 will cause libsecondlife to barf - // (libsl 1550) adds an \0 on the Helpers.StringToField conversion if it isn't present + // (libsl 1550) adds an \0 on the Utils.StringToBytes conversion if it isn't present if (text.Length > 254) { text = text.Remove(254); } - outPacket.ObjectData[0].Text = Helpers.StringToField(text); + outPacket.ObjectData[0].Text = Utils.StringToBytes(text); outPacket.ObjectData[0].TextColor[0] = color[0]; outPacket.ObjectData[0].TextColor[1] = color[1]; @@ -2364,21 +2361,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (attachment) { // Necessary??? - outPacket.ObjectData[0].JointAxisOrAnchor = new LLVector3(0, 0, 2); - outPacket.ObjectData[0].JointPivot = new LLVector3(0, 0, 0); + outPacket.ObjectData[0].JointAxisOrAnchor = new Vector3(0, 0, 2); + outPacket.ObjectData[0].JointPivot = new Vector3(0, 0, 0); // Item from inventory??? outPacket.ObjectData[0].NameValue = - Helpers.StringToField("AttachItemID STRING RW SV " + AssetId.UUID); + Utils.StringToBytes("AttachItemID STRING RW SV " + AssetId.Guid); outPacket.ObjectData[0].State = (byte)((AttachPoint % 16) * 16 + (AttachPoint / 16)); } // Xantor 20080528: Send sound info as well // Xantor 20080530: Zero out everything if there's no SoundId, so zerocompression will work again outPacket.ObjectData[0].Sound = SoundId; - if (SoundId == LLUUID.Zero) + if (SoundId == UUID.Zero) { - outPacket.ObjectData[0].OwnerID = LLUUID.Zero; + outPacket.ObjectData[0].OwnerID = UUID.Zero; outPacket.ObjectData[0].Gain = 0.0f; outPacket.ObjectData[0].Radius = 0.0f; outPacket.ObjectData[0].Flags = 0; @@ -2420,11 +2417,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, - LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity, byte state, LLUUID AssetId) + public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, + Quaternion rotation, Vector3 velocity, Vector3 rotationalvelocity, byte state, UUID AssetId) { if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) - rotation = LLQuaternion.Identity; + rotation = Quaternion.Identity; ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); // TODO: don't create new blocks if recycling an old packet terse.RegionData.RegionHandle = regionHandle; @@ -2436,11 +2433,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(terse, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority); } - public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, - LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity) + public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, + Quaternion rotation, Vector3 velocity, Vector3 rotationalvelocity) { if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) - rotation = LLQuaternion.Identity; + rotation = Quaternion.Identity; ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); // TODO: don't create new blocks if recycling an old packet terse.RegionData.RegionHandle = regionHandle; @@ -2452,7 +2449,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(terse, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority); } - public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID) + public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) { AssetUploadCompletePacket newPack = new AssetUploadCompletePacket(); newPack.AssetBlock.Type = AssetType; @@ -2462,7 +2459,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(newPack, ThrottleOutPacketType.Asset); } - 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) { RequestXferPacket newPack = new RequestXferPacket(); newPack.XferID.ID = XferID; @@ -2483,7 +2480,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(newPack, ThrottleOutPacketType.Asset); } - 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) { ImageDataPacket im = new ImageDataPacket(); im.Header.Reliable = false; @@ -2510,10 +2507,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(pack, ThrottleOutPacketType.Task); } - 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) { ObjectPropertiesFamilyPacket objPropFamilyPack = (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily); // TODO: don't create new blocks if recycling an old packet @@ -2535,16 +2532,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP objPropDB.SalePrice = SalePrice; objPropDB.Category = Category; objPropDB.LastOwnerID = LastOwnerID; - objPropDB.Name = Helpers.StringToField(ObjectName); - objPropDB.Description = Helpers.StringToField(Description); + objPropDB.Name = Utils.StringToBytes(ObjectName); + objPropDB.Description = Utils.StringToBytes(Description); objPropFamilyPack.ObjectData = objPropDB; objPropFamilyPack.Header.Zerocoded = true; OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task); } - 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) { @@ -2562,15 +2559,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP proper.ObjectData[0].InventorySerial = InventorySerial; proper.ObjectData[0].LastOwnerID = LastOwnerUUID; - // proper.ObjectData[0].LastOwnerID = LLUUID.Zero; + // proper.ObjectData[0].LastOwnerID = UUID.Zero; proper.ObjectData[0].ObjectID = ObjectUUID; proper.ObjectData[0].OwnerID = OwnerUUID; - proper.ObjectData[0].TouchName = Helpers.StringToField(TouchTitle); + proper.ObjectData[0].TouchName = Utils.StringToBytes(TouchTitle); proper.ObjectData[0].TextureID = TextureID; - proper.ObjectData[0].SitName = Helpers.StringToField(SitTitle); - proper.ObjectData[0].Name = Helpers.StringToField(ItemName); - proper.ObjectData[0].Description = Helpers.StringToField(ItemDescription); + proper.ObjectData[0].SitName = Utils.StringToBytes(SitTitle); + proper.ObjectData[0].Name = Utils.StringToBytes(ItemName); + proper.ObjectData[0].Description = Utils.StringToBytes(ItemDescription); proper.ObjectData[0].OwnerMask = OwnerMask; proper.ObjectData[0].NextOwnerMask = NextOwnerMask; proper.ObjectData[0].GroupMask = GroupMask; @@ -2591,7 +2588,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private bool convertParamStringToBool(byte[] field) { - string s = Helpers.FieldToUTF8String(field); + string s = Utils.BytesToString(field); if (s == "1" || s.ToLower() == "y" || s.ToLower() == "yes" || s.ToLower() == "t" || s.ToLower() == "true") { return true; @@ -2599,14 +2596,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP return false; } - public void SendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID) + public void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID) { EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); - packet.AgentData.TransactionID = LLUUID.Random(); + packet.AgentData.TransactionID = UUID.Random(); packet.AgentData.AgentID = this.AgentId; packet.AgentData.SessionID = this.SessionId; packet.MethodData.Invoice = invoice; - packet.MethodData.Method = Helpers.StringToField("setaccess"); + packet.MethodData.Method = Utils.StringToBytes("setaccess"); EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + EstateManagers.Length]; @@ -2616,12 +2613,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } int j = 0; - returnblock[j].Parameter = Helpers.StringToField(estateID.ToString()); j++; - returnblock[j].Parameter = Helpers.StringToField(((int)Constants.EstateAccessCodex.EstateManagers).ToString()); j++; - returnblock[j].Parameter = Helpers.StringToField("0"); j++; - returnblock[j].Parameter = Helpers.StringToField("0"); j++; - returnblock[j].Parameter = Helpers.StringToField("0"); j++; - returnblock[j].Parameter = Helpers.StringToField(EstateManagers.Length.ToString()); j++; + returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++; + returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateManagers).ToString()); j++; + returnblock[j].Parameter = Utils.StringToBytes("0"); j++; + returnblock[j].Parameter = Utils.StringToBytes("0"); j++; + returnblock[j].Parameter = Utils.StringToBytes("0"); j++; + returnblock[j].Parameter = Utils.StringToBytes(EstateManagers.Length.ToString()); j++; for (int i = 0; i < EstateManagers.Length; i++) { returnblock[j].Parameter = EstateManagers[i].GetBytes(); j++; @@ -2631,25 +2628,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP this.OutPacket(packet, ThrottleOutPacketType.Task); } - public void SendBannedUserList(LLUUID invoice, EstateBan[] bl, uint estateID) + public void SendBannedUserList(UUID invoice, EstateBan[] bl, uint estateID) { - ListBannedUsers = new List(); + ListBannedUsers = new List(); for (int i = 0; i < bl.Length; i++) { if (bl[i] == null) continue; - if (bl[i].bannedUUID == LLUUID.Zero) + if (bl[i].bannedUUID == UUID.Zero) continue; BannedUsers.Add(bl[i].bannedUUID); } EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); - packet.AgentData.TransactionID = LLUUID.Random(); + packet.AgentData.TransactionID = UUID.Random(); packet.AgentData.AgentID = this.AgentId; packet.AgentData.SessionID = this.SessionId; packet.MethodData.Invoice = invoice; - packet.MethodData.Method = Helpers.StringToField("setaccess"); + packet.MethodData.Method = Utils.StringToBytes("setaccess"); EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count]; @@ -2659,14 +2656,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP } int j = 0; - returnblock[j].Parameter = Helpers.StringToField(estateID.ToString()); j++; - returnblock[j].Parameter = Helpers.StringToField(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++; - returnblock[j].Parameter = Helpers.StringToField("0"); j++; - returnblock[j].Parameter = Helpers.StringToField("0"); j++; - returnblock[j].Parameter = Helpers.StringToField(BannedUsers.Count.ToString()); j++; - returnblock[j].Parameter = Helpers.StringToField("0"); j++; + returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++; + returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++; + returnblock[j].Parameter = Utils.StringToBytes("0"); j++; + returnblock[j].Parameter = Utils.StringToBytes("0"); j++; + returnblock[j].Parameter = Utils.StringToBytes(BannedUsers.Count.ToString()); j++; + returnblock[j].Parameter = Utils.StringToBytes("0"); j++; - foreach (LLUUID banned in BannedUsers) + foreach (UUID banned in BannedUsers) { returnblock[j].Parameter = banned.GetBytes(); j++; } @@ -2696,34 +2693,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP rinfoblk.TerrainRaiseLimit = args.terrainRaiseLimit; rinfoblk.UseEstateSun = args.useEstateSun; rinfoblk.WaterHeight = args.waterHeight; - rinfoblk.SimName = Helpers.StringToField(args.simName); + rinfoblk.SimName = Utils.StringToBytes(args.simName); rinfopack.RegionInfo = rinfoblk; this.OutPacket(rinfopack, ThrottleOutPacketType.Task); } - public void SendEstateCovenantInformation(LLUUID covenant) + public void SendEstateCovenantInformation(UUID covenant) { EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); edata.CovenantID = covenant; edata.CovenantTimestamp = 0; - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; else edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; - edata.EstateName = Helpers.StringToField(m_scene.RegionInfo.EstateSettings.EstateName); + edata.EstateName = Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateName); einfopack.Data = edata; this.OutPacket(einfopack, ThrottleOutPacketType.Task); } - 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) { EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); packet.MethodData.Invoice = invoice; - packet.AgentData.TransactionID = LLUUID.Random(); - packet.MethodData.Method = Helpers.StringToField("estateupdateinfo"); + packet.AgentData.TransactionID = UUID.Random(); + packet.MethodData.Method = Utils.StringToBytes("estateupdateinfo"); EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[10]; for (int i = 0; i < 10; i++) @@ -2732,22 +2729,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP } //Sending Estate Settings - returnblock[0].Parameter = Helpers.StringToField(estateName); + returnblock[0].Parameter = Utils.StringToBytes(estateName); // TODO: remove this cruft once MasterAvatar is fully deprecated // - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) - returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.EstateSettings.EstateOwner.ToString()); + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) + returnblock[1].Parameter = Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateOwner.ToString()); else - returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString()); - returnblock[2].Parameter = Helpers.StringToField(estateID.ToString()); + returnblock[1].Parameter = Utils.StringToBytes(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString()); + returnblock[2].Parameter = Utils.StringToBytes(estateID.ToString()); - returnblock[3].Parameter = Helpers.StringToField(estateFlags.ToString()); - returnblock[4].Parameter = Helpers.StringToField(sunPosition.ToString()); - returnblock[5].Parameter = Helpers.StringToField(parentEstate.ToString()); - returnblock[6].Parameter = Helpers.StringToField(covenant.ToString()); - returnblock[7].Parameter = Helpers.StringToField("1160895077"); // what is this? - returnblock[8].Parameter = Helpers.StringToField("1"); // what is this? - returnblock[9].Parameter = Helpers.StringToField(abuseEmail); + returnblock[3].Parameter = Utils.StringToBytes(estateFlags.ToString()); + returnblock[4].Parameter = Utils.StringToBytes(sunPosition.ToString()); + returnblock[5].Parameter = Utils.StringToBytes(parentEstate.ToString()); + returnblock[6].Parameter = Utils.StringToBytes(covenant.ToString()); + returnblock[7].Parameter = Utils.StringToBytes("1160895077"); // what is this? + returnblock[8].Parameter = Utils.StringToBytes("1"); // what is this? + returnblock[9].Parameter = Utils.StringToBytes(abuseEmail); packet.ParamList = returnblock; packet.Header.Reliable = false; @@ -2783,7 +2780,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP updatePacket.ParcelData.Bitmap = landData.Bitmap; - updatePacket.ParcelData.Desc = Helpers.StringToField(landData.Description); + updatePacket.ParcelData.Desc = Utils.StringToBytes(landData.Description); updatePacket.ParcelData.Category = (byte)landData.Category; updatePacket.ParcelData.ClaimDate = landData.ClaimDate; updatePacket.ParcelData.ClaimPrice = landData.ClaimPrice; @@ -2802,9 +2799,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP } updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; updatePacket.ParcelData.MediaID = landData.MediaID; - updatePacket.ParcelData.MediaURL = Helpers.StringToField(landData.MediaURL); - updatePacket.ParcelData.MusicURL = Helpers.StringToField(landData.MusicURL); - updatePacket.ParcelData.Name = Helpers.StringToField(landData.Name); + updatePacket.ParcelData.MediaURL = Utils.StringToBytes(landData.MediaURL); + updatePacket.ParcelData.MusicURL = Utils.StringToBytes(landData.MusicURL); + updatePacket.ParcelData.Name = Utils.StringToBytes(landData.Name); updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented updatePacket.ParcelData.OtherCount = 0; //unemplemented updatePacket.ParcelData.OtherPrims = landData.OtherPrims; @@ -2851,7 +2848,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP remote_client.OutPacket((Packet)updatePacket, ThrottleOutPacketType.Task); } - public void SendLandAccessListData(List avatars, uint accessFlag, int localLandID) + public void SendLandAccessListData(List avatars, uint accessFlag, int localLandID) { ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply); replyPacket.Data.AgentID = this.AgentId; @@ -2860,7 +2857,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP replyPacket.Data.SequenceID = 0; List list = new List(); - foreach (LLUUID avatar in avatars) + foreach (UUID avatar in avatars) { ParcelAccessListReplyPacket.ListBlock block = new ParcelAccessListReplyPacket.ListBlock(); block.Flags = accessFlag; @@ -2913,7 +2910,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } - public void SendLandObjectOwners(Dictionary ownersAndCount) + public void SendLandObjectOwners(Dictionary ownersAndCount) { int notifyCount = ownersAndCount.Count; ParcelObjectOwnersReplyPacket pack = (ParcelObjectOwnersReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelObjectOwnersReply); @@ -2933,7 +2930,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP = new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount]; int num = 0; - foreach (LLUUID owner in ownersAndCount.Keys) + foreach (UUID owner in ownersAndCount.Keys) { dataBlock[num] = new ParcelObjectOwnersReplyPacket.DataBlock(); dataBlock[num].Count = ownersAndCount[owner]; @@ -2959,9 +2956,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region Helper Methods - protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos, - LLVector3 velocity, - LLQuaternion rotation) + protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, Vector3 pos, + Vector3 velocity, + Quaternion rotation) { byte[] bytes = new byte[60]; int i = 0; @@ -2992,13 +2989,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP internDirec = new Vector3(velocity.X, velocity.Y, velocity.Z); internDirec = internDirec / 128.0f; - internDirec.x += 1; - internDirec.y += 1; - internDirec.z += 1; + internDirec.X += 1; + internDirec.Y += 1; + internDirec.Z += 1; - InternVelocityX = (ushort)(32768 * internDirec.x); - InternVelocityY = (ushort)(32768 * internDirec.y); - InternVelocityZ = (ushort)(32768 * internDirec.z); + InternVelocityX = (ushort)(32768 * internDirec.X); + InternVelocityY = (ushort)(32768 * internDirec.Y); + InternVelocityZ = (ushort)(32768 * internDirec.Z); ushort ac = 32767; bytes[i++] = (byte)(InternVelocityX % 256); @@ -3054,10 +3051,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreatePrimImprovedBlock(uint localID, - LLVector3 position, - LLQuaternion rotation, - LLVector3 velocity, - LLVector3 rotationalvelocity, + Vector3 position, + Quaternion rotation, + Vector3 velocity, + Vector3 rotationalvelocity, byte state) { uint ID = localID; @@ -3082,13 +3079,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP Vector3 vel = new Vector3(velocity.X, velocity.Y, velocity.Z); vel = vel / 128.0f; - vel.x += 1; - vel.y += 1; - vel.z += 1; + vel.X += 1; + vel.Y += 1; + vel.Z += 1; //vel - velx = (ushort)(32768 * (vel.x)); - vely = (ushort)(32768 * (vel.y)); - velz = (ushort)(32768 * (vel.z)); + velx = (ushort)(32768 * (vel.X)); + vely = (ushort)(32768 * (vel.Y)); + velz = (ushort)(32768 * (vel.Z)); bytes[i++] = (byte)(velx % 256); bytes[i++] = (byte)((velx >> 8) % 256); @@ -3126,13 +3123,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP Vector3 rvel = new Vector3(rotationalvelocity.X, rotationalvelocity.Y, rotationalvelocity.Z); rvel = rvel / 128.0f; - rvel.x += 1; - rvel.y += 1; - rvel.z += 1; + rvel.X += 1; + rvel.Y += 1; + rvel.Z += 1; //vel - rvelx = (ushort)(32768 * (rvel.x)); - rvely = (ushort)(32768 * (rvel.y)); - rvelz = (ushort)(32768 * (rvel.z)); + rvelx = (ushort)(32768 * (rvel.X)); + rvely = (ushort)(32768 * (rvel.Y)); + rvelz = (ushort)(32768 * (rvel.Z)); bytes[i++] = (byte)(rvelx % 256); bytes[i++] = (byte)((rvelx >> 8) % 256); @@ -3204,11 +3201,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP objdata.NameValue = new byte[0]; objdata.Text = new byte[0]; objdata.TextColor = new byte[4]; - objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); - objdata.JointPivot = new LLVector3(0, 0, 0); + objdata.JointAxisOrAnchor = new Vector3(0, 0, 0); + objdata.JointPivot = new Vector3(0, 0, 0); objdata.Material = 3; objdata.TextureAnim = new byte[0]; - objdata.Sound = LLUUID.Zero; + objdata.Sound = UUID.Zero; objdata.State = 0; objdata.Data = new byte[0]; @@ -3224,7 +3221,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry) { ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); - // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); + // new OpenMetaverse.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); SetDefaultAvatarPacketValues(ref objdata); objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); @@ -3233,18 +3230,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP objdata.PathScaleX = 100; objdata.PathScaleY = 100; objdata.ParentID = 0; - objdata.OwnerID = LLUUID.Zero; - objdata.Scale = new LLVector3(1, 1, 1); + objdata.OwnerID = UUID.Zero; + objdata.Scale = new Vector3(1, 1, 1); objdata.PCode = (byte)PCode.Avatar; if (textureEntry != null) { objdata.TextureEntry = textureEntry; } - LLVector3 pos = new LLVector3(objdata.ObjectData, 16); + Vector3 pos = new Vector3(objdata.ObjectData, 16); pos.X = 100f; objdata.ID = 8880000; - objdata.NameValue = Helpers.StringToField("FirstName STRING RW SV Test \nLastName STRING RW SV User "); - //LLVector3 pos2 = new LLVector3(100f, 100f, 23f); + objdata.NameValue = Utils.StringToBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User "); + //Vector3 pos2 = new Vector3(100f, 100f, 23f); //objdata.FullID=user.AgentId; byte[] pb = pos.GetBytes(); Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length); @@ -3264,12 +3261,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP objdata.NameValue = new byte[0]; objdata.Text = new byte[0]; objdata.TextColor = new byte[4]; - objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); - objdata.JointPivot = new LLVector3(0, 0, 0); + objdata.JointAxisOrAnchor = new Vector3(0, 0, 0); + objdata.JointPivot = new Vector3(0, 0, 0); objdata.Material = 4; objdata.TextureAnim = new byte[0]; - objdata.Sound = LLUUID.Zero; - LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); + objdata.Sound = UUID.Zero; + Primitive.TextureEntry ntex = new Primitive.TextureEntry(new UUID("00000000-0000-0000-5005-000000000005")); objdata.TextureEntry = ntex.ToBytes(); objdata.State = 0; @@ -3285,15 +3282,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP objdata.ObjectData[64] = 189; } - public void SendNameReply(LLUUID profileId, string firstname, string lastname) + public void SendNameReply(UUID profileId, string firstname, string lastname) { UUIDNameReplyPacket packet = (UUIDNameReplyPacket)PacketPool.Instance.GetPacket(PacketType.UUIDNameReply); // TODO: don't create new blocks if recycling an old packet packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1]; packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock(); packet.UUIDNameBlock[0].ID = profileId; - packet.UUIDNameBlock[0].FirstName = Helpers.StringToField(firstname); - packet.UUIDNameBlock[0].LastName = Helpers.StringToField(lastname); + packet.UUIDNameBlock[0].FirstName = Utils.StringToBytes(firstname); + packet.UUIDNameBlock[0].LastName = Utils.StringToBytes(lastname); OutPacket(packet, ThrottleOutPacketType.Task); } @@ -3382,7 +3379,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { for (int i = 0; i < ogpack.ObjectData.Length; i++) { - handlerObjectGroupRequest(this, ogpack.AgentData.GroupID, ogpack.ObjectData[i].ObjectLocalID, LLUUID.Zero); + handlerObjectGroupRequest(this, ogpack.AgentData.GroupID, ogpack.ObjectData[i].ObjectLocalID, UUID.Zero); } } return true; @@ -3415,7 +3412,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } - public void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question) + public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) { ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion); scriptQuestion.Data = new ScriptQuestionPacket.DataBlock(); @@ -3423,8 +3420,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP scriptQuestion.Data.TaskID = taskID; scriptQuestion.Data.ItemID = itemID; scriptQuestion.Data.Questions = question; - scriptQuestion.Data.ObjectName = Helpers.StringToField(taskName); - scriptQuestion.Data.ObjectOwner = Helpers.StringToField(ownerName); + scriptQuestion.Data.ObjectName = Utils.StringToBytes(taskName); + scriptQuestion.Data.ObjectOwner = Utils.StringToBytes(ownerName); OutPacket(scriptQuestion, ThrottleOutPacketType.Task); } @@ -3433,11 +3430,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP { } - public LLUUID GetDefaultAnimation(string name) + public UUID GetDefaultAnimation(string name) { if (m_defaultAnimations.ContainsKey(name)) return m_defaultAnimations[name]; - return LLUUID.Zero; + return UUID.Zero; } /// @@ -3496,7 +3493,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; - cachedresp.WearableData[i].TextureID = LLUUID.Zero; + cachedresp.WearableData[i].TextureID = UUID.Zero; cachedresp.WearableData[i].HostName = new byte[0]; } @@ -3526,19 +3523,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (part == null) { // It's a ghost! tell the client to delete it from view. - simClient.SendKillObject(Scene.RegionInfo.RegionHandle, + simClient.SendKiPrimitive(Scene.RegionInfo.RegionHandle, localId); } else { - // LLUUID partId = part.UUID; + // UUID partId = part.UUID; UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation; switch (block.Type) { case 1: - LLVector3 pos1 = new LLVector3(block.Data, 0); + Vector3 pos1 = new Vector3(block.Data, 0); handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; if (handlerUpdatePrimSinglePosition != null) @@ -3548,7 +3545,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case 2: - LLQuaternion rot1 = new LLQuaternion(block.Data, 0, true); + Quaternion rot1 = new Quaternion(block.Data, 0, true); handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; if (handlerUpdatePrimSingleRotation != null) @@ -3559,7 +3556,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case 3: - LLQuaternion rot2 = new LLQuaternion(block.Data, 12, true); + Quaternion rot2 = new Quaternion(block.Data, 12, true); handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; if (handlerUpdatePrimSingleRotation != null) { @@ -3569,8 +3566,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case 5: - LLVector3 scale1 = new LLVector3(block.Data, 12); - LLVector3 pos11 = new LLVector3(block.Data, 0); + Vector3 scale1 = new Vector3(block.Data, 12); + Vector3 pos11 = new Vector3(block.Data, 0); handlerUpdatePrimScale = OnUpdatePrimScale; if (handlerUpdatePrimScale != null) @@ -3586,7 +3583,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case 9: - LLVector3 pos2 = new LLVector3(block.Data, 0); + Vector3 pos2 = new Vector3(block.Data, 0); handlerUpdateVector = OnUpdatePrimGroupPosition; @@ -3597,7 +3594,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case 10: - LLQuaternion rot3 = new LLQuaternion(block.Data, 0, true); + Quaternion rot3 = new Quaternion(block.Data, 0, true); handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; if (handlerUpdatePrimRotation != null) @@ -3607,8 +3604,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case 11: - LLVector3 pos3 = new LLVector3(block.Data, 0); - LLQuaternion rot4 = new LLQuaternion(block.Data, 12, true); + Vector3 pos3 = new Vector3(block.Data, 0); + Quaternion rot4 = new Quaternion(block.Data, 12, true); handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation; if (handlerUpdatePrimGroupRotation != null) @@ -3619,8 +3616,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case 13: - LLVector3 scale2 = new LLVector3(block.Data, 12); - LLVector3 pos4 = new LLVector3(block.Data, 0); + Vector3 scale2 = new Vector3(block.Data, 12); + Vector3 pos4 = new Vector3(block.Data, 0); handlerUpdatePrimScale = OnUpdatePrimScale; if (handlerUpdatePrimScale != null) @@ -3638,8 +3635,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case 29: - LLVector3 scale5 = new LLVector3(block.Data, 12); - LLVector3 pos5 = new LLVector3(block.Data, 0); + Vector3 scale5 = new Vector3(block.Data, 12); + Vector3 pos5 = new Vector3(block.Data, 0); handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; if (handlerUpdatePrimGroupScale != null) @@ -3655,8 +3652,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case 21: - LLVector3 scale6 = new LLVector3(block.Data, 12); - LLVector3 pos6 = new LLVector3(block.Data, 0); + Vector3 scale6 = new Vector3(block.Data, 12); + Vector3 pos6 = new Vector3(block.Data, 0); handlerUpdatePrimScale = OnUpdatePrimScale; if (handlerUpdatePrimScale != null) @@ -3691,7 +3688,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP mapReply.LayerData[0].Left = 0; mapReply.LayerData[0].Top = 30000; mapReply.LayerData[0].Right = 30000; - mapReply.LayerData[0].ImageID = new LLUUID("00000000-0000-1111-9999-000000000006"); + mapReply.LayerData[0].ImageID = new UUID("00000000-0000-1111-9999-000000000006"); mapReply.Header.Zerocoded = true; OutPacket(mapReply, ThrottleOutPacketType.Land); } @@ -3717,7 +3714,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP mbReply.Data[iii].Name = System.Text.Encoding.UTF8.GetBytes((string)mp["name"]); mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]); mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]); - mbReply.Data[iii].MapImageID = new LLUUID((string)mp["map-image-id"]); + mbReply.Data[iii].MapImageID = new UUID((string)mp["map-image-id"]); mbReply.Data[iii].RegionFlags = System.Convert.ToUInt32(mp["region-flags"]); mbReply.Data[iii].WaterHeight = System.Convert.ToByte(mp["water-height"]); mbReply.Data[iii].X = System.Convert.ToUInt16(mp["x"]); @@ -3776,7 +3773,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_moneyBalance + debit >= 0) { m_moneyBalance += debit; - SendMoneyBalance(LLUUID.Zero, true, Helpers.StringToField("Poof Poof!"), m_moneyBalance); + SendMoneyBalance(UUID.Zero, true, Utils.StringToBytes("Poof Poof!"), m_moneyBalance); return true; } else @@ -3791,7 +3788,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void DecipherGenericMessage(string gmMethod, LLUUID gmInvoice, GenericMessagePacket.ParamListBlock[] gmParams) + public void DecipherGenericMessage(string gmMethod, UUID gmInvoice, GenericMessagePacket.ParamListBlock[] gmParams) { switch (gmMethod) { @@ -3804,9 +3801,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP try { Helpers.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY); - locx = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[0].Parameter)) - (float)regionX; - locy = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[1].Parameter)) - (float)regionY; - locz = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[2].Parameter)); + locx = Convert.ToSingle(Utils.BytesToString(gmParams[0].Parameter)) - (float)regionX; + locy = Convert.ToSingle(Utils.BytesToString(gmParams[1].Parameter)) - (float)regionY; + locz = Convert.ToSingle(Utils.BytesToString(gmParams[2].Parameter)); } catch (InvalidCastException) { @@ -3817,7 +3814,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerAutoPilotGo = OnAutoPilotGo; if (handlerAutoPilotGo != null) { - handlerAutoPilotGo(0, new LLVector3(locx, locy, locz), this); + handlerAutoPilotGo(0, new Vector3(locx, locy, locz), this); } m_log.InfoFormat("[CLIENT]: Client Requests autopilot to position <{0},{1},{2}>", locx, locy, locz); @@ -3839,7 +3836,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// Entryway from the client to the simulator /// all UDP packets from the client will end up here /// - /// libsecondlife.packet + /// OpenMetaverse.packet public void ProcessInPacket(Packet Pack) { // check if we've got a local packet handler for this packet.type. See RegisterLocalPacketHandlers() @@ -3858,7 +3855,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.GenericMessage: GenericMessagePacket gmpack = (GenericMessagePacket)Pack; - DecipherGenericMessage(Helpers.FieldToUTF8String(gmpack.MethodData.Method), gmpack.MethodData.Invoice, gmpack.ParamList); + DecipherGenericMessage(Utils.BytesToString(gmpack.MethodData.Method), gmpack.MethodData.Invoice, gmpack.ParamList); break; case PacketType.AvatarPropertiesRequest: @@ -3877,8 +3874,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP string fromName = String.Empty; //ClientAvatar.firstname + " " + ClientAvatar.lastname; byte[] message = inchatpack.ChatData.Message; byte type = inchatpack.ChatData.Type; - LLVector3 fromPos = new LLVector3(); // ClientAvatar.Pos; - // LLUUID fromAgentID = AgentId; + Vector3 fromPos = new Vector3(); // ClientAvatar.Pos; + // UUID fromAgentID = AgentId; int channel = inchatpack.ChatData.Channel; @@ -3887,7 +3884,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OSChatMessage args = new OSChatMessage(); args.Channel = channel; args.From = fromName; - args.Message = Helpers.FieldToUTF8String(message); + args.Message = Utils.BytesToString(message); args.Type = (ChatTypeEnum)type; args.Position = fromPos; @@ -3908,8 +3905,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = Packet.PropertiesData; UserProfileData UserProfile = new UserProfileData(); UserProfile.ID = AgentId; - UserProfile.AboutText = Helpers.FieldToUTF8String(Properties.AboutText); - UserProfile.FirstLifeAboutText = Helpers.FieldToUTF8String(Properties.FLAboutText); + UserProfile.AboutText = Utils.BytesToString(Properties.AboutText); + UserProfile.FirstLifeAboutText = Utils.BytesToString(Properties.FLAboutText); UserProfile.FirstLifeImage = Properties.FLImageID; UserProfile.Image = Properties.ImageID; @@ -3926,9 +3923,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP OSChatMessage args = new OSChatMessage(); args.Channel = ch; args.From = String.Empty; - args.Message = Helpers.FieldToUTF8String(msg); + args.Message = Utils.BytesToString(msg); args.Type = ChatTypeEnum.Shout; - args.Position = new LLVector3(); + args.Position = new Vector3(); args.Scene = Scene; args.Sender = this; handlerChatFromViewer2 = OnChatFromViewer; @@ -3940,7 +3937,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.ImprovedInstantMessage: ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack; string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); - string IMmessage = Helpers.FieldToUTF8String(msgpack.MessageBlock.Message); + string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message); handlerInstantMessage = OnInstantMessage; if (handlerInstantMessage != null) @@ -3959,10 +3956,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP AcceptFriendshipPacket afriendpack = (AcceptFriendshipPacket)Pack; // My guess is this is the folder to stick the calling card into - List callingCardFolders = new List(); + List callingCardFolders = new List(); - LLUUID agentID = afriendpack.AgentData.AgentID; - LLUUID transactionID = afriendpack.TransactionBlock.TransactionID; + UUID agentID = afriendpack.AgentData.AgentID; + UUID transactionID = afriendpack.TransactionBlock.TransactionID; for (int fi = 0; fi < afriendpack.FolderData.Length; fi++) { @@ -3977,8 +3974,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.TerminateFriendship: TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack; - LLUUID listOwnerAgentID = tfriendpack.AgentData.AgentID; - LLUUID exFriendID = tfriendpack.ExBlock.OtherID; + UUID listOwnerAgentID = tfriendpack.AgentData.AgentID; + UUID exFriendID = tfriendpack.ExBlock.OtherID; handlerTerminateFriendship = OnTerminateFriendship; if (handlerTerminateFriendship != null) @@ -4130,8 +4127,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP { DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack; - LLUUID itemID = detachtoInv.ObjectData.ItemID; - // LLUUID ATTACH_agentID = detachtoInv.ObjectData.AgentID; + UUID itemID = detachtoInv.ObjectData.ItemID; + // UUID ATTACH_agentID = detachtoInv.ObjectData.AgentID; handlerDetachAttachmentIntoInv(itemID, this); } @@ -4266,13 +4263,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData; AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data; - //Console.WriteLine("Agent Sends:" + Helpers.FieldToUTF8String(querydata.Name)); + //Console.WriteLine("Agent Sends:" + Utils.BytesToString(querydata.Name)); handlerAvatarPickerRequest = OnAvatarPickerRequest; if (handlerAvatarPickerRequest != null) { handlerAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID, - Helpers.FieldToUTF8String(querydata.Name)); + Utils.BytesToString(querydata.Name)); } break; case PacketType.AgentDataUpdateRequest: @@ -4613,8 +4610,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP { ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack; - LLUUID AgentID = newobjPerms.AgentData.AgentID; - LLUUID SessionID = newobjPerms.AgentData.SessionID; + UUID AgentID = newobjPerms.AgentData.AgentID; + UUID SessionID = newobjPerms.AgentData.SessionID; handlerObjectPermissions = null; @@ -4654,7 +4651,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { for (int i = 0; i < undoitem.ObjectData.Length; i++) { - LLUUID objiD = undoitem.ObjectData[i].ObjectID; + UUID objiD = undoitem.ObjectData[i].ObjectID; handlerOnUndo = OnUndo; if (handlerOnUndo != null) { @@ -4762,15 +4759,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP // if (transfer.TransferInfo.SourceType == 3) { - LLUUID taskID = null; - LLUUID itemID = null; - LLUUID requestID = null; - taskID = new LLUUID(transfer.TransferInfo.Params, 48); - itemID = new LLUUID(transfer.TransferInfo.Params, 64); - requestID = new LLUUID(transfer.TransferInfo.Params, 80); + UUID taskID = null; + UUID itemID = null; + UUID requestID = null; + taskID = new UUID(transfer.TransferInfo.Params, 48); + itemID = new UUID(transfer.TransferInfo.Params, 64); + requestID = new UUID(transfer.TransferInfo.Params, 80); if (!(((Scene)m_scene).ExternalChecks.ExternalChecksBypassPermissions())) { - if (taskID != LLUUID.Zero) // Prim + if (taskID != UUID.Zero) // Prim { SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); if (part == null) @@ -4831,7 +4828,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; // Console.WriteLine("upload request " + Pack.ToString()); // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); - LLUUID temp = LLUUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); + UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); handlerAssetUploadRequest = OnAssetUploadRequest; @@ -5019,7 +5016,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP //Console.WriteLine(Pack.ToString()); /*for (int i = 0; i < update.InventoryData.Length; i++) { - if (update.InventoryData[i].TransactionID != LLUUID.Zero) + if (update.InventoryData[i].TransactionID != UUID.Zero) { AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionId)); if (asset != null) @@ -5244,9 +5241,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.TeleportLandmarkRequest: TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack; - LLUUID lmid = tpReq.Info.LandmarkID; + UUID lmid = tpReq.Info.LandmarkID; AssetLandmark lm; - if (lmid != LLUUID.Zero) + if (lmid != UUID.Zero) { AssetBase lma = m_assetCache.GetAsset(lmid, false); @@ -5441,14 +5438,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP args.AuthBuyerID = parcelPropertiesPacket.ParcelData.AuthBuyerID; args.Category = (Parcel.ParcelCategory)parcelPropertiesPacket.ParcelData.Category; - args.Desc = Helpers.FieldToUTF8String(parcelPropertiesPacket.ParcelData.Desc); + args.Desc = Utils.BytesToString(parcelPropertiesPacket.ParcelData.Desc); args.GroupID = parcelPropertiesPacket.ParcelData.GroupID; args.LandingType = parcelPropertiesPacket.ParcelData.LandingType; args.MediaAutoScale = parcelPropertiesPacket.ParcelData.MediaAutoScale; args.MediaID = parcelPropertiesPacket.ParcelData.MediaID; - args.MediaURL = Helpers.FieldToUTF8String(parcelPropertiesPacket.ParcelData.MediaURL); - args.MusicURL = Helpers.FieldToUTF8String(parcelPropertiesPacket.ParcelData.MusicURL); - args.Name = Helpers.FieldToUTF8String(parcelPropertiesPacket.ParcelData.Name); + args.MediaURL = Utils.BytesToString(parcelPropertiesPacket.ParcelData.MediaURL); + args.MusicURL = Utils.BytesToString(parcelPropertiesPacket.ParcelData.MusicURL); + args.Name = Utils.BytesToString(parcelPropertiesPacket.ParcelData.Name); args.ParcelFlags = parcelPropertiesPacket.ParcelData.ParcelFlags; args.PassHours = parcelPropertiesPacket.ParcelData.PassHours; args.PassPrice = parcelPropertiesPacket.ParcelData.PassPrice; @@ -5504,11 +5501,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP ParcelReturnObjectsPacket parcelReturnObjects = (ParcelReturnObjectsPacket)Pack; - LLUUID[] puserselectedOwnerIDs = new LLUUID[parcelReturnObjects.OwnerIDs.Length]; + UUID[] puserselectedOwnerIDs = new UUID[parcelReturnObjects.OwnerIDs.Length]; for (int parceliterator = 0; parceliterator < parcelReturnObjects.OwnerIDs.Length; parceliterator++) puserselectedOwnerIDs[parceliterator] = parcelReturnObjects.OwnerIDs[parceliterator].OwnerID; - LLUUID[] puserselectedTaskIDs = new LLUUID[parcelReturnObjects.TaskIDs.Length]; + UUID[] puserselectedTaskIDs = new UUID[parcelReturnObjects.TaskIDs.Length]; for (int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++) puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID; @@ -5528,7 +5525,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.EstateOwnerMessage: EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; - switch (Helpers.FieldToUTF8String(messagePacket.MethodData.Method)) + switch (Utils.BytesToString(messagePacket.MethodData.Method)) { case "getinfo": if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false)) @@ -5541,9 +5538,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP { OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter), convertParamStringToBool(messagePacket.ParamList[1].Parameter), convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter), - Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[4].Parameter))), - (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter)), - Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[6].Parameter)), + Convert.ToInt16(Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[4].Parameter))), + (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[5].Parameter)), + Convert.ToInt16(Utils.BytesToString(messagePacket.ParamList[6].Parameter)), convertParamStringToBool(messagePacket.ParamList[7].Parameter), convertParamStringToBool(messagePacket.ParamList[8].Parameter)); } @@ -5554,11 +5551,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP // { // foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) // { -// string s = Helpers.FieldToUTF8String(block.Parameter); +// string s = Utils.BytesToString(block.Parameter); // string[] splitField = s.Split(' '); // if (splitField.Length == 2) // { -// LLUUID tempUUID = new LLUUID(splitField[1]); +// UUID tempUUID = new UUID(splitField[1]); // OnSetEstateTerrainBaseTexture(this, Convert.ToInt16(splitField[0]), tempUUID); // } // } @@ -5569,12 +5566,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP { foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) { - string s = Helpers.FieldToUTF8String(block.Parameter); + string s = Utils.BytesToString(block.Parameter); string[] splitField = s.Split(' '); if (splitField.Length == 2) { Int16 corner = Convert.ToInt16(splitField[0]); - LLUUID textureUUID = new LLUUID(splitField[1]); + UUID textureUUID = new UUID(splitField[1]); OnSetEstateTerrainDetailTexture(this, corner, textureUUID); } @@ -5587,7 +5584,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) { - string s = Helpers.FieldToUTF8String(block.Parameter); + string s = Utils.BytesToString(block.Parameter); string[] splitField = s.Split(' '); if (splitField.Length == 3) { @@ -5615,21 +5612,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP try { string tmp; - tmp = Helpers.FieldToUTF8String(messagePacket.ParamList[0].Parameter); + tmp = Utils.BytesToString(messagePacket.ParamList[0].Parameter); if (!tmp.Contains(".")) tmp += ".00"; float WaterHeight = (float)Convert.ToDecimal(tmp); - tmp = Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter); + tmp = Utils.BytesToString(messagePacket.ParamList[1].Parameter); if (!tmp.Contains(".")) tmp += ".00"; float TerrainRaiseLimit = (float)Convert.ToDecimal(tmp); - tmp = Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter); + tmp = Utils.BytesToString(messagePacket.ParamList[2].Parameter); if (!tmp.Contains(".")) tmp += ".00"; float TerrainLowerLimit = (float)Convert.ToDecimal(tmp); bool UseEstateSun = convertParamStringToBool(messagePacket.ParamList[3].Parameter); bool UseFixedSun = convertParamStringToBool(messagePacket.ParamList[4].Parameter); - float SunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter)); + float SunHour = (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[5].Parameter)); bool UseGlobal = convertParamStringToBool(messagePacket.ParamList[6].Parameter); bool EstateFixedSun = convertParamStringToBool(messagePacket.ParamList[7].Parameter); - float EstateSunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[8].Parameter)); + float EstateSunHour = (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[8].Parameter)); OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseEstateSun, UseFixedSun, SunHour, UseGlobal, EstateFixedSun, EstateSunHour); @@ -5649,7 +5646,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) { float timeSeconds = 0; - Helpers.TryParse(Helpers.FieldToUTF8String(block.Parameter), out timeSeconds); + Utils.TryParseSingle(Utils.BytesToString(block.Parameter), out timeSeconds); timeSeconds = (int)timeSeconds; OnEstateRestartSimRequest(this, (int)timeSeconds); @@ -5661,7 +5658,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) { - LLUUID newCovenantID = new LLUUID(Helpers.FieldToUTF8String(block.Parameter)); + UUID newCovenantID = new UUID(Utils.BytesToString(block.Parameter)); OnEstateChangeCovenantRequest(this, newCovenantID); } } @@ -5669,19 +5666,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP case "estateaccessdelta": // Estate access delta manages the banlist and allow list too. if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false)) { - int estateAccessType = Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter)); - OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice, estateAccessType, new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter))); + int estateAccessType = Convert.ToInt16(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); + OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice, estateAccessType, new UUID(Utils.BytesToString(messagePacket.ParamList[2].Parameter))); } break; case "simulatormessage": if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false)) { - LLUUID invoice = messagePacket.MethodData.Invoice; - LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)); - string SenderName = Helpers.FieldToUTF8String(messagePacket.ParamList[3].Parameter); - string Message = Helpers.FieldToUTF8String(messagePacket.ParamList[4].Parameter); - LLUUID sessionID = messagePacket.AgentData.SessionID; + UUID invoice = messagePacket.MethodData.Invoice; + UUID SenderID = new UUID(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); + string SenderName = Utils.BytesToString(messagePacket.ParamList[3].Parameter); + string Message = Utils.BytesToString(messagePacket.ParamList[4].Parameter); + UUID sessionID = messagePacket.AgentData.SessionID; OnSimulatorBlueBoxMessageRequest(this, invoice, SenderID, sessionID, SenderName, Message); } break; @@ -5690,19 +5687,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP { if (messagePacket.ParamList.Length < 5) break; - LLUUID invoice = messagePacket.MethodData.Invoice; - LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)); - string SenderName = Helpers.FieldToUTF8String(messagePacket.ParamList[3].Parameter); - string Message = Helpers.FieldToUTF8String(messagePacket.ParamList[4].Parameter); - LLUUID sessionID = messagePacket.AgentData.SessionID; + UUID invoice = messagePacket.MethodData.Invoice; + UUID SenderID = new UUID(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); + string SenderName = Utils.BytesToString(messagePacket.ParamList[3].Parameter); + string Message = Utils.BytesToString(messagePacket.ParamList[4].Parameter); + UUID sessionID = messagePacket.AgentData.SessionID; OnEstateBlueBoxMessageRequest(this, invoice, SenderID, sessionID, SenderName, Message); } break; case "setregiondebug": if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false)) { - LLUUID invoice = messagePacket.MethodData.Invoice; - LLUUID SenderID = messagePacket.AgentData.AgentID; + UUID invoice = messagePacket.MethodData.Invoice; + UUID SenderID = messagePacket.AgentData.AgentID; bool scripted = convertParamStringToBool(messagePacket.ParamList[0].Parameter); bool collisionEvents = convertParamStringToBool(messagePacket.ParamList[1].Parameter); bool physics = convertParamStringToBool(messagePacket.ParamList[2].Parameter); @@ -5713,11 +5710,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP case "teleporthomeuser": if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false)) { - LLUUID invoice = messagePacket.MethodData.Invoice; - LLUUID SenderID = messagePacket.AgentData.AgentID; - LLUUID Prey = LLUUID.Zero; + UUID invoice = messagePacket.MethodData.Invoice; + UUID SenderID = messagePacket.AgentData.AgentID; + UUID Prey = UUID.Zero; - Helpers.TryParse(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter), out Prey); + UUID.TryParse(Utils.BytesToString(messagePacket.ParamList[1].Parameter), out Prey); OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey); } @@ -5750,10 +5747,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP case "estatechangeinfo": if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false)) { - LLUUID invoice = messagePacket.MethodData.Invoice; - LLUUID SenderID = messagePacket.AgentData.AgentID; - UInt32 param1 = Convert.ToUInt32(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter)); - UInt32 param2 = Convert.ToUInt32(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)); + UUID invoice = messagePacket.MethodData.Invoice; + UUID SenderID = messagePacket.AgentData.AgentID; + UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); + UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); handlerEstateChangeInfo = OnEstateChangeInfo; if (handlerEstateChangeInfo != null) @@ -5774,7 +5771,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerLandStatRequest = OnLandStatRequest; if (handlerLandStatRequest != null) { - handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Helpers.FieldToUTF8String(lsrp.RequestData.Filter), this); + handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Utils.BytesToString(lsrp.RequestData.Filter), this); } //int parcelID, uint reportType, uint requestflags, string filter @@ -5813,7 +5810,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.RequestGodlikePowers: RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack; RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock; - LLUUID token = rblock.Token; + UUID token = rblock.Token; RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; @@ -6086,7 +6083,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP shape.PathTaperY = addPacket.ObjectData.PathTaperY; shape.PathTwist = addPacket.ObjectData.PathTwist; shape.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; - LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("89556747-24cb-43ed-920b-47caed15465f")); + Primitive.TextureEntry ntex = new Primitive.TextureEntry(new UUID("89556747-24cb-43ed-920b-47caed15465f")); shape.TextureEntry = ntex.ToBytes(); //shape.Textures = ntex; return shape; @@ -6099,7 +6096,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendBlueBoxMessage(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) + public void SendBlueBoxMessage(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message) { if (!ChildAgentStatus()) SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)1, (uint)Util.UnixTimeSinceEpoch()); @@ -6122,7 +6119,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP logReply.AgentData.SessionID = SessionId; logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1]; logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock(); - logReply.InventoryData[0].ItemID = LLUUID.Zero; + logReply.InventoryData[0].ItemID = UUID.Zero; OutPacket(logReply, ThrottleOutPacketType.Task); } @@ -6135,7 +6132,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(healthpacket, ThrottleOutPacketType.Task); } - public void SendAgentOnline(LLUUID[] agentIDs) + public void SendAgentOnline(UUID[] agentIDs) { OnlineNotificationPacket onp = new OnlineNotificationPacket(); OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[agentIDs.Length]; @@ -6150,7 +6147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(onp, ThrottleOutPacketType.Task); } - public void SendAgentOffline(LLUUID[] agentIDs) + public void SendAgentOffline(UUID[] agentIDs) { OfflineNotificationPacket offp = new OfflineNotificationPacket(); OfflineNotificationPacket.AgentBlockBlock[] offpb = new OfflineNotificationPacket.AgentBlockBlock[agentIDs.Length]; @@ -6165,12 +6162,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(offp, ThrottleOutPacketType.Task); } - 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) { AvatarSitResponsePacket avatarSitResponse = new AvatarSitResponsePacket(); avatarSitResponse.SitObject.ID = TargetID; - if (CameraAtOffset != LLVector3.Zero) + if (CameraAtOffset != Vector3.Zero) { avatarSitResponse.SitTransform.CameraAtOffset = CameraAtOffset; avatarSitResponse.SitTransform.CameraEyeOffset = CameraEyeOffset; @@ -6183,7 +6180,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(avatarSitResponse, ThrottleOutPacketType.Task); } - public void SendAdminResponse(LLUUID Token, uint AdminLevel) + public void SendAdminResponse(UUID Token, uint AdminLevel) { GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket(); GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock(); @@ -6210,7 +6207,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP Group.Contribution = GroupMembership[i].contribution; Group.GroupID = GroupMembership[i].GroupID; Group.GroupInsigniaID = GroupMembership[i].GroupPicture; - Group.GroupName = Helpers.StringToField(GroupMembership[i].groupName); + Group.GroupName = Utils.StringToBytes(GroupMembership[i].groupName); Group.GroupPowers = GroupMembership[i].groupPowers; Groups[i] = Group; Groupupdate.GroupData = Groups; @@ -6220,13 +6217,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(Groupupdate, ThrottleOutPacketType.Task); } - public void SendGroupNameReply(LLUUID groupLLUID, string GroupName) + public void SendGroupNameReply(UUID groupLLUID, string GroupName) { UUIDGroupNameReplyPacket pack = new UUIDGroupNameReplyPacket(); UUIDGroupNameReplyPacket.UUIDNameBlockBlock[] uidnameblock = new UUIDGroupNameReplyPacket.UUIDNameBlockBlock[1]; UUIDGroupNameReplyPacket.UUIDNameBlockBlock uidnamebloc = new UUIDGroupNameReplyPacket.UUIDNameBlockBlock(); uidnamebloc.ID = groupLLUID; - uidnamebloc.GroupName = Helpers.StringToField(GroupName); + uidnamebloc.GroupName = Utils.StringToBytes(GroupName); uidnameblock[0] = uidnamebloc; pack.UUIDNameBlock = uidnameblock; OutPacket(pack, ThrottleOutPacketType.Task); @@ -6251,15 +6248,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP lsrepdb.Score = lsrpia[i].Score; lsrepdb.TaskID = lsrpia[i].TaskID; lsrepdb.TaskLocalID = lsrpia[i].TaskLocalID; - lsrepdb.TaskName = Helpers.StringToField(lsrpia[i].TaskName); - lsrepdb.OwnerName = Helpers.StringToField(lsrpia[i].OwnerName); + lsrepdb.TaskName = Utils.StringToBytes(lsrpia[i].TaskName); + lsrepdb.OwnerName = Utils.StringToBytes(lsrpia[i].OwnerName); lsrepdba[i] = lsrepdb; } lsrp.ReportData = lsrepdba; OutPacket(lsrp, ThrottleOutPacketType.Task); } - public void SendScriptRunningReply(LLUUID objectID, LLUUID itemID, bool running) + public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running) { ScriptRunningReplyPacket scriptRunningReply = new ScriptRunningReplyPacket(); scriptRunningReply.Script.ObjectID = objectID; @@ -6310,8 +6307,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP else { int processedLength = 0; - // libsecondlife hardcodes 1500 as the maximum data chunk size - int maxChunkSize = 1250; + int maxChunkSize = Settings.MAX_PACKET_SIZE - 100; int packetNumber = 0; while (processedLength < req.AssetInf.Data.Length) @@ -6378,17 +6374,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(commandMessagePacket, ThrottleOutPacketType.Unknown); } - 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) { ParcelMediaUpdatePacket updatePacket = new ParcelMediaUpdatePacket(); - updatePacket.DataBlock.MediaURL = Helpers.StringToField(mediaUrl); + updatePacket.DataBlock.MediaURL = Utils.StringToBytes(mediaUrl); updatePacket.DataBlock.MediaID = mediaTextureID; updatePacket.DataBlock.MediaAutoScale = autoScale; - updatePacket.DataBlockExtended.MediaType = Helpers.StringToField(mediaType); - updatePacket.DataBlockExtended.MediaDesc = Helpers.StringToField(mediaDesc); + updatePacket.DataBlockExtended.MediaType = Utils.StringToBytes(mediaType); + updatePacket.DataBlockExtended.MediaDesc = Utils.StringToBytes(mediaDesc); updatePacket.DataBlockExtended.MediaWidth = mediaWidth; updatePacket.DataBlockExtended.MediaWidth = mediaHeight; updatePacket.DataBlockExtended.MediaLoop = mediaLoop; @@ -6401,7 +6397,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region Camera - public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary parameters) + public void SendSetFollowCamProperties (UUID objectID, SortedDictionary parameters) { SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties); packet.ObjectData.ObjectID = objectID; @@ -6419,7 +6415,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(packet, ThrottleOutPacketType.Task); } - public void SendClearFollowCamProperties (LLUUID objectID) + public void SendClearFollowCamProperties (UUID objectID) { ClearFollowCamPropertiesPacket packet = (ClearFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ClearFollowCamProperties); packet.ObjectData.ObjectID = objectID; @@ -6428,21 +6424,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP #endregion - public void SendRegionHandle(LLUUID regionID, ulong handle) { + public void SendRegionHandle(UUID regionID, ulong handle) { RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)PacketPool.Instance.GetPacket(PacketType.RegionIDAndHandleReply); reply.ReplyBlock.RegionID = regionID; reply.ReplyBlock.RegionHandle = handle; OutPacket(reply, ThrottleOutPacketType.Land); } - 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) { ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); reply.AgentData.AgentID = m_agentId; reply.Data.ParcelID = parcelID; reply.Data.OwnerID = land.OwnerID; - reply.Data.Name = Helpers.StringToField(land.Name != null ? land.Name : ""); - reply.Data.Desc = Helpers.StringToField(land.Description != null ? land.Description : ""); + reply.Data.Name = Utils.StringToBytes(land.Name); + reply.Data.Desc = Utils.StringToBytes(land.Description); reply.Data.ActualArea = land.Area; reply.Data.BillableArea = land.Area; // TODO: what is this? @@ -6451,15 +6447,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP ((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + ((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); - LLVector3 pos = land.UserLocation; - if (pos.Equals(LLVector3.Zero)) + Vector3 pos = land.UserLocation; + if (pos.Equals(Vector3.Zero)) { pos = (land.AABBMax + land.AABBMin) * 0.5f; } reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; reply.Data.GlobalZ = pos.Z; - reply.Data.SimName = Helpers.StringToField(info.RegionName != null ? info.RegionName : ""); + reply.Data.SimName = Utils.StringToBytes(info.RegionName); reply.Data.SnapshotID = land.SnapshotID; reply.Data.Dwell = 0; // TODO: not implemented yet reply.Data.SalePrice = land.SalePrice; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 551e7ab..eddee10 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -33,8 +33,8 @@ using System.Net.Sockets; using System.Threading; using System.Timers; using System.Reflection; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using Timer = System.Timers.Timer; using OpenSim.Framework; using OpenSim.Region.ClientStack.LindenUDP; @@ -44,7 +44,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes); public delegate void PacketDrop(Packet pack, Object id); - public delegate bool SynchronizeClientHandler(IScene scene, Packet packet, LLUUID agentID, ThrottleOutPacketType throttlePacketType); + public delegate bool SynchronizeClientHandler(IScene scene, Packet packet, UUID agentID, ThrottleOutPacketType throttlePacketType); public interface IPacketHandler { @@ -259,9 +259,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP // acks being appended to the payload, just don't send // any with them until libsl is fixed. // - if (packet is libsecondlife.Packets.ViewerEffectPacket) + if (packet is OpenMetaverse.Packets.ViewerEffectPacket) return; - if (packet is libsecondlife.Packets.SimStatsPacket) + if (packet is OpenMetaverse.Packets.SimStatsPacket) return; // Add acks to outgoing packets diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 94f7214..1e369ec 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -29,8 +29,8 @@ using System; using System.Collections.Generic; using System.Threading; using System.Timers; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Framework.Statistics; using OpenSim.Framework.Statistics.Interfaces; @@ -82,9 +82,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP // private long ThrottleInterval; private Timer throttleTimer; - private LLUUID m_agentId; + private UUID m_agentId; - public LLPacketQueue(LLUUID agentId) + public LLPacketQueue(UUID agentId) { // While working on this, the BlockingQueue had me fooled for a bit. // The Blocking queue causes the thread to stop until there's something @@ -479,7 +479,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = 0; i < 7; i++) Array.Reverse(throttle, j + i*singlefloat, singlefloat); - // values gotten from libsecondlife.org/wiki/Throttle. Thanks MW_ + // values gotten from OpenMetaverse.org/wiki/Throttle. Thanks MW_ // bytes // Convert to integer, since.. the full fp space isn't used. tResend = (int) BitConverter.ToSingle(throttle, j); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs index 2a3f2e1..07d3c45 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs @@ -27,8 +27,8 @@ using System.Net; using System.Net.Sockets; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Region.ClientStack.LindenUDP; @@ -73,7 +73,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, IScene scene, AssetCache assetCache, LLPacketServer packServer, AgentCircuitManager authenSessions, - LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP) + UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) { return new LLClientView(remoteEP, scene, assetCache, packServer, authenSessions, agentId, sessionId, circuitCode, proxyEP); @@ -147,4 +147,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP client.Close(false); } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLQueItem.cs b/OpenSim/Region/ClientStack/LindenUDP/LLQueItem.cs index e836dd7..3bb0b7a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLQueItem.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLQueItem.cs @@ -26,7 +26,7 @@ */ using System; -using libsecondlife.Packets; +using OpenMetaverse.Packets; using OpenSim.Framework; namespace OpenSim.Region.ClientStack.LindenUDP diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 8dec185..2d57d7f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -31,7 +31,7 @@ using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Reflection; -using libsecondlife.Packets; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -136,7 +136,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Return new port // This because in Grid mode it is not really important what port the region listens to as long as it is correctly registered. - // So the option allow_alternate_ports="true" was added to default.xml + // So the option allow_alternate_ports="true" was added to default.Xml port = (uint)(listenPort - proxyPortOffset); } diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 91f7472..d1572fd 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -28,7 +28,7 @@ using System.Collections.Generic; using System.Net; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -138,7 +138,7 @@ namespace OpenSim.Region.ClientStack // TODO: Remove this cruft once MasterAvatar is fully deprecated //Master Avatar Setup UserProfileData masterAvatar; - if (scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero) + if (scene.RegionInfo.MasterAvatarAssignedUUID != UUID.Zero) { masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID); scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName; @@ -160,7 +160,7 @@ namespace OpenSim.Region.ClientStack else { m_log.Info("[PARCEL]: No master avatar found, using null."); - scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero; + scene.RegionInfo.MasterAvatarAssignedUUID = UUID.Zero; } scene.LoadPrimsFromStorage(regionInfo.originRegionID); diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index a2c3c2c..aabddc6 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -29,7 +29,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications; @@ -177,7 +177,7 @@ namespace OpenSim.Region.Communications.Local return null; } - public RegionInfo RequestNeighbourInfo(LLUUID regionID) + public RegionInfo RequestNeighbourInfo(UUID regionID) { // TODO add a dictionary for faster lookup foreach (RegionInfo info in m_regions.Values) @@ -229,7 +229,7 @@ namespace OpenSim.Region.Communications.Local return mapBlocks; } - public bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) + public bool TellRegionToCloseChildConnection(ulong regionHandle, UUID agentID) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -306,7 +306,7 @@ namespace OpenSim.Region.Communications.Local return false; } - public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) + public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, UUID agentID) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -338,7 +338,7 @@ namespace OpenSim.Region.Communications.Local return false; } - public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData, int XMLMethod) + public bool InformRegionOfPrimCrossing(ulong regionHandle, UUID primID, string objData, int XMLMethod) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -355,7 +355,7 @@ namespace OpenSim.Region.Communications.Local /// /// /// - public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) + public bool ExpectAvatarCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -366,7 +366,7 @@ namespace OpenSim.Region.Communications.Local return false; } - public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical) + public bool ExpectPrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -376,7 +376,7 @@ namespace OpenSim.Region.Communications.Local return false; } - public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) + public bool AcknowledgeAgentCrossed(ulong regionHandle, UUID agentId) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -385,7 +385,7 @@ namespace OpenSim.Region.Communications.Local return false; } - public bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primID) + public bool AcknowledgePrimCrossed(ulong regionHandle, UUID primID) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -430,7 +430,7 @@ namespace OpenSim.Region.Communications.Local } } - public void TriggerLogOffUser(ulong regionHandle, LLUUID agentID, LLUUID RegionSecret, string message) + public void TriggerLogOffUser(ulong regionHandle, UUID agentID, UUID RegionSecret, string message) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -440,7 +440,7 @@ namespace OpenSim.Region.Communications.Local } } - public void TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData, int XMLMethod) + public void TriggerExpectPrim(ulong regionHandle, UUID primID, string objData, int XMLMethod) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -461,7 +461,7 @@ namespace OpenSim.Region.Communications.Local } } - public bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) + public bool TriggerExpectAvatarCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) { if (m_regionListeners.ContainsKey(regionHandle)) { @@ -472,7 +472,7 @@ namespace OpenSim.Region.Communications.Local return false; } - public bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical) + public bool TriggerExpectPrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical) { if (m_regionListeners.ContainsKey(regionHandle)) { diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index 1d8ea53..5cb33cc 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs @@ -27,7 +27,7 @@ using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications; @@ -44,7 +44,7 @@ namespace OpenSim.Region.Communications.Local private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) + public override void RequestInventoryForUser(UUID userID, InventoryReceiptCallback callback) { m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID); @@ -60,7 +60,7 @@ namespace OpenSim.Region.Communications.Local // Need to retrieve the root folder on the first pass foreach (InventoryFolderBase folder in skeletonFolders) { - if (folder.ParentID == LLUUID.Zero) + if (folder.ParentID == UUID.Zero) { rootFolder = new InventoryFolderImpl(folder); folders.Add(rootFolder); @@ -88,7 +88,7 @@ namespace OpenSim.Region.Communications.Local callback(folders, items); } - public override bool HasInventoryForUser(LLUUID userID) + public override bool HasInventoryForUser(UUID userID) { InventoryFolderBase root = RequestRootFolder(userID); if (root == null) diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index aeb9ae0..518ba09 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -30,7 +30,7 @@ using System.Collections; using System.Collections.Generic; using System.Reflection; using System.Text.RegularExpressions; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications; @@ -246,9 +246,9 @@ namespace OpenSim.Region.Communications.Local _login.SecureSession = response.SecureSessionID; _login.CircuitCode = (uint) response.CircuitCode; if (specificStartLocation) - _login.StartPos = new LLVector3(locX, locY, locZ); + _login.StartPos = new Vector3(locX, locY, locZ); else - _login.StartPos = new LLVector3(128, 128, 128); + _login.StartPos = new Vector3(128, 128, 128); _login.CapsPath = capsPath; m_log.InfoFormat( @@ -282,7 +282,7 @@ namespace OpenSim.Region.Communications.Local } // See LoginService - protected override InventoryData GetInventorySkeleton(LLUUID userID) + protected override InventoryData GetInventorySkeleton(UUID userID) { List folders = m_Parent.InterServiceInventoryService.GetInventorySkeleton(userID); @@ -293,12 +293,12 @@ namespace OpenSim.Region.Communications.Local folders = m_Parent.InterServiceInventoryService.GetInventorySkeleton(userID); } - LLUUID rootID = LLUUID.Zero; + UUID rootID = UUID.Zero; ArrayList AgentInventoryArray = new ArrayList(); Hashtable TempHash; foreach (InventoryFolderBase InvFolder in folders) { - if (InvFolder.ParentID == LLUUID.Zero) + if (InvFolder.ParentID == UUID.Zero) { rootID = InvFolder.ID; } diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 2ee7981..c0887df 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -26,7 +26,7 @@ */ using System; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; @@ -88,7 +88,7 @@ namespace OpenSim.Region.Communications.Local return profile; } - public override UserProfileData SetupMasterUser(LLUUID uuid) + public override UserProfileData SetupMasterUser(UUID uuid) { UserProfileData data = GetUserProfile(uuid); if (data == null) diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index da2e4a2..1dd4219 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -37,7 +37,7 @@ using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; using System.Security.Authentication; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nwc.XmlRpc; using OpenSim.Framework; @@ -125,7 +125,7 @@ namespace OpenSim.Region.Communications.OGS1 GridParams["server_uri"] = regionInfo.ServerURI; GridParams["region_secret"] = regionInfo.regionSecret; - if (regionInfo.MasterAvatarAssignedUUID != LLUUID.Zero) + if (regionInfo.MasterAvatarAssignedUUID != UUID.Zero) GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString(); else GridParams["master_avatar_uuid"] = regionInfo.EstateSettings.EstateOwner.ToString(); @@ -275,7 +275,7 @@ namespace OpenSim.Region.Communications.OGS1 sri.HttpPort = Convert.ToUInt32(neighbourData["http_port"]); } - sri.RegionID = new LLUUID((string) neighbourData["uuid"]); + sri.RegionID = new UUID((string) neighbourData["uuid"]); neighbours.Add(sri); } @@ -294,7 +294,7 @@ namespace OpenSim.Region.Communications.OGS1 /// FIXME: Might be nicer to return a proper exception here since we could inform the client more about the /// nature of the faiulre. /// - public RegionInfo RequestNeighbourInfo(LLUUID Region_UUID) + public RegionInfo RequestNeighbourInfo(UUID Region_UUID) { RegionInfo regionInfo; Hashtable requestData = new Hashtable(); @@ -344,7 +344,7 @@ namespace OpenSim.Region.Communications.OGS1 regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); } - regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]); + regionInfo.RegionID = new UUID((string) responseData["region_UUID"]); regionInfo.RegionName = (string) responseData["region_name"]; if (requestData.ContainsKey("regionHandle")) @@ -407,7 +407,7 @@ namespace OpenSim.Region.Communications.OGS1 regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); } - regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]); + regionInfo.RegionID = new UUID((string) responseData["region_UUID"]); regionInfo.RegionName = (string) responseData["region_name"]; lock (m_remoteRegionInfoCache) @@ -475,7 +475,7 @@ namespace OpenSim.Region.Communications.OGS1 regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); } - regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]); + regionInfo.RegionID = new UUID((string) responseData["region_UUID"]); regionInfo.RegionName = (string) responseData["region_name"]; if (!m_remoteRegionInfoCache.ContainsKey(regionInfo.RegionHandle)) @@ -533,7 +533,7 @@ namespace OpenSim.Region.Communications.OGS1 neighbour.Access = Convert.ToByte(n["access"]); neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]); neighbour.WaterHeight = Convert.ToByte(n["water-height"]); - neighbour.MapImageId = new LLUUID((string) n["map-image-id"]); + neighbour.MapImageId = new UUID((string) n["map-image-id"]); neighbours.Add(neighbour); } @@ -606,11 +606,11 @@ namespace OpenSim.Region.Communications.OGS1 m_log.Debug("[CONNECTION DEBUGGING]: Expect User called, starting agent setup ... "); Hashtable requestData = (Hashtable) request.Params[0]; AgentCircuitData agentData = new AgentCircuitData(); - agentData.SessionID = new LLUUID((string) requestData["session_id"]); - agentData.SecureSessionID = new LLUUID((string) requestData["secure_session_id"]); + agentData.SessionID = new UUID((string) requestData["session_id"]); + agentData.SecureSessionID = new UUID((string) requestData["secure_session_id"]); agentData.firstname = (string) requestData["firstname"]; agentData.lastname = (string) requestData["lastname"]; - agentData.AgentID = new LLUUID((string) requestData["agent_id"]); + agentData.AgentID = new UUID((string) requestData["agent_id"]); agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); agentData.CapsPath = (string) requestData["caps_path"]; @@ -623,7 +623,7 @@ namespace OpenSim.Region.Communications.OGS1 { m_log.Debug("[CONNECTION DEBUGGING]: Main agent detected"); agentData.startpos = - new LLVector3((float)Convert.ToDecimal((string)requestData["startpos_x"]), + new Vector3((float)Convert.ToDecimal((string)requestData["startpos_x"]), (float)Convert.ToDecimal((string)requestData["startpos_y"]), (float)Convert.ToDecimal((string)requestData["startpos_z"])); agentData.child = false; @@ -684,10 +684,10 @@ namespace OpenSim.Region.Communications.OGS1 m_log.Debug("[CONNECTION DEBUGGING]: LogOff User Called "); Hashtable requestData = (Hashtable)request.Params[0]; string message = (string)requestData["message"]; - LLUUID agentID = LLUUID.Zero; - LLUUID RegionSecret = LLUUID.Zero; - Helpers.TryParse((string)requestData["agent_id"], out agentID); - Helpers.TryParse((string)requestData["region_secret"], out RegionSecret); + UUID agentID = UUID.Zero; + UUID RegionSecret = UUID.Zero; + UUID.TryParse((string)requestData["agent_id"], out agentID); + UUID.TryParse((string)requestData["region_secret"], out RegionSecret); ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]); @@ -1072,7 +1072,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData, int XMLMethod) + public bool InformRegionOfPrimCrossing(ulong regionHandle, UUID primID, string objData, int XMLMethod) { int failures = 0; lock (m_deadRegionCache) @@ -1106,7 +1106,7 @@ namespace OpenSim.Region.Communications.OGS1 if (remObject != null) { - retValue = remObject.InformRegionOfPrimCrossing(regionHandle, primID.UUID, objData, XMLMethod); + retValue = remObject.InformRegionOfPrimCrossing(regionHandle, primID.Guid, objData, XMLMethod); } else { @@ -1168,7 +1168,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) + public bool ExpectAvatarCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) { RegionInfo[] regions = m_regionsOnInstance.ToArray(); bool banned = false; @@ -1212,7 +1212,7 @@ namespace OpenSim.Region.Communications.OGS1 if (remObject != null) { retValue = - remObject.ExpectAvatarCrossing(regionHandle, agentID.UUID, new sLLVector3(position), + remObject.ExpectAvatarCrossing(regionHandle, agentID.Guid, position, isFlying); } else @@ -1246,7 +1246,7 @@ namespace OpenSim.Region.Communications.OGS1 } } - public bool ExpectPrimCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isPhysical) + public bool ExpectPrimCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isPhysical) { RegionInfo regInfo = null; try @@ -1269,7 +1269,7 @@ namespace OpenSim.Region.Communications.OGS1 if (remObject != null) { retValue = - remObject.ExpectAvatarCrossing(regionHandle, agentID.UUID, new sLLVector3(position), + remObject.ExpectAvatarCrossing(regionHandle, agentID.Guid, position, isPhysical); } else @@ -1322,7 +1322,7 @@ namespace OpenSim.Region.Communications.OGS1 } } - public bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) + public bool TellRegionToCloseChildConnection(ulong regionHandle, UUID agentID) { RegionInfo regInfo = null; try @@ -1345,7 +1345,7 @@ namespace OpenSim.Region.Communications.OGS1 if (remObject != null) { // retValue = - remObject.TellRegionToCloseChildConnection(regionHandle, agentID.UUID); + remObject.TellRegionToCloseChildConnection(regionHandle, agentID.Guid); } else { @@ -1421,12 +1421,12 @@ namespace OpenSim.Region.Communications.OGS1 } } - public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) + public bool AcknowledgeAgentCrossed(ulong regionHandle, UUID agentId) { return m_localBackend.AcknowledgeAgentCrossed(regionHandle, agentId); } - public bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primId) + public bool AcknowledgePrimCrossed(ulong regionHandle, UUID primId) { return m_localBackend.AcknowledgePrimCrossed(regionHandle, primId); } @@ -1509,7 +1509,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool IncomingPrim(ulong regionHandle, LLUUID primID, string objData, int XMLMethod) + public bool IncomingPrim(ulong regionHandle, UUID primID, string objData, int XMLMethod) { // Is this necessary? try @@ -1532,7 +1532,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) + public bool TriggerExpectAvatarCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) { try { @@ -1545,7 +1545,7 @@ namespace OpenSim.Region.Communications.OGS1 } } - public bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isPhysical) + public bool TriggerExpectPrimCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isPhysical) { try { @@ -1558,7 +1558,7 @@ namespace OpenSim.Region.Communications.OGS1 } } - public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) + public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, UUID agentID) { try { @@ -1692,18 +1692,18 @@ namespace OpenSim.Region.Communications.OGS1 hash = (Hashtable)response.Value; try { landData = new LandData(); - landData.AABBMax = LLVector3.Parse((string)hash["AABBMax"]); - landData.AABBMin = LLVector3.Parse((string)hash["AABBMin"]); + landData.AABBMax = Vector3.Parse((string)hash["AABBMax"]); + landData.AABBMin = Vector3.Parse((string)hash["AABBMin"]); landData.Area = Convert.ToInt32(hash["Area"]); landData.AuctionID = Convert.ToUInt32(hash["AuctionID"]); landData.Description = (string)hash["Description"]; landData.Flags = Convert.ToUInt32(hash["Flags"]); - landData.GlobalID = new LLUUID((string)hash["GlobalID"]); + landData.GlobalID = new UUID((string)hash["GlobalID"]); landData.Name = (string)hash["Name"]; - landData.OwnerID = new LLUUID((string)hash["OwnerID"]); + landData.OwnerID = new UUID((string)hash["OwnerID"]); landData.SalePrice = Convert.ToInt32(hash["SalePrice"]); - landData.SnapshotID = new LLUUID((string)hash["SnapshotID"]); - landData.UserLocation = LLVector3.Parse((string)hash["UserLocation"]); + landData.SnapshotID = new UUID((string)hash["SnapshotID"]); + landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]); m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name); } catch (Exception e) @@ -1739,7 +1739,7 @@ namespace OpenSim.Region.Communications.OGS1 if (landData != null) { // for now, only push out the data we need for answering a ParcelInfoReqeust - // FIXME: these Replace calls are necessary as LLVector3.Parse can't parse vectors with spaces in them. Can be removed as soon as we switch to a newer version + // FIXME: these Replace calls are necessary as Vector3.Parse can't parse vectors with spaces in them. Can be removed as soon as we switch to a newer version hash["AABBMax"] = landData.AABBMax.ToString().Replace(" ", ""); hash["AABBMin"] = landData.AABBMin.ToString().Replace(" ", ""); hash["Area"] = landData.Area.ToString(); diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs index 8285fb1..1f0c067 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs @@ -28,7 +28,7 @@ using System; using System.Reflection; using System.Runtime.Remoting; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; @@ -36,17 +36,17 @@ namespace OpenSim.Region.Communications.OGS1 { public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData); - public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); + public delegate bool ExpectArrival(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying); - public delegate bool InformRegionPrimGroup(ulong regionHandle, LLUUID primID, LLVector3 Positon, bool isPhysical); + public delegate bool InformRegionPrimGroup(ulong regionHandle, UUID primID, Vector3 Positon, bool isPhysical); - public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData, int XMLMethod); + public delegate bool PrimGroupArrival(ulong regionHandle, UUID primID, string objData, int XMLMethod); public delegate bool RegionUp(RegionUpData region, ulong regionhandle); public delegate bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate childUpdate); - public delegate bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID); + public delegate bool TellRegionToCloseChildConnection(ulong regionHandle, UUID agentID); public sealed class InterRegionSingleton { @@ -112,7 +112,7 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) + public bool ExpectAvatarCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) { handlerArrival = OnArrival; if (handlerArrival != null) @@ -122,7 +122,7 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool InformRegionPrim(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical) + public bool InformRegionPrim(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical) { handlerPrimGroupNear = OnPrimGroupNear; if (handlerPrimGroupNear != null) @@ -132,7 +132,7 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, string objData, int XMLMethod) + public bool ExpectPrimCrossing(ulong regionHandle, UUID primID, string objData, int XMLMethod) { handlerPrimGroupArrival = OnPrimGroupArrival; if (handlerPrimGroupArrival != null) @@ -142,7 +142,7 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) + public bool TellRegionToCloseChildConnection(ulong regionHandle, UUID agentID) { handlerTellRegionToCloseChildConnection = OnTellRegionToCloseChildConnection; if (handlerTellRegionToCloseChildConnection != null) @@ -202,13 +202,13 @@ namespace OpenSim.Region.Communications.OGS1 } - public bool ExpectAvatarCrossing(ulong regionHandle, Guid agentID, sLLVector3 position, bool isFlying) + public bool ExpectAvatarCrossing(ulong regionHandle, Guid agentID, Vector3 position, bool isFlying) { try { return - InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, new LLUUID(agentID), - new LLVector3(position.x, position.y, position.z), + InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, new UUID(agentID), + position, isFlying); } catch (RemotingException e) @@ -218,13 +218,13 @@ namespace OpenSim.Region.Communications.OGS1 } } - public bool InformRegionPrim(ulong regionHandle, Guid SceneObjectGroupID, sLLVector3 position, bool isPhysical) + public bool InformRegionPrim(ulong regionHandle, Guid SceneObjectGroupID, Vector3 position, bool isPhysical) { try { return - InterRegionSingleton.Instance.InformRegionPrim(regionHandle, new LLUUID(SceneObjectGroupID), - new LLVector3(position.x, position.y, position.z), + InterRegionSingleton.Instance.InformRegionPrim(regionHandle, new UUID(SceneObjectGroupID), + position, isPhysical); } catch (RemotingException e) @@ -238,7 +238,7 @@ namespace OpenSim.Region.Communications.OGS1 { try { - return InterRegionSingleton.Instance.ExpectPrimCrossing(regionHandle, new LLUUID(primID), objData, XMLMethod); + return InterRegionSingleton.Instance.ExpectPrimCrossing(regionHandle, new UUID(primID), objData, XMLMethod); } catch (RemotingException e) { @@ -251,7 +251,7 @@ namespace OpenSim.Region.Communications.OGS1 { try { - return InterRegionSingleton.Instance.TellRegionToCloseChildConnection(regionHandle, new LLUUID(agentID)); + return InterRegionSingleton.Instance.TellRegionToCloseChildConnection(regionHandle, new UUID(agentID)); } catch (RemotingException) { diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 2828928..b9e8394 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -29,7 +29,7 @@ using System; using System.Collections.Generic; using System.Net; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications; @@ -46,8 +46,8 @@ namespace OpenSim.Region.Communications.OGS1 private string _inventoryServerUrl; private Uri m_Uri; - private Dictionary m_RequestingInventory - = new Dictionary(); + private Dictionary m_RequestingInventory + = new Dictionary(); public OGS1InventoryService(string inventoryServerUrl) { @@ -67,7 +67,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) + public void RequestInventoryForUser(UUID userID, InventoryReceiptCallback callback) { if (!m_RequestingInventory.ContainsKey(userID)) { @@ -83,7 +83,7 @@ namespace OpenSim.Region.Communications.OGS1 = new RestObjectPosterResponse(); requester.ResponseCallback = InventoryResponse; - requester.BeginPostObject(_inventoryServerUrl + "/GetInventory/", userID.UUID); + requester.BeginPostObject(_inventoryServerUrl + "/GetInventory/", userID.Guid); } catch (WebException e) { @@ -106,7 +106,7 @@ namespace OpenSim.Region.Communications.OGS1 /// private void InventoryResponse(InventoryCollection response) { - LLUUID userID = response.UserID; + UUID userID = response.UserID; if (m_RequestingInventory.ContainsKey(userID)) { m_log.InfoFormat("[OGS1 INVENTORY SERVICE]: " + @@ -121,7 +121,7 @@ namespace OpenSim.Region.Communications.OGS1 foreach (InventoryFolderBase folder in response.Folders) { - if (folder.ParentID == LLUUID.Zero) + if (folder.ParentID == UUID.Zero) { rootFolder = new InventoryFolderImpl(folder); folders.Add(rootFolder); @@ -296,12 +296,12 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool HasInventoryForUser(LLUUID userID) + public bool HasInventoryForUser(UUID userID) { return false; } - public InventoryFolderBase RequestRootFolder(LLUUID userID) + public InventoryFolderBase RequestRootFolder(UUID userID) { return null; } diff --git a/OpenSim/Region/Communications/OGS1/OGS1SecureInventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1SecureInventoryService.cs index 26521ab..c690def 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1SecureInventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1SecureInventoryService.cs @@ -29,7 +29,7 @@ using System; using System.Collections.Generic; using System.Net; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications; @@ -46,8 +46,8 @@ namespace OpenSim.Region.Communications.OGS1 private string _inventoryServerUrl; private Uri m_Uri; - private Dictionary m_RequestingInventory - = new Dictionary(); + private Dictionary m_RequestingInventory + = new Dictionary(); public OGS1SecureInventoryService(string inventoryServerUrl) { @@ -67,7 +67,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public void RequestInventoryForUser(LLUUID userID, LLUUID session_id, InventoryReceiptCallback callback) + public void RequestInventoryForUser(UUID userID, UUID session_id, InventoryReceiptCallback callback) { if (!m_RequestingInventory.ContainsKey(userID)) { @@ -83,7 +83,7 @@ namespace OpenSim.Region.Communications.OGS1 = new RestSessionObjectPosterResponse(); requester.ResponseCallback = InventoryResponse; - requester.BeginPostObject(_inventoryServerUrl + "/GetInventory/", userID.UUID, session_id.ToString(), userID.ToString()); + requester.BeginPostObject(_inventoryServerUrl + "/GetInventory/", userID.Guid, session_id.ToString(), userID.ToString()); } catch (WebException e) { @@ -106,7 +106,7 @@ namespace OpenSim.Region.Communications.OGS1 /// private void InventoryResponse(InventoryCollection response) { - LLUUID userID = response.UserID; + UUID userID = response.UserID; if (m_RequestingInventory.ContainsKey(userID)) { m_log.InfoFormat("[OGS1 INVENTORY SERVICE]: " + @@ -121,7 +121,7 @@ namespace OpenSim.Region.Communications.OGS1 foreach (InventoryFolderBase folder in response.Folders) { - if (folder.ParentID == LLUUID.Zero) + if (folder.ParentID == UUID.Zero) { rootFolder = new InventoryFolderImpl(folder); folders.Add(rootFolder); @@ -166,7 +166,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool AddFolder(InventoryFolderBase folder, LLUUID session_id) + public bool AddFolder(InventoryFolderBase folder, UUID session_id) { try { @@ -186,7 +186,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool UpdateFolder(InventoryFolderBase folder, LLUUID session_id) + public bool UpdateFolder(InventoryFolderBase folder, UUID session_id) { try { @@ -206,7 +206,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool MoveFolder(InventoryFolderBase folder, LLUUID session_id) + public bool MoveFolder(InventoryFolderBase folder, UUID session_id) { try { @@ -225,7 +225,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool PurgeFolder(InventoryFolderBase folder, LLUUID session_id) + public bool PurgeFolder(InventoryFolderBase folder, UUID session_id) { try { @@ -244,7 +244,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool AddItem(InventoryItemBase item, LLUUID session_id) + public bool AddItem(InventoryItemBase item, UUID session_id) { try { @@ -261,7 +261,7 @@ namespace OpenSim.Region.Communications.OGS1 } // TODO: this is a temporary workaround, the UpdateInventoryItem method need to be implemented - public bool UpdateItem(InventoryItemBase item, LLUUID session_id) + public bool UpdateItem(InventoryItemBase item, UUID session_id) { try { @@ -280,7 +280,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public bool DeleteItem(InventoryItemBase item, LLUUID session_id) + public bool DeleteItem(InventoryItemBase item, UUID session_id) { try { @@ -296,12 +296,12 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool HasInventoryForUser(LLUUID userID) + public bool HasInventoryForUser(UUID userID) { return false; } - public InventoryFolderBase RequestRootFolder(LLUUID userID) + public InventoryFolderBase RequestRootFolder(UUID userID) { return null; } diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 2223aeb..317be13 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -31,7 +31,7 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using System.Text.RegularExpressions; -using libsecondlife; +using OpenMetaverse; using log4net; using Nwc.XmlRpc; using OpenSim.Framework; @@ -64,27 +64,27 @@ namespace OpenSim.Region.Communications.OGS1 UserProfileData userData = new UserProfileData(); userData.FirstName = (string) data["firstname"]; userData.SurName = (string) data["lastname"]; - userData.ID = new LLUUID((string) data["uuid"]); + userData.ID = new UUID((string) data["uuid"]); userData.UserInventoryURI = (string) data["server_inventory"]; userData.UserAssetURI = (string) data["server_asset"]; userData.FirstLifeAboutText = (string) data["profile_firstlife_about"]; - userData.FirstLifeImage = new LLUUID((string) data["profile_firstlife_image"]); + userData.FirstLifeImage = new UUID((string) data["profile_firstlife_image"]); userData.CanDoMask = Convert.ToUInt32((string) data["profile_can_do"]); userData.WantDoMask = Convert.ToUInt32(data["profile_want_do"]); userData.AboutText = (string)data["profile_about"]; - userData.Image = new LLUUID((string) data["profile_image"]); + userData.Image = new UUID((string) data["profile_image"]); userData.LastLogin = Convert.ToInt32((string) data["profile_lastlogin"]); userData.HomeRegion = Convert.ToUInt64((string) data["home_region"]); if (data.Contains("home_region_id")) - userData.HomeRegionID = new LLUUID((string)data["home_region_id"]); + userData.HomeRegionID = new UUID((string)data["home_region_id"]); else - userData.HomeRegionID = LLUUID.Zero; + userData.HomeRegionID = UUID.Zero; userData.HomeLocation = - new LLVector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]), + new Vector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]), (float) Convert.ToDecimal((string) data["home_coordinates_y"]), (float) Convert.ToDecimal((string) data["home_coordinates_z"])); userData.HomeLookAt = - new LLVector3((float) Convert.ToDecimal((string) data["home_look_x"]), + new Vector3((float) Convert.ToDecimal((string) data["home_look_x"]), (float) Convert.ToDecimal((string) data["home_look_y"]), (float) Convert.ToDecimal((string) data["home_look_z"])); if (data.Contains("user_flags")) @@ -100,9 +100,9 @@ namespace OpenSim.Region.Communications.OGS1 userData.CustomType = ""; if (data.Contains("partner")) - userData.Partner = new LLUUID((string) data["partner"]); + userData.Partner = new UUID((string) data["partner"]); else - userData.Partner = LLUUID.Zero; + userData.Partner = UUID.Zero; return userData; } @@ -112,7 +112,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// null if the request fails - public UserAgentData GetAgentByUUID(LLUUID userId) + public UserAgentData GetAgentByUUID(UUID userId) { try { @@ -131,11 +131,11 @@ namespace OpenSim.Region.Communications.OGS1 "): " + (string)respData["error_desc"]); return null; } - LLUUID sessionid = LLUUID.Zero; + UUID sessionid = UUID.Zero; UserAgentData userAgent = new UserAgentData(); userAgent.Handle = Convert.ToUInt64((string)respData["handle"]); - Helpers.TryParse((string)respData["sessionid"], out sessionid); + UUID.TryParse((string)respData["sessionid"], out sessionid); userAgent.SessionID = sessionid; if ((string)respData["agent_online"] == "TRUE") @@ -183,17 +183,17 @@ namespace OpenSim.Region.Communications.OGS1 } } - public List ConvertXMLRPCDataToAvatarPickerList(LLUUID queryID, Hashtable data) + public List ConvertXMLRPCDataToAvatarPickerList(UUID queryID, Hashtable data) { List pickerlist = new List(); int pickercount = Convert.ToInt32((string) data["avcount"]); - LLUUID respqueryID = new LLUUID((string) data["queryid"]); + UUID respqueryID = new UUID((string) data["queryid"]); if (queryID == respqueryID) { for (int i = 0; i < pickercount; i++) { AvatarPickerAvatar apicker = new AvatarPickerAvatar(); - LLUUID avatarID = new LLUUID((string) data["avatarid" + i.ToString()]); + UUID avatarID = new UUID((string) data["avatarid" + i.ToString()]); string firstname = (string) data["firstname" + i.ToString()]; string lastname = (string) data["lastname" + i.ToString()]; apicker.AvatarID = avatarID; @@ -219,8 +219,8 @@ namespace OpenSim.Region.Communications.OGS1 { FriendListItem buddylistitem = new FriendListItem(); - buddylistitem.FriendListOwner = new LLUUID((string)data["ownerID" + i.ToString()]); - buddylistitem.Friend = new LLUUID((string)data["friendID" + i.ToString()]); + buddylistitem.FriendListOwner = new UUID((string)data["ownerID" + i.ToString()]); + buddylistitem.Friend = new UUID((string)data["friendID" + i.ToString()]); buddylistitem.FriendListOwnerPerms = (uint)Convert.ToInt32((string)data["ownerPerms" + i.ToString()]); buddylistitem.FriendPerms = (uint)Convert.ToInt32((string)data["friendPerms" + i.ToString()]); @@ -239,11 +239,11 @@ namespace OpenSim.Region.Communications.OGS1 /// final position x /// final position y /// final position z - public void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz) + public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz) { Hashtable param = new Hashtable(); - param["avatar_uuid"] = userid.UUID.ToString(); - param["region_uuid"] = regionid.UUID.ToString(); + param["avatar_uuid"] = userid.ToString(); + param["region_uuid"] = regionid.ToString(); param["region_handle"] = regionhandle.ToString(); param["region_pos_x"] = posx.ToString(); param["region_pos_y"] = posy.ToString(); @@ -268,7 +268,7 @@ namespace OpenSim.Region.Communications.OGS1 return GetUserProfile(firstName + " " + lastName); } - public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle) + public void UpdateUserCurrentRegion(UUID avatarid, UUID regionuuid, ulong regionhandle) { Hashtable param = new Hashtable(); param.Add("avatar_id", avatarid.ToString()); @@ -320,7 +320,7 @@ namespace OpenSim.Region.Communications.OGS1 } } - public List GenerateAgentPickerRequestResponse(LLUUID queryID, string query) + public List GenerateAgentPickerRequestResponse(UUID queryID, string query) { List pickerlist = new List(); Regex objAlphaNumericPattern = new Regex("[^a-zA-Z0-9 ]"); @@ -379,7 +379,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// null if the request fails - public UserProfileData GetUserProfile(LLUUID avatarID) + public UserProfileData GetUserProfile(UUID avatarID) { try { @@ -404,7 +404,7 @@ namespace OpenSim.Region.Communications.OGS1 } - public void ClearUserAgent(LLUUID avatarID) + public void ClearUserAgent(UUID avatarID) { // TODO: implement } @@ -435,7 +435,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// /// - public UserProfileData SetupMasterUser(LLUUID uuid) + public UserProfileData SetupMasterUser(UUID uuid) { UserProfileData data = GetUserProfile(uuid); @@ -448,7 +448,7 @@ namespace OpenSim.Region.Communications.OGS1 return data; } - public LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) + public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) { throw new Exception("The method or operation is not implemented."); } @@ -523,13 +523,13 @@ namespace OpenSim.Region.Communications.OGS1 /// The agent that who's friends list is being added to /// The agent that being added to the friends list of the friends list owner /// A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects - public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) + public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) { try { Hashtable param = new Hashtable(); - param["ownerID"] = friendlistowner.UUID.ToString(); - param["friendID"] = friend.UUID.ToString(); + param["ownerID"] = friendlistowner.ToString(); + param["friendID"] = friend.ToString(); param["friendPerms"] = perms.ToString(); IList parameters = new ArrayList(); parameters.Add(param); @@ -575,13 +575,13 @@ namespace OpenSim.Region.Communications.OGS1 /// /// The agent that who's friends list is being updated /// The Ex-friend agent - public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) + public void RemoveUserFriend(UUID friendlistowner, UUID friend) { try { Hashtable param = new Hashtable(); - param["ownerID"] = friendlistowner.UUID.ToString(); - param["friendID"] = friend.UUID.ToString(); + param["ownerID"] = friendlistowner.ToString(); + param["friendID"] = friend.ToString(); IList parameters = new ArrayList(); parameters.Add(param); @@ -627,13 +627,13 @@ namespace OpenSim.Region.Communications.OGS1 /// The agent that who's friends list is being updated /// The agent that is getting or loosing permissions /// A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects - public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) + public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) { try { Hashtable param = new Hashtable(); - param["ownerID"] = friendlistowner.UUID.ToString(); - param["friendID"] = friend.UUID.ToString(); + param["ownerID"] = friendlistowner.ToString(); + param["friendID"] = friend.ToString(); param["friendPerms"] = perms.ToString(); IList parameters = new ArrayList(); parameters.Add(param); @@ -672,17 +672,17 @@ namespace OpenSim.Region.Communications.OGS1 } } /// - /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship for LLUUID friendslistowner + /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship for UUID friendslistowner /// /// The agent that we're retreiving the friends Data. - public List GetUserFriendList(LLUUID friendlistowner) + public List GetUserFriendList(UUID friendlistowner) { List buddylist = new List(); try { Hashtable param = new Hashtable(); - param["ownerID"] = friendlistowner.UUID.ToString(); + param["ownerID"] = friendlistowner.ToString(); IList parameters = new ArrayList(); parameters.Add(param); @@ -708,7 +708,7 @@ namespace OpenSim.Region.Communications.OGS1 #endregion /// Appearance - public AvatarAppearance GetUserAppearance(LLUUID user) + public AvatarAppearance GetUserAppearance(UUID user) { AvatarAppearance appearance = null; @@ -733,7 +733,7 @@ namespace OpenSim.Region.Communications.OGS1 return appearance; } - public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) + public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) { try { diff --git a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs index 7ddd072..8030b59 100644 --- a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs +++ b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs @@ -34,7 +34,7 @@ using log4net; using OpenSim.Region.Environment.Scenes; using OpenSim.Framework.Communications.Capabilities; using Caps = OpenSim.Framework.Communications.Capabilities.Caps; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework.Servers; namespace OpenSim.Region.DataSnapshot @@ -64,7 +64,7 @@ namespace OpenSim.Region.DataSnapshot //harbl } - public void OnRegisterCaps(LLUUID agentID, Caps caps) + public void OnRegisterCaps(UUID agentID, Caps caps) { m_log.Info("[DATASNAPSHOT]: Registering service discovery capability for " + agentID); string capsBase = "/CAPS/" + caps.CapsObjectPath; diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index da72b61..46c9b3c 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -34,7 +34,7 @@ using System.Reflection; using System.Text; using System.Timers; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -42,7 +42,7 @@ using OpenSim.Framework.Communications; using OpenSim.Region.DataSnapshot.Interfaces; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; -using libsecondlife.Packets; +using OpenMetaverse.Packets; namespace OpenSim.Region.DataSnapshot { @@ -219,7 +219,7 @@ namespace OpenSim.Region.DataSnapshot return null; } - public Scene SceneForUUID(LLUUID id) + public Scene SceneForUUID(UUID id) { foreach (Scene scene in m_scenes) if (scene.RegionInfo.RegionID == id) diff --git a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs index eccdcf1..f25aad4 100644 --- a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs @@ -27,7 +27,7 @@ using System; using System.Xml; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.DataSnapshot.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -54,8 +54,8 @@ namespace OpenSim.Region.DataSnapshot.Providers //Now in DataSnapshotProvider module form! XmlNode estatedata = factory.CreateNode(XmlNodeType.Element, "estate", ""); - LLUUID ownerid = m_scene.RegionInfo.MasterAvatarAssignedUUID; - if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + UUID ownerid = m_scene.RegionInfo.MasterAvatarAssignedUUID; + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) ownerid = m_scene.RegionInfo.EstateSettings.EstateOwner; // Can't fail because if it weren't in cache, we wouldn't be here diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs index 930ea8f..b0ba29d 100644 --- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs @@ -29,14 +29,14 @@ using System; using System.Collections.Generic; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Region.DataSnapshot.Interfaces; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Modules.World.Land; using OpenSim.Region.Environment.Scenes; -using libsecondlife.Packets; +using OpenMetaverse.Packets; namespace OpenSim.Region.DataSnapshot.Providers { @@ -179,16 +179,16 @@ namespace OpenSim.Region.DataSnapshot.Providers //default location XmlNode tpLocation = nodeFactory.CreateNode(XmlNodeType.Element, "location", ""); - LLVector3 loc = parcel.UserLocation; - if (loc.Equals(LLVector3.Zero)) // This test is mute at this point: the location is wrong by default - loc = new LLVector3((parcel.AABBMax.X - parcel.AABBMin.X) / 2, (parcel.AABBMax.Y - parcel.AABBMin.Y) / 2, (parcel.AABBMax.Y - parcel.AABBMin.Y) / 2); + Vector3 loc = parcel.UserLocation; + if (loc.Equals(Vector3.Zero)) // This test is mute at this point: the location is wrong by default + loc = new Vector3((parcel.AABBMax.X - parcel.AABBMin.X) / 2, (parcel.AABBMax.Y - parcel.AABBMin.Y) / 2, (parcel.AABBMax.Y - parcel.AABBMin.Y) / 2); tpLocation.InnerText = loc.X.ToString() + "/" + loc.Y.ToString() + "/" + loc.Z.ToString(); xmlparcel.AppendChild(tpLocation); //TODO: figure how to figure out teleport system landData.landingType //land texture snapshot uuid - if (parcel.SnapshotID != LLUUID.Zero) + if (parcel.SnapshotID != UUID.Zero) { XmlNode textureuuid = nodeFactory.CreateNode(XmlNodeType.Element, "image", ""); textureuuid.InnerText = parcel.SnapshotID.ToString(); @@ -196,7 +196,7 @@ namespace OpenSim.Region.DataSnapshot.Providers } //attached user and group - if (parcel.GroupID != LLUUID.Zero) + if (parcel.GroupID != UUID.Zero) { XmlNode groupblock = nodeFactory.CreateNode(XmlNodeType.Element, "group", ""); XmlNode groupuuid = nodeFactory.CreateNode(XmlNodeType.Element, "uuid", ""); @@ -213,7 +213,7 @@ namespace OpenSim.Region.DataSnapshot.Providers { XmlNode userblock = nodeFactory.CreateNode(XmlNodeType.Element, "owner", ""); - LLUUID userOwnerUUID = parcel.OwnerID; + UUID userOwnerUUID = parcel.OwnerID; XmlNode useruuid = nodeFactory.CreateNode(XmlNodeType.Element, "uuid", ""); useruuid.InnerText = userOwnerUUID.ToString(); @@ -298,7 +298,7 @@ namespace OpenSim.Region.DataSnapshot.Providers IClientAPI remote_client) { this.Stale = true; }; client.OnParcelPropertiesUpdateRequest += delegate(LandUpdateArgs args, int local_id, IClientAPI remote_client) { this.Stale = true; }; - client.OnParcelBuy += delegate (LLUUID agentId, LLUUID groupId, bool final, bool groupOwned, + client.OnParcelBuy += delegate (UUID agentId, UUID groupId, bool final, bool groupOwned, bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated) { this.Stale = true; }; } @@ -315,4 +315,4 @@ namespace OpenSim.Region.DataSnapshot.Providers #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs index d2a5051..c23c697 100644 --- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs @@ -33,7 +33,7 @@ using log4net; using OpenSim.Region.DataSnapshot.Interfaces; using OpenSim.Region.Environment.Scenes; using OpenSim.Framework; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.DataSnapshot.Providers { @@ -59,29 +59,29 @@ namespace OpenSim.Region.DataSnapshot.Providers //Detect object data changes by hooking into the IClientAPI. //Very dirty, and breaks whenever someone changes the client API. - client.OnAddPrim += delegate (LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, - PrimitiveBaseShape shape, byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, + client.OnAddPrim += delegate (UUID ownerID, Vector3 RayEnd, Quaternion rot, + PrimitiveBaseShape shape, byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, byte RayEndIsIntersection) { this.Stale = true; }; client.OnLinkObjects += delegate (IClientAPI remoteClient, uint parent, List children) { this.Stale = true; }; client.OnDelinkObjects += delegate(List primIds) { this.Stale = true; }; - client.OnGrabUpdate += delegate(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, + client.OnGrabUpdate += delegate(UUID objectID, Vector3 offset, Vector3 grapPos, IClientAPI remoteClient) { this.Stale = true; }; client.OnObjectAttach += delegate(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, - LLQuaternion rot) { this.Stale = true; }; - client.OnObjectDuplicate += delegate(uint localID, LLVector3 offset, uint dupeFlags, LLUUID AgentID, - LLUUID GroupID) { this.Stale = true; }; - client.OnObjectDuplicateOnRay += delegate(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, - LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, bool BypassRaycast, + Quaternion rot) { this.Stale = true; }; + client.OnObjectDuplicate += delegate(uint localID, Vector3 offset, uint dupeFlags, UUID AgentID, + UUID GroupID) { this.Stale = true; }; + client.OnObjectDuplicateOnRay += delegate(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, + UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart, bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) { this.Stale = true; }; client.OnObjectIncludeInSearch += delegate(IClientAPI remoteClient, bool IncludeInSearch, uint localID) { this.Stale = true; }; - client.OnObjectPermissions += delegate(IClientAPI controller, LLUUID agentID, LLUUID sessionID, + client.OnObjectPermissions += delegate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set) { this.Stale = true; }; - client.OnRezObject += delegate(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, - LLVector3 RayStart, LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, + client.OnRezObject += delegate(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, + Vector3 RayStart, UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, bool RezSelected, - bool RemoveItem, LLUUID fromTaskID) { this.Stale = true; }; + bool RemoveItem, UUID fromTaskID) { this.Stale = true; }; } public Scene GetParentScene @@ -105,11 +105,11 @@ namespace OpenSim.Region.DataSnapshot.Providers m_log.Debug("[DATASNAPSHOT]: Found object " + obj.Name + " in scene"); - if ((obj.RootPart.Flags & LLObject.ObjectFlags.JointWheel) == LLObject.ObjectFlags.JointWheel) { + if ((obj.RootPart.Flags & PrimFlags.JointWheel) == PrimFlags.JointWheel) { XmlNode xmlobject = nodeFactory.CreateNode(XmlNodeType.Element, "object", ""); node = nodeFactory.CreateNode(XmlNodeType.Element, "uuid", ""); - node.InnerText = obj.UUID.ToString(); + node.InnerText = obj.ToString(); xmlobject.AppendChild(node); SceneObjectPart m_rootPart = null; @@ -170,4 +170,4 @@ namespace OpenSim.Region.DataSnapshot.Providers public event ProviderStale OnStale; } -} \ No newline at end of file +} diff --git a/OpenSim/Region/DataSnapshot/SnapshotStore.cs b/OpenSim/Region/DataSnapshot/SnapshotStore.cs index e1a6651..d913cc5 100644 --- a/OpenSim/Region/DataSnapshot/SnapshotStore.cs +++ b/OpenSim/Region/DataSnapshot/SnapshotStore.cs @@ -32,7 +32,7 @@ using System.Xml; using System.IO; using OpenSim.Region.Environment.Scenes; using OpenSim.Region.DataSnapshot.Interfaces; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.DataSnapshot { @@ -211,7 +211,7 @@ namespace OpenSim.Region.DataSnapshot private string DataFileNameScene(Scene scene) { return Path.Combine(m_directory, Path.ChangeExtension(scene.RegionInfo.RegionName, "xml")); - //return (m_snapsDir + Path.DirectorySeparatorChar + scene.RegionInfo.RegionName + ".xml"); + //return (m_snapsDir + Path.DirectorySeparatorChar + scene.RegionInfo.RegionName + ".Xml"); } private XmlNode MakeRegionNode(Scene scene, XmlDocument basedoc) diff --git a/OpenSim/Region/Environment/Interfaces/IAgentAssetTransactions.cs b/OpenSim/Region/Environment/Interfaces/IAgentAssetTransactions.cs index c099fa1..90d1c12 100644 --- a/OpenSim/Region/Environment/Interfaces/IAgentAssetTransactions.cs +++ b/OpenSim/Region/Environment/Interfaces/IAgentAssetTransactions.cs @@ -25,20 +25,20 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; namespace OpenSim.Region.Environment.Interfaces { public interface IAgentAssetTransactions { - void HandleItemUpdateFromTransaction(IClientAPI remoteClient, LLUUID transactionID, + void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID, InventoryItemBase item); - void HandleItemCreationFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, + void HandleItemCreationFromTransaction(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask); - void RemoveAgentAssetTransactions(LLUUID userID); + void RemoveAgentAssetTransactions(UUID userID); } } diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs index d03e167..a722833 100644 --- a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs +++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; @@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Interfaces { public interface IAvatarFactory { - bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance); - void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance); + bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance); + void UpdateDatabase(UUID userID, AvatarAppearance avatAppearance); } } diff --git a/OpenSim/Region/Environment/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Environment/Interfaces/IDynamicTextureManager.cs index aeb47e1..c54c697 100644 --- a/OpenSim/Region/Environment/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Environment/Interfaces/IDynamicTextureManager.cs @@ -26,22 +26,22 @@ */ using System.IO; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Interfaces { public interface IDynamicTextureManager { void RegisterRender(string handleType, IDynamicTextureRender render); - void ReturnData(LLUUID id, byte[] data); + void ReturnData(UUID id, byte[] data); - LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, string extraParams, + UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer); - LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, string extraParams, + UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); - LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, string extraParams, + UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer); - LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, string extraParams, + UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); } @@ -52,7 +52,7 @@ namespace OpenSim.Region.Environment.Interfaces bool SupportsAsynchronous(); byte[] ConvertUrl(string url, string extraParams); byte[] ConvertStream(Stream data, string extraParams); - bool AsyncConvertUrl(LLUUID id, string url, string extraParams); - bool AsyncConvertData(LLUUID id, string bodyData, string extraParams); + bool AsyncConvertUrl(UUID id, string url, string extraParams); + bool AsyncConvertData(UUID id, string bodyData, string extraParams); } } diff --git a/OpenSim/Region/Environment/Interfaces/IEmailModule.cs b/OpenSim/Region/Environment/Interfaces/IEmailModule.cs index 3726ba5..5f1bcf3 100644 --- a/OpenSim/Region/Environment/Interfaces/IEmailModule.cs +++ b/OpenSim/Region/Environment/Interfaces/IEmailModule.cs @@ -27,7 +27,7 @@ using System; using OpenSim.Framework; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Interfaces { @@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Interfaces public interface IEmailModule : IRegionModule { - void SendEmail(LLUUID objectID, string address, string subject, string body); - Email GetNextEmail(LLUUID objectID, string sender, string subject); + void SendEmail(UUID objectID, string address, string subject, string body); + Email GetNextEmail(UUID objectID, string sender, string subject); } } diff --git a/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs b/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs index ecac2ca..f2d14a6 100644 --- a/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs +++ b/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs @@ -27,7 +27,7 @@ using System; using OpenSim.Framework; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Interfaces { @@ -35,7 +35,7 @@ namespace OpenSim.Region.Environment.Interfaces { void Initialise(string connectstring); - EstateSettings LoadEstateSettings(LLUUID regionID); + EstateSettings LoadEstateSettings(UUID regionID); void StoreEstateSettings(EstateSettings es); } } diff --git a/OpenSim/Region/Environment/Interfaces/IEstateModule.cs b/OpenSim/Region/Environment/Interfaces/IEstateModule.cs index bfe3591..70c5800 100644 --- a/OpenSim/Region/Environment/Interfaces/IEstateModule.cs +++ b/OpenSim/Region/Environment/Interfaces/IEstateModule.cs @@ -27,13 +27,13 @@ using System; using OpenSim.Framework; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Interfaces { public interface IEstateModule : IRegionModule { uint GetRegionFlags(); - bool IsManager(LLUUID avatarID); + bool IsManager(UUID avatarID); } } diff --git a/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs b/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs index 3a635de..216782b 100644 --- a/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs +++ b/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs @@ -26,17 +26,17 @@ */ using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.Environment.Modules.Scripting.HttpRequest; namespace OpenSim.Region.Environment.Interfaces { public interface IHttpRequests { - LLUUID MakeHttpRequest(string url, string parameters, string body); - LLUUID StartHttpRequest(uint localID, LLUUID itemID, string url, List parameters, Dictionary headers, string body); - void StopHttpRequest(uint m_localID, LLUUID m_itemID); + UUID MakeHttpRequest(string url, string parameters, string body); + UUID StartHttpRequest(uint localID, UUID itemID, string url, List parameters, Dictionary headers, string body); + void StopHttpRequest(uint m_localID, UUID m_itemID); HttpRequestClass GetNextCompletedRequest(); - void RemoveCompletedRequest(LLUUID id); + void RemoveCompletedRequest(UUID id); } } diff --git a/OpenSim/Region/Environment/Interfaces/IInventoryModule.cs b/OpenSim/Region/Environment/Interfaces/IInventoryModule.cs index c93694a9..50f4af3 100644 --- a/OpenSim/Region/Environment/Interfaces/IInventoryModule.cs +++ b/OpenSim/Region/Environment/Interfaces/IInventoryModule.cs @@ -26,7 +26,7 @@ */ using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.Environment; using OpenSim.Region.Environment.Scenes; @@ -37,7 +37,7 @@ namespace OpenSim.Framework /// public interface IInventoryModule { - void SetRootAgentScene(LLUUID agentID, Scene scene); - bool NeedSceneCacheClear(LLUUID agentID, Scene scene); + void SetRootAgentScene(UUID agentID, Scene scene); + bool NeedSceneCacheClear(UUID agentID, Scene scene); } } diff --git a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs index c1f6f45..4a74949 100644 --- a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs @@ -26,7 +26,7 @@ */ using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; @@ -35,13 +35,13 @@ namespace OpenSim.Region.Environment.Interfaces public interface ILandChannel { - List ParcelsNearPoint(LLVector3 position); + List ParcelsNearPoint(Vector3 position); ILandObject GetLandObject(int x, int y); ILandObject GetLandObject(float x, float y); bool IsLandPrimCountTainted(); bool IsForcefulBansAllowed(); void UpdateLandObject(int localID, LandData data); - void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient); + void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient); void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); } diff --git a/OpenSim/Region/Environment/Interfaces/ILandObject.cs b/OpenSim/Region/Environment/Interfaces/ILandObject.cs index 750b387..96fa378 100644 --- a/OpenSim/Region/Environment/Interfaces/ILandObject.cs +++ b/OpenSim/Region/Environment/Interfaces/ILandObject.cs @@ -26,7 +26,7 @@ */ using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; @@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Interfaces LandData landData { get; set; } bool[,] landBitmap { get; set; } - LLUUID regionUUID { get; } + UUID regionUUID { get; } bool containsPoint(int x, int y); ILandObject Copy(); @@ -50,12 +50,12 @@ namespace OpenSim.Region.Environment.Interfaces void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client); void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client); - bool isEitherBannedOrRestricted(LLUUID avatar); - bool isBannedFromLand(LLUUID avatar); - bool isRestrictedFromLand(LLUUID avatar); + bool isEitherBannedOrRestricted(UUID avatar); + bool isBannedFromLand(UUID avatar); + bool isRestrictedFromLand(UUID avatar); void sendLandUpdateToClient(IClientAPI remote_client); - List createAccessListArrayByFlag(ParcelManager.AccessList flag); - void sendAccessList(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); + List createAccessListArrayByFlag(ParcelManager.AccessList flag); + void sendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); void updateAccessList(uint flags, List entries, IClientAPI remote_client); void updateLandBitmapByteArray(); void setLandBitmapFromByteArray(); @@ -71,11 +71,11 @@ namespace OpenSim.Region.Environment.Interfaces void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client); void sendLandObjectOwners(IClientAPI remote_client); void returnObject(SceneObjectGroup obj); - void returnLandObjects(uint type, LLUUID[] owners, IClientAPI remote_client); + void returnLandObjects(uint type, UUID[] owners, IClientAPI remote_client); void resetLandPrimCounts(); void addPrimToCount(SceneObjectGroup obj); void removePrimFromCount(SceneObjectGroup obj); - void updateLandSold(LLUUID avatarID, LLUUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); + void updateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs index 4e716a2..5f10ec5 100644 --- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs @@ -26,7 +26,7 @@ */ using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; @@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// /// - void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); + void StoreObject(SceneObjectGroup obj, UUID regionUUID); /// /// Entirely removes the object, including inventory @@ -54,25 +54,25 @@ namespace OpenSim.Region.Environment.Interfaces /// /// /// - void RemoveObject(LLUUID uuid, LLUUID regionUUID); + void RemoveObject(UUID uuid, UUID regionUUID); /// /// Store a prim's inventory /// /// - void StorePrimInventory(LLUUID primID, ICollection items); + void StorePrimInventory(UUID primID, ICollection items); - List LoadObjects(LLUUID regionUUID); + List LoadObjects(UUID regionUUID); - void StoreTerrain(double[,] terrain, LLUUID regionID); - double[,] LoadTerrain(LLUUID regionID); + void StoreTerrain(double[,] terrain, UUID regionID); + double[,] LoadTerrain(UUID regionID); void StoreLandObject(ILandObject Parcel); - void RemoveLandObject(LLUUID globalID); - List LoadLandObjects(LLUUID regionUUID); + void RemoveLandObject(UUID globalID); + List LoadLandObjects(UUID regionUUID); void StoreRegionSettings(RegionSettings rs); - RegionSettings LoadRegionSettings(LLUUID regionUUID); + RegionSettings LoadRegionSettings(UUID regionUUID); void Shutdown(); } diff --git a/OpenSim/Region/Environment/Interfaces/IScriptModule.cs b/OpenSim/Region/Environment/Interfaces/IScriptModule.cs index 8d3868e..efe7944 100644 --- a/OpenSim/Region/Environment/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Environment/Interfaces/IScriptModule.cs @@ -27,12 +27,12 @@ using System; using OpenSim.Framework; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Interfaces { public interface IScriptModule : IRegionModule { - bool GetScriptRunning(LLUUID objectID, LLUUID itemID); + bool GetScriptRunning(UUID objectID, UUID itemID); } } diff --git a/OpenSim/Region/Environment/Interfaces/IWorldComm.cs b/OpenSim/Region/Environment/Interfaces/IWorldComm.cs index c2a55eb..1a33450 100644 --- a/OpenSim/Region/Environment/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Environment/Interfaces/IWorldComm.cs @@ -26,7 +26,7 @@ */ using System; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Modules.Scripting.WorldComm; @@ -34,15 +34,15 @@ namespace OpenSim.Region.Environment.Interfaces { public interface IWorldComm { - int Listen(uint LocalID, LLUUID itemID, LLUUID hostID, int channel, string name, LLUUID id, string msg); - void DeliverMessage(ChatTypeEnum type, int channel, string name, LLUUID id, string msg); + int Listen(uint LocalID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg); + void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg); bool HasMessages(); ListenerInfo GetNextMessage(); - void ListenControl(LLUUID itemID, int handle, int active); - void ListenRemove(LLUUID itemID, int handle); - void DeleteListener(LLUUID itemID); - Object[] GetSerializationData(LLUUID itemID); - void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID, + void ListenControl(UUID itemID, int handle, int active); + void ListenRemove(UUID itemID, int handle); + void DeleteListener(UUID itemID); + Object[] GetSerializationData(UUID itemID); + void CreateFromData(uint localID, UUID itemID, UUID hostID, Object[] data); } } diff --git a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs index a2c164f..88e9ab5 100644 --- a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs +++ b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs @@ -25,24 +25,24 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.Environment.Modules.Scripting.XMLRPC; namespace OpenSim.Region.Environment.Interfaces { public interface IXMLRPC { - LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID, LLUUID channelID); - void CloseXMLRPCChannel(LLUUID channelKey); + UUID OpenXMLRPCChannel(uint localID, UUID itemID, UUID channelID); + void CloseXMLRPCChannel(UUID channelKey); bool hasRequests(); void RemoteDataReply(string channel, string message_id, string sdata, int idata); bool IsEnabled(); RPCRequestInfo GetNextCompletedRequest(); - void RemoveCompletedRequest(LLUUID id); - void DeleteChannels(LLUUID itemID); - LLUUID SendRemoteData(uint localID, LLUUID itemID, string channel, string dest, int idata, string sdata); + void RemoveCompletedRequest(UUID id); + void DeleteChannels(UUID itemID); + UUID SendRemoteData(uint localID, UUID itemID, string channel, string dest, int idata, string sdata); SendRemoteDataRequest GetNextCompletedSRDRequest(); - void RemoveCompletedSRDRequest(LLUUID id); - void CancelSRDRequests(LLUUID itemID); + void RemoveCompletedSRDRequest(UUID id); + void CancelSRDRequests(UUID itemID); } } diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs index d3cf41e..3b521c3 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs @@ -26,8 +26,8 @@ */ using System.Collections.Generic; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -43,16 +43,16 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload private List AssetRequests; private Scene m_scene; - private Dictionary RegisteredScenes = new Dictionary(); + private Dictionary RegisteredScenes = new Dictionary(); /// /// Assets requests (for each user) which are waiting for asset server data. This includes texture requests /// - private Dictionary> RequestedAssets; + private Dictionary> RequestedAssets; public AssetDownloadModule() { - RequestedAssets = new Dictionary>(); + RequestedAssets = new Dictionary>(); AssetRequests = new List(); } @@ -109,24 +109,24 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload /// public void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest) { - LLUUID requestID = null; + UUID requestID = null; byte source = 2; if (transferRequest.TransferInfo.SourceType == 2) { //direct asset request - requestID = new LLUUID(transferRequest.TransferInfo.Params, 0); + requestID = new UUID(transferRequest.TransferInfo.Params, 0); } else if (transferRequest.TransferInfo.SourceType == 3) { //inventory asset request - requestID = new LLUUID(transferRequest.TransferInfo.Params, 80); + requestID = new UUID(transferRequest.TransferInfo.Params, 80); source = 3; //Console.WriteLine("asset request " + requestID); } //not found asset // so request from asset server - Dictionary userRequests = null; + Dictionary userRequests = null; if (RequestedAssets.TryGetValue(userInfo.AgentId, out userRequests)) { if (!userRequests.ContainsKey(requestID)) @@ -143,7 +143,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload } else { - userRequests = new Dictionary(); + userRequests = new Dictionary(); AssetRequest request = new AssetRequest(); request.RequestUser = userInfo; request.RequestAssetID = requestID; @@ -156,11 +156,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload } } - public void AssetCallback(LLUUID assetID, AssetBase asset) + public void AssetCallback(UUID assetID, AssetBase asset) { if (asset != null) { - foreach (Dictionary userRequests in RequestedAssets.Values) + foreach (Dictionary userRequests in RequestedAssets.Values) { if (userRequests.ContainsKey(assetID)) { @@ -212,9 +212,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload public int NumPackets = 0; public int PacketCounter = 0; public byte[] Params = null; - public LLUUID RequestAssetID; + public UUID RequestAssetID; public IClientAPI RequestUser; - public LLUUID TransferRequestID; + public UUID TransferRequestID; //public bool AssetInCache; //public int TimeRequested; @@ -225,4 +225,4 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs index bc1d710..c46c4a4 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs @@ -28,8 +28,8 @@ using System; using System.Collections.Generic; using System.IO; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -46,18 +46,18 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction // Fields private bool m_dumpAssetsToFile; public AgentAssetTransactionsManager Manager; - public LLUUID UserID; - public Dictionary XferUploaders = new Dictionary(); + public UUID UserID; + public Dictionary XferUploaders = new Dictionary(); // Methods - public AgentAssetTransactions(LLUUID agentID, AgentAssetTransactionsManager manager, bool dumpAssetsToFile) + public AgentAssetTransactions(UUID agentID, AgentAssetTransactionsManager manager, bool dumpAssetsToFile) { UserID = agentID; Manager = manager; m_dumpAssetsToFile = dumpAssetsToFile; } - public AssetXferUploader RequestXferUploader(LLUUID transactionID) + public AssetXferUploader RequestXferUploader(UUID transactionID) { if (!XferUploaders.ContainsKey(transactionID)) { @@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction } } - public void RequestCreateInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, + public void RequestCreateInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) { @@ -102,7 +102,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction } } - public void RequestUpdateInventoryItem(IClientAPI remoteClient, LLUUID transactionID, + public void RequestUpdateInventoryItem(IClientAPI remoteClient, UUID transactionID, InventoryItemBase item) { if (XferUploaders.ContainsKey(transactionID)) @@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction /// /// /// The asset if the upload has completed, null if it has not. - public AssetBase GetTransactionAsset(LLUUID transactionID) + public AssetBase GetTransactionAsset(UUID transactionID) { if (XferUploaders.ContainsKey(transactionID)) { @@ -143,7 +143,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction // Fields public bool AddToInventory; public AssetBase Asset; - public LLUUID InventFolder = LLUUID.Zero; + public UUID InventFolder = UUID.Zero; private sbyte invType = 0; private bool m_createItem = false; private string m_description = String.Empty; @@ -154,7 +154,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction private AgentAssetTransactions m_userTransactions; private uint nextPerm = 0; private IClientAPI ourClient; - public LLUUID TransactionID = LLUUID.Zero; + public UUID TransactionID = UUID.Zero; private sbyte type = 0; public bool UploadComplete; private byte wearableType = 0; @@ -210,7 +210,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction /// /// /// True if the transfer is complete, false otherwise - public bool Initialise(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, + public bool Initialise(IClientAPI remoteClient, UUID assetID, UUID transaction, sbyte type, byte[] data, bool storeLocal, bool tempFile) { ourClient = remoteClient; @@ -297,7 +297,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction fs.Close(); } - public void RequestCreateInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, + public void RequestCreateInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) { @@ -321,7 +321,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction } } - public void RequestUpdateInventoryItem(IClientAPI remoteClient, LLUUID transactionID, + public void RequestUpdateInventoryItem(IClientAPI remoteClient, UUID transactionID, InventoryItemBase item) { if (TransactionID == transactionID) @@ -332,7 +332,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction if (userInfo != null) { - LLUUID assetID = LLUUID.Combine(transactionID, remoteClient.SecureSessionId); + UUID assetID = UUID.Combine(transactionID, remoteClient.SecureSessionId); AssetBase asset = m_userTransactions.Manager.MyScene.CommsManager.AssetCache.GetAsset( @@ -346,7 +346,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction if (asset != null && asset.FullID == assetID) { // Assets never get updated, new ones get created - asset.FullID = LLUUID.Random(); + asset.FullID = UUID.Random(); asset.Name = item.Name; asset.Description = item.Description; asset.Type = (sbyte) item.AssetType; @@ -371,7 +371,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction InventoryItemBase item = new InventoryItemBase(); item.Owner = ourClient.AgentId; item.Creator = ourClient.AgentId; - item.ID = LLUUID.Random(); + item.ID = UUID.Random(); item.AssetID = Asset.FullID; item.Description = m_description; item.Name = m_name; diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs index b1cbdcc..e6e27be 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction { public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions { - private readonly Dictionary RegisteredScenes = new Dictionary(); + private readonly Dictionary RegisteredScenes = new Dictionary(); private bool m_dumpAssetsToFile = false; private Scene m_scene = null; @@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction #region IAgentAssetTransactions Members - public void HandleItemCreationFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, + public void HandleItemCreationFromTransaction(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) { @@ -61,13 +61,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction wearableType, nextOwnerMask); } - public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, LLUUID transactionID, + public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID, InventoryItemBase item) { m_transactionManager.HandleItemUpdateFromTransaction(remoteClient, transactionID, item); } - public void RemoveAgentAssetTransactions(LLUUID userID) + public void RemoveAgentAssetTransactions(UUID userID) { m_transactionManager.RemoveAgentAssetTransactions(userID); } @@ -146,8 +146,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction /// /// Each agent has its own singleton collection of transactions /// - private Dictionary AgentTransactions = - new Dictionary(); + private Dictionary AgentTransactions = + new Dictionary(); /// /// Should we dump uploaded assets to the filesystem? @@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction /// /// /// - private AgentAssetTransactions GetUserTransactions(LLUUID userID) + private AgentAssetTransactions GetUserTransactions(UUID userID) { lock (AgentTransactions) { @@ -188,7 +188,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction /// from a scene (and hence won't be making any more transactions here). /// /// - public void RemoveAgentAssetTransactions(LLUUID userID) + public void RemoveAgentAssetTransactions(UUID userID) { // m_log.DebugFormat("Removing agent asset transactions structure for agent {0}", userID); @@ -214,7 +214,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction /// /// /// - public void HandleItemCreationFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, + public void HandleItemCreationFromTransaction(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) { @@ -237,7 +237,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction /// /// /// - public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, LLUUID transactionID, + public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID, InventoryItemBase item) { m_log.DebugFormat( @@ -259,7 +259,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction /// /// /// - public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, + public void HandleUDPUploadRequest(IClientAPI remoteClient, UUID assetID, UUID transaction, sbyte type, byte[] data, bool storeLocal, bool tempFile) { if (((AssetType)type == AssetType.Texture || diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs index 8f81f3d..813d271 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Threading; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -50,8 +50,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload /// /// Each user has their own texture download service. /// - private readonly Dictionary m_userTextureServices = - new Dictionary(); + private readonly Dictionary m_userTextureServices = + new Dictionary(); private Scene m_scene; private List m_scenes = new List(); @@ -109,7 +109,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload /// Cleanup the texture service related objects for the removed presence. /// /// - private void EventManager_OnRemovePresence(LLUUID agentId) + private void EventManager_OnRemovePresence(UUID agentId) { UserTextureDownloadService textureService; @@ -216,4 +216,4 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload m_scene.AddPendingDownloads(-1); } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs index c5af174..f6d8543 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs @@ -25,8 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -46,11 +46,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload // See ITextureSender // private bool m_sending = false; - private LLUUID m_textureId; + private UUID m_textureId; // See ITextureSender - public TextureNotFoundSender(IClientAPI client, LLUUID textureID) + public TextureNotFoundSender(IClientAPI client, UUID textureID) { // // m_client = client; m_textureId = textureID; @@ -101,4 +101,4 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index e6ee75f..c38bc62 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -27,7 +27,7 @@ using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications.Limit; @@ -65,8 +65,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload /// /// XXX Also going to limit requests for found textures. /// - private readonly IRequestLimitStrategy foundTextureLimitStrategy - = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); + private readonly IRequestLimitStrategy foundTextureLimitStrategy + = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); private readonly IClientAPI m_client; private readonly Scene m_scene; @@ -80,15 +80,15 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload /// /// Holds texture senders before they have received the appropriate texture from the asset cache. /// - private readonly Dictionary m_textureSenders = new Dictionary(); + private readonly Dictionary m_textureSenders = new Dictionary(); /// /// We're going to limit requests for the same missing texture. /// XXX This is really a temporary solution to deal with the situation where a client continually requests /// the same missing textures /// - private readonly IRequestLimitStrategy missingTextureLimitStrategy - = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); + private readonly IRequestLimitStrategy missingTextureLimitStrategy + = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); public UserTextureDownloadService( IClientAPI client, Scene scene, BlockingQueue sharedQueue) @@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload /// /// /// - public void TextureCallback(LLUUID textureID, AssetBase texture) + public void TextureCallback(UUID textureID, AssetBase texture) { //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs index 7554d1a..dbfd4d2 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs @@ -27,7 +27,7 @@ using System; using System.Reflection; -using libsecondlife.Packets; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender /// private AssetBase m_asset; - //public LLUUID assetID { get { return m_asset.FullID; } } + //public UUID assetID { get { return m_asset.FullID; } } // private bool m_cancel = false; @@ -220,4 +220,4 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender return numPackets; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs index 16874d7..3c69621 100644 --- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.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; @@ -228,4 +228,4 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 5df3f52..9433cf6 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -29,7 +29,7 @@ using System; using System.Collections.Generic; using System.Threading; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Modules public class AvatarFactoryModule : IAvatarFactory { private Scene m_scene = null; - private readonly Dictionary m_avatarsAppearance = new Dictionary(); + private readonly Dictionary m_avatarsAppearance = new Dictionary(); private bool m_enablePersist = false; private string m_connectionString; @@ -51,10 +51,10 @@ namespace OpenSim.Region.Environment.Modules private BaseDatabaseConnector m_databaseMapper; private AppearanceTableMapper m_appearanceMapper; - private Dictionary m_fetchesInProgress = new Dictionary(); + private Dictionary m_fetchesInProgress = new Dictionary(); private object m_syncLock = new object(); - public bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance) + public bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance) { //should only let one thread at a time do this part @@ -163,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules } } - private AvatarAppearance CreateDefault(LLUUID avatarId) + private AvatarAppearance CreateDefault(UUID avatarId) { AvatarAppearance appearance = null; AvatarWearable[] wearables; @@ -174,7 +174,7 @@ namespace OpenSim.Region.Environment.Modules return appearance; } - private AvatarAppearance CheckDatabase(LLUUID avatarId) + private AvatarAppearance CheckDatabase(UUID avatarId) { AvatarAppearance appearance = null; if (m_enablePersist) @@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules return appearance; } - private AvatarAppearance CheckCache(LLUUID avatarId) + private AvatarAppearance CheckCache(UUID avatarId) { AvatarAppearance appearance = null; lock (m_avatarsAppearance) @@ -282,16 +282,16 @@ namespace OpenSim.Region.Environment.Modules { if (wear.Type < 13) { - if (wear.ItemID == LLUUID.Zero) + if (wear.ItemID == UUID.Zero) { - avatAppearance.Wearables[wear.Type].ItemID = LLUUID.Zero; - avatAppearance.Wearables[wear.Type].AssetID = LLUUID.Zero; + avatAppearance.Wearables[wear.Type].ItemID = UUID.Zero; + avatAppearance.Wearables[wear.Type].AssetID = UUID.Zero; UpdateDatabase(clientView.AgentId, avatAppearance); } else { - LLUUID assetId; + UUID assetId; InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID); if (baseItem != null) @@ -310,11 +310,11 @@ namespace OpenSim.Region.Environment.Modules } } - public void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance) + public void UpdateDatabase(UUID userID, AvatarAppearance avatAppearance) { if (m_enablePersist) { - m_appearanceMapper.Update(userID.UUID, avatAppearance); + m_appearanceMapper.Update(userID.Guid, avatAppearance); } } diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs index 1493e32..e1599a8 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs @@ -32,7 +32,7 @@ using System.Net.Sockets; using System.Reflection; using System.Text.RegularExpressions; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat // chat works by redistributing every incoming chat // message to each avatar in the scene - LLVector3 pos = new LLVector3(128, 128, 30); + Vector3 pos = new Vector3(128, 128, 30); ((Scene)c.Scene).ForEachScenePresence(delegate(ScenePresence presence) { if (presence.IsChildAgent) return; @@ -129,12 +129,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat if (null == c.SenderObject) client.SendChatMessage(c.Message, (byte)c.Type, - pos, c.From, LLUUID.Zero, + pos, c.From, UUID.Zero, (byte)ChatSourceType.Agent, (byte)ChatAudibleLevel.Fully); else client.SendChatMessage(c.Message, (byte)c.Type, - pos, c.From, LLUUID.Zero, + pos, c.From, UUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); }); @@ -153,13 +153,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat scene = m_scenes[0]; // Filled in since it's easier than rewriting right now. - LLVector3 fromPos = e.Position; - LLVector3 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, + Vector3 fromPos = e.Position; + Vector3 regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); string fromName = e.From; string message = e.Message; - LLUUID fromID = e.SenderUUID; + UUID fromID = e.SenderUUID; if(message.Length >= 1000) // libomv limit message = message.Substring(0, 1000); @@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat if (avatar != null) { fromPos = avatar.AbsolutePosition; - regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, + regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); fromName = avatar.Firstname + " " + avatar.Lastname; fromID = e.Sender.AgentId; @@ -217,16 +217,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat } } - private void TrySendChatMessage(ScenePresence presence, LLVector3 fromPos, LLVector3 regionPos, - LLUUID fromAgentID, string fromName, ChatTypeEnum type, + private void TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, + UUID fromAgentID, string fromName, ChatTypeEnum type, string message, ChatSourceType src) { // don't send stuff to child agents if (presence.IsChildAgent) return; - LLVector3 fromRegionPos = fromPos + regionPos; - LLVector3 toRegionPos = presence.AbsolutePosition + - new LLVector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, + Vector3 fromRegionPos = fromPos + regionPos; + Vector3 toRegionPos = presence.AbsolutePosition + + new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos)); diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs index 9df05e0..8fe5080 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs @@ -32,7 +32,7 @@ using System.Net.Sockets; using System.Reflection; using System.Text.RegularExpressions; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -617,7 +617,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat public void ListenerRun() { string inputLine; - LLVector3 pos = new LLVector3(128, 128, 20); + Vector3 pos = new Vector3(128, 128, 20); while (m_enabled) { try @@ -638,7 +638,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat c.Position = pos; c.From = data["nick"]; c.Sender = null; - c.SenderUUID = LLUUID.Zero; + c.SenderUUID = UUID.Zero; // is message "\001ACTION foo // bar\001"? -> "/me foo bar" @@ -684,9 +684,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat c.Message = String.Format(format, args); c.Type = ChatTypeEnum.Say; c.Channel = 0; - c.Position = new LLVector3(128, 128, 20); + c.Position = new Vector3(128, 128, 20); c.Sender = null; - c.SenderUUID = LLUUID.Zero; + c.SenderUUID = UUID.Zero; foreach (Scene m_scene in m_scenes) { diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs index 2a0bba4..19c193f 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs @@ -32,7 +32,7 @@ using System.Net; using System.Net.Sockets; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// Where Stipends come from and Fees go to. /// - // private LLUUID EconomyBaseAccount = LLUUID.Zero; + // private UUID EconomyBaseAccount = UUID.Zero; private float EnergyEfficiency = 0f; private bool gridmode = false; @@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney private IConfigSource m_gConfig; private bool m_keepMoneyAcrossLogins = true; - private Dictionary m_KnownClientFunds = new Dictionary(); + private Dictionary m_KnownClientFunds = new Dictionary(); // private string m_LandAddress = String.Empty; private int m_minFundsBeforeRefresh = 100; @@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// Region UUIDS indexed by AgentID /// - private Dictionary m_rootAgents = new Dictionary(); + private Dictionary m_rootAgents = new Dictionary(); /// /// Scenes by Region Handle @@ -184,11 +184,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney } } - public void ApplyUploadCharge(LLUUID agentID) + public void ApplyUploadCharge(UUID agentID) { } - public bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount) + public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount) { string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); @@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10); PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1); PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); - // string EBA = startupConfig.GetString("EconomyBaseAccount", LLUUID.Zero.ToString()); + // string EBA = startupConfig.GetString("EconomyBaseAccount", UUID.Zero.ToString()); // Helpers.TryParse(EBA, out EconomyBaseAccount); // UserLevelPaysFees = startupConfig.GetInt("UserLevelPaysFees", -1); @@ -294,7 +294,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney if (s != null && agent != null && childYN == false) { //s.RegionInfo.RegionHandle; - LLUUID agentID = LLUUID.Zero; + UUID agentID = UUID.Zero; int funds = 0; Hashtable hbinfo = @@ -302,7 +302,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney s.RegionInfo.regionSecret); if ((bool) hbinfo["success"] == true) { - Helpers.TryParse((string) hbinfo["agentId"], out agentID); + UUID.TryParse((string)hbinfo["agentId"], out agentID); try { funds = (Int32) hbinfo["funds"]; @@ -331,7 +331,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney (string) hbinfo["errorMessage"]); client.SendAlertMessage((string) hbinfo["errorMessage"]); } - SendMoneyBalance(client, agentID, client.SessionId, LLUUID.Zero); + SendMoneyBalance(client, agentID, client.SessionId, UUID.Zero); } } } @@ -365,7 +365,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - private bool doMoneyTransfer(LLUUID Sender, LLUUID Receiver, int amount, int transactiontype, string description) + private bool doMoneyTransfer(UUID Sender, UUID Receiver, int amount, int transactiontype, string description) { bool result = false; if (amount >= 0) @@ -425,7 +425,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public void SendMoneyBalance(IClientAPI client, LLUUID agentID, LLUUID SessionID, LLUUID TransactionID) + public void SendMoneyBalance(IClientAPI client, UUID agentID, UUID SessionID, UUID TransactionID) { if (client.AgentId == agentID && client.SessionId == SessionID) { @@ -456,7 +456,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public Hashtable GetBalanceForUserFromMoneyServer(LLUUID agentId, LLUUID secureSessionID, LLUUID regionId, string regionSecret) + public Hashtable GetBalanceForUserFromMoneyServer(UUID agentId, UUID secureSessionID, UUID regionId, string regionSecret) { Hashtable MoneyBalanceRequestParams = new Hashtable(); MoneyBalanceRequestParams["agentId"] = agentId.ToString(); @@ -551,7 +551,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public Hashtable claim_user(LLUUID agentId, LLUUID secureSessionID, LLUUID regionId, string regionSecret) + public Hashtable claim_user(UUID agentId, UUID secureSessionID, UUID regionId, string regionSecret) { Hashtable MoneyBalanceRequestParams = new Hashtable(); MoneyBalanceRequestParams["agentId"] = agentId.ToString(); @@ -563,12 +563,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney IClientAPI sendMoneyBal = LocateClientObject(agentId); if (sendMoneyBal != null) { - SendMoneyBalance(sendMoneyBal, agentId, sendMoneyBal.SessionId, LLUUID.Zero); + SendMoneyBalance(sendMoneyBal, agentId, sendMoneyBal.SessionId, UUID.Zero); } return MoneyRespData; } - private SceneObjectPart findPrim(LLUUID objectID) + private SceneObjectPart findPrim(UUID objectID) { lock (m_scenel) { @@ -584,7 +584,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return null; } - private string resolveObjectName(LLUUID objectID) + private string resolveObjectName(UUID objectID) { SceneObjectPart part = findPrim(objectID); if (part != null) @@ -594,7 +594,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return String.Empty; } - private string resolveAgentName(LLUUID agentID) + private string resolveAgentName(UUID agentID) { // try avatar username surname Scene scene = GetRandomScene(); @@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return String.Empty; } - private void BalanceUpdate(LLUUID senderID, LLUUID receiverID, bool transactionresult, string description) + private void BalanceUpdate(UUID senderID, UUID receiverID, bool transactionresult, string description) { IClientAPI sender = LocateClientObject(senderID); IClientAPI receiver = LocateClientObject(receiverID); @@ -616,12 +616,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { if (sender != null) { - sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(description), GetFundsForAgentID(senderID)); + sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID)); } if (receiver != null) { - receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(description), GetFundsForAgentID(receiverID)); + receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID)); } } } @@ -633,7 +633,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public bool TransferMoneyonMoneyServer(LLUUID sourceId, LLUUID destId, int amount, int transactiontype, string description) + public bool TransferMoneyonMoneyServer(UUID sourceId, UUID destId, int amount, int transactiontype, string description) { int aggregatePermInventory = 0; int aggregatePermNextOwner = 0; @@ -709,7 +709,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return rvalue; } - public int GetRemoteBalance(LLUUID agentId) + public int GetRemoteBalance(UUID agentId) { int funds = 0; @@ -755,7 +755,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney } SetLocalFundsForAgentID(agentId, funds); - SendMoneyBalance(aClient, agentId, aClient.SessionId, LLUUID.Zero); + SendMoneyBalance(aClient, agentId, aClient.SessionId, UUID.Zero); } else { @@ -776,10 +776,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney if (requestData.ContainsKey("agentId")) { - LLUUID agentId = LLUUID.Zero; + UUID agentId = UUID.Zero; - Helpers.TryParse((string) requestData["agentId"], out agentId); - if (agentId != LLUUID.Zero) + UUID.TryParse((string) requestData["agentId"], out agentId); + if (agentId != UUID.Zero) { GetRemoteBalance(agentId); } @@ -809,13 +809,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney Hashtable retparam = new Hashtable(); Hashtable requestData = (Hashtable) request.Params[0]; - LLUUID agentId = LLUUID.Zero; - LLUUID soundId = LLUUID.Zero; - LLUUID regionId = LLUUID.Zero; + UUID agentId = UUID.Zero; + UUID soundId = UUID.Zero; + UUID regionId = UUID.Zero; - Helpers.TryParse((string) requestData["agentId"], out agentId); - Helpers.TryParse((string) requestData["soundId"], out soundId); - Helpers.TryParse((string) requestData["regionId"], out regionId); + UUID.TryParse((string) requestData["agentId"], out agentId); + UUID.TryParse((string) requestData["soundId"], out soundId); + UUID.TryParse((string) requestData["regionId"], out regionId); string text = (string) requestData["text"]; string secret = (string) requestData["secret"]; @@ -828,9 +828,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney IClientAPI client = LocateClientObject(agentId); if (client != null) { - if (soundId != LLUUID.Zero) - client.SendPlayAttachedSound(soundId, LLUUID.Zero, LLUUID.Zero, 1.0f, 0); - client.SendBlueBoxMessage(LLUUID.Zero, LLUUID.Zero, "", text); + + if (soundId != UUID.Zero) + client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0); + + client.SendBlueBoxMessage(UUID.Zero, UUID.Zero, "", text); + retparam.Add("success", true); } else @@ -843,10 +846,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney retparam.Add("success", false); } } - else - { - retparam.Add("success", false); - } + ret.Value = retparam; return ret; } @@ -856,14 +856,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney public XmlRpcResponse quote_func(XmlRpcRequest request) { Hashtable requestData = (Hashtable) request.Params[0]; - LLUUID agentId = LLUUID.Zero; + UUID agentId = UUID.Zero; int amount = 0; Hashtable quoteResponse = new Hashtable(); XmlRpcResponse returnval = new XmlRpcResponse(); if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) { - Helpers.TryParse((string) requestData["agentId"], out agentId); + UUID.TryParse((string) requestData["agentId"], out agentId); try { amount = (Int32) requestData["currencyBuy"]; @@ -894,11 +894,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney public XmlRpcResponse buy_func(XmlRpcRequest request) { Hashtable requestData = (Hashtable) request.Params[0]; - LLUUID agentId = LLUUID.Zero; + UUID agentId = UUID.Zero; int amount = 0; if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) { - Helpers.TryParse((string) requestData["agentId"], out agentId); + UUID.TryParse((string) requestData["agentId"], out agentId); try { amount = (Int32) requestData["currencyBuy"]; @@ -906,7 +906,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney catch (InvalidCastException) { } - if (agentId != LLUUID.Zero) + if (agentId != UUID.Zero) { lock (m_KnownClientFunds) { @@ -922,7 +922,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney IClientAPI client = LocateClientObject(agentId); if (client != null) { - SendMoneyBalance(client, agentId, client.SessionId, LLUUID.Zero); + SendMoneyBalance(client, agentId, client.SessionId, UUID.Zero); } } } @@ -974,11 +974,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney Hashtable retparam = new Hashtable(); Hashtable requestData = (Hashtable) request.Params[0]; - LLUUID agentId = LLUUID.Zero; + UUID agentId = UUID.Zero; int amount = 0; if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) { - Helpers.TryParse((string) requestData["agentId"], out agentId); + UUID.TryParse((string) requestData["agentId"], out agentId); try { amount = (Int32) requestData["currencyBuy"]; @@ -986,7 +986,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney catch (InvalidCastException) { } - if (agentId != LLUUID.Zero) + if (agentId != UUID.Zero) { lock (m_KnownClientFunds) { @@ -1002,7 +1002,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney IClientAPI client = LocateClientObject(agentId); if (client != null) { - SendMoneyBalance(client, agentId, client.SessionId, LLUUID.Zero); + SendMoneyBalance(client, agentId, client.SessionId, UUID.Zero); } } } @@ -1020,7 +1020,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// Ensures that the agent accounting data is set up in this instance. /// /// - private void CheckExistAndRefreshFunds(LLUUID agentID) + private void CheckExistAndRefreshFunds(UUID agentID) { lock (m_KnownClientFunds) { @@ -1043,7 +1043,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - private int GetFundsForAgentID(LLUUID AgentID) + private int GetFundsForAgentID(UUID AgentID) { int returnfunds = 0; lock (m_KnownClientFunds) @@ -1060,7 +1060,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return returnfunds; } - private void SetLocalFundsForAgentID(LLUUID AgentID, int amount) + private void SetLocalFundsForAgentID(UUID AgentID, int amount) { lock (m_KnownClientFunds) { @@ -1084,7 +1084,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - private IClientAPI LocateClientObject(LLUUID AgentID) + private IClientAPI LocateClientObject(UUID AgentID) { ScenePresence tPresence = null; IClientAPI rclient = null; @@ -1110,7 +1110,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return null; } - private Scene LocateSceneClientIn(LLUUID AgentId) + private Scene LocateSceneClientIn(UUID AgentId) { lock (m_scenel) { @@ -1148,7 +1148,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public Scene GetSceneByUUID(LLUUID RegionID) + public Scene GetSceneByUUID(UUID RegionID) { lock (m_scenel) { @@ -1167,7 +1167,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney #region event Handlers - public void requestPayPrice(IClientAPI client, LLUUID objectID) + public void requestPayPrice(IClientAPI client, UUID objectID) { Scene scene = LocateSceneClientIn(client.AgentId); if (scene == null) @@ -1186,7 +1186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// When the client closes the connection we remove their accounting info from memory to free up resources. /// /// - public void ClientClosed(LLUUID AgentID) + public void ClientClosed(UUID AgentID) { lock (m_KnownClientFunds) { @@ -1204,7 +1204,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// Event called Economy Data Request handler. /// /// - public void EconomyDataRequestHandler(LLUUID agentId) + public void EconomyDataRequestHandler(UUID agentId) { IClientAPI user = LocateClientObject(agentId); @@ -1309,11 +1309,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney if (e.sender != e.receiver) { - sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.sender)); + sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(e.sender)); } if (receiver != null) { - receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(part.OwnerID)); + receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(part.OwnerID)); } } return; @@ -1330,13 +1330,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { if (sender != null) { - sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.sender)); + sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(e.sender)); } } if (receiver != null) { - receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.receiver)); + receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(e.receiver)); } } else @@ -1369,7 +1369,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// Event Handler for when the client logs out. /// /// - private void ClientLoggedOut(LLUUID AgentId) + private void ClientLoggedOut(UUID AgentId) { lock (m_rootAgents) { @@ -1396,7 +1396,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, LLUUID regionID) + private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) { lock (m_rootAgents) { @@ -1404,8 +1404,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { if (avatar.Scene.RegionInfo.originRegionID != m_rootAgents[avatar.UUID]) { - - m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID; @@ -1527,7 +1525,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney else { string killer = DeadAvatar.Scene.CommsManager.UUIDNameRequestString(part.OwnerID); - DeadAvatar.ControllingClient.SendAgentAlertMessage("You impailed yourself on " + part.Name + " owned by " + killer +"!", true); + DeadAvatar.ControllingClient.SendAgentAlertMessage("You impaled yourself on " + part.Name + " owned by " + killer +"!", true); } //DeadAvatar.Scene. part.ObjectOwner } @@ -1564,8 +1562,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney #endregion - public void ObjectBuy(IClientAPI remoteClient, LLUUID agentID, - LLUUID sessionID, LLUUID groupID, LLUUID categoryID, + public void ObjectBuy(IClientAPI remoteClient, UUID agentID, + UUID sessionID, UUID groupID, UUID categoryID, uint localID, byte saleType, int salePrice) { GetClientFunds(remoteClient); diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index 4a98622..0be540d 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs @@ -28,8 +28,8 @@ using System; using System.Collections; using System.Collections.Generic; using System.Reflection; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -43,10 +43,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary> FriendLists = new Dictionary>(); - private Dictionary m_pendingFriendRequests = new Dictionary(); - private Dictionary m_rootAgents = new Dictionary(); - private Dictionary> StoredFriendListUpdates = new Dictionary>(); + private Dictionary> FriendLists = new Dictionary>(); + private Dictionary m_pendingFriendRequests = new Dictionary(); + private Dictionary m_rootAgents = new Dictionary(); + private Dictionary> StoredFriendListUpdates = new Dictionary>(); private List m_scene = new List(); @@ -98,16 +98,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends if (requestData.ContainsKey("agent_id") && requestData.ContainsKey("notify_id") && requestData.ContainsKey("status")) { - LLUUID notifyAgentId = LLUUID.Zero; - LLUUID notifyAboutAgentId = LLUUID.Zero; + UUID notifyAgentId = UUID.Zero; + UUID notifyAboutAgentId = UUID.Zero; bool notifyOnlineStatus = false; if ((string)requestData["status"] == "TRUE") notifyOnlineStatus = true; - Helpers.TryParse((string)requestData["notify_id"], out notifyAgentId); + UUID.TryParse((string)requestData["notify_id"], out notifyAgentId); - Helpers.TryParse((string)requestData["agent_id"], out notifyAboutAgentId); + UUID.TryParse((string)requestData["agent_id"], out notifyAboutAgentId); m_log.InfoFormat("[PRESENCE]: Got presence update for {0}, and we're telling {1}, with a status {2}", notifyAboutAgentId.ToString(), notifyAgentId.ToString(), notifyOnlineStatus.ToString()); ScenePresence avatar = GetPresenceFromAgentID(notifyAgentId); if (avatar != null) @@ -189,7 +189,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } - private void doFriendListUpdateOnline(LLUUID AgentId) + private void doFriendListUpdateOnline(UUID AgentId) { List fl = new List(); @@ -213,7 +213,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - List UpdateUsers = new List(); + List UpdateUsers = new List(); foreach (FriendListItem f in fl) { @@ -226,7 +226,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } } - foreach (LLUUID user in UpdateUsers) + foreach (UUID user in UpdateUsers) { ScenePresence av = GetPresenceFromAgentID(user); if (av != null) @@ -245,7 +245,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends if (fli.Friend == AgentId) { fli.onlinestatus = true; - LLUUID[] Agents = new LLUUID[1]; + UUID[] Agents = new UUID[1]; Agents[0] = AgentId; av.ControllingClient.SendAgentOnline(Agents); @@ -266,7 +266,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void ClientLoggedOut(LLUUID AgentId) + private void ClientLoggedOut(UUID AgentId) { lock (m_rootAgents) { @@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends lfli = FriendLists[AgentId]; } } - List updateUsers = new List(); + List updateUsers = new List(); foreach (FriendListItem fli in lfli) { if (fli.onlinestatus == true) @@ -352,7 +352,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends ScenePresence av = GetPresenceFromAgentID(updateUsers[i]); if (av != null) { - LLUUID[] agents = new LLUUID[1]; + UUID[] agents = new UUID[1]; agents[0] = AgentId; av.ControllingClient.SendAgentOffline(agents); } @@ -364,7 +364,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, LLUUID regionID) + private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) { lock (m_rootAgents) { @@ -427,7 +427,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private ScenePresence GetPresenceFromAgentID(LLUUID AgentID) + private ScenePresence GetPresenceFromAgentID(UUID AgentID) { ScenePresence returnAgent = null; lock (m_scene) @@ -451,11 +451,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends #region FriendRequestHandling - private void OnInstantMessage(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + private void OnInstantMessage(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket) { // Friend Requests go by Instant Message.. using the dialog param @@ -464,17 +464,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends // 38 == Offer friendship if (dialog == (byte) 38) { - LLUUID friendTransactionID = LLUUID.Random(); + UUID friendTransactionID = UUID.Random(); m_pendingFriendRequests.Add(friendTransactionID, fromAgentID); m_log.Info("[FRIEND]: 38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message); GridInstantMessage msg = new GridInstantMessage(); - msg.fromAgentID = fromAgentID.UUID; - msg.fromAgentSession = fromAgentSession.UUID; - msg.toAgentID = toAgentID.UUID; - msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here + msg.fromAgentID = fromAgentID.Guid; + msg.fromAgentSession = fromAgentSession.Guid; + msg.toAgentID = toAgentID.Guid; + msg.imSessionID = friendTransactionID.Guid; // This is the item we're mucking with here m_log.Info("[FRIEND]: Filling Session: " + msg.imSessionID.ToString()); msg.timestamp = timestamp; if (client != null) @@ -490,8 +490,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends msg.fromGroup = fromGroup; msg.offline = offline; msg.ParentEstateID = ParentEstateID; - msg.Position = new sLLVector3(Position); - msg.RegionID = RegionID.UUID; + msg.Position = Position; + msg.RegionID = RegionID.Guid; msg.binaryBucket = binaryBucket; // We don't really care which scene we pipe it through. m_scene[0].TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); @@ -512,7 +512,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void OnApprovedFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List callingCardFolders) + private void OnApprovedFriendRequest(IClientAPI client, UUID agentID, UUID transactionID, List callingCardFolders) { if (m_pendingFriendRequests.ContainsKey(transactionID)) { @@ -528,18 +528,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends // Compose response to other agent. GridInstantMessage msg = new GridInstantMessage(); - msg.toAgentID = m_pendingFriendRequests[transactionID].UUID; - msg.fromAgentID = agentID.UUID; + msg.toAgentID = m_pendingFriendRequests[transactionID].Guid; + msg.fromAgentID = agentID.Guid; msg.fromAgentName = client.Name; - msg.fromAgentSession = client.SessionId.UUID; + msg.fromAgentSession = client.SessionId.Guid; msg.fromGroup = false; - msg.imSessionID = transactionID.UUID; - msg.message = agentID.UUID.ToString(); + msg.imSessionID = transactionID.Guid; + msg.message = agentID.Guid.ToString(); msg.ParentEstateID = 0; msg.timestamp = (uint) Util.UnixTimeSinceEpoch(); - msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID; + msg.RegionID = SceneAgentIn.RegionInfo.RegionID.Guid; msg.dialog = (byte) 39; // Approved friend request - msg.Position = new sLLVector3(); + msg.Position = Vector3.Zero; msg.offline = (byte) 0; msg.binaryBucket = new byte[0]; // We don't really care which scene we pipe it through, it goes to the shared IM Module and/or the database @@ -548,7 +548,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); - //LLUUID[] Agents = new LLUUID[1]; + //UUID[] Agents = new UUID[1]; //Agents[0] = msg.toAgentID; //av.ControllingClient.SendAgentOnline(Agents); @@ -557,7 +557,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void OnDenyFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List callingCardFolders) + private void OnDenyFriendRequest(IClientAPI client, UUID agentID, UUID transactionID, List callingCardFolders) { if (m_pendingFriendRequests.ContainsKey(transactionID)) { @@ -571,18 +571,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } // Compose response to other agent. GridInstantMessage msg = new GridInstantMessage(); - msg.toAgentID = m_pendingFriendRequests[transactionID].UUID; - msg.fromAgentID = agentID.UUID; + msg.toAgentID = m_pendingFriendRequests[transactionID].Guid; + msg.fromAgentID = agentID.Guid; msg.fromAgentName = client.Name; - msg.fromAgentSession = client.SessionId.UUID; + msg.fromAgentSession = client.SessionId.Guid; msg.fromGroup = false; - msg.imSessionID = transactionID.UUID; - msg.message = agentID.UUID.ToString(); + msg.imSessionID = transactionID.Guid; + msg.message = agentID.Guid.ToString(); msg.ParentEstateID = 0; msg.timestamp = (uint) Util.UnixTimeSinceEpoch(); - msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID; + msg.RegionID = SceneAgentIn.RegionInfo.RegionID.Guid; msg.dialog = (byte) 40; // Deny friend request - msg.Position = new sLLVector3(); + msg.Position = Vector3.Zero; msg.offline = (byte) 0; msg.binaryBucket = new byte[0]; SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); @@ -590,7 +590,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void OnTerminateFriendship(IClientAPI client, LLUUID agent, LLUUID exfriendID) + private void OnTerminateFriendship(IClientAPI client, UUID agent, UUID exfriendID) { m_scene[0].StoreRemoveFriendship(agent, exfriendID); // TODO: Inform the client that the ExFriend is offline @@ -599,10 +599,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends private void OnGridInstantMessage(GridInstantMessage msg) { // Trigger the above event handler - OnInstantMessage(null, new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), - new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, + OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession), + new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, - new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), + new Vector3(msg.Position.X, msg.Position.Y, msg.Position.Z), new UUID(msg.RegionID), msg.binaryBucket); } @@ -611,8 +611,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends public struct StoredFriendListUpdate { - public LLUUID storedFor; - public LLUUID storedAbout; + public UUID storedFor; + public UUID storedAbout; public bool OnlineYN; } } diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index eaa5013..ad0cac0 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -41,11 +41,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary m_grouplistmap = new Dictionary(); - private Dictionary m_groupmap = new Dictionary(); - private Dictionary m_iclientmap = new Dictionary(); - private Dictionary m_groupUUIDGroup = new Dictionary(); - private LLUUID opensimulatorGroupID = new LLUUID("00000000-68f9-1111-024e-222222111123"); + private Dictionary m_grouplistmap = new Dictionary(); + private Dictionary m_groupmap = new Dictionary(); + private Dictionary m_iclientmap = new Dictionary(); + private Dictionary m_groupUUIDGroup = new Dictionary(); + private UUID opensimulatorGroupID = new UUID("00000000-68f9-1111-024e-222222111123"); private List m_scene = new List(); @@ -161,13 +161,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups client.SendGroupMembership(updateGroups); } - private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) + private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID AgentID, UUID SessionID) { // Adam, this is one of those impossible to refactor items without resorting to .Split hackery string firstname = remoteClient.FirstName; string lastname = remoteClient.LastName; - LLUUID ActiveGroupID = LLUUID.Zero; + UUID ActiveGroupID = UUID.Zero; uint ActiveGroupPowers = 0; string ActiveGroupName = "OpenSimulator Tester"; string ActiveGroupTitle = "I IZ N0T"; @@ -202,11 +202,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups } } - private void OnInstantMessage(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + private void OnInstantMessage(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket) { } @@ -214,16 +214,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups private void OnGridInstantMessage(GridInstantMessage msg) { // Trigger the above event handler - OnInstantMessage(null, new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), - new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, + OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession), + new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, - new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), + new Vector3(msg.Position.X, msg.Position.Y, msg.Position.Z), new UUID(msg.RegionID), msg.binaryBucket); } - private void HandleUUIDGroupNameRequest(LLUUID id,IClientAPI remote_client) + private void HandleUUIDGroupNameRequest(UUID id,IClientAPI remote_client) { string groupnamereply = "Unknown"; - LLUUID groupUUID = LLUUID.Zero; + UUID groupUUID = UUID.Zero; lock (m_groupUUIDGroup) { @@ -236,7 +236,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups } remote_client.SendGroupNameReply(groupUUID, groupnamereply); } - private void OnClientClosed(LLUUID agentID) + private void OnClientClosed(UUID agentID) { lock (m_iclientmap) { diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs index bb3303f..6b2de80 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs @@ -30,7 +30,7 @@ using System.Collections.Generic; using System.Reflection; using System.Net; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); - private Dictionary m_userRegionMap = new Dictionary(); + private Dictionary m_userRegionMap = new Dictionary(); #region IRegionModule Members @@ -106,11 +106,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage client.OnInstantMessage += OnInstantMessage; } - private void OnInstantMessage(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + private void OnInstantMessage(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket) { bool dialogHandledElsewhere @@ -122,8 +122,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage // IM dialogs need to be pre-processed and have their sessionID filled by the server // so the sim can match the transaction on the return packet. - // Don't send a Friend Dialog IM with a LLUUID.Zero session. - if (!(dialogHandledElsewhere && imSessionID == LLUUID.Zero)) + // Don't send a Friend Dialog IM with a UUID.Zero session. + if (!(dialogHandledElsewhere && imSessionID == UUID.Zero)) { // Try root avatar only first foreach (Scene scene in m_scenes) @@ -195,10 +195,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage private void OnGridInstantMessage(GridInstantMessage msg) { // Trigger the above event handler - OnInstantMessage(null, new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), - new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, + OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession), + new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, - new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), + new Vector3(msg.Position.X, msg.Position.Y, msg.Position.Z), new UUID(msg.RegionID), msg.binaryBucket); } @@ -214,10 +214,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage { bool successful = false; // various rational defaults - LLUUID fromAgentID = LLUUID.Zero; - LLUUID fromAgentSession = LLUUID.Zero; - LLUUID toAgentID = LLUUID.Zero; - LLUUID imSessionID = LLUUID.Zero; + UUID fromAgentID = UUID.Zero; + UUID fromAgentSession = UUID.Zero; + UUID toAgentID = UUID.Zero; + UUID imSessionID = UUID.Zero; uint timestamp = 0; string fromAgentName = ""; string message = ""; @@ -225,8 +225,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage bool fromGroup = false; byte offline = (byte)0; uint ParentEstateID=0; - LLVector3 Position = LLVector3.Zero; - LLUUID RegionID = LLUUID.Zero ; + Vector3 Position = Vector3.Zero; + UUID RegionID = UUID.Zero ; byte[] binaryBucket = new byte[0]; float pos_x = 0; @@ -248,11 +248,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage && requestData.ContainsKey("binary_bucket") && requestData.ContainsKey("region_handle")) { // Do the easy way of validating the UUIDs - Helpers.TryParse((string)requestData["from_agent_id"], out fromAgentID); - Helpers.TryParse((string)requestData["from_agent_session"], out fromAgentSession); - Helpers.TryParse((string)requestData["to_agent_id"], out toAgentID); - Helpers.TryParse((string)requestData["im_session_id"], out imSessionID); - Helpers.TryParse((string)requestData["region_id"], out RegionID); + UUID.TryParse((string)requestData["from_agent_id"], out fromAgentID); + UUID.TryParse((string)requestData["from_agent_session"], out fromAgentSession); + UUID.TryParse((string)requestData["to_agent_id"], out toAgentID); + UUID.TryParse((string)requestData["im_session_id"], out imSessionID); + UUID.TryParse((string)requestData["region_id"], out RegionID); # region timestamp try @@ -345,24 +345,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage } # endregion - Position = new LLVector3(pos_x, pos_y, pos_z); + Position = new Vector3(pos_x, pos_y, pos_z); binaryBucket = Convert.FromBase64String((string)requestData["binary_bucket"]); // Create a New GridInstantMessageObject the the data GridInstantMessage gim = new GridInstantMessage(); - gim.fromAgentID = fromAgentID.UUID; + gim.fromAgentID = fromAgentID.Guid; gim.fromAgentName = fromAgentName; - gim.fromAgentSession = fromAgentSession.UUID; + gim.fromAgentSession = fromAgentSession.Guid; gim.fromGroup = fromGroup; - gim.imSessionID = imSessionID.UUID; - gim.RegionID = RegionID.UUID; + gim.imSessionID = imSessionID.Guid; + gim.RegionID = RegionID.Guid; gim.timestamp = timestamp; - gim.toAgentID = toAgentID.UUID; + gim.toAgentID = toAgentID.Guid; gim.message = message; gim.dialog = dialog; gim.offline = offline; gim.ParentEstateID = ParentEstateID; - gim.Position = new sLLVector3(Position); + gim.Position = Position; gim.binaryBucket = binaryBucket; @@ -418,11 +418,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage /// /// /// - public delegate void GridInstantMessageDelegate(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + public delegate void GridInstantMessageDelegate(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle); private void GridInstantMessageCompleted(IAsyncResult iar) @@ -432,11 +432,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage } - protected virtual void SendGridInstantMessageViaXMLRPC(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + protected virtual void SendGridInstantMessageViaXMLRPC(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle) { GridInstantMessageDelegate d = SendGridInstantMessageViaXMLRPCAsync; @@ -459,11 +459,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage /// if it's the same as the user's looked up region handle, then we end the recursive loop /// /// - protected virtual void SendGridInstantMessageViaXMLRPCAsync(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + protected virtual void SendGridInstantMessageViaXMLRPCAsync(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle) { UserAgentData upd = null; @@ -527,10 +527,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage if (reginfo != null) { GridInstantMessage msg = new GridInstantMessage(); - msg.fromAgentID = fromAgentID.UUID; - msg.fromAgentSession = fromAgentSession.UUID; - msg.toAgentID = toAgentID.UUID; - msg.imSessionID = imSessionID.UUID; + msg.fromAgentID = fromAgentID.Guid; + msg.fromAgentSession = fromAgentSession.Guid; + msg.toAgentID = toAgentID.Guid; + msg.imSessionID = imSessionID.Guid; msg.timestamp = timestamp; msg.fromAgentName = fromAgentName; msg.message = message; @@ -538,8 +538,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage msg.fromGroup = fromGroup; msg.offline = offline; msg.ParentEstateID = ParentEstateID; - msg.Position = new sLLVector3(Position); - msg.RegionID = RegionID.UUID; + msg.Position = Position; + msg.RegionID = RegionID.Guid; msg.binaryBucket = binaryBucket; Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(msg); @@ -649,7 +649,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage /// /// UUID of region to get the region handle for /// - private ulong getLocalRegionHandleFromUUID(LLUUID regionID) + private ulong getLocalRegionHandleFromUUID(UUID regionID) { ulong returnhandle = 0; @@ -692,13 +692,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage byte[] offlinedata = new byte[1]; offlinedata[0] = msg.offline; gim["offline"] = Convert.ToBase64String(offlinedata, Base64FormattingOptions.None); gim["parent_estate_id"] = msg.ParentEstateID.ToString(); - gim["position_x"] = msg.Position.x.ToString(); - gim["position_y"] = msg.Position.y.ToString(); - gim["position_z"] = msg.Position.z.ToString(); + gim["position_x"] = msg.Position.X.ToString(); + gim["position_y"] = msg.Position.Y.ToString(); + gim["position_z"] = msg.Position.Z.ToString(); gim["region_id"] = msg.RegionID.ToString(); gim["binary_bucket"] = Convert.ToBase64String(msg.binaryBucket,Base64FormattingOptions.None); return gim; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs index d036dbb..344cb5e 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs @@ -27,7 +27,7 @@ using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -46,10 +46,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory /// occurs in the initial offer message, not the accept message. So this dictionary links /// IM Session Ids to ItemIds /// - private IDictionary m_pendingOffers = new Dictionary(); + private IDictionary m_pendingOffers = new Dictionary(); private List m_Scenelist = new List(); - private Dictionary m_AgentRegions = new Dictionary(); + private Dictionary m_AgentRegions = new Dictionary(); #region IRegionModule Members @@ -92,11 +92,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory client.OnInstantMessage += OnInstantMessage; } - private void OnInstantMessage(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + private void OnInstantMessage(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket) { if (dialog == (byte) InstantMessageDialog.InventoryOffered) @@ -117,8 +117,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory // Next 16 bytes are the UUID //Array.Copy(binaryBucket, 1, rawId, 0, 16); - //LLUUID itemId = new LLUUID(new Guid(rawId)); - LLUUID itemId = new LLUUID(binaryBucket, 1); + //UUID itemId = new UUID(new Guid(rawId)); + UUID itemId = new UUID(binaryBucket, 1); m_log.DebugFormat( "[AGENT INVENTORY]: ItemId for giving is {0}", itemId); @@ -225,12 +225,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory } } - public void SetRootAgentScene(LLUUID agentID, Scene scene) + public void SetRootAgentScene(UUID agentID, Scene scene) { m_AgentRegions[agentID] = scene; } - public bool NeedSceneCacheClear(LLUUID agentID, Scene scene) + public bool NeedSceneCacheClear(UUID agentID, Scene scene) { if (!m_AgentRegions.ContainsKey(agentID)) { @@ -279,7 +279,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory return false; } - public void ClientLoggedOut(LLUUID agentID) + public void ClientLoggedOut(UUID agentID) { if (m_AgentRegions.ContainsKey(agentID)) m_AgentRegions.Remove(agentID); diff --git a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs index 20b1c1c..f9c0dcf 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs @@ -27,7 +27,7 @@ using System; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles /// /// /// - public void RequestAvatarProperty(IClientAPI remoteClient, LLUUID avatarID) + public void RequestAvatarProperty(IClientAPI remoteClient, UUID avatarID) { // FIXME: finish adding fields such as url, masking, etc. UserProfileData profile = m_scene.CommsManager.UserService.GetUserProfile(avatarID); @@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles } else { - charterMember = Helpers.StringToField(profile.CustomType); + charterMember = Utils.StringToBytes(profile.CustomType); } remoteClient.SendAvatarProperties(profile.ID, profile.AboutText, diff --git a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs index 1f41a92..e3a9a45 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -125,7 +125,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice #endregion - public void OnRegisterCaps(LLUUID agentID, Caps caps) + public void OnRegisterCaps(UUID agentID, Caps caps) { m_log.DebugFormat("[ASTERISKVOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); string capsBase = "/CAPS/" + caps.CapsObjectPath; @@ -157,7 +157,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice /// /// public string ParcelVoiceInfoRequest(string request, string path, string param, - LLUUID agentID, Caps caps) + UUID agentID, Caps caps) { // we need to do: // - send channel_uri: as "sip:regionID@m_sipDomain" @@ -226,7 +226,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice /// /// public string ProvisionVoiceAccountRequest(string request, string path, string param, - LLUUID agentID, Caps caps) + UUID agentID, Caps caps) { // we need to // - get user data from UserProfileCacheService @@ -289,4 +289,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice } } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs index c6852f7..bd89175 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice #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; @@ -130,7 +130,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice /// /// public string ParcelVoiceInfoRequest(string request, string path, string param, - LLUUID agentID, Caps caps) + UUID agentID, Caps caps) { try { @@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice /// /// public string ProvisionVoiceAccountRequest(string request, string path, string param, - LLUUID agentID, Caps caps) + UUID agentID, Caps caps) { try { @@ -199,4 +199,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice return null; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs index f99bfc5..dd592dd 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs @@ -39,7 +39,7 @@ using System; using System.Collections.Generic; using System.Drawing; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -50,8 +50,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class AuraMetaEntity : PointMetaEntity @@ -59,13 +57,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Constructors //transparency of root part, NOT particle system. Should probably add support for changing particle system transparency. - public AuraMetaEntity(Scene scene, uint LocalId, LLVector3 groupPos, float transparency, LLVector3 color, LLVector3 scale) + public AuraMetaEntity(Scene scene, uint LocalId, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale) : base(scene, LocalId, groupPos, transparency) { SetAura(color, scale); } - public AuraMetaEntity(Scene scene, LLUUID uuid, uint LocalId, LLVector3 groupPos, float transparency, LLVector3 color, LLVector3 scale) + public AuraMetaEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale) : base(scene, uuid, LocalId, groupPos, transparency) { SetAura(color, scale); @@ -75,7 +73,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Private Methods - private float Average(LLVector3 values) + private float Average(Vector3 values) { return (values.X + values.Y + values.Z)/3f; } @@ -84,12 +82,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Public Methods - public void SetAura(LLVector3 color, LLVector3 scale) + public void SetAura(Vector3 color, Vector3 scale) { SetAura(color, Average(scale) * 2.0f); } - public void SetAura(LLVector3 color, float radius) + public void SetAura(Vector3 color, float radius) { SceneObjectPart From = m_Entity.RootPart; @@ -110,7 +108,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement SetAura(From, color, radius, burstRadius, age, burstRate, patternFlags); } - public void SetAura(SceneObjectPart From, LLVector3 color, float radius, float burstRadius, float age, float burstRate, libsecondlife.Primitive.ParticleSystem.SourcePattern patternFlags) + public void SetAura(SceneObjectPart From, Vector3 color, float radius, float burstRadius, float age, float burstRate, Primitive.ParticleSystem.SourcePattern patternFlags) { Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive | @@ -139,7 +137,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement prules.PartAcceleration.Y = 0.0f; prules.PartAcceleration.Z = 0.0f; prules.Pattern = patternFlags; //PSYS_SRC_PATTERN - //prules.Texture = LLUUID.Zero;//= LLUUID //PSYS_SRC_TEXTURE, default used if blank + //prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank prules.BurstRate = burstRate; //PSYS_SRC_BURST_RATE prules.BurstPartCount = 2; //PSYS_SRC_BURST_PART_COUNT //prules.BurstRadius = radius; //PSYS_SRC_BURST_RADIUS @@ -160,4 +158,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs index 9e39088..b27bbc0 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs @@ -39,7 +39,7 @@ using System; using System.Collections.Generic; using System.Drawing; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -50,21 +50,19 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class BeamMetaEntity : PointMetaEntity { #region Constructors - public BeamMetaEntity(Scene scene, uint LocalId, LLVector3 groupPos, float transparency, SceneObjectPart To, LLVector3 color) + public BeamMetaEntity(Scene scene, uint LocalId, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color) : base(scene, LocalId, groupPos, transparency) { SetBeamToUUID(To, color); } - public BeamMetaEntity(Scene scene, LLUUID uuid, uint LocalId, LLVector3 groupPos, float transparency, SceneObjectPart To, LLVector3 color) + public BeamMetaEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color) : base(scene, uuid, LocalId, groupPos, transparency) { SetBeamToUUID(To, color); @@ -74,13 +72,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Public Methods - public void SetBeamToUUID(SceneObjectPart To, LLVector3 color) + public void SetBeamToUUID(SceneObjectPart To, Vector3 color) { SceneObjectPart From = m_Entity.RootPart; //Scale size of particles to distance objects are apart (for better visibility) - LLVector3 FromPos = From.GetWorldPosition(); - LLVector3 ToPos = From.GetWorldPosition(); -// LLUUID toUUID = To.UUID; + Vector3 FromPos = From.GetWorldPosition(); + Vector3 ToPos = From.GetWorldPosition(); + UUID toUUID = To.UUID; float distance = (float) (Math.Sqrt(Math.Pow(FromPos.X-ToPos.X, 2) + Math.Pow(FromPos.X-ToPos.Y, 2) + Math.Pow(FromPos.X-ToPos.Z, 2) @@ -94,7 +92,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement SetBeamToUUID(From, To, color, rate, scale, speed); } - public void SetBeamToUUID(SceneObjectPart From, SceneObjectPart To, LLVector3 color, float rate, float scale, float speed) + public void SetBeamToUUID(SceneObjectPart From, SceneObjectPart To, Vector3 color, float rate, float scale, float speed) { Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive | @@ -118,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement prules.PartAcceleration.Y = 0.0f; prules.PartAcceleration.Z = 0.0f; //prules.Pattern = Primitive.ParticleSystem.SourcePattern.Explode; //PSYS_SRC_PATTERN - //prules.Texture = LLUUID.Zero;//= LLUUID //PSYS_SRC_TEXTURE, default used if blank + //prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank prules.BurstRate = rate; //PSYS_SRC_BURST_RATE prules.BurstPartCount = 1; //PSYS_SRC_BURST_PART_COUNT prules.BurstRadius = 0.5f; //PSYS_SRC_BURST_RADIUS @@ -138,4 +136,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs index 6ccb646..072de5e 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs @@ -39,7 +39,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Threading; -using libsecondlife; +using OpenMetaverse; using OpenSim; using OpenSim.Framework; @@ -49,8 +49,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { /// @@ -266,7 +264,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement /// /// Only called by the MainLoop. /// - private void UndoDid(CMModel model, CMView view, LLUUID uuid) + private void UndoDid(CMModel model, CMView view, UUID uuid) { if ((m_state & State.SHOWING_CHANGES) > 0) { @@ -289,7 +287,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_WorkQueue.Enqueue(moreWork); } - protected void ObjectDuplicated(uint localID, LLVector3 offset, uint dupeFlags, LLUUID AgentID, LLUUID GroupID) + protected void ObjectDuplicated(uint localID, Vector3 offset, uint dupeFlags, UUID AgentID, UUID GroupID) { Work moreWork = new Work(); moreWork.Type = WorkType.OBJECTDUPLICATED; @@ -298,8 +296,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_log.Debug("[CONTENT MANAGEMENT] dup queue"); } - protected void ObjectDuplicatedOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, - LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, + protected void ObjectDuplicatedOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, + UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart, bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) { Work moreWork = new Work(); @@ -318,7 +316,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_log.Debug("[CONTENT MANAGEMENT] new client"); } - protected void OnUnDid(IClientAPI remoteClient, LLUUID primId) + protected void OnUnDid(IClientAPI remoteClient, UUID primId) { Work moreWork = new Work(); moreWork.Type = WorkType.UNDODID; @@ -405,7 +403,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement /// /// /// - protected void StopManaging(LLUUID clientUUID) + protected void StopManaging(UUID clientUUID) { foreach(Object sceneobj in m_sceneList.Values) { @@ -433,7 +431,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement } } - protected void UpdateMultiplePosition(uint localID, LLVector3 pos, IClientAPI remoteClient) + protected void UpdateMultiplePosition(uint localID, Vector3 pos, IClientAPI remoteClient) { Work moreWork = new Work(); moreWork.Type = WorkType.OBJECTATTRIBUTECHANGE; @@ -442,7 +440,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_log.Debug("[CONTENT MANAGEMENT] pos"); } - protected void UpdateMultipleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) + protected void UpdateMultipleRotation(uint localID, Quaternion rot, IClientAPI remoteClient) { Work moreWork = new Work(); moreWork.Type = WorkType.OBJECTATTRIBUTECHANGE; @@ -451,7 +449,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_log.Debug("[CONTENT MANAGEMENT] rot"); } - protected void UpdateMultipleScale(uint localID, LLVector3 scale, IClientAPI remoteClient) + protected void UpdateMultipleScale(uint localID, Vector3 scale, IClientAPI remoteClient) { Work moreWork = new Work(); moreWork.Type = WorkType.OBJECTATTRIBUTECHANGE; @@ -460,8 +458,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_log.Debug("[CONTENT MANAGEMENT]scale"); } - protected void UpdateNewParts(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, - byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, + protected void UpdateNewParts(UUID ownerID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, + byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, byte RayEndIsIntersection) { Work moreWork = new Work(); @@ -471,7 +469,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_log.Debug("[CONTENT MANAGEMENT] new parts"); } - protected void UpdateSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient) + protected void UpdateSinglePosition(uint localID, Vector3 pos, IClientAPI remoteClient) { Work moreWork = new Work(); moreWork.Type = WorkType.OBJECTATTRIBUTECHANGE; @@ -483,7 +481,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement /// /// /// - protected void UpdateSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) + protected void UpdateSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient) { Work moreWork = new Work(); moreWork.Type = WorkType.OBJECTATTRIBUTECHANGE; @@ -492,7 +490,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_log.Debug("[CONTENT MANAGEMENT] rot"); } - protected void UpdateSingleScale(uint localID, LLVector3 scale, IClientAPI remoteClient) + protected void UpdateSingleScale(uint localID, Vector3 scale, IClientAPI remoteClient) { Work moreWork = new Work(); moreWork.Type = WorkType.OBJECTATTRIBUTECHANGE; @@ -723,7 +721,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement public Object Data2; //Just more space for holding data. public uint LocalId; //Convenient public WorkType Type; - public LLUUID UUID; //Convenient + public UUID UUID; //Convenient #endregion Fields } @@ -745,4 +743,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Other } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs index 454429c..996badf 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs @@ -40,7 +40,7 @@ using System.Collections; using System.Collections.Generic; using System.Threading; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -52,8 +52,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class CMEntityCollection @@ -63,12 +61,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Any ContentManagementEntities that represent old versions of current SceneObjectGroups or // old versions of deleted SceneObjectGroups will be stored in this hash table. - // The LLUUID keys are from the SceneObjectGroup RootPart UUIDs - protected Hashtable m_CMEntityHash = Hashtable.Synchronized(new Hashtable()); //LLUUID to ContentManagementEntity + // The UUID keys are from the SceneObjectGroup RootPart UUIDs + protected Hashtable m_CMEntityHash = Hashtable.Synchronized(new Hashtable()); //UUID to ContentManagementEntity // SceneObjectParts that have not been revisioned will be given green auras stored in this hashtable - // The LLUUID keys are from the SceneObjectPart that they are supposed to be on. - protected Hashtable m_NewlyCreatedEntityAura = Hashtable.Synchronized(new Hashtable()); //LLUUID to AuraMetaEntity + // The UUID keys are from the SceneObjectPart that they are supposed to be on. + protected Hashtable m_NewlyCreatedEntityAura = Hashtable.Synchronized(new Hashtable()); //UUID to AuraMetaEntity #endregion Fields @@ -151,7 +149,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement part.ParentGroup.Scene.PrimIDAllocate(), part.GetWorldPosition(), MetaEntity.TRANSLUCENT, - new LLVector3(0,254,0), + new Vector3(0,254,0), part.Scale ); m_NewlyCreatedEntityAura.Add(part.UUID, ent); @@ -175,7 +173,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement return ent; } - public bool RemoveEntity(LLUUID uuid) + public bool RemoveEntity(UUID uuid) { if (!m_CMEntityHash.ContainsKey(uuid)) return false; @@ -183,7 +181,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement return true; } - public bool RemoveNewlyCreatedEntityAura(LLUUID uuid) + public bool RemoveNewlyCreatedEntityAura(UUID uuid) { if (!m_NewlyCreatedEntityAura.ContainsKey(uuid)) return false; @@ -193,4 +191,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs index 92ae0d7..e1b4129 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs @@ -39,7 +39,7 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics; -using libsecondlife; +using OpenMetaverse; using OpenSim; using OpenSim.Framework; @@ -49,8 +49,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class CMModel @@ -133,14 +131,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_MetaEntityCollection.ClearAll(); } - public ContentManagementEntity FindMetaEntityAffectedByUndo(LLUUID uuid) + public ContentManagementEntity FindMetaEntityAffectedByUndo(UUID uuid) { ContentManagementEntity ent = GetMetaGroupByPrim(uuid); return ent; } //-------------------------------- HELPERS --------------------------------------------------------------------// - public ContentManagementEntity GetMetaGroupByPrim(LLUUID uuid) + public ContentManagementEntity GetMetaGroupByPrim(UUID uuid) { foreach (Object ent in m_MetaEntityCollection.Entities.Values) { @@ -194,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement SceneObjectGroup temp = null; System.Collections.Hashtable deleteListUUIDs = new Hashtable(); // Dictionary SearchList = new Dictionary(); - Dictionary ReplacementList = new Dictionary(); + Dictionary ReplacementList = new Dictionary(); int revision = m_database.GetMostRecentRevision(scene.RegionInfo.RegionID); // EntityBase[] searchArray; @@ -255,14 +253,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement break; } - foreach(LLUUID uuid in deleteListUUIDs.Keys) + foreach(UUID uuid in deleteListUUIDs.Keys) { try { // I thought that the DeleteGroup() function would handle all of this, but it doesn't. I'm not sure WHAT it handles. ((SceneObjectGroup)scene.Entities[uuid]).DetachFromBackup((SceneObjectGroup)scene.Entities[uuid]); scene.PhysicsScene.RemovePrim(((SceneObjectGroup)scene.Entities[uuid]).RootPart.PhysActor); - scene.SendKillObject(scene.Entities[uuid].LocalId); + scene.SendKiPrimitive(scene.Entities[uuid].LocalId); scene.m_innerScene.DeleteSceneObject(uuid, false); ((SceneObjectGroup)scene.Entities[uuid]).DeleteGroup(); } @@ -284,7 +282,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement if (!(ent is SceneObjectGroup)) continue; - if ((((SceneObjectGroup)ent).RootPart.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Phantom) == 0) + if ((((SceneObjectGroup)ent).RootPart.GetEffectiveObjectFlags() & (uint) PrimFlags.Phantom) == 0) ((SceneObjectGroup)ent).ApplyPhysics(true); ((SceneObjectGroup)ent).AttachToBackup(); ((SceneObjectGroup)ent).HasGroupChanged = true; // If not true, then attaching to backup does nothing because no change is detected. @@ -346,7 +344,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement { if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID)) { - ((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).SetAura(new LLVector3(0,254,0), part.Scale); + ((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).SetAura(new Vector3(0,254,0), part.Scale); ((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).RootPart.GroupPosition = part.GetWorldPosition(); auraList.Add((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]); } @@ -356,4 +354,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMView.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMView.cs index fca2830..90ef6ef 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMView.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMView.cs @@ -39,7 +39,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim; using OpenSim.Framework; @@ -49,8 +49,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class CMView @@ -136,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement SendSimChatMessage(scene, menu); } - public void DisplayMetaEntity(LLUUID uuid) + public void DisplayMetaEntity(UUID uuid) { ContentManagementEntity group = m_model.GetMetaGroupByPrim(uuid); if (group != null) @@ -199,10 +197,10 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement public void SendSimChatMessage(Scene scene, string message) { - scene.SimChat(Helpers.StringToField(message), - ChatTypeEnum.Broadcast, 0, new LLVector3(0,0,0), "Content Manager", LLUUID.Zero, false); + scene.SimChat(Utils.StringToBytes(message), + ChatTypeEnum.Broadcast, 0, new Vector3(0,0,0), "Content Manager", UUID.Zero, false); } #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs index 8e0dd33..819ff87 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs @@ -38,7 +38,7 @@ using System; using System.Collections.Generic; using System.Drawing; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -49,8 +49,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class ContentManagementEntity : MetaEntity @@ -64,8 +62,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Fields - protected Dictionary m_AuraEntities = new Dictionary(); - protected Dictionary m_BeamEntities = new Dictionary(); + protected Dictionary m_AuraEntities = new Dictionary(); + protected Dictionary m_BeamEntities = new Dictionary(); // The LinkNum of parts in m_Entity and m_UnchangedEntity are the same though UUID and LocalId are different. // This can come in handy. @@ -108,7 +106,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement /// /// Check if an entitybase list (like that returned by scene.GetEntities() ) contains a group with the rootpart uuid that matches the current uuid. /// - private bool ContainsKey(List list, LLUUID uuid) + private bool ContainsKey(List list, UUID uuid) { foreach( EntityBase part in list) if (part.UUID == uuid) @@ -116,7 +114,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement return false; } - private SceneObjectGroup GetGroupByUUID(System.Collections.Generic.List list, LLUUID uuid) + private SceneObjectGroup GetGroupByUUID(System.Collections.Generic.List list, UUID uuid) { foreach (EntityBase ent in list) { @@ -150,7 +148,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement // if already displaying a red aura over part, make sure its red if (m_AuraEntities.ContainsKey(part.UUID)) { - m_AuraEntities[part.UUID].SetAura(new LLVector3(254,0,0), part.Scale); + m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale); } else { @@ -158,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_Entity.Scene.PrimIDAllocate(), part.GetWorldPosition(), MetaEntity.TRANSLUCENT, - new LLVector3(254,0,0), + new Vector3(254,0,0), part.Scale ); m_AuraEntities.Add(part.UUID, auraGroup); @@ -189,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement /// /// Check if the revisioned scene object group that this CMEntity is based off of contains a child with the given UUID. /// - public bool HasChildPrim(LLUUID uuid) + public bool HasChildPrim(UUID uuid) { if (m_UnchangedEntity.Children.ContainsKey(uuid)) return true; @@ -266,7 +264,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_UnchangedEntity.RootPart.GetWorldPosition(), MetaEntity.TRANSLUCENT, sceneEntityPart, - new LLVector3(0,0,254) + new Vector3(0,0,254) ); m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup); } @@ -280,7 +278,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_Entity.Scene.PrimIDAllocate(), UnchangedPart.GetWorldPosition(), MetaEntity.TRANSLUCENT, - new LLVector3(0,0,254), + new Vector3(0,0,254), UnchangedPart.Scale ); m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); @@ -314,7 +312,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_Entity.Scene.PrimIDAllocate(), UnchangedPart.GetWorldPosition(), MetaEntity.TRANSLUCENT, - new LLVector3(254,0,0), + new Vector3(254,0,0), UnchangedPart.Scale ); m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); @@ -386,4 +384,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementModule.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementModule.cs index d5423e0..85eb927 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementModule.cs @@ -36,7 +36,7 @@ using System; using System.Collections.Generic; using System.Threading; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -48,8 +48,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class ContentManagementModule : IRegionModule @@ -162,4 +160,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/FileSystemDatabase.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/FileSystemDatabase.cs index c675365..66d279a 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/FileSystemDatabase.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/FileSystemDatabase.cs @@ -40,7 +40,7 @@ using Slash = System.IO.Path; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -53,8 +53,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class FileSystemDatabase : IContentDatabase @@ -70,8 +68,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Fields private string m_repodir = null; - private Dictionary m_scenes = new Dictionary(); - private Dictionary m_serialiser = new Dictionary(); + private Dictionary m_scenes = new Dictionary(); + private Dictionary m_serialiser = new Dictionary(); #endregion Fields @@ -92,7 +90,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement if (!Directory.Exists(m_repodir)) Directory.CreateDirectory(m_repodir); - foreach (LLUUID region in m_scenes.Keys) + foreach (UUID region in m_scenes.Keys) { scenedir = m_repodir + Slash.DirectorySeparatorChar + region + Slash.DirectorySeparatorChar; if (!Directory.Exists(scenedir)) @@ -104,7 +102,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement private void SetupSerialiser() { if (m_serialiser.Count == 0) - foreach(LLUUID region in m_scenes.Keys) + foreach(UUID region in m_scenes.Keys) m_serialiser.Add(region, m_scenes[region].RequestModuleInterface() ); @@ -114,12 +112,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Public Methods - public int GetMostRecentRevision(LLUUID regionid) + public int GetMostRecentRevision(UUID regionid) { return NumOfRegionRev(regionid); } - public string GetRegionObjectHeightMap(LLUUID regionid) + public string GetRegionObjectHeightMap(UUID regionid) { String filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar + "heightmap.r32"; @@ -131,7 +129,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement return result; } - public string GetRegionObjectHeightMap(LLUUID regionid, int revision) + public string GetRegionObjectHeightMap(UUID regionid, int revision) { String filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar + "heightmap.r32"; @@ -143,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement return result; } - public System.Collections.ArrayList GetRegionObjectXMLList(LLUUID regionid, int revision) + public System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid, int revision) { System.Collections.ArrayList objectList = new System.Collections.ArrayList(); string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar + @@ -169,7 +167,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement return null; } - public System.Collections.ArrayList GetRegionObjectXMLList(LLUUID regionid) + public System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid) { int revision = NumOfRegionRev(regionid); m_log.Info("[FSDB]: found revisions:" + revision); @@ -215,7 +213,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement m_scenes.Add(scene.RegionInfo.RegionID, scene); } - public System.Collections.Generic.SortedDictionary ListOfRegionRevisions(LLUUID regionid) + public System.Collections.Generic.SortedDictionary ListOfRegionRevisions(UUID regionid) { SortedDictionary revisionDict = new SortedDictionary(); @@ -244,7 +242,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement return revisionDict; } - public int NumOfRegionRev(LLUUID regionid) + public int NumOfRegionRev(UUID regionid) { string scenedir = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar; m_log.Info("[FSDB]: Reading scene dir: " + scenedir); @@ -261,7 +259,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement CreateDirectory(); } - public void SaveRegion(LLUUID regionid, string regionName, string logMessage) + public void SaveRegion(UUID regionid, string regionName, string logMessage) { m_log.Info("[FSDB]: ..............................."); string scenedir = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar; @@ -311,4 +309,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/GitDatabase.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/GitDatabase.cs index 6417a0f..9fd542c 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/GitDatabase.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/GitDatabase.cs @@ -41,7 +41,7 @@ using Slash = System.IO.Path; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -54,8 +54,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { /// @@ -73,57 +71,57 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Public Methods - public SceneObjectGroup GetMostRecentObjectRevision(LLUUID id) + public SceneObjectGroup GetMostRecentObjectRevision(UUID id) { return null; } - public int GetMostRecentRevision(LLUUID regionid) + public int GetMostRecentRevision(UUID regionid) { return 0; } - public SceneObjectGroup GetObjectRevision(LLUUID id, int revision) + public SceneObjectGroup GetObjectRevision(UUID id, int revision) { return null; } - public System.Collections.ArrayList GetObjectsFromRegion(LLUUID regionid, int revision) + public System.Collections.ArrayList GetObjectsFromRegion(UUID regionid, int revision) { return null; } - public string GetRegionObjectHeightMap(LLUUID regionid) + public string GetRegionObjectHeightMap(UUID regionid) { return null; } - public string GetRegionObjectHeightMap(LLUUID regionid, int revision) + public string GetRegionObjectHeightMap(UUID regionid, int revision) { return null; } - public string GetRegionObjectXML(LLUUID regionid) + public string GetRegionObjectXML(UUID regionid) { return null; } - public string GetRegionObjectXML(LLUUID regionid, int revision) + public string GetRegionObjectXML(UUID regionid, int revision) { return null; } - public System.Collections.ArrayList GetRegionObjectXMLList(LLUUID regionid) + public System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid) { return null; } - public System.Collections.ArrayList GetRegionObjectXMLList(LLUUID regionid, int revision) + public System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid, int revision) { return null; } - public bool InRepository(LLUUID id) + public bool InRepository(UUID id) { return false; } @@ -132,22 +130,22 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement { } - public System.Collections.Generic.SortedDictionary ListOfObjectRevisions(LLUUID id) + public System.Collections.Generic.SortedDictionary ListOfObjectRevisions(UUID id) { return null; } - public System.Collections.Generic.SortedDictionary ListOfRegionRevisions(LLUUID id) + public System.Collections.Generic.SortedDictionary ListOfRegionRevisions(UUID id) { return null; } - public int NumOfObjectRev(LLUUID id) + public int NumOfObjectRev(UUID id) { return 0; } - public int NumOfRegionRev(LLUUID regionid) + public int NumOfRegionRev(UUID regionid) { return 0; } @@ -160,10 +158,10 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement { } - public void SaveRegion(LLUUID regionid, string regionName, string logMessage) + public void SaveRegion(UUID regionid, string regionName, string logMessage) { } #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/IContentDatabase.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/IContentDatabase.cs index 6a940d3..638172b 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/IContentDatabase.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/IContentDatabase.cs @@ -36,11 +36,8 @@ #endregion Header using System; - -using libsecondlife; - +using OpenMetaverse; using OpenSim.Region.Environment.Scenes; - using Nini.Config; namespace OpenSim.Region.Environment.Modules.ContentManagement @@ -52,18 +49,18 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement /// /// Returns the most recent revision number of a region. /// - int GetMostRecentRevision(LLUUID regionid); + int GetMostRecentRevision(UUID regionid); - string GetRegionObjectHeightMap(LLUUID regionid); + string GetRegionObjectHeightMap(UUID regionid); - string GetRegionObjectHeightMap(LLUUID regionid, int revision); + string GetRegionObjectHeightMap(UUID regionid, int revision); /// /// Retrieves the xml that describes each individual object from the last revision or specific revision of the given region. /// - System.Collections.ArrayList GetRegionObjectXMLList(LLUUID regionid); + System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid); - System.Collections.ArrayList GetRegionObjectXMLList(LLUUID regionid, int revision); + System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid, int revision); /// /// Similar to the IRegionModule function. This is the function to be called before attempting to interface with the database. @@ -75,12 +72,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement /// /// Returns a list of the revision numbers and corresponding log messages for a given region. /// - System.Collections.Generic.SortedDictionary ListOfRegionRevisions(LLUUID id); + System.Collections.Generic.SortedDictionary ListOfRegionRevisions(UUID id); /// /// Returns the total number of revisions saved for a specific region. /// - int NumOfRegionRev(LLUUID regionid); + int NumOfRegionRev(UUID regionid); /// /// Should be called once after Initialise has been called. @@ -90,8 +87,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement /// /// Saves the Region terrain map and objects within the region as xml to the database. /// - void SaveRegion(LLUUID regionid, string regionName, string logMessage); + void SaveRegion(UUID regionid, string regionName, string logMessage); #endregion Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs index 4823bfd..5a6dbc8 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs @@ -39,7 +39,7 @@ using System; using System.Collections.Generic; using System.Drawing; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -50,8 +50,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class MetaEntity @@ -109,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Public Properties - public Dictionary Children + public Dictionary Children { get { return m_Entity.Children; } set { m_Entity.Children = value; } @@ -142,7 +140,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement get { return m_Entity.Scene; } } - public LLUUID UUID + public UUID UUID { get { return m_Entity.UUID; } set { m_Entity.UUID = value; } @@ -161,7 +159,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement protected void Initialize(bool physics) { //make new uuids - Dictionary parts = new Dictionary(); + Dictionary parts = new Dictionary(); foreach(SceneObjectPart part in m_Entity.Children.Values) { part.ResetIDs(part.LinkNum); @@ -191,7 +189,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement //This is important because we are not IN any database. //m_Entity.FakeDeleteGroup(); foreach( SceneObjectPart part in m_Entity.Children.Values) - client.SendKillObject(m_Entity.RegionHandle, part.LocalId); + client.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); } /// @@ -201,7 +199,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement { foreach( SceneObjectPart part in m_Entity.Children.Values) m_Entity.Scene.ClientManager.ForEachClient(delegate(IClientAPI controller) - { controller.SendKillObject(m_Entity.RegionHandle, part.LocalId); } + { controller.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); } ); } @@ -237,12 +235,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement /// public static void SetPartTransparency(SceneObjectPart part, float transparencyAmount) { - LLObject.TextureEntry tex = null; - LLColor texcolor; + Primitive.TextureEntry tex = null; + Color4 texcolor; try { tex = part.Shape.Textures; - texcolor = new LLColor(); + texcolor = new Color4(); } catch(Exception) { @@ -280,4 +278,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs index cafc2bf..b0c6955 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs @@ -39,7 +39,7 @@ using System; using System.Collections.Generic; using System.Drawing; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -50,22 +50,20 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { public class PointMetaEntity : MetaEntity { #region Constructors - public PointMetaEntity(Scene scene, uint LocalId, LLVector3 groupPos, float transparency) + public PointMetaEntity(Scene scene, uint LocalId, Vector3 groupPos, float transparency) : base() { - CreatePointEntity(scene, LLUUID.Random(), LocalId, groupPos); + CreatePointEntity(scene, UUID.Random(), LocalId, groupPos); SetPartTransparency(m_Entity.RootPart, transparency); } - public PointMetaEntity(Scene scene, LLUUID uuid, uint LocalId, LLVector3 groupPos, float transparency) + public PointMetaEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos, float transparency) : base() { CreatePointEntity(scene, uuid, LocalId, groupPos); @@ -76,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Private Methods - private void CreatePointEntity(Scene scene, LLUUID uuid, uint LocalId, LLVector3 groupPos) + private void CreatePointEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos) { SceneObjectGroup x = new SceneObjectGroup(); SceneObjectPart y = new SceneObjectPart(); @@ -85,23 +83,23 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement y.Name = "Very Small Point"; y.RegionHandle = scene.RegionInfo.RegionHandle; y.CreationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; - y.OwnerID = LLUUID.Zero; - y.CreatorID = LLUUID.Zero; - y.LastOwnerID = LLUUID.Zero; + y.OwnerID = UUID.Zero; + y.CreatorID = UUID.Zero; + y.LastOwnerID = UUID.Zero; y.UUID = uuid; y.LocalId = LocalId; y.Shape = PrimitiveBaseShape.CreateBox(); - y.Scale = new LLVector3(0.01f,0.01f,0.01f); - y.LastOwnerID = LLUUID.Zero; + y.Scale = new Vector3(0.01f,0.01f,0.01f); + y.LastOwnerID = UUID.Zero; y.GroupPosition = groupPos; - y.OffsetPosition = new LLVector3(0, 0, 0); - y.RotationOffset = new LLQuaternion(0,0,0,0); - y.Velocity = new LLVector3(0, 0, 0); - y.RotationalVelocity = new LLVector3(0, 0, 0); - y.AngularVelocity = new LLVector3(0, 0, 0); - y.Acceleration = new LLVector3(0, 0, 0); + y.OffsetPosition = new Vector3(0, 0, 0); + y.RotationOffset = new Quaternion(0,0,0,0); + y.Velocity = new Vector3(0, 0, 0); + y.RotationalVelocity = new Vector3(0, 0, 0); + y.AngularVelocity = new Vector3(0, 0, 0); + y.Acceleration = new Vector3(0, 0, 0); y.Flags = 0; y.TrimPermissions(); @@ -121,4 +119,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Private Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs index 38938c6..ba937f5 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs @@ -37,7 +37,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Drawing; -using libsecondlife; +using OpenMetaverse; using Nini.Config; @@ -48,8 +48,6 @@ using OpenSim.Region.Physics.Manager; using log4net; -using Axiom.Math; - namespace OpenSim.Region.Environment.Modules.ContentManagement { #region Enumerations @@ -99,14 +97,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #region Private Methods - private static bool AreQuaternionsEquivalent(LLQuaternion first, LLQuaternion second) + private static bool AreQuaternionsEquivalent(Quaternion first, Quaternion second) { - LLVector3 firstVector = llRot2Euler(first); - LLVector3 secondVector = llRot2Euler(second); + Vector3 firstVector = llRot2Euler(first); + Vector3 secondVector = llRot2Euler(second); return AreVectorsEquivalent(firstVector, secondVector); } - private static bool AreVectorsEquivalent(LLVector3 first, LLVector3 second) + private static bool AreVectorsEquivalent(Vector3 first, Vector3 second) { if(TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2) && TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2) @@ -133,21 +131,21 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs // Also changed the original function from LSL_Types to LL types - private static LLVector3 llRot2Euler(LLQuaternion r) + private static Vector3 llRot2Euler(Quaternion r) { - LLQuaternion t = new LLQuaternion(r.X * r.X, r.Y * r.Y, r.Z * r.Z, r.W * r.W); + Quaternion t = new Quaternion(r.X * r.X, r.Y * r.Y, r.Z * r.Z, r.W * r.W); double m = (t.X + t.Y + t.Z + t.W); - if (m == 0) return new LLVector3(); + if (m == 0) return new Vector3(); double n = 2 * (r.Y * r.W + r.X * r.Z); double p = m * m - n * n; if (p > 0) - return new LLVector3((float)NormalizeAngle(Math.Atan2(2.0 * (r.X * r.W - r.Y * r.Z), (-t.X - t.Y + t.Z + t.W))), + return new Vector3((float)NormalizeAngle(Math.Atan2(2.0 * (r.X * r.W - r.Y * r.Z), (-t.X - t.Y + t.Z + t.W))), (float)NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), (float)NormalizeAngle(Math.Atan2(2.0 * (r.Z * r.W - r.X * r.Y), (t.X - t.Y - t.Z + t.W)))); else if (n > 0) - return new LLVector3(0.0f, (float)(Math.PI / 2), (float)NormalizeAngle(Math.Atan2((r.Z * r.W + r.X * r.Y), 0.5 - t.X - t.Z))); + return new Vector3(0.0f, (float)(Math.PI / 2), (float)NormalizeAngle(Math.Atan2((r.Z * r.W + r.X * r.Y), 0.5 - t.X - t.Z))); else - return new LLVector3(0.0f, (float)(-Math.PI / 2), (float)NormalizeAngle(Math.Atan2((r.Z * r.W + r.X * r.Y), 0.5 - t.X - t.Z))); + return new Vector3(0.0f, (float)(-Math.PI / 2), (float)NormalizeAngle(Math.Atan2((r.Z * r.W + r.X * r.Y), 0.5 - t.X - t.Z))); } #endregion Private Methods @@ -187,7 +185,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement result |= Diff.ROTATIONOFFSET; - // MISC COMPARISONS (LLUUID, Byte) + // MISC COMPARISONS (UUID, Byte) if(first.ClickAction != second.ClickAction) result |= Diff.CLICKACTION; if(first.ObjectOwner != second.ObjectOwner) @@ -217,4 +215,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement #endregion Public Methods } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index 8fad62f..8fd4104 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs @@ -37,8 +37,8 @@ using System.Reflection; using System.Text.RegularExpressions; using System.Threading; -using libsecondlife; -using libsecondlife.StructuredData; +using OpenMetaverse; +using OpenMetaverse.StructuredData; using log4net; using Nini.Config; @@ -50,9 +50,9 @@ using OpenSim.Region.Environment.Scenes; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Communications.Capabilities; using OpenSim.Framework.Statistics; -using LLSD = libsecondlife.StructuredData.LLSD; -using LLSDMap = libsecondlife.StructuredData.LLSDMap; -using LLSDArray = libsecondlife.StructuredData.LLSDArray; +using LLSD = OpenMetaverse.StructuredData.LLSD; +using LLSDMap = OpenMetaverse.StructuredData.LLSDMap; +using LLSDArray = OpenMetaverse.StructuredData.LLSDArray; namespace OpenSim.Region.Environment.Modules.InterGrid { @@ -60,12 +60,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid { public string first_name; public string last_name; - public LLUUID agent_id; - public LLUUID local_agent_id; - public LLUUID region_id; + public UUID agent_id; + public UUID local_agent_id; + public UUID region_id; public uint circuit_code; - public LLUUID secure_session_id; - public LLUUID session_id; + public UUID secure_session_id; + public UUID session_id; public bool agent_access; public string sim_access; public uint god_level; @@ -89,7 +89,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid private List m_scene = new List(); private Dictionary CapsLoginID = new Dictionary(); - private Dictionary m_OGPState = new Dictionary(); + private Dictionary m_OGPState = new Dictionary(); private string LastNameSuffix = "_EXTERNAL"; private string FirstNamePrefix = ""; @@ -231,10 +231,10 @@ namespace OpenSim.Region.Environment.Modules.InterGrid //string RegionURI = reg.ServerURI; //int RegionPort = (int)reg.HttpPort; - LLUUID RemoteAgentID = requestMap["agent_id"].AsUUID(); + UUID RemoteAgentID = requestMap["agent_id"].AsUUID(); // will be used in the future. The client always connects with the aditi agentid currently - LLUUID LocalAgentID = RemoteAgentID; + UUID LocalAgentID = RemoteAgentID; string FirstName = requestMap["first_name"].AsString(); string LastName = requestMap["last_name"].AsString(); @@ -274,15 +274,15 @@ namespace OpenSim.Region.Environment.Modules.InterGrid // Generate a dummy agent for the user so we can get back a CAPS path AgentCircuitData agentData = new AgentCircuitData(); agentData.AgentID = LocalAgentID; - agentData.BaseFolder=LLUUID.Zero; + agentData.BaseFolder=UUID.Zero; agentData.CapsPath=Util.GetRandomCapsPath(); agentData.child = false; agentData.circuitcode = (uint)(Util.RandomClass.Next()); agentData.firstname = FirstName; agentData.lastname = LastName; - agentData.SecureSessionID=LLUUID.Random(); - agentData.SessionID=LLUUID.Random(); - agentData.startpos = new LLVector3(128f, 128f, 100f); + agentData.SecureSessionID=UUID.Random(); + agentData.SessionID=UUID.Random(); + agentData.startpos = new Vector3(128f, 128f, 100f); // Pre-Fill our region cache with information on the agent. UserAgentData useragent = new UserAgentData(); @@ -308,14 +308,14 @@ namespace OpenSim.Region.Environment.Modules.InterGrid userProfile.CurrentAgent = useragent; userProfile.CustomType = "OGP"; userProfile.FirstLifeAboutText = "I'm testing OpenGrid Protocol"; - userProfile.FirstLifeImage = LLUUID.Zero; + userProfile.FirstLifeImage = UUID.Zero; userProfile.FirstName = agentData.firstname; userProfile.GodLevel = 0; userProfile.HomeLocation = agentData.startpos; userProfile.HomeLocationX = agentData.startpos.X; userProfile.HomeLocationY = agentData.startpos.Y; userProfile.HomeLocationZ = agentData.startpos.Z; - userProfile.HomeLookAt = LLVector3.Zero; + userProfile.HomeLookAt = Vector3.Zero; userProfile.HomeLookAtX = userProfile.HomeLookAt.X; userProfile.HomeLookAtY = userProfile.HomeLookAt.Y; userProfile.HomeLookAtZ = userProfile.HomeLookAt.Z; @@ -324,18 +324,18 @@ namespace OpenSim.Region.Environment.Modules.InterGrid userProfile.HomeRegionX = reg.RegionLocX; userProfile.HomeRegionY = reg.RegionLocY; userProfile.ID = agentData.AgentID; - userProfile.Image = LLUUID.Zero; + userProfile.Image = UUID.Zero; userProfile.LastLogin = Util.UnixTimeSinceEpoch(); - userProfile.Partner = LLUUID.Zero; + userProfile.Partner = UUID.Zero; userProfile.PasswordHash = "$1$"; userProfile.PasswordSalt = ""; - userProfile.RootInventoryFolderID = LLUUID.Zero; + userProfile.RootInventoryFolderID = UUID.Zero; userProfile.SurName = agentData.lastname; userProfile.UserAssetURI = homeScene.CommsManager.NetworkServersInfo.AssetURL; userProfile.UserFlags = 0; userProfile.UserInventoryURI = homeScene.CommsManager.NetworkServersInfo.InventoryURL; userProfile.WantDoMask = 0; - userProfile.WebLoginKey = LLUUID.Random(); + userProfile.WebLoginKey = UUID.Random(); // Do caps registration // get seed cap @@ -348,7 +348,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid //string raCap = string.Empty; - LLUUID AvatarRezCapUUID = LLUUID.Random(); + UUID AvatarRezCapUUID = UUID.Random(); string rezAvatarPath = "/agent/" + AvatarRezCapUUID + "/rez_avatar"; // Get a reference to the user's cap so we can pull out the Caps Object Path @@ -389,8 +389,8 @@ namespace OpenSim.Region.Environment.Modules.InterGrid LLSDMap requestMap = (LLSDMap)request; // take these values to start. There's a few more - LLUUID SecureSessionID=requestMap["secure_session_id"].AsUUID(); - LLUUID SessionID = requestMap["session_id"].AsUUID(); + UUID SecureSessionID=requestMap["secure_session_id"].AsUUID(); + UUID SessionID = requestMap["session_id"].AsUUID(); int circuitcode = requestMap["circuit_code"].AsInteger(); LLSDArray Parameter = new LLSDArray(); if (requestMap.ContainsKey("parameter")) @@ -401,7 +401,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid //int version = 1; int estateID = 1; int parentEstateID = 1; - LLUUID regionID = LLUUID.Zero; + UUID regionID = UUID.Zero; bool visibleToParent = true; for (int i = 0; i < Parameter.Count; i++) @@ -537,17 +537,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid m_log.InfoFormat("[OGP]: prefix {0}, uuid {1}, suffix {2}", PathArray[1], PathArray[2], PathArray[3]); string uuidString = PathArray[2]; m_log.InfoFormat("[OGP]: Request to Derez avatar with UUID {0}", uuidString); - LLUUID userUUID = LLUUID.Zero; - if (Helpers.TryParse(uuidString, out userUUID)) + UUID userUUID = UUID.Zero; + if (UUID.TryParse(uuidString, out userUUID)) { - LLUUID RemoteID = uuidString; - LLUUID LocalID = RemoteID; + UUID RemoteID = uuidString; + UUID LocalID = RemoteID; // FIXME: TODO: Routine to map RemoteUUIDs to LocalUUIds // would be done already.. but the client connects with the Aditi UUID // regardless over the UDP stack OGPState userState = GetOGPState(LocalID); - if (userState.agent_id != LLUUID.Zero) + if (userState.agent_id != UUID.Zero) { //LLSDMap outboundRequestMap = new LLSDMap(); LLSDMap inboundRequestMap = (LLSDMap)request; @@ -592,7 +592,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid int rrX = rezResponseMap["region_x"].AsInteger(); int rrY = rezResponseMap["region_y"].AsInteger(); m_log.ErrorFormat("X:{0}, Y:{1}", rrX, rrY); - LLUUID rrRID = rezResponseMap["region_id"].AsUUID(); + UUID rrRID = rezResponseMap["region_id"].AsUUID(); string rrAccess = rezResponseMap["sim_access"].AsString(); @@ -802,12 +802,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid OGPState returnState = new OGPState(); returnState.first_name = ""; returnState.last_name = ""; - returnState.agent_id = LLUUID.Zero; - returnState.local_agent_id = LLUUID.Zero; - returnState.region_id = LLUUID.Zero; + returnState.agent_id = UUID.Zero; + returnState.local_agent_id = UUID.Zero; + returnState.region_id = UUID.Zero; returnState.circuit_code = 0; - returnState.secure_session_id = LLUUID.Zero; - returnState.session_id = LLUUID.Zero; + returnState.secure_session_id = UUID.Zero; + returnState.session_id = UUID.Zero; returnState.agent_access = true; returnState.god_level = 0; returnState.god_overide = false; @@ -827,7 +827,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid return returnState; } - private OGPState GetOGPState(LLUUID agentId) + private OGPState GetOGPState(UUID agentId) { lock (m_OGPState) { @@ -842,7 +842,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid } } - public void DeleteOGPState(LLUUID agentId) + public void DeleteOGPState(UUID agentId) { lock (m_OGPState) { @@ -851,7 +851,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid } } - private void UpdateOGPState(LLUUID agentId, OGPState state) + private void UpdateOGPState(UUID agentId, OGPState state) { lock (m_OGPState) { @@ -866,7 +866,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid } } - public void ShutdownConnection(LLUUID avatarId, OpenGridProtocolModule mod) + public void ShutdownConnection(UUID avatarId, OpenGridProtocolModule mod) { Scene homeScene = GetRootScene(); ScenePresence avatar = null; @@ -905,7 +905,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid public void ShutdownNoLogout() { - LLUUID avUUID = LLUUID.Zero; + UUID avUUID = UUID.Zero; if (avToBeKilled != null) { diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs index 15ce584..59d29d6 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -29,9 +29,9 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; -using libsecondlife; +using OpenMetaverse; +using OpenMetaverse.Imaging; using Nini.Config; -using OpenJPEGNet; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -40,12 +40,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture { public class DynamicTextureModule : IRegionModule, IDynamicTextureManager { - private Dictionary RegisteredScenes = new Dictionary(); + private Dictionary RegisteredScenes = new Dictionary(); private Dictionary RenderPlugins = new Dictionary(); - private Dictionary Updaters = new Dictionary(); + private Dictionary Updaters = new Dictionary(); #region IDynamicTextureManager Members @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture /// /// /// - public void ReturnData(LLUUID id, byte[] data) + public void ReturnData(UUID id, byte[] data) { if (Updaters.ContainsKey(id)) { @@ -75,13 +75,13 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture } } - public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, + public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer) { return AddDynamicTextureURL(simID, primID, contentType, url, extraParams, updateTimer, false, 255); } - public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, + public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) { if (RenderPlugins.ContainsKey(contentType)) @@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture updater.ContentType = contentType; updater.Url = url; updater.UpdateTimer = updateTimer; - updater.UpdaterID = LLUUID.Random(); + updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; @@ -107,16 +107,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); return updater.UpdaterID; } - return LLUUID.Zero; + return UUID.Zero; } - public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, + public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer) { return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, false, 255); } - public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, + public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) { if (RenderPlugins.ContainsKey(contentType)) @@ -127,7 +127,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture updater.ContentType = contentType; updater.BodyData = data; updater.UpdateTimer = updateTimer; - updater.UpdaterID = LLUUID.Random(); + updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; @@ -140,7 +140,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); return updater.UpdaterID; } - return LLUUID.Zero; + return UUID.Zero; } #endregion @@ -184,18 +184,18 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture public string BodyData; public string ContentType; public byte FrontAlpha = 255; - public LLUUID LastAssetID; + public UUID LastAssetID; public string Params; - public LLUUID PrimID; + public UUID PrimID; public bool SetNewFrontAlpha = false; - public LLUUID SimUUID; - public LLUUID UpdaterID; + public UUID SimUUID; + public UUID UpdaterID; public int UpdateTimer; public string Url; public DynamicTextureUpdater() { - LastAssetID = LLUUID.Zero; + LastAssetID = UUID.Zero; UpdateTimer = 0; BodyData = null; } @@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture if (BlendWithOldTexture) { - LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; + UUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; oldAsset = scene.AssetCache.GetAsset(lastTextureID, true); if (oldAsset != null) { @@ -231,7 +231,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture // Create a new asset for user AssetBase asset = new AssetBase(); - asset.FullID = LLUUID.Random(); + asset.FullID = UUID.Random(); asset.Data = assetData; asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); asset.Type = 0; @@ -243,10 +243,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture LastAssetID = asset.FullID; // mostly keep the values from before - LLObject.TextureEntry tmptex = part.Shape.Textures; + Primitive.TextureEntry tmptex = part.Shape.Textures; // remove the old asset from the cache - LLUUID oldID = tmptex.DefaultTexture.TextureID; + UUID oldID = tmptex.DefaultTexture.TextureID; scene.AssetCache.ExpireAsset(oldID); tmptex.DefaultTexture.TextureID = asset.FullID; @@ -259,15 +259,27 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha) { - Bitmap image1 = new Bitmap(OpenJPEG.DecodeToImage(frontImage)); - Bitmap image2 = new Bitmap(OpenJPEG.DecodeToImage(backImage)); - if (setNewAlpha) + ManagedImage managedImage; + Image image; + + if (OpenJPEG.DecodeToImage(frontImage, out managedImage, out image)) { - SetAlpha(ref image1, newAlpha); + Bitmap image1 = new Bitmap(image); + + if (OpenJPEG.DecodeToImage(backImage, out managedImage, out image)) + { + Bitmap image2 = new Bitmap(image); + + if (setNewAlpha) + SetAlpha(ref image1, newAlpha); + + Bitmap joint = MergeBitMaps(image1, image2); + + return OpenJPEG.EncodeFromImage(joint, true); + } } - Bitmap joint = MergeBitMaps(image1, image2); - return OpenJPEG.EncodeFromImage(joint, true); + return null; } public Bitmap MergeBitMaps(Bitmap front, Bitmap back) diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index bcf3e76..5a715f5 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs @@ -29,7 +29,7 @@ using System; using System.Reflection; using System.Collections.Generic; using System.Text.RegularExpressions; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules } } - private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) + private SceneObjectPart findPrim(UUID objectID, out string ObjectRegionName) { lock (m_Scenes) { @@ -179,7 +179,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules return null; } - private void resolveNamePositionRegionName(LLUUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) + private void resolveNamePositionRegionName(UUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) { string m_ObjectRegionName; SceneObjectPart part = findPrim(objectID, out m_ObjectRegionName); @@ -203,7 +203,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules /// /// /// - public void SendEmail(LLUUID objectID, string address, string subject, string body) + public void SendEmail(UUID objectID, string address, string subject, string body) { //Check if address is empty if (address == string.Empty) @@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules //Creation EmailMessage EmailMessage emailMessage = new EmailMessage(); //From - emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); + emailMessage.FromAddress = new EmailAddress(objectID.ToString()+"@"+m_HostName); //To - Only One emailMessage.AddToAddress(new EmailAddress(address)); //Subject @@ -264,7 +264,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules //Send Email Message emailMessage.Send(smtpServer); //Log - m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.UUID.ToString()); + m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.ToString()); } catch (Exception e) { @@ -280,7 +280,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules /// /// /// - public Email GetNextEmail(LLUUID objectID, string sender, string subject) + public Email GetNextEmail(UUID objectID, string sender, string subject) { return null; } diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 1eb0387..9595588 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -31,7 +31,7 @@ using System.IO; using System.Net; using System.Text; using System.Threading; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Servers; @@ -91,7 +91,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest private string m_name = "HttpScriptRequests"; // - private Dictionary m_pendingRequests; + private Dictionary m_pendingRequests; private Scene m_scene; // private Queue rpcQueue = new Queue(); @@ -101,14 +101,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest #region IHttpRequests Members - public LLUUID MakeHttpRequest(string url, string parameters, string body) + public UUID MakeHttpRequest(string url, string parameters, string body) { - return LLUUID.Zero; + return UUID.Zero; } - public LLUUID StartHttpRequest(uint localID, LLUUID itemID, string url, List parameters, Dictionary headers, string body) + public UUID StartHttpRequest(uint localID, UUID itemID, string url, List parameters, Dictionary headers, string body) { - LLUUID reqID = LLUUID.Random(); + UUID reqID = UUID.Random(); HttpRequestClass htc = new HttpRequestClass(); // Partial implementation: support for parameter flags needed @@ -163,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest return reqID; } - public void StopHttpRequest(uint m_localID, LLUUID m_itemID) + public void StopHttpRequest(uint m_localID, UUID m_itemID) { if (m_pendingRequests != null) { @@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest { lock (HttpListLock) { - foreach (LLUUID luid in m_pendingRequests.Keys) + foreach (UUID luid in m_pendingRequests.Keys) { HttpRequestClass tmpReq; @@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest return null; } - public void RemoveCompletedRequest(LLUUID id) + public void RemoveCompletedRequest(UUID id) { lock (HttpListLock) { @@ -232,7 +232,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest m_scene.RegisterModuleInterface(this); - m_pendingRequests = new Dictionary(); + m_pendingRequests = new Dictionary(); } public void PostInitialise() @@ -274,11 +274,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest public bool httpVerifyCert = true; // not implemented // Request info - public LLUUID itemID; + public UUID itemID; public uint localID; public DateTime next; public string outbound_body; - public LLUUID reqID; + public UUID reqID; public HttpWebRequest request; public string response_body; public List response_metadata; diff --git a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs index 725322b..339ad42 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -29,9 +29,9 @@ using System; using System.Drawing; using System.IO; using System.Net; -using libsecondlife; +using OpenMetaverse; +using OpenMetaverse.Imaging; using Nini.Config; -using OpenJPEGNet; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -70,13 +70,13 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL return null; } - public bool AsyncConvertUrl(LLUUID id, string url, string extraParams) + public bool AsyncConvertUrl(UUID id, string url, string extraParams) { MakeHttpRequest(url, id); return true; } - public bool AsyncConvertData(LLUUID id, string bodyData, string extraParams) + public bool AsyncConvertData(UUID id, string bodyData, string extraParams) { return false; } @@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL #endregion - private void MakeHttpRequest(string url, LLUUID requestID) + private void MakeHttpRequest(string url, UUID requestID) { WebRequest request = HttpWebRequest.Create(url); RequestState state = new RequestState((HttpWebRequest) request, requestID); @@ -177,10 +177,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL public class RequestState { public HttpWebRequest Request = null; - public LLUUID RequestID = LLUUID.Zero; + public UUID RequestID = UUID.Zero; public int TimeOfRequest = 0; - public RequestState(HttpWebRequest request, LLUUID requestID) + public RequestState(HttpWebRequest request, UUID requestID) { Request = request; RequestID = requestID; @@ -189,4 +189,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs index 27f1182..256bf27 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs @@ -31,12 +31,11 @@ using System.Drawing.Imaging; using System.Globalization; using System.IO; using System.Net; -using libsecondlife; +using OpenMetaverse; +using OpenMetaverse.Imaging; using Nini.Config; -using OpenJPEGNet; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; -using Image=System.Drawing.Image; //using Cairo; @@ -79,12 +78,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender return null; } - public bool AsyncConvertUrl(LLUUID id, string url, string extraParams) + public bool AsyncConvertUrl(UUID id, string url, string extraParams) { return false; } - public bool AsyncConvertData(LLUUID id, string bodyData, string extraParams) + public bool AsyncConvertData(UUID id, string bodyData, string extraParams) { Draw(bodyData, id, extraParams); return true; @@ -127,7 +126,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender #endregion - private void Draw(string data, LLUUID id, string extraParams) + private void Draw(string data, UUID id, string extraParams) { // TODO: this is a brutal hack. extraParams should actually be parsed reasonably. int size = 256; @@ -374,4 +373,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender return null; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs index 2f67dee..ae5eefc 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -66,7 +66,7 @@ using OpenSim.Region.Environment.Scenes; * * For LSL compliance, note the following: * (Tested again 1.21.1 on May 2, 2008) - * 1. 'id' has to be parsed into a LLUUID. None-UUID keys are + * 1. 'id' has to be parsed into a UUID. None-UUID keys are * to be replaced by the ZeroID key. (Well, TryParse does * that for us. * 2. Setting up an listen event from the same script, with the @@ -157,7 +157,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// key to filter on (user given, could be totally faked) /// msg to filter on /// number of the scripts handle - public int Listen(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, LLUUID id, string msg) + public int Listen(uint localID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg) { return m_listenerManager.AddListener(localID, itemID, hostID, channel, name, id, msg); } @@ -169,7 +169,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// UUID of the script engine /// handle returned by Listen() /// temp. activate or deactivate the Listen() - public void ListenControl(LLUUID itemID, int handle, int active) + public void ListenControl(UUID itemID, int handle, int active) { if (active == 1) m_listenerManager.Activate(itemID, handle); @@ -182,7 +182,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// /// UUID of the script engine /// handle returned by Listen() - public void ListenRemove(LLUUID itemID, int handle) + public void ListenRemove(UUID itemID, int handle) { m_listenerManager.Remove(itemID, handle); } @@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// (script engine) /// /// UUID of the script engine - public void DeleteListener(LLUUID itemID) + public void DeleteListener(UUID itemID) { m_listenerManager.DeleteListener(itemID); } @@ -210,11 +210,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm /// name of sender (object or avatar) /// key of sender (object or avatar) /// msg to sent - public void DeliverMessage(ChatTypeEnum type, int channel, string name, LLUUID id, string msg) + public void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg) { SceneObjectPart source = null; ScenePresence avatar = null; - LLVector3 position; + Vector3 position; source = m_scene.GetSceneObjectPart(id); if (source != null) @@ -231,7 +231,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm // Determine which listen event filters match the given set of arguments, this results // in a limited set of listeners, each belonging a host. If the host is in range, add them // to the pending queue. - foreach (ListenerInfo li in m_listenerManager.GetListeners(LLUUID.Zero, channel, name, id, msg)) + foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) { // Dont process if this message is from yourself! if (li.GetHostID().Equals(id)) @@ -331,12 +331,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm e.Message); } - public Object[] GetSerializationData(LLUUID itemID) + public Object[] GetSerializationData(UUID itemID) { return m_listenerManager.GetSerializationData(itemID); } - public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID, + public void CreateFromData(uint localID, UUID itemID, UUID hostID, Object[] data) { m_listenerManager.AddFromData(localID, itemID, hostID, data); @@ -357,7 +357,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm m_curlisteners = 0; } - public int AddListener(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, LLUUID id, string msg) + public int AddListener(uint localID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg) { // do we already have a match on this particular filter event? List coll = GetListeners(itemID, channel, name, id, msg); @@ -395,7 +395,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm return -1; } - public void Remove(LLUUID itemID, int handle) + public void Remove(UUID itemID, int handle) { lock (m_listeners) { @@ -419,7 +419,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm } } - public void DeleteListener(LLUUID itemID) + public void DeleteListener(UUID itemID) { List emptyChannels = new List(); List removedListeners = new List(); @@ -455,7 +455,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm } } - public void Activate(LLUUID itemID, int handle) + public void Activate(UUID itemID, int handle) { lock (m_listeners) { @@ -474,7 +474,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm } } - public void Dectivate(LLUUID itemID, int handle) + public void Dectivate(UUID itemID, int handle) { lock (m_listeners) { @@ -494,7 +494,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm } // non-locked access, since its always called in the context of the lock - private int GetNewHandle(LLUUID itemID) + private int GetNewHandle(UUID itemID) { List handles = new List(); @@ -521,7 +521,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm // Theres probably a more clever and efficient way to // do this, maybe with regex. // PM2008: Ha, one could even be smart and define a specialized Enumerator. - public List GetListeners(LLUUID itemID, int channel, string name, LLUUID id, string msg) + public List GetListeners(UUID itemID, int channel, string name, UUID id, string msg) { List collection = new List(); @@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm { continue; } - if (!itemID.Equals(LLUUID.Zero) && !li.GetItemID().Equals(itemID)) + if (!itemID.Equals(UUID.Zero) && !li.GetItemID().Equals(itemID)) { continue; } @@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm { continue; } - if (!li.GetID().Equals(LLUUID.Zero) && !li.GetID().Equals(id)) + if (!li.GetID().Equals(UUID.Zero) && !li.GetID().Equals(id)) { continue; } @@ -561,7 +561,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm return collection; } - public Object[] GetSerializationData(LLUUID itemID) + public Object[] GetSerializationData(UUID itemID) { List data = new List(); @@ -576,7 +576,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm return (Object[])data.ToArray(); } - public void AddFromData(uint localID, LLUUID itemID, LLUUID hostID, + public void AddFromData(uint localID, UUID itemID, UUID hostID, Object[] data) { int idx = 0; @@ -603,25 +603,25 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm private bool m_active; // Listener is active or not private int m_handle; // Assigned handle of this listener private uint m_localID; // Local ID from script engine - private LLUUID m_itemID; // ID of the host script engine - private LLUUID m_hostID; // ID of the host/scene part + private UUID m_itemID; // ID of the host script engine + private UUID m_hostID; // ID of the host/scene part private int m_channel; // Channel - private LLUUID m_id; // ID to filter messages from + private UUID m_id; // ID to filter messages from private string m_name; // Object name to filter messages from private string m_message; // The message - public ListenerInfo(int handle, uint localID, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message) + public ListenerInfo(int handle, uint localID, UUID ItemID, UUID hostID, int channel, string name, UUID id, string message) { Initialise(handle, localID, ItemID, hostID, channel, name, id, message); } - public ListenerInfo(ListenerInfo li, string name, LLUUID id, string message) + public ListenerInfo(ListenerInfo li, string name, UUID id, string message) { Initialise(li.m_handle, li.m_localID, li.m_itemID, li.m_hostID, li.m_channel, name, id, message); } - private void Initialise(int handle, uint localID, LLUUID ItemID, LLUUID hostID, int channel, string name, - LLUUID id, string message) + private void Initialise(int handle, uint localID, UUID ItemID, UUID hostID, int channel, string name, + UUID id, string message) { m_active = true; m_handle = handle; @@ -648,22 +648,22 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm return data; } - public static ListenerInfo FromData(uint localID, LLUUID ItemID, LLUUID hostID, Object[] data) + public static ListenerInfo FromData(uint localID, UUID ItemID, UUID hostID, Object[] data) { ListenerInfo linfo = new ListenerInfo((int)data[1], localID, ItemID, hostID, (int)data[2], (string)data[3], - (LLUUID)data[4], (string)data[5]); + (UUID)data[4], (string)data[5]); linfo.m_active=(bool)data[0]; return linfo; } - public LLUUID GetItemID() + public UUID GetItemID() { return m_itemID; } - public LLUUID GetHostID() + public UUID GetHostID() { return m_hostID; } @@ -708,7 +708,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm m_active = true; } - public LLUUID GetID() + public UUID GetID() { return m_id; } diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs index bde90bc..85aa344 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs @@ -31,7 +31,7 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -82,12 +82,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC private string m_name = "XMLRPCModule"; // - private Dictionary m_openChannels; - private Dictionary m_pendingSRDResponses; + private Dictionary m_openChannels; + private Dictionary m_pendingSRDResponses; private int m_remoteDataPort = 0; - private Dictionary m_rpcPending; - private Dictionary m_rpcPendingResponses; + private Dictionary m_rpcPending; + private Dictionary m_rpcPendingResponses; private List m_scenes = new List(); private int RemoteReplyScriptTimeout = 9000; private int RemoteReplyScriptWait = 300; @@ -102,10 +102,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC // get called only one time (or we lose any open channels) if (null == m_openChannels) { - m_openChannels = new Dictionary(); - m_rpcPending = new Dictionary(); - m_rpcPendingResponses = new Dictionary(); - m_pendingSRDResponses = new Dictionary(); + m_openChannels = new Dictionary(); + m_rpcPending = new Dictionary(); + m_rpcPendingResponses = new Dictionary(); + m_pendingSRDResponses = new Dictionary(); try { @@ -164,11 +164,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC /********************************************** * OpenXMLRPCChannel * - * Generate a LLUUID channel key and add it and + * Generate a UUID channel key and add it and * the prim id to dictionary * * A custom channel key can be proposed. - * Otherwise, passing LLUUID.Zero will generate + * Otherwise, passing UUID.Zero will generate * and return a random channel * * First check if there is a channel assigned for @@ -179,9 +179,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC * * ********************************************/ - public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID, LLUUID channelID) + public UUID OpenXMLRPCChannel(uint localID, UUID itemID, UUID channelID) { - LLUUID newChannel = LLUUID.Zero; + UUID newChannel = UUID.Zero; // This should no longer happen, but the check is reasonable anyway if (null == m_openChannels) @@ -201,9 +201,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC } } - if (newChannel == LLUUID.Zero) + if (newChannel == UUID.Zero) { - newChannel = (channelID == LLUUID.Zero) ? LLUUID.Random() : channelID; + newChannel = (channelID == UUID.Zero) ? UUID.Random() : channelID; RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, newChannel); lock (XMLRPCListLock) { @@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC // Delete channels based on itemID // for when a script is deleted - public void DeleteChannels(LLUUID itemID) + public void DeleteChannels(UUID itemID) { if (m_openChannels != null) { @@ -234,7 +234,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC IEnumerator tmpEnumerator = tmp.GetEnumerator(); while (tmpEnumerator.MoveNext()) - m_openChannels.Remove((LLUUID) tmpEnumerator.Current); + m_openChannels.Remove((UUID) tmpEnumerator.Current); } } } @@ -248,12 +248,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public void RemoteDataReply(string channel, string message_id, string sdata, int idata) { - LLUUID message_key = new LLUUID(message_id); - LLUUID channel_key = new LLUUID(channel); + UUID message_key = new UUID(message_id); + UUID channel_key = new UUID(channel); RPCRequestInfo rpcInfo = null; - if (message_key == LLUUID.Zero) + if (message_key == UUID.Zero) { foreach (RPCRequestInfo oneRpcInfo in m_rpcPendingResponses.Values) if (oneRpcInfo.GetChannelKey() == channel_key) @@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC * *********************************************/ - public void CloseXMLRPCChannel(LLUUID channelKey) + public void CloseXMLRPCChannel(UUID channelKey) { if (m_openChannels.ContainsKey(channelKey)) m_openChannels.Remove(channelKey); @@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC { lock (XMLRPCListLock) { - foreach (LLUUID luid in m_rpcPending.Keys) + foreach (UUID luid in m_rpcPending.Keys) { RPCRequestInfo tmpReq; @@ -322,7 +322,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return null; } - public void RemoveCompletedRequest(LLUUID id) + public void RemoveCompletedRequest(UUID id) { lock (XMLRPCListLock) { @@ -339,7 +339,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC } } - public LLUUID SendRemoteData(uint localID, LLUUID itemID, string channel, string dest, int idata, string sdata) + public UUID SendRemoteData(uint localID, UUID itemID, string channel, string dest, int idata, string sdata) { SendRemoteDataRequest req = new SendRemoteDataRequest( localID, itemID, channel, dest, idata, sdata @@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC { lock (XMLRPCListLock) { - foreach (LLUUID luid in m_pendingSRDResponses.Keys) + foreach (UUID luid in m_pendingSRDResponses.Keys) { SendRemoteDataRequest tmpReq; @@ -369,7 +369,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return null; } - public void RemoveCompletedSRDRequest(LLUUID id) + public void RemoveCompletedSRDRequest(UUID id) { lock (XMLRPCListLock) { @@ -381,7 +381,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC } } - public void CancelSRDRequests(LLUUID itemID) + public void CancelSRDRequests(UUID itemID) { if (m_pendingSRDResponses != null) { @@ -408,7 +408,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC if (GoodXML) { - LLUUID channel = new LLUUID((string) requestData["Channel"]); + UUID channel = new UUID((string) requestData["Channel"]); RPCChannelInfo rpcChanInfo; if (m_openChannels.TryGetValue(channel, out rpcChanInfo)) { @@ -462,24 +462,24 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public class RPCRequestInfo { - private LLUUID m_ChannelKey; + private UUID m_ChannelKey; private string m_IntVal; - private LLUUID m_ItemID; + private UUID m_ItemID; private uint m_localID; - private LLUUID m_MessageID; + private UUID m_MessageID; private bool m_processed; private int m_respInt; private string m_respStr; private string m_StrVal; - public RPCRequestInfo(uint localID, LLUUID itemID, LLUUID channelKey, string strVal, string intVal) + public RPCRequestInfo(uint localID, UUID itemID, UUID channelKey, string strVal, string intVal) { m_localID = localID; m_StrVal = strVal; m_IntVal = intVal; m_ItemID = itemID; m_ChannelKey = channelKey; - m_MessageID = LLUUID.Random(); + m_MessageID = UUID.Random(); m_processed = false; m_respStr = String.Empty; m_respInt = 0; @@ -490,7 +490,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return m_processed; } - public LLUUID GetChannelKey() + public UUID GetChannelKey() { return m_ChannelKey; } @@ -525,7 +525,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return m_localID; } - public LLUUID GetItemID() + public UUID GetItemID() { return m_ItemID; } @@ -540,7 +540,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC return int.Parse(m_IntVal); } - public LLUUID GetMessageID() + public UUID GetMessageID() { return m_MessageID; } @@ -548,23 +548,23 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public class RPCChannelInfo { - private LLUUID m_ChannelKey; - private LLUUID m_itemID; + private UUID m_ChannelKey; + private UUID m_itemID; private uint m_localID; - public RPCChannelInfo(uint localID, LLUUID itemID, LLUUID channelID) + public RPCChannelInfo(uint localID, UUID itemID, UUID channelID) { m_ChannelKey = channelID; m_localID = localID; m_itemID = itemID; } - public LLUUID GetItemID() + public UUID GetItemID() { return m_itemID; } - public LLUUID GetChannelID() + public UUID GetChannelID() { return m_ChannelKey; } @@ -583,15 +583,15 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC public bool finished; private Thread httpThread; public int idata; - public LLUUID m_itemID; + public UUID m_itemID; public uint m_localID; - public LLUUID reqID; + public UUID reqID; public XmlRpcRequest request; public int response_idata; public string response_sdata; public string sdata; - public SendRemoteDataRequest(uint localID, LLUUID itemID, string channel, string dest, int idata, string sdata) + public SendRemoteDataRequest(uint localID, UUID itemID, string channel, string dest, int idata, string sdata) { this.channel = channel; destURL = dest; @@ -600,10 +600,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC m_itemID = itemID; m_localID = localID; - reqID = LLUUID.Random(); + reqID = UUID.Random(); } - public LLUUID process() + public UUID process() { httpThread = new Thread(SendRequest); httpThread.Name = "HttpRequestThread"; @@ -625,12 +625,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC { Hashtable param = new Hashtable(); - // Check if channel is an LLUUID + // Check if channel is an UUID // if not, use as method name - LLUUID parseUID; + UUID parseUID; string mName = "llRemoteData"; if ((channel != null) && (channel != "")) - if (!LLUUID.TryParse(channel, out parseUID)) + if (!UUID.TryParse(channel, out parseUID)) mName = channel; else param["Channel"] = channel; @@ -698,7 +698,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC } } - public LLUUID GetReqID() + public UUID GetReqID() { return reqID; } 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; diff --git a/OpenSim/Region/Environment/Scenes/Animation.cs b/OpenSim/Region/Environment/Scenes/Animation.cs index b2fca90..2854e06 100644 --- a/OpenSim/Region/Environment/Scenes/Animation.cs +++ b/OpenSim/Region/Environment/Scenes/Animation.cs @@ -26,14 +26,14 @@ */ using System; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Scenes { public class Animation { - private LLUUID animID; - public LLUUID AnimID + private UUID animID; + public UUID AnimID { get { return animID; } set { animID = value; } @@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes { } - public Animation(LLUUID animID, int sequenceNum) + public Animation(UUID animID, int sequenceNum) { this.animID = animID; this.sequenceNum = sequenceNum; diff --git a/OpenSim/Region/Environment/Scenes/AnimationSet.cs b/OpenSim/Region/Environment/Scenes/AnimationSet.cs index c485d30..0b7188a 100644 --- a/OpenSim/Region/Environment/Scenes/AnimationSet.cs +++ b/OpenSim/Region/Environment/Scenes/AnimationSet.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Scenes { @@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Scenes ResetDefaultAnimation(); } - public bool HasAnimation(LLUUID animID) + public bool HasAnimation(UUID animID) { if (m_defaultAnimation.AnimID == animID) return true; @@ -57,7 +57,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public bool Add(LLUUID animID, int sequenceNum) + public bool Add(UUID animID, int sequenceNum) { lock (m_animations) { @@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public bool Remove(LLUUID animID) + public bool Remove(UUID animID) { lock (m_animations) { @@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Scenes /// The default animation is reserved for "main" animations /// that are mutually exclusive, e.g. flying and sitting. /// - public bool SetDefaultAnimation(LLUUID animID, int sequenceNum) + public bool SetDefaultAnimation(UUID animID, int sequenceNum) { if (m_defaultAnimation.AnimID != animID) { @@ -123,18 +123,18 @@ namespace OpenSim.Region.Environment.Scenes /// public bool TrySetDefaultAnimation(string anim, int sequenceNum) { - if (Animations.AnimsLLUUID.ContainsKey(anim)) + if (Animations.AnimsUUID.ContainsKey(anim)) { - return SetDefaultAnimation(Animations.AnimsLLUUID[anim], sequenceNum); + return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum); } return false; } - public void GetArrays(out LLUUID[] animIDs, out int[] sequenceNums) + public void GetArrays(out UUID[] animIDs, out int[] sequenceNums) { lock (m_animations) { - animIDs = new LLUUID[m_animations.Count + 1]; + animIDs = new UUID[m_animations.Count + 1]; sequenceNums = new int[m_animations.Count + 1]; animIDs[0] = m_defaultAnimation.AnimID; diff --git a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs index fe9c8e7..6bb5525 100644 --- a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs +++ b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs @@ -27,18 +27,18 @@ using System.Collections.Generic; using System.Xml; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Scenes { public class AvatarAnimations { - public Dictionary AnimsLLUUID = new Dictionary(); - public Dictionary AnimsNames = new Dictionary(); + public Dictionary AnimsUUID = new Dictionary(); + public Dictionary AnimsNames = new Dictionary(); public AvatarAnimations() { - using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) + using (XmlTextReader reader = new XmlTextReader("data/avataranimations.Xml")) { XmlDocument doc = new XmlDocument(); doc.Load(reader); @@ -47,9 +47,9 @@ namespace OpenSim.Region.Environment.Scenes if (nod.Attributes["name"] != null) { string name = (string)nod.Attributes["name"].Value; - LLUUID id = (LLUUID)nod.InnerText; + UUID id = (UUID)nod.InnerText; - AnimsLLUUID.Add(name, id); + AnimsUUID.Add(name, id); AnimsNames.Add(id, name); } } diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index 40caabc..884ff32 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs @@ -28,8 +28,7 @@ using System; using System.Runtime.Serialization; using System.Security.Permissions; -using Axiom.Math; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Scenes { @@ -45,9 +44,9 @@ namespace OpenSim.Region.Environment.Scenes } protected Scene m_scene; - protected LLUUID m_uuid; + protected UUID m_uuid; - public virtual LLUUID UUID + public virtual UUID UUID { get { return m_uuid; } set { m_uuid = value; } @@ -73,30 +72,30 @@ namespace OpenSim.Region.Environment.Scenes } protected bool m_isDeleted; - protected LLVector3 m_pos; + protected Vector3 m_pos; /// /// /// - public virtual LLVector3 AbsolutePosition + public virtual Vector3 AbsolutePosition { get { return m_pos; } set { m_pos = value; } } - protected LLVector3 m_velocity; - protected LLVector3 m_rotationalvelocity; + protected Vector3 m_velocity; + protected Vector3 m_rotationalvelocity; /// /// /// - public virtual LLVector3 Velocity + public virtual Vector3 Velocity { get { return m_velocity; } set { m_velocity = value; } } - protected Quaternion m_rotation = new Quaternion(0, 0, 1, 0); + protected Quaternion m_rotation = new Quaternion(0f, 0f, 1f, 0f); public virtual Quaternion Rotation { @@ -117,13 +116,13 @@ namespace OpenSim.Region.Environment.Scenes /// public EntityBase() { - m_uuid = LLUUID.Zero; + m_uuid = UUID.Zero; - m_pos = new LLVector3(); - m_velocity = new LLVector3(); - Rotation = new Quaternion(); + m_pos = Vector3.Zero; + m_velocity = Vector3.Zero; + Rotation = Quaternion.Identity; m_name = "(basic entity)"; - m_rotationalvelocity = new LLVector3(0, 0, 0); + m_rotationalvelocity = Vector3.Zero; } /// @@ -157,33 +156,33 @@ namespace OpenSim.Region.Environment.Scenes throw new ArgumentNullException("info"); } - m_uuid = new LLUUID((Guid)info.GetValue("m_uuid", typeof(Guid))); + m_uuid = new UUID((Guid)info.GetValue("m_uuid", typeof(Guid))); m_name = (string)info.GetValue("m_name", typeof(string)); m_pos - = new LLVector3( + = new Vector3( (float)info.GetValue("m_pos.X", typeof(float)), (float)info.GetValue("m_pos.Y", typeof(float)), (float)info.GetValue("m_pos.Z", typeof(float))); m_velocity - = new LLVector3( + = new Vector3( (float)info.GetValue("m_velocity.X", typeof(float)), (float)info.GetValue("m_velocity.Y", typeof(float)), (float)info.GetValue("m_velocity.Z", typeof(float))); m_rotationalvelocity - = new LLVector3( + = new Vector3( (float)info.GetValue("m_rotationalvelocity.X", typeof(float)), (float)info.GetValue("m_rotationalvelocity.Y", typeof(float)), (float)info.GetValue("m_rotationalvelocity.Z", typeof(float))); m_rotation = new Quaternion( - (float)info.GetValue("m_rotation.w", typeof(float)), - (float)info.GetValue("m_rotation.x", typeof(float)), - (float)info.GetValue("m_rotation.y", typeof(float)), - (float)info.GetValue("m_rotation.z", typeof(float))); + (float)info.GetValue("m_rotation.X", typeof(float)), + (float)info.GetValue("m_rotation.Y", typeof(float)), + (float)info.GetValue("m_rotation.Z", typeof(float)), + (float)info.GetValue("m_rotation.W", typeof(float))); m_localId = (uint)info.GetValue("m_localId", typeof(uint)); @@ -200,29 +199,29 @@ namespace OpenSim.Region.Environment.Scenes throw new ArgumentNullException("info"); } - info.AddValue("m_uuid", m_uuid.UUID); + info.AddValue("m_uuid", m_uuid.Guid); info.AddValue("m_name", m_name); - // LLVector3 + // Vector3 info.AddValue("m_pos.X", m_pos.X); info.AddValue("m_pos.Y", m_pos.Y); info.AddValue("m_pos.Z", m_pos.Z); - // LLVector3 + // Vector3 info.AddValue("m_velocity.X", m_velocity.X); info.AddValue("m_velocity.Y", m_velocity.Y); info.AddValue("m_velocity.Z", m_velocity.Z); - // LLVector3 + // Vector3 info.AddValue("m_rotationalvelocity.X", m_rotationalvelocity.X); info.AddValue("m_rotationalvelocity.Y", m_rotationalvelocity.Y); info.AddValue("m_rotationalvelocity.Z", m_rotationalvelocity.Z); // Quaternion - info.AddValue("m_rotation.w", m_rotation.w); - info.AddValue("m_rotation.x", m_rotation.x); - info.AddValue("m_rotation.y", m_rotation.y); - info.AddValue("m_rotation.z", m_rotation.z); + info.AddValue("m_rotation.X", m_rotation.X); + info.AddValue("m_rotation.Y", m_rotation.Y); + info.AddValue("m_rotation.Z", m_rotation.Z); + info.AddValue("m_rotation.W", m_rotation.W); info.AddValue("m_localId", m_localId); } diff --git a/OpenSim/Region/Environment/Scenes/EntityList.cs b/OpenSim/Region/Environment/Scenes/EntityList.cs index ff8def2..09eb84f 100644 --- a/OpenSim/Region/Environment/Scenes/EntityList.cs +++ b/OpenSim/Region/Environment/Scenes/EntityList.cs @@ -29,9 +29,8 @@ using System; using System.Collections; using System.Collections.Generic; using System.Reflection; -using Axiom.Math; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Types; @@ -69,9 +68,9 @@ namespace OpenSim.Region.Environment.Scenes // ListObjects() // ListPresenes() // RemoveAll() - // FindObject(LLUUID) + // FindObject(UUID) // FindObject(int) - // FindPresence(LLUUID) + // FindPresence(UUID) public void Add(SceneObjectGroup obj) { @@ -84,7 +83,7 @@ namespace OpenSim.Region.Environment.Scenes m_pres_by_uuid[pres.UUID] = pres; } - public SceneObjectGroup RemoveObject(LLUUID uuid) + public SceneObjectGroup RemoveObject(UUID uuid) { SceneObjectGroup sog = null; try @@ -101,7 +100,7 @@ namespace OpenSim.Region.Environment.Scenes return sog; } - public ScenePresence RemovePresence(LLUUID uuid) + public ScenePresence RemovePresence(UUID uuid) { ScenePresence sp = null; try @@ -117,7 +116,7 @@ namespace OpenSim.Region.Environment.Scenes return sp; } - public SceneObjectGroup FindObject(LLUUID uuid) + public SceneObjectGroup FindObject(UUID uuid) { try { @@ -135,7 +134,7 @@ namespace OpenSim.Region.Environment.Scenes { try { - LLUUID uuid = (LLUUID)m_obj_by_local[local]; + UUID uuid = (UUID)m_obj_by_local[local]; SceneObjectGroup sog = (SceneObjectGroup)m_obj_by_uuid[uuid]; return sog; } @@ -146,7 +145,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public ScenePresence FindPresense(LLUUID uuid) + public ScenePresence FindPresense(UUID uuid) { try { @@ -159,4 +158,4 @@ namespace OpenSim.Region.Environment.Scenes } } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index d48ef0c..58f5efe 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs @@ -26,7 +26,7 @@ */ using System; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using Caps=OpenSim.Framework.Communications.Capabilities.Caps; @@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes public event OnNewPresenceDelegate OnNewPresence; - public delegate void OnRemovePresenceDelegate(LLUUID agentId); + public delegate void OnRemovePresenceDelegate(UUID agentId); public event OnRemovePresenceDelegate OnRemovePresence; @@ -83,11 +83,11 @@ namespace OpenSim.Region.Environment.Scenes public event OnShutdownDelegate OnShutdown; - public delegate void ObjectGrabDelegate(uint localID, uint originalID, LLVector3 offsetPos, IClientAPI remoteClient); + public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient); public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient); - public delegate void ScriptResetDelegate(uint localID, LLUUID itemID); + public delegate void ScriptResetDelegate(uint localID, UUID itemID); - public delegate void OnPermissionErrorDelegate(LLUUID user, string reason); + public delegate void OnPermissionErrorDelegate(UUID user, string reason); public event ObjectGrabDelegate OnObjectGrab; public event ObjectDeGrabDelegate OnObjectDeGrab; @@ -95,27 +95,27 @@ namespace OpenSim.Region.Environment.Scenes public event OnPermissionErrorDelegate OnPermissionError; - public delegate void NewRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez); + public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez); public event NewRezScript OnRezScript; - public delegate void RemoveScript(uint localID, LLUUID itemID); + public delegate void RemoveScript(uint localID, UUID itemID); public event RemoveScript OnRemoveScript; - public delegate void StartScript(uint localID, LLUUID itemID); + public delegate void StartScript(uint localID, UUID itemID); public event StartScript OnStartScript; - public delegate void StopScript(uint localID, LLUUID itemID); + public delegate void StopScript(uint localID, UUID itemID); public event StopScript OnStopScript; - public delegate bool SceneGroupMoved(LLUUID groupID, LLVector3 delta); + public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta); public event SceneGroupMoved OnSceneGroupMove; - public delegate void SceneGroupGrabed(LLUUID groupID, LLVector3 offset, LLUUID userID); + public delegate void SceneGroupGrabed(UUID groupID, Vector3 offset, UUID userID); public event SceneGroupGrabed OnSceneGroupGrab; @@ -123,11 +123,11 @@ namespace OpenSim.Region.Environment.Scenes public event LandObjectAdded OnLandObjectAdded; - public delegate void LandObjectRemoved(LLUUID globalID); + public delegate void LandObjectRemoved(UUID globalID); public event LandObjectRemoved OnLandObjectRemoved; - public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, LLUUID regionID); + public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; @@ -143,7 +143,7 @@ namespace OpenSim.Region.Environment.Scenes public event NewGridInstantMessage OnGridInstantMessageToGroupsModule; - public delegate void ClientClosed(LLUUID clientID); + public delegate void ClientClosed(UUID clientID); public event ClientClosed OnClientClosed; @@ -151,11 +151,11 @@ namespace OpenSim.Region.Environment.Scenes public event ScriptChangedEvent OnScriptChangedEvent; - public delegate void ScriptControlEvent(uint localID, LLUUID item, LLUUID avatarID, uint held, uint changed); + public delegate void ScriptControlEvent(uint localID, UUID item, UUID avatarID, uint held, uint changed); public event ScriptControlEvent OnScriptControlEvent; - public delegate void ScriptAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos); + public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); public event ScriptAtTargetEvent OnScriptAtTargetEvent; @@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Scenes public delegate void OnMakeRootAgentDelegate(ScenePresence presence); public event OnMakeRootAgentDelegate OnMakeRootAgent; - public delegate void NewInventoryItemUploadComplete(LLUUID avatarID, LLUUID assetID, string name, int userlevel); + public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel); public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete; @@ -217,13 +217,13 @@ namespace OpenSim.Region.Environment.Scenes /// has been instantiated and before it is return to the /// client and provides region modules to add their caps. /// - public delegate void RegisterCapsEvent(LLUUID agentID, Caps caps); + public delegate void RegisterCapsEvent(UUID agentID, Caps caps); public event RegisterCapsEvent OnRegisterCaps; /// /// DeregisterCapsEvent is called by Scene when the caps /// handler for an agent are removed. /// - public delegate void DeregisterCapsEvent(LLUUID agentID, Caps caps); + public delegate void DeregisterCapsEvent(UUID agentID, Caps caps); public event DeregisterCapsEvent OnDeregisterCaps; /// /// ChatFromWorldEvent is called via Scene when a chat message @@ -244,8 +244,8 @@ namespace OpenSim.Region.Environment.Scenes public class MoneyTransferArgs : EventArgs { - public LLUUID sender; - public LLUUID receiver; + public UUID sender; + public UUID receiver; // Always false. The SL protocol sucks. public bool authenticated = false; @@ -254,7 +254,7 @@ namespace OpenSim.Region.Environment.Scenes public int transactiontype; public string description; - public MoneyTransferArgs(LLUUID asender, LLUUID areceiver, int aamount, int atransactiontype, string adescription) + public MoneyTransferArgs(UUID asender, UUID areceiver, int aamount, int atransactiontype, string adescription) { sender = asender; receiver = areceiver; @@ -266,11 +266,11 @@ namespace OpenSim.Region.Environment.Scenes public class LandBuyArgs : EventArgs { - public LLUUID agentId = LLUUID.Zero; + public UUID agentId = UUID.Zero; - public LLUUID groupId = LLUUID.Zero; + public UUID groupId = UUID.Zero; - public LLUUID parcelOwnerID = LLUUID.Zero; + public UUID parcelOwnerID = UUID.Zero; public bool final = false; public bool groupOwned = false; @@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes public int transactionID = 0; public int amountDebited = 0; - public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, + public LandBuyArgs(UUID pagentId, UUID pgroupId, bool pfinal, bool pgroupOwned, bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, bool pauthenticated) { @@ -385,7 +385,7 @@ namespace OpenSim.Region.Environment.Scenes handlerClientMovement(avatar); } - public void TriggerPermissionError(LLUUID user, string reason) + public void TriggerPermissionError(UUID user, string reason) { handlerPermissionError = OnPermissionError; if (handlerPermissionError != null) @@ -422,7 +422,7 @@ namespace OpenSim.Region.Environment.Scenes handlerNewPresence(presence); } - public void TriggerOnRemovePresence(LLUUID agentId) + public void TriggerOnRemovePresence(UUID agentId) { handlerRemovePresence = OnRemovePresence; if (handlerRemovePresence != null) @@ -492,7 +492,7 @@ namespace OpenSim.Region.Environment.Scenes handlerShutdown(); } - public void TriggerObjectGrab(uint localID, uint originalID, LLVector3 offsetPos, IClientAPI remoteClient) + public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient) { handlerObjectGrab = OnObjectGrab; if (handlerObjectGrab != null) @@ -510,7 +510,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerScriptReset(uint localID, LLUUID itemID) + public void TriggerScriptReset(uint localID, UUID itemID) { handlerScriptReset = OnScriptReset; if (handlerScriptReset != null) @@ -519,7 +519,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez) + public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez) { handlerRezScript = OnRezScript; if (handlerRezScript != null) @@ -528,7 +528,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerStartScript(uint localID, LLUUID itemID) + public void TriggerStartScript(uint localID, UUID itemID) { handlerStartScript = OnStartScript; if (handlerStartScript != null) @@ -537,7 +537,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerStopScript(uint localID, LLUUID itemID) + public void TriggerStopScript(uint localID, UUID itemID) { handlerStopScript = OnStopScript; if (handlerStopScript != null) @@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerRemoveScript(uint localID, LLUUID itemID) + public void TriggerRemoveScript(uint localID, UUID itemID) { handlerRemoveScript = OnRemoveScript; if (handlerRemoveScript != null) @@ -555,7 +555,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public bool TriggerGroupMove(LLUUID groupID, LLVector3 delta) + public bool TriggerGroupMove(UUID groupID, Vector3 delta) { handlerSceneGroupMove = OnSceneGroupMove; @@ -566,7 +566,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public void TriggerGroupGrab(LLUUID groupID, LLVector3 offset, LLUUID userID) + public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID) { handlerSceneGroupGrab = OnSceneGroupGrab; if (handlerSceneGroupGrab != null) @@ -585,7 +585,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerLandObjectRemoved(LLUUID globalID) + public void TriggerLandObjectRemoved(UUID globalID) { handlerLandObjectRemoved = OnLandObjectRemoved; if (handlerLandObjectRemoved != null) @@ -601,7 +601,7 @@ namespace OpenSim.Region.Environment.Scenes TriggerLandObjectAdded(newParcel); } - public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, LLUUID regionID) + public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) { handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel; @@ -634,7 +634,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerClientClosed(LLUUID ClientID) + public void TriggerClientClosed(UUID ClientID) { handlerClientClosed = OnClientClosed; if (handlerClientClosed != null) @@ -661,7 +661,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps) + public void TriggerOnRegisterCaps(UUID agentID, Caps caps) { handlerRegisterCaps = OnRegisterCaps; if (handlerRegisterCaps != null) @@ -670,7 +670,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerOnDeregisterCaps(LLUUID agentID, Caps caps) + public void TriggerOnDeregisterCaps(UUID agentID, Caps caps) { handlerDeregisterCaps = OnDeregisterCaps; if (handlerDeregisterCaps != null) @@ -679,7 +679,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerOnNewInventoryItemUploadComplete(LLUUID agentID, LLUUID AssetID, String AssetName, int userlevel) + public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel) { handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete; if (handlerNewInventoryItemUpdateComplete != null) @@ -706,7 +706,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos) + public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) { handlerScriptAtTargetEvent = OnScriptAtTargetEvent; if (handlerScriptAtTargetEvent != null) @@ -769,7 +769,7 @@ namespace OpenSim.Region.Environment.Scenes } } - internal void TriggerControlEvent(uint p, LLUUID scriptUUID, LLUUID avatarID, uint held, uint _changed) + internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) { handlerScriptControlEvent = OnScriptControlEvent; if (handlerScriptControlEvent != null) diff --git a/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs b/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs index 3a20190..9a4c72f 100644 --- a/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs +++ b/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs @@ -25,13 +25,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; namespace OpenSim.Region.Environment.Scenes { public interface IScenePresenceBody { - void processMovement(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); + void processMovement(IClientAPI remoteClient, uint flags, Quaternion bodyRotation); } } diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 658478d..e61fb19 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -28,9 +28,8 @@ using System; using System.Collections.Generic; using System.Reflection; -using Axiom.Math; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Types; @@ -53,11 +52,11 @@ namespace OpenSim.Region.Environment.Scenes #region Fields - protected internal Dictionary ScenePresences = new Dictionary(); + protected internal Dictionary ScenePresences = new Dictionary(); // SceneObjects is not currently populated or used. - //public Dictionary SceneObjects; - protected internal Dictionary Entities = new Dictionary(); - protected internal Dictionary RestorePresences = new Dictionary(); + //public Dictionary SceneObjects; + protected internal Dictionary Entities = new Dictionary(); + protected internal Dictionary RestorePresences = new Dictionary(); protected internal BasicQuadTreeNode QuadTree; @@ -276,7 +275,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was deleted, false if there was no object to delete - protected internal bool DeleteSceneObject(LLUUID uuid, bool resultOfObjectLinked) + protected internal bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked) { lock (Entities) { @@ -378,9 +377,9 @@ namespace OpenSim.Region.Environment.Scenes } } - protected internal void HandleUndo(IClientAPI remoteClient, LLUUID primId) + protected internal void HandleUndo(IClientAPI remoteClient, UUID primId) { - if (primId != LLUUID.Zero) + if (primId != UUID.Zero) { SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId); if (part != null) @@ -389,7 +388,7 @@ namespace OpenSim.Region.Environment.Scenes } protected internal void HandleObjectGroupUpdate( - IClientAPI remoteClient, LLUUID GroupID, uint objectLocalID, LLUUID Garbage) + IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) { List EntityList = GetEntities(); @@ -417,17 +416,17 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) + protected internal void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot) { // Calls attach with a Zero position - AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); + AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero); } public SceneObjectGroup RezSingleAttachment( - IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) + IClientAPI remoteClient, UUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) { - SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, LLVector3.Zero, LLVector3.Zero, LLUUID.Zero, (byte)1, true, + SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), @@ -435,17 +434,17 @@ namespace OpenSim.Region.Environment.Scenes if (objatt != null) { - AttachObject(remoteClient,objatt.LocalId,AttachmentPt,new LLQuaternion(0,0,0,1),objatt.AbsolutePosition); + AttachObject(remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition); objatt.ScheduleGroupForFullUpdate(); } return objatt; } - // What makes this method odd and unique is it tries to detach using an LLUUID.... Yay for standards. - // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID?? - public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient) + // What makes this method odd and unique is it tries to detach using an UUID.... Yay for standards. + // To LocalId or UUID, *THAT* is the question. How now Brown UUID?? + public void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient) { - if (itemID == LLUUID.Zero) // If this happened, someone made a mistake.... + if (itemID == UUID.Zero) // If this happened, someone made a mistake.... return; List EntityList = GetEntities(); @@ -467,7 +466,7 @@ namespace OpenSim.Region.Environment.Scenes } protected internal void AttachObject( - IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, LLVector3 attachPos) + IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos) { List EntityList = GetEntities(); foreach (EntityBase obj in EntityList) @@ -485,7 +484,7 @@ namespace OpenSim.Region.Environment.Scenes if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) { - attachPos = LLVector3.Zero; + attachPos = Vector3.Zero; } // AttachmentPt 0 means the client chose to 'wear' the attachment. @@ -503,16 +502,16 @@ namespace OpenSim.Region.Environment.Scenes { // Stick it on left hand with Zero Offset from the attachment point. AttachmentPt = (uint)AttachmentPoint.LeftHand; - attachPos = LLVector3.Zero; + attachPos = Vector3.Zero; } m_log.Debug("[ATTACH]: Using attachpoint: " + AttachmentPt.ToString()); // Saves and gets assetID - if (group.GetFromAssetID() == LLUUID.Zero) + if (group.GetFromAssetID() == UUID.Zero) { - LLUUID newAssetID = m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId); + UUID newAssetID = m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId); // sets assetID so client can show asset as 'attached' in inventory group.SetFromAssetID(newAssetID); @@ -573,7 +572,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// Remove a presence from the scene /// - protected internal void RemoveScenePresence(LLUUID agentID) + protected internal void RemoveScenePresence(UUID agentID) { lock (Entities) { @@ -696,7 +695,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// null if either the avatar wasn't in the scene, or they do not have a controlling client - protected internal IClientAPI GetControllingClient(LLUUID agentId) + protected internal IClientAPI GetControllingClient(UUID agentId) { ScenePresence presence = GetScenePresence(agentId); @@ -735,7 +734,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// null if the agent was not found - protected internal ScenePresence GetScenePresence(LLUUID agentID) + protected internal ScenePresence GetScenePresence(UUID agentID) { ScenePresence sp; ScenePresences.TryGetValue(agentID, out sp); @@ -768,7 +767,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// null if no scene object group containing that prim is found - private SceneObjectGroup GetGroupByPrim(LLUUID fullID) + private SceneObjectGroup GetGroupByPrim(UUID fullID) { List EntityList = GetEntities(); @@ -828,7 +827,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// null if the part was not found - protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) + protected internal SceneObjectPart GetSceneObjectPart(UUID fullID) { SceneObjectGroup group = GetGroupByPrim(fullID); if (group != null) @@ -837,7 +836,7 @@ namespace OpenSim.Region.Environment.Scenes return null; } - protected internal bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar) + protected internal bool TryGetAvatar(UUID avatarId, out ScenePresence avatar) { ScenePresence presence; if (ScenePresences.TryGetValue(avatarId, out presence)) @@ -906,7 +905,7 @@ namespace OpenSim.Region.Environment.Scenes if (ent is SceneObjectGroup) { SceneObjectGroup grp = (SceneObjectGroup)ent; - if ((grp.RootPart.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Scripted) != 0) + if ((grp.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0) { if (grp.scriptScore >= 0.01) { @@ -938,13 +937,13 @@ namespace OpenSim.Region.Environment.Scenes } } - protected internal LLUUID ConvertLocalIDToFullID(uint localID) + protected internal UUID ConvertLocalIDToFullID(uint localID) { SceneObjectGroup group = GetGroupByPrim(localID); if (group != null) return group.GetPartsFullID(localID); else - return LLUUID.Zero; + return UUID.Zero; } protected internal void ForEachClient(Action action) @@ -968,7 +967,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient) + protected internal void UpdatePrimScale(uint localID, Vector3 scale, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); if (group != null) @@ -980,7 +979,7 @@ namespace OpenSim.Region.Environment.Scenes } } - protected internal void UpdatePrimGroupScale(uint localID, LLVector3 scale, IClientAPI remoteClient) + protected internal void UpdatePrimGroupScale(uint localID, Vector3 scale, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); if (group != null) @@ -1001,7 +1000,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// protected internal void RequestObjectPropertiesFamily( - IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags, LLUUID ObjectID) + IClientAPI remoteClient, UUID AgentID, uint RequestFlags, UUID ObjectID) { SceneObjectGroup group = GetGroupByPrim(ObjectID); if (group != null) @@ -1016,7 +1015,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) + protected internal void UpdatePrimSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); if (group != null) @@ -1034,7 +1033,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) + protected internal void UpdatePrimRotation(uint localID, Quaternion rot, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); if (group != null) @@ -1053,7 +1052,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void UpdatePrimRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient) + protected internal void UpdatePrimRotation(uint localID, Vector3 pos, Quaternion rot, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); if (group != null) @@ -1071,12 +1070,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void UpdatePrimSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient) + protected internal void UpdatePrimSinglePosition(uint localID, Vector3 pos, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); if (group != null) { - // LLVector3 oldPos = group.AbsolutePosition; + // Vector3 oldPos = group.AbsolutePosition; if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) { group.SendGroupTerseUpdate(); @@ -1096,13 +1095,13 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient) + protected internal void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); if (group != null) { - // LLVector3 oldPos = group.AbsolutePosition; + // Vector3 oldPos = group.AbsolutePosition; if (group.RootPart.IsAttachment) { group.UpdateGroupPosition(pos); @@ -1166,7 +1165,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) + protected internal void MoveObject(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(objectID); if (group != null) @@ -1219,7 +1218,7 @@ namespace OpenSim.Region.Environment.Scenes } } - protected internal void UpdateExtraParam(LLUUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data) + protected internal void UpdateExtraParam(UUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data) { SceneObjectGroup group = GetGroupByPrim(primLocalID); @@ -1237,7 +1236,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void UpdatePrimShape(LLUUID agentID, uint primLocalID, UpdateShapeArgs shapeBlock) + protected internal void UpdatePrimShape(UUID agentID, uint primLocalID, UpdateShapeArgs shapeBlock) { SceneObjectGroup group = GetGroupByPrim(primLocalID); if (group != null) @@ -1323,7 +1322,7 @@ namespace OpenSim.Region.Environment.Scenes // We need to explicitly resend the newly link prim's object properties since no other actions // occur on link to invoke this elsewhere (such as object selection) - parenPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected); + parenPrim.RootPart.AddFlag(PrimFlags.CreateSelected); parenPrim.TriggerScriptChangedEvent(Changed.LINK); if (client != null) parenPrim.GetProperties(client); @@ -1478,8 +1477,8 @@ namespace OpenSim.Region.Environment.Scenes protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) { - LLUUID user = remoteClient.AgentId; - LLUUID objid = null; + UUID user = remoteClient.AgentId; + UUID objid = null; SceneObjectPart obj = null; List EntityList = GetEntities(); @@ -1487,7 +1486,7 @@ namespace OpenSim.Region.Environment.Scenes { if (ent is SceneObjectGroup) { - foreach (KeyValuePair subent in ((SceneObjectGroup)ent).Children) + foreach (KeyValuePair subent in ((SceneObjectGroup)ent).Children) { if (subent.Value.LocalId == localID) { @@ -1512,11 +1511,11 @@ namespace OpenSim.Region.Environment.Scenes if (IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanEditObject(objid, user)) { - obj.ParentGroup.RootPart.AddFlag(LLObject.ObjectFlags.JointWheel); + obj.ParentGroup.RootPart.AddFlag(PrimFlags.JointWheel); } else if (!IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(objid,user)) { - obj.ParentGroup.RootPart.RemFlag(LLObject.ObjectFlags.JointWheel); + obj.ParentGroup.RootPart.RemFlag(PrimFlags.JointWheel); } } @@ -1526,12 +1525,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID) + protected internal void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID) { //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); // SceneObjectGroup dupe = DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero); - DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero); + DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity); } /// /// Duplicate the given object. @@ -1539,7 +1538,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal SceneObjectGroup DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID, Quaternion rot) + protected internal SceneObjectGroup DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) { //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); @@ -1580,9 +1579,9 @@ namespace OpenSim.Region.Environment.Scenes m_numPrim += copy.Children.Count; - if (rot != Quaternion.Zero) + if (rot != Quaternion.Identity) { - copy.UpdateGroupRotation(new LLQuaternion(rot.x, rot.y, rot.z, rot.w)); + copy.UpdateGroupRotation(rot); } copy.CreateScriptInstances(0, false); @@ -1610,7 +1609,7 @@ namespace OpenSim.Region.Environment.Scenes return (float) - Math.Sqrt((v1.x - v2.x) * (v1.x - v2.x) + (v1.y - v2.y) * (v1.y - v2.y) + (v1.z - v2.z) * (v1.z - v2.z)); + Math.Sqrt((v1.X - v2.X) * (v1.X - v2.X) + (v1.Y - v2.Y) * (v1.Y - v2.Y) + (v1.Z - v2.Z) * (v1.Z - v2.Z)); } #endregion diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index ab580ae..cdd6943 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -30,8 +30,8 @@ using System.Collections.Generic; using System.Reflection; using System.Text; using System.Timers; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Scenes public EntityBase selectedEnt; public IClientAPI remoteClient; public SceneObjectGroup objectGroup; - public LLUUID folderID; + public UUID folderID; public bool permissionToDelete; } @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void AddUploadedInventoryItem(LLUUID agentID, InventoryItemBase item) + public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) { IMoneyModule money=RequestModuleInterface(); if (money != null) @@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Scenes AddInventoryItem(agentID, item); } - public bool AddInventoryItemReturned(LLUUID AgentId, InventoryItemBase item) + public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(AgentId); @@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void AddInventoryItem(LLUUID AgentID, InventoryItemBase item) + public void AddInventoryItem(UUID AgentID, InventoryItemBase item) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(AgentID); @@ -160,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data) + public UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); if (userInfo != null) @@ -192,13 +192,13 @@ namespace OpenSim.Region.Environment.Scenes } } } - return LLUUID.Zero; + return UUID.Zero; } /// - /// CapsUpdatedInventoryItemAsset(IClientAPI, LLUUID, byte[]) + /// CapsUpdatedInventoryItemAsset(IClientAPI, UUID, byte[]) /// - private LLUUID CapsUpdateInventoryItemAsset(LLUUID avatarId, LLUUID itemID, byte[] data) + private UUID CapsUpdateInventoryItemAsset(UUID avatarId, UUID itemID, byte[] data) { ScenePresence avatar; @@ -214,7 +214,7 @@ namespace OpenSim.Region.Environment.Scenes avatarId); } - return LLUUID.Zero; + return UUID.Zero; } /// @@ -225,8 +225,8 @@ namespace OpenSim.Region.Environment.Scenes /// The prim which contains the item to update /// Indicates whether the script to update is currently running /// - public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, LLUUID itemId, - LLUUID primId, bool isScriptRunning, byte[] data) + public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId, + UUID primId, bool isScriptRunning, byte[] data) { // Retrieve group SceneObjectPart part = GetSceneObjectPart(primId); @@ -274,10 +274,10 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// CapsUpdateTaskInventoryScriptAsset(IClientAPI, LLUUID, LLUUID, bool, byte[]) + /// CapsUpdateTaskInventoryScriptAsset(IClientAPI, UUID, UUID, bool, byte[]) /// - private void CapsUpdateTaskInventoryScriptAsset(LLUUID avatarId, LLUUID itemId, - LLUUID primId, bool isScriptRunning, byte[] data) + private void CapsUpdateTaskInventoryScriptAsset(UUID avatarId, UUID itemId, + UUID primId, bool isScriptRunning, byte[] data) { ScenePresence avatar; @@ -300,17 +300,17 @@ namespace OpenSim.Region.Environment.Scenes /// a transaction /// /// - /// The transaction ID. If this is LLUUID.Zero we will + /// The transaction ID. If this is UUID.Zero we will /// assume that we are not in a transaction /// The ID of the updated item /// The name of the updated item /// The description of the updated item /// The permissions of the updated item -/* public void UpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, - LLUUID itemID, string name, string description, +/* public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, + UUID itemID, string name, string description, uint nextOwnerMask)*/ - public void UpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, - LLUUID itemID, InventoryItemBase itemUpd) + public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, + UUID itemID, InventoryItemBase itemUpd) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); @@ -321,7 +321,7 @@ namespace OpenSim.Region.Environment.Scenes if (item != null) { - if (LLUUID.Zero == transactionID) + if (UUID.Zero == transactionID) { item.Name = itemUpd.Name; item.Description = itemUpd.Description; @@ -378,7 +378,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// ID of the sender of the item /// - public void GiveInventoryItem(IClientAPI recipientClient, LLUUID senderId, LLUUID itemId) + public void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId) { // Retrieve the item from the sender CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId); @@ -413,13 +413,13 @@ namespace OpenSim.Region.Environment.Scenes InventoryItemBase itemCopy = new InventoryItemBase(); itemCopy.Owner = recipientClient.AgentId; itemCopy.Creator = senderId; - itemCopy.ID = LLUUID.Random(); + itemCopy.ID = UUID.Random(); itemCopy.AssetID = item.AssetID; itemCopy.Description = item.Description; itemCopy.Name = item.Name; itemCopy.AssetType = item.AssetType; itemCopy.InvType = item.InvType; - itemCopy.Folder = LLUUID.Zero; + itemCopy.Folder = UUID.Zero; if (ExternalChecks.ExternalChecksPropagatePermissions()) { if (item.InvType == 6) @@ -493,8 +493,8 @@ namespace OpenSim.Region.Environment.Scenes } } - public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, - LLUUID newFolderID, string newName) + public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, UUID oldAgentID, UUID oldItemID, + UUID newFolderID, string newName) { m_log.DebugFormat( "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}", @@ -579,7 +579,7 @@ namespace OpenSim.Region.Environment.Scenes asset.Name = name; asset.Description = description; asset.Type = assetType; - asset.FullID = LLUUID.Random(); + asset.FullID = UUID.Random(); asset.Data = (data == null) ? new byte[1] : data; return asset; @@ -593,7 +593,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void MoveInventoryItem(IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, + public void MoveInventoryItem(IClientAPI remoteClient, UUID folderID, UUID itemID, int length, string newName) { m_log.DebugFormat( @@ -648,7 +648,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, + private void CreateNewInventoryItem(IClientAPI remoteClient, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate) { CreateNewInventoryItem( @@ -667,7 +667,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// private void CreateNewInventoryItem( - IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, + IClientAPI remoteClient, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, int creationDate) { CachedUserInfo userInfo @@ -678,7 +678,7 @@ namespace OpenSim.Region.Environment.Scenes InventoryItemBase item = new InventoryItemBase(); item.Owner = remoteClient.AgentId; item.Creator = remoteClient.AgentId; - item.ID = LLUUID.Random(); + item.ID = UUID.Random(); item.AssetID = asset.FullID; item.Description = asset.Description; item.Name = name; @@ -717,14 +717,14 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, + public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte assetType, byte wearableType, uint nextOwnerMask, int creationDate) { // m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID); - if (transactionID == LLUUID.Zero) + if (transactionID == UUID.Zero) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); @@ -734,9 +734,9 @@ namespace OpenSim.Region.Environment.Scenes ScenePresence presence; TryGetAvatar(remoteClient.AgentId, out presence); byte[] data = null; - if (invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum + if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum { - LLVector3 pos=presence.AbsolutePosition; + Vector3 pos=presence.AbsolutePosition; string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n", presence.Scene.RegionInfo.RegionID, pos.X, pos.Y, pos.Z, @@ -775,7 +775,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - private void RemoveInventoryItem(IClientAPI remoteClient, LLUUID itemID) + private void RemoveInventoryItem(IClientAPI remoteClient, UUID itemID) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); @@ -798,7 +798,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - private void RemoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID) + private void RemoveInventoryFolder(IClientAPI remoteClient, UUID folderID) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); @@ -873,7 +873,7 @@ namespace OpenSim.Region.Environment.Scenes /// be necessary for a permissions check at some stage. /// /// - public void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID) + public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID) { SceneObjectPart part = GetSceneObjectPart(localID); SceneObjectGroup group = part.ParentGroup; @@ -896,7 +896,7 @@ namespace OpenSim.Region.Environment.Scenes } } - private InventoryItemBase CreateAgentInventoryItemFromTask(LLUUID destAgent, SceneObjectPart part, LLUUID itemId) + private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId) { TaskInventoryItem taskItem = part.GetInventoryItem(itemId); @@ -913,7 +913,7 @@ namespace OpenSim.Region.Environment.Scenes InventoryItemBase agentItem = new InventoryItemBase(); - agentItem.ID = LLUUID.Random(); + agentItem.ID = UUID.Random(); agentItem.Creator = taskItem.CreatorID; agentItem.Owner = destAgent; agentItem.AssetID = taskItem.AssetID; @@ -954,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, SceneObjectPart part, LLUUID itemId) + public void MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId) { InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId); @@ -970,7 +970,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void ClientMoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) + public void ClientMoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, uint primLocalId, UUID itemId) { SceneObjectPart part = GetSceneObjectPart(primLocalId); @@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void MoveTaskInventoryItem(LLUUID avatarId, LLUUID folderId, SceneObjectPart part, LLUUID itemId) + public void MoveTaskInventoryItem(UUID avatarId, UUID folderId, SceneObjectPart part, UUID itemId) { ScenePresence avatar; @@ -1040,7 +1040,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void MoveTaskInventoryItem(LLUUID destId, SceneObjectPart part, LLUUID itemId) + public void MoveTaskInventoryItem(UUID destId, SceneObjectPart part, UUID itemId) { TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId); @@ -1065,7 +1065,7 @@ namespace OpenSim.Region.Environment.Scenes return; } - if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) + if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0) { // object cannot copy items to an object owned by a different owner // unless llAllowInventoryDrop has been called @@ -1081,7 +1081,7 @@ namespace OpenSim.Region.Environment.Scenes TaskInventoryItem destTaskItem = new TaskInventoryItem(); - destTaskItem.ItemID = LLUUID.Random(); + destTaskItem.ItemID = UUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; destTaskItem.AssetID = srcTaskItem.AssetID; destTaskItem.GroupID = destPart.GroupID; @@ -1130,7 +1130,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List items) + public void MoveTaskInventoryItems(UUID destID, string category, SceneObjectPart host, List items) { CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); if (profile == null || profile.RootFolder == null) @@ -1142,11 +1142,11 @@ namespace OpenSim.Region.Environment.Scenes return; } - LLUUID newFolderID = LLUUID.Random(); + UUID newFolderID = UUID.Random(); profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); - foreach (LLUUID itemID in items) + foreach (UUID itemID in items) { InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(destID, host, itemID); agentItem.Folder = newFolderID; @@ -1167,16 +1167,16 @@ namespace OpenSim.Region.Environment.Scenes /// /// Update an item in a prim (task) inventory. - /// This method does not handle scripts, RezScript(IClientAPI, LLUUID, unit) + /// This method does not handle scripts, RezScript(IClientAPI, UUID, unit) /// /// /// /// /// - public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID transactionID, TaskInventoryItem itemInfo, + public void UpdateTaskInventory(IClientAPI remoteClient, UUID transactionID, TaskInventoryItem itemInfo, uint primLocalID) { - LLUUID itemID = itemInfo.ItemID; + UUID itemID = itemInfo.ItemID; // Find the prim we're dealing with SceneObjectPart part = GetSceneObjectPart(primLocalID); @@ -1193,8 +1193,8 @@ namespace OpenSim.Region.Environment.Scenes if (currentItem == null) { - LLUUID copyID = LLUUID.Random(); - if (itemID != LLUUID.Zero) + UUID copyID = UUID.Random(); + if (itemID != UUID.Zero) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); @@ -1254,12 +1254,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void RezScript(IClientAPI remoteClient, InventoryItemBase itemBase, LLUUID transactionID, uint localID) + public void RezScript(IClientAPI remoteClient, InventoryItemBase itemBase, UUID transactionID, uint localID) { - LLUUID itemID=itemBase.ID; - LLUUID copyID = LLUUID.Random(); + UUID itemID=itemBase.ID; + UUID copyID = UUID.Random(); - if (itemID != LLUUID.Zero) + if (itemID != UUID.Zero) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); @@ -1344,7 +1344,7 @@ namespace OpenSim.Region.Environment.Scenes taskItem.GroupID = itemBase.GroupID; taskItem.GroupPermissions = 0; taskItem.Flags = itemBase.Flags; - taskItem.PermsGranter = LLUUID.Zero; + taskItem.PermsGranter = UUID.Zero; taskItem.PermsMask = 0; taskItem.AssetID = asset.ID; @@ -1361,7 +1361,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void RezScript(LLUUID srcId, SceneObjectPart srcPart, LLUUID destId, int pin, int running, int start_param) + public void RezScript(UUID srcId, SceneObjectPart srcPart, UUID destId, int pin, int running, int start_param) { TaskInventoryItem srcTaskItem = srcPart.GetInventoryItem(srcId); @@ -1407,7 +1407,7 @@ namespace OpenSim.Region.Environment.Scenes TaskInventoryItem destTaskItem = new TaskInventoryItem(); - destTaskItem.ItemID = LLUUID.Random(); + destTaskItem.ItemID = UUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; destTaskItem.AssetID = srcTaskItem.AssetID; destTaskItem.GroupID = destPart.GroupID; @@ -1467,7 +1467,7 @@ namespace OpenSim.Region.Environment.Scenes { DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet; - LLUUID folderID = LLUUID.Zero; + UUID folderID = UUID.Zero; foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) { @@ -1598,7 +1598,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - private void DeleteToInventory(DeRezObjectPacket DeRezPacket, EntityBase selectedEnt, IClientAPI remoteClient, SceneObjectGroup objectGroup, LLUUID folderID, bool permissionToDelete) + private void DeleteToInventory(DeRezObjectPacket DeRezPacket, EntityBase selectedEnt, IClientAPI remoteClient, SceneObjectGroup objectGroup, UUID folderID, bool permissionToDelete) { string sceneObjectXml = objectGroup.ToXmlString(); @@ -1616,7 +1616,7 @@ namespace OpenSim.Region.Environment.Scenes // If we're deleting someone else's item, it goes back to their deleted items folder // If we're returning someone's item, it goes back to the owner's Lost And Found folder. - if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero || (DeRezPacket.AgentBlock.Destination == 6 && objectGroup.OwnerID != remoteClient.AgentId)) + if (DeRezPacket.AgentBlock.DestinationID == UUID.Zero || (DeRezPacket.AgentBlock.Destination == 6 && objectGroup.OwnerID != remoteClient.AgentId)) { List subrootfolders = userInfo.RootFolder.RequestListOfFolders(); foreach (InventoryFolderBase flder in subrootfolders) @@ -1628,7 +1628,7 @@ namespace OpenSim.Region.Environment.Scenes } } - if (folderID == LLUUID.Zero) + if (folderID == UUID.Zero) { folderID = userInfo.RootFolder.ID; } @@ -1643,7 +1643,7 @@ namespace OpenSim.Region.Environment.Scenes ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId), ((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId), (sbyte)AssetType.Object, - Helpers.StringToField(sceneObjectXml)); + Utils.StringToBytes(sceneObjectXml)); AssetCache.AddAsset(asset); InventoryItemBase item = new InventoryItemBase(); @@ -1654,7 +1654,7 @@ namespace OpenSim.Region.Environment.Scenes else // Delete / Return item.Owner = objectGroup.OwnerID; - item.ID = LLUUID.Random(); + item.ID = UUID.Random(); item.AssetID = asset.FullID; item.Description = asset.Description; item.Name = asset.Name; @@ -1709,7 +1709,7 @@ namespace OpenSim.Region.Environment.Scenes DeleteSceneObject(objectGroup); } - public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID assetID, LLUUID agentID) + public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, UUID assetID, UUID agentID) { SceneObjectGroup objectGroup = grp; if (objectGroup != null) @@ -1723,7 +1723,7 @@ namespace OpenSim.Region.Environment.Scenes Queue searchfolders = new Queue(); searchfolders.Enqueue(userInfo.RootFolder); - LLUUID foundFolder = userInfo.RootFolder.ID; + UUID foundFolder = userInfo.RootFolder.ID; // search through folders to find the asset. while (searchfolders.Count > 0) @@ -1754,7 +1754,7 @@ namespace OpenSim.Region.Environment.Scenes objectGroup.GetPartName(objectGroup.LocalId), objectGroup.GetPartDescription(objectGroup.LocalId), (sbyte)AssetType.Object, - Helpers.StringToField(sceneObjectXml)); + Utils.StringToBytes(sceneObjectXml)); AssetCache.AddAsset(asset); InventoryItemBase item = new InventoryItemBase(); @@ -1797,7 +1797,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) + public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId) { SceneObjectGroup objectGroup = grp; if (objectGroup != null) @@ -1812,13 +1812,13 @@ namespace OpenSim.Region.Environment.Scenes objectGroup.GetPartName(objectGroup.LocalId), objectGroup.GetPartDescription(objectGroup.LocalId), (sbyte)AssetType.Object, - Helpers.StringToField(sceneObjectXml)); + Utils.StringToBytes(sceneObjectXml)); AssetCache.AddAsset(asset); InventoryItemBase item = new InventoryItemBase(); item.Creator = objectGroup.RootPart.CreatorID; item.Owner = remoteClient.AgentId; - item.ID = LLUUID.Random(); + item.ID = UUID.Random(); item.AssetID = asset.FullID; item.Description = asset.Description; item.Name = asset.Name; @@ -1848,9 +1848,9 @@ namespace OpenSim.Region.Environment.Scenes remoteClient.SendInventoryItemCreateUpdate(item); return item.AssetID; } - return LLUUID.Zero; + return UUID.Zero; } - return LLUUID.Zero; + return UUID.Zero; } @@ -1872,10 +1872,10 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public virtual void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, - LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, + public virtual void RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, + UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, - bool RezSelected, bool RemoveItem, LLUUID fromTaskID) + bool RezSelected, bool RemoveItem, UUID fromTaskID) { RezObject( remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, @@ -1901,10 +1901,10 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public virtual SceneObjectGroup RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, - LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, + public virtual SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, + UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, - bool RezSelected, bool RemoveItem, LLUUID fromTaskID, bool attachment) + bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) { // Work out position details byte bRayEndIsIntersection = (byte)0; @@ -1918,11 +1918,11 @@ namespace OpenSim.Region.Environment.Scenes bRayEndIsIntersection = (byte)0; } - LLVector3 scale = new LLVector3(0.5f, 0.5f, 0.5f); + Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f); - LLVector3 pos = GetNewRezLocation( - RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), + Vector3 pos = GetNewRezLocation( + RayStart, RayEnd, RayTargetID, Quaternion.Identity, BypassRayCast, bRayEndIsIntersection,true,scale, false); // Rez object @@ -1939,7 +1939,7 @@ namespace OpenSim.Region.Environment.Scenes if (rezAsset != null) { - string xmlData = Helpers.FieldToUTF8String(rezAsset.Data); + string xmlData = Utils.BytesToString(rezAsset.Data); SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, remoteClient.AgentId, pos) && !attachment) { @@ -1955,7 +1955,7 @@ namespace OpenSim.Region.Environment.Scenes if (!attachment) { pos = GetNewRezLocation( - RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), + RayStart, RayEnd, RayTargetID, Quaternion.Identity, BypassRayCast, bRayEndIsIntersection, true, group.GroupScale(), false); group.AbsolutePosition = pos; } @@ -2066,18 +2066,18 @@ namespace OpenSim.Region.Environment.Scenes /// public virtual SceneObjectGroup RezObject( SceneObjectPart sourcePart, TaskInventoryItem item, - LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) + Vector3 pos, Quaternion rot, Vector3 vel, int param) { // Rez object if (item != null) { - LLUUID ownerID = item.OwnerID; + UUID ownerID = item.OwnerID; AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false); if (rezAsset != null) { - string xmlData = Helpers.FieldToUTF8String(rezAsset.Data); + string xmlData = Utils.BytesToString(rezAsset.Data); SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, ownerID, pos)) @@ -2154,7 +2154,7 @@ namespace OpenSim.Region.Environment.Scenes return null; } - public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) + public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId) { string message = ""; if (returnobjects.Length <= 0) @@ -2186,7 +2186,7 @@ namespace OpenSim.Region.Environment.Scenes { if (userInfo.HasReceivedInventory) { - LLUUID folderID = LLUUID.Zero; + UUID folderID = UUID.Zero; List subrootfolders = userInfo.RootFolder.RequestListOfFolders(); foreach (InventoryFolderBase flder in subrootfolders) @@ -2198,7 +2198,7 @@ namespace OpenSim.Region.Environment.Scenes } } - if (folderID == LLUUID.Zero) + if (folderID == UUID.Zero) { folderID = userInfo.RootFolder.ID; } @@ -2213,13 +2213,13 @@ namespace OpenSim.Region.Environment.Scenes returnobjects[i].GetPartName(returnobjects[i].LocalId), returnobjects[i].GetPartDescription(returnobjects[i].LocalId), (sbyte)AssetType.Object, - Helpers.StringToField(sceneObjectXml)); + Utils.StringToBytes(sceneObjectXml)); AssetCache.AddAsset(asset); InventoryItemBase item = new InventoryItemBase(); item.Creator = returnobjects[i].RootPart.CreatorID; item.Owner = returnobjects[i].OwnerID; - item.ID = LLUUID.Random(); + item.ID = UUID.Random(); item.AssetID = asset.FullID; item.Description = asset.Description; item.Name = asset.Name; @@ -2295,7 +2295,7 @@ namespace OpenSim.Region.Environment.Scenes } - public void GetScriptRunning(IClientAPI controllingClient, LLUUID objectID, LLUUID itemID) + public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) { IScriptModule scriptModule = RequestModuleInterface(); if (scriptModule == null) @@ -2305,7 +2305,7 @@ namespace OpenSim.Region.Environment.Scenes scriptModule.GetScriptRunning(objectID, itemID)); } - public void SetScriptRunning(IClientAPI controllingClient, LLUUID objectID, LLUUID itemID, bool running) + public void SetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID, bool running) { SceneObjectPart part = GetSceneObjectPart(objectID); if (part == null) @@ -2317,7 +2317,7 @@ namespace OpenSim.Region.Environment.Scenes EventManager.TriggerStopScript(part.LocalId, itemID); } - public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, + public void RezSingleAttachment(IClientAPI remoteClient, UUID itemID, uint AttachmentPt, uint ItemFlags, uint NextOwnerMask) { SceneObjectGroup att = m_innerScene.RezSingleAttachment(remoteClient, itemID, AttachmentPt, ItemFlags, NextOwnerMask); @@ -2333,7 +2333,7 @@ namespace OpenSim.Region.Environment.Scenes } public void RezSingleAttachment(SceneObjectGroup att, - IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt, + IClientAPI remoteClient, UUID itemID, uint AttachmentPt, uint ItemFlags, uint NextOwnerMask) { if (att.RootPart != null) @@ -2352,12 +2352,12 @@ namespace OpenSim.Region.Environment.Scenes } } - public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, LLQuaternion rot, LLVector3 pos) + public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos) { m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos); } - public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient) + public void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient) { ScenePresence presence; if (TryGetAvatar(remoteClient.AgentId, out presence)) diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 14d6826..38f4029 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -26,20 +26,20 @@ */ using System.Collections.Generic; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; namespace OpenSim.Region.Environment.Scenes { public partial class Scene { - protected void SimChat(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName, - LLUUID fromID, bool fromAgent, bool broadcast) + protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, + UUID fromID, bool fromAgent, bool broadcast) { OSChatMessage args = new OSChatMessage(); - args.Message = Helpers.FieldToUTF8String(message); + args.Message = Utils.BytesToString(message); args.Channel = channel; args.Type = type; args.Position = fromPos; @@ -75,8 +75,8 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SimChat(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName, - LLUUID fromID, bool fromAgent) + public void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, + UUID fromID, bool fromAgent) { SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, false); } @@ -89,8 +89,8 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SimChatBroadcast(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName, - LLUUID fromID, bool fromAgent) + public void SimChatBroadcast(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, + UUID fromID, bool fromAgent) { SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, true); } @@ -125,7 +125,7 @@ namespace OpenSim.Region.Environment.Scenes // We also need to check the children of this prim as they // can be selected as well and send property information bool foundPrim = false; - foreach (KeyValuePair child in ((SceneObjectGroup) ent).Children) + foreach (KeyValuePair child in ((SceneObjectGroup) ent).Children) { if (child.Value.LocalId == primLocalID) { @@ -196,7 +196,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount, + public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount, int transactiontype, string description) { EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(source, destination, amount, @@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes EventManager.TriggerMoneyTransfer(this, args); } - public virtual void ProcessParcelBuy(LLUUID agentId, LLUUID groupId, bool final, bool groupOwned, + public virtual void ProcessParcelBuy(UUID agentId, UUID groupId, bool final, bool groupOwned, bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated) { EventManager.LandBuyArgs args = new EventManager.LandBuyArgs(agentId, groupId, final, groupOwned, @@ -219,7 +219,7 @@ namespace OpenSim.Region.Environment.Scenes m_eventManager.TriggerLandBuy(this, args); } - public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) + public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient) { List EntityList = GetEntities(); @@ -286,7 +286,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void ProcessAvatarPickerRequest(IClientAPI client, LLUUID avatarID, LLUUID RequestID, string query) + public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query) { //EventManager.TriggerAvatarPickerRequest(); @@ -308,11 +308,11 @@ namespace OpenSim.Region.Environment.Scenes int i = 0; foreach (AvatarPickerAvatar item in AvatarResponses) { - LLUUID translatedIDtem = item.AvatarID; + UUID translatedIDtem = item.AvatarID; searchData[i] = new AvatarPickerReplyPacket.DataBlock(); searchData[i].AvatarID = translatedIDtem; - searchData[i].FirstName = Helpers.StringToField((string) item.firstName); - searchData[i].LastName = Helpers.StringToField((string) item.lastName); + searchData[i].FirstName = Utils.StringToBytes((string) item.firstName); + searchData[i].LastName = Utils.StringToBytes((string) item.lastName); i++; } if (AvatarResponses.Count == 0) @@ -337,8 +337,8 @@ namespace OpenSim.Region.Environment.Scenes client.SendAvatarPickerReply(agent_data, data_args); } - public void ProcessScriptReset(IClientAPI remoteClient, LLUUID objectID, - LLUUID itemID) + public void ProcessScriptReset(IClientAPI remoteClient, UUID objectID, + UUID itemID) { SceneObjectPart part=GetSceneObjectPart(objectID); if (part == null) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index becd7dc..9e784d6 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -32,10 +32,9 @@ using System.Drawing.Imaging; using System.IO; using System.Threading; using System.Timers; -using Axiom.Math; -using libsecondlife; -using libsecondlife.Packets; -using OpenJPEGNet; +using OpenMetaverse; +using OpenMetaverse.Imaging; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; @@ -116,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// Each agent has its own capabilities handler. /// - protected Dictionary m_capsHandlers = new Dictionary(); + protected Dictionary m_capsHandlers = new Dictionary(); protected BaseHttpServer m_httpListener; @@ -201,19 +200,19 @@ namespace OpenSim.Region.Environment.Scenes } // Local reference to the objects in the scene (which are held in innerScene) - // public Dictionary Objects + // public Dictionary Objects // { // get { return m_innerScene.SceneObjects; } // } // Reference to all of the agents in the scene (root and child) - protected Dictionary m_scenePresences + protected Dictionary m_scenePresences { get { return m_innerScene.ScenePresences; } set { m_innerScene.ScenePresences = value; } } - // protected Dictionary m_sceneObjects + // protected Dictionary m_sceneObjects // { // get { return m_innerScene.SceneObjects; } // set { m_innerScene.SceneObjects = value; } @@ -227,13 +226,13 @@ namespace OpenSim.Region.Environment.Scenes /// If you want a list of entities where the list itself is guaranteed not to change, please use /// GetEntities() /// - public Dictionary Entities + public Dictionary Entities { get { return m_innerScene.Entities; } set { m_innerScene.Entities = value; } } - public Dictionary m_restorePresences + public Dictionary m_restorePresences { get { return m_innerScene.RestorePresences; } set { m_innerScene.RestorePresences = value; } @@ -466,7 +465,7 @@ namespace OpenSim.Region.Environment.Scenes m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); m_log.Error("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); m_restartTimer.Start(); - SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes"); + SendRegionMessageFromEstateTools(UUID.Random(), UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes"); //SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes"); } } @@ -481,7 +480,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_RestartTimerCounter <= m_incrementsof15seconds) { if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) - SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + + SendRegionMessageFromEstateTools(UUID.Random(), UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter) * 15) + " seconds"); // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) + @@ -923,8 +922,11 @@ namespace OpenSim.Region.Environment.Scenes foreach (AssetBase asset in textures) { - Image image = OpenJPEG.DecodeToImage(asset.Data); - bitImages.Add(image); + ManagedImage managedImage; + Image image; + + if (OpenJPEG.DecodeToImage(asset.Data, out managedImage, out image)) + bitImages.Add(image); } Bitmap mapTexture = new Bitmap(2560, 2560); @@ -1025,9 +1027,9 @@ namespace OpenSim.Region.Environment.Scenes double[,] hm = Heightmap.GetDoubles(); bool ShadowDebugContinue = true; //Color prim = Color.FromArgb(120, 120, 120); - //LLVector3 RayEnd = new LLVector3(0, 0, 0); - //LLVector3 RayStart = new LLVector3(0, 0, 0); - //LLVector3 direction = new LLVector3(0, 0, -1); + //Vector3 RayEnd = new Vector3(0, 0, 0); + //Vector3 RayStart = new Vector3(0, 0, 0); + //Vector3 direction = new Vector3(0, 0, -1); //Vector3 AXOrigin = new Vector3(); //Vector3 AXdirection = new Vector3(); //Ray testRay = new Ray(); @@ -1061,10 +1063,10 @@ namespace OpenSim.Region.Environment.Scenes //int tc = System.Environment.TickCount; for (int y = 0; y < 256; y++) { - //RayEnd = new LLVector3(x, y, 0); - //RayStart = new LLVector3(x, y, 255); + //RayEnd = new Vector3(x, y, 0); + //RayStart = new Vector3(x, y, 255); - //direction = LLVector3.Norm(RayEnd - RayStart); + //direction = Vector3.Norm(RayEnd - RayStart); //AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); //AXdirection = new Vector3(direction.X, direction.Y, direction.Z); @@ -1272,7 +1274,7 @@ namespace OpenSim.Region.Environment.Scenes 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. @@ -1285,7 +1287,7 @@ namespace OpenSim.Region.Environment.Scenes //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) @@ -1302,7 +1304,7 @@ namespace OpenSim.Region.Environment.Scenes // 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) @@ -1327,21 +1329,20 @@ namespace OpenSim.Region.Environment.Scenes if (isBelow256AboveTerrain) { // Translate scale by rotation so scale is represented properly when object is rotated - Vector3 scale = new Vector3(part.Shape.Scale.X, part.Shape.Scale.Y, part.Shape.Scale.Z); - LLQuaternion llrot = part.GetWorldRotation(); - Quaternion rot = new Quaternion(llrot.W, llrot.X, llrot.Y, llrot.Z); - scale = rot * scale; + Vector3 scale = part.Shape.Scale; + Quaternion rot = part.GetWorldRotation(); + scale *= 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 @@ -1420,7 +1421,7 @@ namespace OpenSim.Region.Environment.Scenes // map tile while protecting the (grid) asset database from bloat caused by a new asset each // time a mapimage is generated! - LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; + UUID lastMapRegionUUID = m_regInfo.lastMapUUID; int lastMapRefresh = 0; int twoDays = 172800; @@ -1440,21 +1441,21 @@ namespace OpenSim.Region.Environment.Scenes { } - LLUUID TerrainImageLLUUID = LLUUID.Random(); + UUID TerrainImageUUID = UUID.Random(); - if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) + if (lastMapRegionUUID == UUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) { - m_regInfo.SaveLastMapUUID(TerrainImageLLUUID); + m_regInfo.SaveLastMapUUID(TerrainImageUUID); m_log.Warn("[MAPTILE]: STORING MAPTILE IMAGE"); } else { - TerrainImageLLUUID = lastMapRegionUUID; + TerrainImageUUID = lastMapRegionUUID; m_log.Warn("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID"); } - m_regInfo.RegionSettings.TerrainImageID = TerrainImageLLUUID; + m_regInfo.RegionSettings.TerrainImageID = TerrainImageUUID; AssetBase asset = new AssetBase(); asset.FullID = m_regInfo.RegionSettings.TerrainImageID; @@ -1471,7 +1472,7 @@ namespace OpenSim.Region.Environment.Scenes #region Load Land - public void loadAllLandObjectsFromStorage(LLUUID regionID) + public void loadAllLandObjectsFromStorage(UUID regionID) { m_log.Info("[SCENE]: Loading land objects from storage"); List landData = m_storageManager.DataStore.LoadLandObjects(regionID); @@ -1500,7 +1501,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// Loads the World's objects /// - public virtual void LoadPrimsFromStorage(LLUUID regionID) + public virtual void LoadPrimsFromStorage(UUID regionID) { m_log.Info("[SCENE]: Loading objects from datastore"); @@ -1509,7 +1510,7 @@ namespace OpenSim.Region.Environment.Scenes { AddRestoredSceneObject(group, true, true); SceneObjectPart rootPart = group.GetChildPart(group.UUID); - rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted; + rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted; rootPart.TrimPermissions(); group.CheckSculptAndLoad(); //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); @@ -1533,20 +1534,20 @@ namespace OpenSim.Region.Environment.Scenes return myID; } - public LLVector3 GetNewRezLocation(LLVector3 RayStart, LLVector3 RayEnd, LLUUID RayTargetID, LLQuaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, LLVector3 scale, bool FaceCenter) + public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter) { - LLVector3 pos = LLVector3.Zero; + Vector3 pos = Vector3.Zero; if (RayEndIsIntersection == (byte)1) { pos = RayEnd; return pos; } - if (RayTargetID != LLUUID.Zero) + if (RayTargetID != UUID.Zero) { SceneObjectPart target = GetSceneObjectPart(RayTargetID); - LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); + Vector3 direction = Vector3.Normalize(RayEnd - RayStart); Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); @@ -1561,7 +1562,7 @@ namespace OpenSim.Region.Environment.Scenes Ray NewRay = new Ray(AXOrigin, AXdirection); // Ray Trace against target here - EntityIntersection ei = target.TestIntersectionOBB(NewRay, new Quaternion(1,0,0,0), frontFacesOnly, FaceCenter); + EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter); // Un-comment out the following line to Get Raytrace results printed to the console. // m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString()); @@ -1570,15 +1571,15 @@ namespace OpenSim.Region.Environment.Scenes // If we hit something if (ei.HitTF) { - LLVector3 scaleComponent = new LLVector3(ei.AAfaceNormal.x, ei.AAfaceNormal.y, ei.AAfaceNormal.z); + Vector3 scaleComponent = new Vector3(ei.AAfaceNormal.X, ei.AAfaceNormal.Y, ei.AAfaceNormal.Z); if (scaleComponent.X != 0) ScaleOffset = scale.X; if (scaleComponent.Y != 0) ScaleOffset = scale.Y; if (scaleComponent.Z != 0) ScaleOffset = scale.Z; ScaleOffset = Math.Abs(ScaleOffset); - LLVector3 intersectionpoint = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); - LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z); + Vector3 intersectionpoint = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z); + Vector3 normal = new Vector3(ei.normal.X, ei.normal.Y, ei.normal.Z); // Set the position to the intersection point - LLVector3 offset = (normal * (ScaleOffset / 2f)); + Vector3 offset = (normal * (ScaleOffset / 2f)); pos = (intersectionpoint + offset); // Un-offset the prim (it gets offset later by the consumer method) @@ -1598,7 +1599,7 @@ namespace OpenSim.Region.Environment.Scenes if (ei.HitTF) { - pos = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); + pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z); } return pos; @@ -1612,11 +1613,11 @@ namespace OpenSim.Region.Environment.Scenes } } - public virtual void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, - byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, + public virtual void AddNewPrim(UUID ownerID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, + byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, byte RayEndIsIntersection) { - LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f, 0.5f, 0.5f), false); + Vector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new Vector3(0.5f, 0.5f, 0.5f), false); if (ExternalChecks.ExternalChecksCanRezObject(1, ownerID, pos)) { @@ -1627,7 +1628,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public virtual SceneObjectGroup AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) + public virtual SceneObjectGroup AddNewPrim(UUID ownerID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) { //m_log.DebugFormat( // "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName); @@ -1640,8 +1641,8 @@ namespace OpenSim.Region.Environment.Scenes //rootPart.TrimPermissions(); if ((rootPart.Shape.PCode == (byte)PCode.Grass) || (rootPart.Shape.PCode == (byte)PCode.Tree) || (rootPart.Shape.PCode == (byte)PCode.NewTree)) { - rootPart.AddFlag(LLObject.ObjectFlags.Phantom); - //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom; + rootPart.AddFlag(PrimFlags.Phantom); + //rootPart.ObjectFlags += (uint)PrimFlags.Phantom; if (rootPart.Shape.PCode != (byte)PCode.Grass) AdaptTree(ref shape); } @@ -1658,20 +1659,20 @@ namespace OpenSim.Region.Environment.Scenes { case Tree.Cypress1: case Tree.Cypress2: - tree.Scale = new LLVector3(4, 4, 10); + tree.Scale = new Vector3(4, 4, 10); break; // case... other tree types - // tree.Scale = new LLVector3(?, ?, ?); + // tree.Scale = new Vector3(?, ?, ?); // break; default: - tree.Scale = new LLVector3(4, 4, 4); + tree.Scale = new Vector3(4, 4, 4); break; } } - public SceneObjectGroup AddTree(LLUUID uuid, LLVector3 scale, LLQuaternion rotation, LLVector3 position, + public SceneObjectGroup AddTree(UUID uuid, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree) { PrimitiveBaseShape treeShape = new PrimitiveBaseShape(); @@ -1771,7 +1772,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was in the scene, false if it was not - public bool UnlinkSceneObject(LLUUID uuid, bool resultOfLinkingObjects) + public bool UnlinkSceneObject(UUID uuid, bool resultOfLinkingObjects) { if (m_innerScene.DeleteSceneObject(uuid,resultOfLinkingObjects)) { @@ -1783,7 +1784,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) + public void LoadPrimsFromXml(string fileName, bool newIdsFlag, Vector3 loadOffset) { m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); @@ -1818,7 +1819,7 @@ namespace OpenSim.Region.Environment.Scenes m_serialiser.SavePrimsToXml2(this, fileName); } - public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) + public void SavePrimsToXml2(TextWriter stream, Vector3 min, Vector3 max) { m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); @@ -1876,7 +1877,7 @@ namespace OpenSim.Region.Environment.Scenes /// current position of Group /// Scene Object Group that we're crossing - public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp) + public void CrossPrimGroupIntoNewRegion(Vector3 position, SceneObjectGroup grp) { if (grp == null) return; @@ -1897,12 +1898,12 @@ namespace OpenSim.Region.Environment.Scenes return; } - m_log.Warn("Prim crossing: " + grp.UUID.ToString()); + m_log.Warn("Prim crossing: " + grp.ToString()); int thisx = (int)RegionInfo.RegionLocX; int thisy = (int)RegionInfo.RegionLocY; ulong newRegionHandle = 0; - LLVector3 pos = position; + Vector3 pos = position; if (position.X > Constants.RegionSize + 0.1f) { @@ -1973,7 +1974,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public bool IncomingInterRegionPrimGroup(ulong regionHandle, LLUUID primID, string objXMLData, int XMLMethod) + public bool IncomingInterRegionPrimGroup(ulong regionHandle, UUID primID, string objXMLData, int XMLMethod) { m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); if (XMLMethod == 0) @@ -2160,7 +2161,7 @@ namespace OpenSim.Region.Environment.Scenes } // Gesture - public virtual void ActivateGesture(IClientAPI client, LLUUID assetId, LLUUID gestureId) + public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) { // UserProfileCacheService User = CommsManager.SecureInventoryService.UpdateItem(gestureid, agentID); CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); @@ -2180,7 +2181,7 @@ namespace OpenSim.Region.Environment.Scenes m_log.DebugFormat("Asset : {0} gesture :{1}", gestureId.ToString(), assetId.ToString()); } - public virtual void DeactivateGesture(IClientAPI client, LLUUID gestureId) + public virtual void DeactivateGesture(IClientAPI client, UUID gestureId) { // UserProfileCacheService User = CommsManager.SecureInventoryService.UpdateItem(gestureid, agentID); CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); @@ -2200,14 +2201,14 @@ namespace OpenSim.Region.Environment.Scenes m_log.DebugFormat("gesture : {0} ", gestureId.ToString()); } - public virtual void TeleportClientHome(LLUUID agentId, IClientAPI client) + public virtual void TeleportClientHome(UUID agentId, IClientAPI client) { UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); if (UserProfile != null) { - LLUUID homeRegionID = UserProfile.HomeRegionID; + UUID homeRegionID = UserProfile.HomeRegionID; ulong homeRegionHandle = UserProfile.HomeRegion; - if (homeRegionID == LLUUID.Zero) + if (homeRegionID == UUID.Zero) { RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); if (info == null) @@ -2234,11 +2235,11 @@ namespace OpenSim.Region.Environment.Scenes } } - public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, - LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, + public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, + UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart, bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) { - LLVector3 pos; + Vector3 pos; const bool frontFacesOnly = true; //m_log.Info("HITTARGET: " + RayTargetObj.ToString() + ", COPYTARGET: " + localID.ToString()); SceneObjectPart target = GetSceneObjectPart(localID); @@ -2246,7 +2247,7 @@ namespace OpenSim.Region.Environment.Scenes if (target != null && target2 != null) { - LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); + Vector3 direction = Vector3.Normalize(RayEnd - RayStart); Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); @@ -2261,7 +2262,7 @@ namespace OpenSim.Region.Environment.Scenes Ray NewRay = new Ray(AXOrigin, AXdirection); // Ray Trace against target here - EntityIntersection ei = target2.TestIntersectionOBB(NewRay, new Quaternion(1, 0, 0, 0), frontFacesOnly, CopyCenters); + EntityIntersection ei = target2.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, CopyCenters); // Un-comment out the following line to Get Raytrace results printed to the console. //m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString()); @@ -2270,26 +2271,26 @@ namespace OpenSim.Region.Environment.Scenes // If we hit something if (ei.HitTF) { - LLVector3 scale = target.Scale; - LLVector3 scaleComponent = new LLVector3(ei.AAfaceNormal.x, ei.AAfaceNormal.y, ei.AAfaceNormal.z); + Vector3 scale = target.Scale; + Vector3 scaleComponent = new Vector3(ei.AAfaceNormal.X, ei.AAfaceNormal.Y, ei.AAfaceNormal.Z); if (scaleComponent.X != 0) ScaleOffset = scale.X; if (scaleComponent.Y != 0) ScaleOffset = scale.Y; if (scaleComponent.Z != 0) ScaleOffset = scale.Z; ScaleOffset = Math.Abs(ScaleOffset); - LLVector3 intersectionpoint = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); - LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z); - LLVector3 offset = normal * (ScaleOffset / 2f); + Vector3 intersectionpoint = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z); + Vector3 normal = new Vector3(ei.normal.X, ei.normal.Y, ei.normal.Z); + Vector3 offset = normal * (ScaleOffset / 2f); pos = intersectionpoint + offset; // stick in offset format from the original prim pos = pos - target.ParentGroup.AbsolutePosition; if (CopyRotates) { - LLQuaternion worldRot = target2.GetWorldRotation(); + Quaternion worldRot = target2.GetWorldRotation(); - // SceneObjectGroup obj = m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, new Quaternion(worldRot.W,worldRot.X,worldRot.Y,worldRot.Z)); - m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, new Quaternion(worldRot.W,worldRot.X,worldRot.Y,worldRot.Z)); - //obj.Rotation = new Quaternion(worldRot.W, worldRot.X, worldRot.Y, worldRot.Z); + // SceneObjectGroup obj = m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); + m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); + //obj.Rotation = worldRot; //obj.UpdateGroupRotation(worldRot); } else @@ -2305,7 +2306,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags) + public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) { UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); if (UserProfile != null) @@ -2369,7 +2370,7 @@ namespace OpenSim.Region.Environment.Scenes /// Remove the given client from the scene. /// /// - public override void RemoveClient(LLUUID agentID) + public override void RemoveClient(UUID agentID) { bool childagentYN = false; ScenePresence avatar = GetScenePresence(agentID); @@ -2420,7 +2421,7 @@ namespace OpenSim.Region.Environment.Scenes { try { - client.SendKillObject(avatar.RegionHandle, avatar.LocalId); + client.SendKiPrimitive(avatar.RegionHandle, avatar.LocalId); } catch (NullReferenceException) { @@ -2462,7 +2463,7 @@ namespace OpenSim.Region.Environment.Scenes //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); } - public void HandleRemoveKnownRegionsFromAvatar(LLUUID avatarID, List regionslst) + public void HandleRemoveKnownRegionsFromAvatar(UUID avatarID, List regionslst) { ScenePresence av = GetScenePresence(avatarID); if (av != null) @@ -2493,7 +2494,7 @@ namespace OpenSim.Region.Environment.Scenes #region Entities - public void SendKillObject(uint localID) + public void SendKiPrimitive(uint localID) { SceneObjectPart part = GetSceneObjectPart(localID); if (part != null) // It is a prim @@ -2504,7 +2505,7 @@ namespace OpenSim.Region.Environment.Scenes return; } } - Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); + Broadcast(delegate(IClientAPI client) { client.SendKiPrimitive(m_regionHandle, localID); }); } #endregion @@ -2524,7 +2525,7 @@ namespace OpenSim.Region.Environment.Scenes m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; - m_sceneGridService.KillObject += SendKillObject; + m_sceneGridService.KiPrimitive += SendKiPrimitive; m_sceneGridService.OnGetLandData += GetLandData; } @@ -2533,7 +2534,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void UnRegisterReginWithComms() { - m_sceneGridService.KillObject -= SendKillObject; + m_sceneGridService.KiPrimitive -= SendKiPrimitive; m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; @@ -2574,7 +2575,7 @@ namespace OpenSim.Region.Environment.Scenes ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); if (land != null) { - if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != LLVector3.Zero) + if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero) { agent.startpos = land.landData.UserLocation; } @@ -2608,7 +2609,7 @@ namespace OpenSim.Region.Environment.Scenes return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); } - protected void HandleLogOffUserFromGrid(ulong regionHandle, LLUUID AvatarID, LLUUID RegionSecret, string message) + protected void HandleLogOffUserFromGrid(ulong regionHandle, UUID AvatarID, UUID RegionSecret, string message) { if (RegionInfo.RegionHandle == regionHandle) { @@ -2645,7 +2646,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void AddCapsHandler(LLUUID agentId) + public void AddCapsHandler(UUID agentId) { if (RegionInfo.EstateSettings.IsBanned(agentId)) return; @@ -2670,7 +2671,7 @@ namespace OpenSim.Region.Environment.Scenes m_capsHandlers[agentId] = cap; } - public Caps GetCapsHandlerForUser(LLUUID agentId) + public Caps GetCapsHandlerForUser(UUID agentId) { lock (m_capsHandlers) { @@ -2686,7 +2687,7 @@ namespace OpenSim.Region.Environment.Scenes /// Remove the caps handler for a given agent. /// /// - public void RemoveCapsHandler(LLUUID agentId) + public void RemoveCapsHandler(UUID agentId) { lock (m_capsHandlers) { @@ -2717,7 +2718,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public virtual void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) + public virtual void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) { if (regionHandle == m_regInfo.RegionHandle) { @@ -2742,7 +2743,7 @@ namespace OpenSim.Region.Environment.Scenes public virtual bool IncomingChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) { - ScenePresence childAgentUpdate = GetScenePresence(new LLUUID(cAgentData.AgentID)); + ScenePresence childAgentUpdate = GetScenePresence(new UUID(cAgentData.AgentID)); if (childAgentUpdate != null) { // I can't imagine *yet* why we would get an update if the agent is a root agent.. @@ -2768,7 +2769,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public bool CloseConnection(ulong regionHandle, LLUUID agentID) + public bool CloseConnection(ulong regionHandle, UUID agentID) { if (regionHandle == m_regionHandle) { @@ -2850,8 +2851,8 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, LLVector3 position, - LLVector3 lookat, uint flags) + public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position, + Vector3 lookat, uint flags) { RegionInfo regionInfo = m_sceneGridService.RequestClosestRegion(regionName); if (regionInfo == null) @@ -2871,8 +2872,8 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, - LLVector3 lookAt, uint flags) + public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, Vector3 position, + Vector3 lookAt, uint flags) { lock (m_scenePresences) { @@ -2890,7 +2891,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void RequestTeleportLandmark(IClientAPI remoteClient, LLUUID regionID, LLVector3 position) + public void RequestTeleportLandmark(IClientAPI remoteClient, UUID regionID, Vector3 position) { RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID); @@ -2906,7 +2907,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_scenePresences.ContainsKey(remoteClient.AgentId)) { m_sceneGridService.RequestTeleportToLocation(m_scenePresences[remoteClient.AgentId], info.RegionHandle, - position, LLVector3.Zero, 0); + position, Vector3.Zero, 0); } } } @@ -2919,7 +2920,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public bool InformNeighbourOfCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) + public bool InformNeighbourOfCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) { return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying); } @@ -3006,7 +3007,7 @@ namespace OpenSim.Region.Environment.Scenes objectCapacity = objects; } - public List GetFriendList(LLUUID avatarID) + public List GetFriendList(UUID avatarID) { return CommsManager.GetUserFriendList(avatarID); } @@ -3035,7 +3036,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SendUrlToUser(LLUUID avatarID, string objectName, LLUUID objectID, LLUUID ownerID, bool groupOwned, + public void SendUrlToUser(UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url) { lock (m_scenePresences) @@ -3048,7 +3049,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void SendDialogToUser(LLUUID avatarID, string objectName, LLUUID objectID, LLUUID ownerID, string message, LLUUID TextureID, int ch, string[] buttonlabels) + public void SendDialogToUser(UUID avatarID, string objectName, UUID objectID, UUID ownerID, string message, UUID TextureID, int ch, string[] buttonlabels) { lock (m_scenePresences) { @@ -3067,13 +3068,13 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public LLUUID MakeHttpRequest(string url, string type, string body) + public UUID MakeHttpRequest(string url, string type, string body) { if (m_httpRequestModule != null) { return m_httpRequestModule.MakeHttpRequest(url, type, body); } - return LLUUID.Zero; + return UUID.Zero; } /// @@ -3091,25 +3092,25 @@ namespace OpenSim.Region.Environment.Scenes m_eventManager.TriggerGridInstantMessage(message, options); } - public virtual void StoreAddFriendship(LLUUID ownerID, LLUUID friendID, uint perms) + public virtual void StoreAddFriendship(UUID ownerID, UUID friendID, uint perms) { // TODO: m_sceneGridService.DoStuff; m_sceneGridService.AddNewUserFriend(ownerID, friendID, perms); } - public virtual void StoreUpdateFriendship(LLUUID ownerID, LLUUID friendID, uint perms) + public virtual void StoreUpdateFriendship(UUID ownerID, UUID friendID, uint perms) { // TODO: m_sceneGridService.DoStuff; m_sceneGridService.UpdateUserFriendPerms(ownerID, friendID, perms); } - public virtual void StoreRemoveFriendship(LLUUID ownerID, LLUUID ExfriendID) + public virtual void StoreRemoveFriendship(UUID ownerID, UUID ExfriendID) { // TODO: m_sceneGridService.DoStuff; m_sceneGridService.RemoveUserFriend(ownerID, ExfriendID); } - public virtual List StoreGetFriendsForUser(LLUUID ownerID) + public virtual List StoreGetFriendsForUser(UUID ownerID) { // TODO: m_sceneGridService.DoStuff; return m_sceneGridService.GetUserFriendList(ownerID); @@ -3144,7 +3145,7 @@ namespace OpenSim.Region.Environment.Scenes #region Alert Methods - private void SendPermissionAlert(LLUUID user, string reason) + private void SendPermissionAlert(UUID user, string reason) { SendAlertToUser(user, reason, false); } @@ -3170,7 +3171,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SendAlertToUser(LLUUID agentID, string message, bool modal) + public void SendAlertToUser(UUID agentID, string message, bool modal) { lock (m_scenePresences) { @@ -3188,7 +3189,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void handleRequestGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token, bool godLike, + public void handleRequestGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) { lock (m_scenePresences) @@ -3200,7 +3201,7 @@ namespace OpenSim.Region.Environment.Scenes if (ExternalChecks.ExternalChecksCanBeGodLike(agentID)) { // Next we check for spoofing..... - LLUUID testSessionID = m_scenePresences[agentID].ControllingClient.SessionId; + UUID testSessionID = m_scenePresences[agentID].ControllingClient.SessionId; if (sessionID == testSessionID) { if (sessionID == controllingClient.SessionId) @@ -3226,7 +3227,7 @@ namespace OpenSim.Region.Environment.Scenes /// The session of the person sending the message /// The name of the person doing the sending /// The Message being sent to the user - public void SendRegionMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) + public void SendRegionMessageFromEstateTools(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message) { List presenceList = GetScenePresences(); @@ -3245,7 +3246,7 @@ namespace OpenSim.Region.Environment.Scenes /// The session of the person sending the message /// The name of the person doing the sending /// The Message being sent to the user - public void SendEstateMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) + public void SendEstateMessageFromEstateTools(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message) { ClientManager.ForEachClient(delegate(IClientAPI controller) @@ -3266,10 +3267,10 @@ namespace OpenSim.Region.Environment.Scenes /// the person that is being kicked /// This isn't used apparently /// The message to send to the user after it's been turned into a field - public void HandleGodlikeKickUser(LLUUID godID, LLUUID sessionID, LLUUID agentID, uint kickflags, byte[] reason) + public void HandleGodlikeKickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) { // For some reason the client sends this seemingly hard coded UUID for kicking everyone. Dun-know. - LLUUID kickUserID = new LLUUID("44e87126e7944ded05b37c42da3d5cdb"); + UUID kickUserID = new UUID("44e87126e7944ded05b37c42da3d5cdb"); lock (m_scenePresences) { if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID) @@ -3281,7 +3282,7 @@ namespace OpenSim.Region.Environment.Scenes ClientManager.ForEachClient(delegate(IClientAPI controller) { if (controller.AgentId != godID) - controller.Kick(Helpers.FieldToUTF8String(reason)); + controller.Kick(Utils.BytesToString(reason)); } ); @@ -3304,7 +3305,7 @@ namespace OpenSim.Region.Environment.Scenes { m_innerScene.removeUserCount(!m_scenePresences[agentID].IsChildAgent); - m_scenePresences[agentID].ControllingClient.Kick(Helpers.FieldToUTF8String(reason)); + m_scenePresences[agentID].ControllingClient.Kick(Utils.BytesToString(reason)); m_scenePresences[agentID].ControllingClient.Close(true); } } @@ -3317,7 +3318,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void HandleObjectPermissionsUpdate(IClientAPI controller, LLUUID agentID, LLUUID sessionID, byte field, uint localId, uint mask, byte set) + public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set) { // Check for spoofing.. since this is permissions we're talking about here! if ((controller.SessionId == sessionID) && (controller.AgentId == agentID)) @@ -3423,7 +3424,7 @@ namespace OpenSim.Region.Environment.Scenes if (part.Name == cmdparams[0]) { part.Resize( - new LLVector3(Convert.ToSingle(cmdparams[1]), Convert.ToSingle(cmdparams[2]), + new Vector3(Convert.ToSingle(cmdparams[1]), Convert.ToSingle(cmdparams[2]), Convert.ToSingle(cmdparams[3]))); Console.WriteLine("Edited scale of Primitive: " + part.Name); @@ -3489,12 +3490,12 @@ namespace OpenSim.Region.Environment.Scenes return Heightmap[x, y]; } - public LLUUID GetLandOwner(float x, float y) + public UUID GetLandOwner(float x, float y) { ILandObject land = LandChannel.GetLandObject(x, y); if (land == null) { - return LLUUID.Zero; + return UUID.Zero; } else { @@ -3570,7 +3571,7 @@ namespace OpenSim.Region.Environment.Scenes m_eventManager.TriggerOnScriptChangedEvent(localID, change); } - public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos) + public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) { m_eventManager.TriggerAtTargetEvent(localID, handle, targetpos, currentpos); } @@ -3580,7 +3581,7 @@ namespace OpenSim.Region.Environment.Scenes m_eventManager.TriggerNotAtTargetEvent(localID); } - private bool scriptDanger(SceneObjectPart part,LLVector3 pos) + private bool scriptDanger(SceneObjectPart part,Vector3 pos) { ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); if (part != null) @@ -3636,7 +3637,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public bool scriptDanger(uint localID, LLVector3 pos) + public bool scriptDanger(uint localID, Vector3 pos) { SceneObjectPart part = GetSceneObjectPart(localID); if (part != null) @@ -3678,7 +3679,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public LLUUID ConvertLocalIDToFullID(uint localID) + public UUID ConvertLocalIDToFullID(uint localID) { return m_innerScene.ConvertLocalIDToFullID(localID); } @@ -3737,7 +3738,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public ScenePresence GetScenePresence(LLUUID avatarID) + public ScenePresence GetScenePresence(UUID avatarID) { return m_innerScene.GetScenePresence(avatarID); } @@ -3747,7 +3748,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// AvatarID to lookup /// - public override bool PresenceChildStatus(LLUUID avatarID) + public override bool PresenceChildStatus(UUID avatarID) { ScenePresence cp = GetScenePresence(avatarID); return cp.IsChildAgent; @@ -3811,12 +3812,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public SceneObjectPart GetSceneObjectPart(LLUUID fullID) + public SceneObjectPart GetSceneObjectPart(UUID fullID) { return m_innerScene.GetSceneObjectPart(fullID); } - internal bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar) + internal bool TryGetAvatar(UUID avatarId, out ScenePresence avatar) { return m_innerScene.TryGetAvatar(avatarId, out avatar); } @@ -3921,7 +3922,7 @@ namespace OpenSim.Region.Environment.Scenes // }); } - public void RegionHandleRequest(IClientAPI client, LLUUID regionID) + public void RegionHandleRequest(IClientAPI client, UUID regionID) { RegionInfo info; if (regionID == RegionInfo.RegionID) @@ -3939,7 +3940,7 @@ namespace OpenSim.Region.Environment.Scenes client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); } - public void SetRootAgentScene(LLUUID agentID) + public void SetRootAgentScene(UUID agentID) { IInventoryModule inv = RequestModuleInterface(); if (inv == null) @@ -3948,7 +3949,7 @@ namespace OpenSim.Region.Environment.Scenes inv.SetRootAgentScene(agentID, this); } - public bool NeedSceneCacheClear(LLUUID agentID) + public bool NeedSceneCacheClear(UUID agentID) { IInventoryModule inv = RequestModuleInterface(); if (inv == null) @@ -3957,7 +3958,7 @@ namespace OpenSim.Region.Environment.Scenes return inv.NeedSceneCacheClear(agentID, this); } - public void ObjectSaleInfo(IClientAPI client, LLUUID agentID, LLUUID sessionID, uint localID, byte saleType, int salePrice) + public void ObjectSaleInfo(IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice) { SceneObjectPart part = GetSceneObjectPart(localID); if (part == null || part.ParentGroup == null) @@ -3976,7 +3977,7 @@ namespace OpenSim.Region.Environment.Scenes part.GetProperties(client); } - public void PerformObjectBuy(IClientAPI remoteClient, LLUUID categoryID, + public void PerformObjectBuy(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType) { SceneObjectPart part = GetSceneObjectPart(localID); @@ -4031,13 +4032,13 @@ namespace OpenSim.Region.Environment.Scenes group.GetPartName(localID), group.GetPartDescription(localID), (sbyte)AssetType.Object, - Helpers.StringToField(sceneObjectXml)); + Utils.StringToBytes(sceneObjectXml)); AssetCache.AddAsset(asset); InventoryItemBase item = new InventoryItemBase(); item.Creator = part.CreatorID; - item.ID = LLUUID.Random(); + item.ID = UUID.Random(); item.Owner = remoteClient.AgentId; item.AssetID = asset.FullID; item.Description = asset.Description; @@ -4069,7 +4070,7 @@ namespace OpenSim.Region.Environment.Scenes break; case 3: // Sell contents - List invList = part.GetInventoryList(); + List invList = part.GetInventoryList(); if (invList.Count > 0) MoveTaskInventoryItems(remoteClient.AgentId, part.Name, diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index c624a41..51909ad 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.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.Framework.Communications.Cache; @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public abstract void RemoveClient(LLUUID agentID); + public abstract void RemoveClient(UUID agentID); public abstract void CloseAllAgents(uint circuitcode); @@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Scenes handlerPhysicsCrash(RegionInfo); } - public virtual bool PresenceChildStatus(LLUUID avatarID) + public virtual bool PresenceChildStatus(UUID avatarID) { return false; } @@ -210,8 +210,8 @@ namespace OpenSim.Region.Environment.Scenes /// /// XXX These two methods are very temporary /// - protected Dictionary capsPaths = new Dictionary(); - public string GetCapsPath(LLUUID agentId) + protected Dictionary capsPaths = new Dictionary(); + public string GetCapsPath(UUID agentId) { if (capsPaths.ContainsKey(agentId)) { diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index f8c5814..9ff35c0 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -30,16 +30,16 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications; namespace OpenSim.Region.Environment.Scenes { - public delegate void KillObjectDelegate(uint localID); + public delegate void KiPrimitiveDelegate(uint localID); - public delegate void RemoveKnownRegionsFromAvatarList(LLUUID avatarID, List regionlst); + public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List regionlst); public class SceneCommunicationService //one instance per region { @@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Scenes private LogOffUser handlerLogOffUser = null; private GetLandData handlerGetLandData = null; // OnGetLandData - public KillObjectDelegate KillObject; + public KiPrimitiveDelegate KiPrimitive; public string _debugRegionName = String.Empty; public string debugRegionName @@ -158,7 +158,7 @@ namespace OpenSim.Region.Environment.Scenes } } - protected void GridLogOffUser(ulong regionHandle, LLUUID AgentID, LLUUID RegionSecret, string message) + protected void GridLogOffUser(ulong regionHandle, UUID AgentID, UUID RegionSecret, string message) { handlerLogOffUser = OnLogOffUser; if (handlerLogOffUser != null) @@ -188,7 +188,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } - protected void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) + protected void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) { handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; if (handlerAvatarCrossingIntoRegion != null) @@ -197,7 +197,7 @@ namespace OpenSim.Region.Environment.Scenes } } - protected bool IncomingPrimCrossing(ulong regionHandle, LLUUID primID, String objXMLData, int XMLMethod) + protected bool IncomingPrimCrossing(ulong regionHandle, UUID primID, String objXMLData, int XMLMethod) { handlerExpectPrim = OnExpectPrim; if (handlerExpectPrim != null) @@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Scenes } - protected void PrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical) + protected void PrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical) { handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; if (handlerPrimCrossingIntoRegion != null) @@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Scenes } } - protected bool CloseConnection(ulong regionHandle, LLUUID agentID) + protected bool CloseConnection(ulong regionHandle, UUID agentID) { m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString()); handlerCloseAgentConnection = OnCloseAgentConnection; @@ -315,9 +315,9 @@ namespace OpenSim.Region.Environment.Scenes for (int i = 0; i < neighbours.Count; i++) { AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); - agent.BaseFolder = LLUUID.Zero; - agent.InventoryFolder = LLUUID.Zero; - agent.startpos = new LLVector3(128, 128, 70); + agent.BaseFolder = UUID.Zero; + agent.InventoryFolder = UUID.Zero; + agent.startpos = new Vector3(128, 128, 70); agent.child = true; InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; @@ -356,9 +356,9 @@ namespace OpenSim.Region.Environment.Scenes public void InformNeighborChildAgent(ScenePresence avatar, RegionInfo region, List neighbours) { AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); - agent.BaseFolder = LLUUID.Zero; - agent.InventoryFolder = LLUUID.Zero; - agent.startpos = new LLVector3(128, 128, 70); + agent.BaseFolder = UUID.Zero; + agent.InventoryFolder = UUID.Zero; + agent.startpos = new Vector3(128, 128, 70); agent.child = true; InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; @@ -484,13 +484,13 @@ namespace OpenSim.Region.Environment.Scenes d); } - public delegate void SendCloseChildAgentDelegate(LLUUID agentID, List regionlst); + public delegate void SendCloseChildAgentDelegate(UUID agentID, List regionlst); /// /// This Closes child agents on neighboring regions /// Calls an asynchronous method to do so.. so it doesn't lag the sim. /// - private void SendCloseChildAgentAsync(LLUUID agentID, List regionlst) + private void SendCloseChildAgentAsync(UUID agentID, List regionlst) { foreach (ulong regionHandle in regionlst) @@ -525,7 +525,7 @@ namespace OpenSim.Region.Environment.Scenes icon.EndInvoke(iar); } - public void SendCloseChildAgentConnections(LLUUID agentID, List regionslst) + public void SendCloseChildAgentConnections(UUID agentID, List regionslst) { // This assumes that we know what our neighbors are. SendCloseChildAgentDelegate d = SendCloseChildAgentAsync; @@ -550,7 +550,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public virtual RegionInfo RequestNeighbouringRegionInfo(LLUUID regionID) + public virtual RegionInfo RequestNeighbouringRegionInfo(UUID regionID) { //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionID); return m_commsProvider.GridService.RequestNeighbourInfo(regionID); @@ -578,8 +578,8 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public virtual void RequestTeleportToLocation(ScenePresence avatar, ulong regionHandle, LLVector3 position, - LLVector3 lookAt, uint flags) + public virtual void RequestTeleportToLocation(ScenePresence avatar, ulong regionHandle, Vector3 position, + Vector3 lookAt, uint flags) { bool destRegionUp = false; @@ -588,7 +588,7 @@ namespace OpenSim.Region.Environment.Scenes // Teleport within the same region if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0) { - LLVector3 emergencyPos = new LLVector3(128, 128, 128); + Vector3 emergencyPos = new Vector3(128, 128, 128); m_log.WarnFormat( "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", @@ -614,8 +614,8 @@ namespace OpenSim.Region.Environment.Scenes { avatar.ControllingClient.SendTeleportLocationStart(); AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); - agent.BaseFolder = LLUUID.Zero; - agent.InventoryFolder = LLUUID.Zero; + agent.BaseFolder = UUID.Zero; + agent.InventoryFolder = UUID.Zero; agent.startpos = position; agent.child = true; @@ -667,9 +667,9 @@ namespace OpenSim.Region.Environment.Scenes avatar.MakeChildAgent(); Thread.Sleep(5000); avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle); - if (KillObject != null) + if (KiPrimitive != null) { - KillObject(avatar.LocalId); + KiPrimitive(avatar.LocalId); } uint newRegionX = (uint)(reg.RegionHandle >> 40); uint newRegionY = (((uint)(reg.RegionHandle)) >> 8); @@ -700,12 +700,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public bool CrossToNeighbouringRegion(ulong regionhandle, LLUUID agentID, LLVector3 position, bool isFlying) + public bool CrossToNeighbouringRegion(ulong regionhandle, UUID agentID, Vector3 position, bool isFlying) { return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying); } - public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, string objData, int XMLMethod) + public bool PrimCrossToNeighboringRegion(ulong regionhandle, UUID primID, string objData, int XMLMethod) { return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod); } @@ -716,32 +716,32 @@ namespace OpenSim.Region.Environment.Scenes return m_commsProvider.GridService.GetGridSettings(); } - public void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz) + public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz) { m_commsProvider.LogOffUser(userid, regionid, regionhandle, posx, posy, posz); } - public void ClearUserAgent(LLUUID avatarID) + public void ClearUserAgent(UUID avatarID) { m_commsProvider.UserService.ClearUserAgent(avatarID); } - public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) + public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) { m_commsProvider.AddNewUserFriend(friendlistowner, friend, perms); } - public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) + public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) { m_commsProvider.UpdateUserFriendPerms(friendlistowner, friend, perms); } - public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) + public void RemoveUserFriend(UUID friendlistowner, UUID friend) { m_commsProvider.RemoveUserFriend(friendlistowner, friend); } - public List GetUserFriendList(LLUUID friendlistowner) + public List GetUserFriendList(UUID friendlistowner) { return m_commsProvider.GetUserFriendList(friendlistowner); } @@ -751,7 +751,7 @@ namespace OpenSim.Region.Environment.Scenes return m_commsProvider.GridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); } - public List GenerateAgentPickerRequestResponse(LLUUID queryID, string query) + public List GenerateAgentPickerRequestResponse(UUID queryID, string query) { return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query); } diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index a0e0a37..a2a4b2d 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Text; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Scenes #region Object Permission Checks - public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); + public delegate uint GenerateClientFlags(UUID userID, UUID objectIDID); private List GenerateClientFlagsCheckFunctions = new List(); public void addGenerateClientFlags(GenerateClientFlags delegateFunc) @@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes GenerateClientFlagsCheckFunctions.Remove(delegateFunc); } - public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) + public uint ExternalChecksGenerateClientFlags(UUID userID, UUID objectID) { SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); @@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Scenes return 0; uint perms=part.GetEffectiveObjectFlags() | - (uint)LLObject.ObjectFlags.ObjectModify | - (uint)LLObject.ObjectFlags.ObjectCopy | - (uint)LLObject.ObjectFlags.ObjectMove | - (uint)LLObject.ObjectFlags.ObjectTransfer | - (uint)LLObject.ObjectFlags.ObjectYouOwner | - (uint)LLObject.ObjectFlags.ObjectAnyOwner | - (uint)LLObject.ObjectFlags.ObjectOwnerModify | - (uint)LLObject.ObjectFlags.ObjectYouOfficer; + (uint)PrimFlags.ObjectModify | + (uint)PrimFlags.ObjectCopy | + (uint)PrimFlags.ObjectMove | + (uint)PrimFlags.ObjectTransfer | + (uint)PrimFlags.ObjectYouOwner | + (uint)PrimFlags.ObjectAnyOwner | + (uint)PrimFlags.ObjectOwnerModify | + (uint)PrimFlags.ObjectYouOfficer; foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) { @@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Scenes } #region REZ OBJECT - public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); + public delegate bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene); private List CanRezObjectCheckFunctions = new List(); public void addCheckRezObject(CanRezObject delegateFunc) @@ -177,7 +177,7 @@ namespace OpenSim.Region.Environment.Scenes CanRezObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) + public bool ExternalChecksCanRezObject(int objectCount, UUID owner, Vector3 objectPosition) { foreach (CanRezObject check in CanRezObjectCheckFunctions) { @@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region DELETE OBJECT - public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); + public delegate bool CanDeleteObject(UUID objectID, UUID deleter, Scene scene); private List CanDeleteObjectCheckFunctions = new List(); public void addCheckDeleteObject(CanDeleteObject delegateFunc) @@ -207,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes CanDeleteObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) + public bool ExternalChecksCanDeleteObject(UUID objectID, UUID deleter) { foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) { @@ -222,7 +222,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region TAKE OBJECT - public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); + public delegate bool CanTakeObject(UUID objectID, UUID stealer, Scene scene); private List CanTakeObjectCheckFunctions = new List(); public void addCheckTakeObject(CanTakeObject delegateFunc) @@ -237,7 +237,7 @@ namespace OpenSim.Region.Environment.Scenes CanTakeObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) + public bool ExternalChecksCanTakeObject(UUID objectID, UUID AvatarTakingUUID) { foreach (CanTakeObject check in CanTakeObjectCheckFunctions) { @@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region TAKE COPY OBJECT - public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); + public delegate bool CanTakeCopyObject(UUID objectID, UUID userID, Scene inScene); private List CanTakeCopyObjectCheckFunctions = new List(); public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) @@ -267,7 +267,7 @@ namespace OpenSim.Region.Environment.Scenes CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanTakeCopyObject(UUID objectID, UUID userID) { foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) { @@ -282,7 +282,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region DUPLICATE OBJECT - public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); + public delegate bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); private List CanDuplicateObjectCheckFunctions = new List(); public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) @@ -297,7 +297,7 @@ namespace OpenSim.Region.Environment.Scenes CanDuplicateObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) + public bool ExternalChecksCanDuplicateObject(int objectCount, UUID objectID, UUID owner, Vector3 objectPosition) { foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) { @@ -312,7 +312,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region EDIT OBJECT - public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); + public delegate bool CanEditObject(UUID objectID, UUID editorID, Scene scene); private List CanEditObjectCheckFunctions = new List(); public void addCheckEditObject(CanEditObject delegateFunc) @@ -327,7 +327,7 @@ namespace OpenSim.Region.Environment.Scenes CanEditObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) + public bool ExternalChecksCanEditObject(UUID objectID, UUID editorID) { foreach (CanEditObject check in CanEditObjectCheckFunctions) { @@ -342,7 +342,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region MOVE OBJECT - public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); + public delegate bool CanMoveObject(UUID objectID, UUID moverID, Scene scene); private List CanMoveObjectCheckFunctions = new List(); public void addCheckMoveObject(CanMoveObject delegateFunc) @@ -357,7 +357,7 @@ namespace OpenSim.Region.Environment.Scenes CanMoveObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) + public bool ExternalChecksCanMoveObject(UUID objectID, UUID moverID) { foreach (CanMoveObject check in CanMoveObjectCheckFunctions) { @@ -372,7 +372,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region OBJECT ENTRY - public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); + public delegate bool CanObjectEntry(UUID objectID, Vector3 newPoint, Scene scene); private List CanObjectEntryCheckFunctions = new List(); public void addCheckObjectEntry(CanObjectEntry delegateFunc) @@ -387,7 +387,7 @@ namespace OpenSim.Region.Environment.Scenes CanObjectEntryCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) + public bool ExternalChecksCanObjectEntry(UUID objectID, Vector3 newPoint) { foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) { @@ -402,7 +402,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region RETURN OBJECT - public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); + public delegate bool CanReturnObject(UUID objectID, UUID returnerID, Scene scene); private List CanReturnObjectCheckFunctions = new List(); public void addCheckReturnObject(CanReturnObject delegateFunc) @@ -417,7 +417,7 @@ namespace OpenSim.Region.Environment.Scenes CanReturnObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) + public bool ExternalChecksCanReturnObject(UUID objectID, UUID returnerID) { foreach (CanReturnObject check in CanReturnObjectCheckFunctions) { @@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region INSTANT MESSAGE - public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); + public delegate bool CanInstantMessage(UUID user, UUID target, Scene startScene); private List CanInstantMessageCheckFunctions = new List(); public void addCheckInstantMessage(CanInstantMessage delegateFunc) @@ -447,7 +447,7 @@ namespace OpenSim.Region.Environment.Scenes CanInstantMessageCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) + public bool ExternalChecksCanInstantMessage(UUID user, UUID target) { foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) { @@ -462,7 +462,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region INVENTORY TRANSFER - public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); + public delegate bool CanInventoryTransfer(UUID user, UUID target, Scene startScene); private List CanInventoryTransferCheckFunctions = new List(); public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) @@ -477,7 +477,7 @@ namespace OpenSim.Region.Environment.Scenes CanInventoryTransferCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) + public bool ExternalChecksCanInventoryTransfer(UUID user, UUID target) { foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) { @@ -492,7 +492,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region VIEW SCRIPT - public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + public delegate bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene); private List CanViewScriptCheckFunctions = new List(); public void addCheckViewScript(CanViewScript delegateFunc) @@ -507,7 +507,7 @@ namespace OpenSim.Region.Environment.Scenes CanViewScriptCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) + public bool ExternalChecksCanViewScript(UUID script, UUID objectID, UUID user) { foreach (CanViewScript check in CanViewScriptCheckFunctions) { @@ -519,7 +519,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + public delegate bool CanViewNotecard(UUID script, UUID objectID, UUID user, Scene scene); private List CanViewNotecardCheckFunctions = new List(); public void addCheckViewNotecard(CanViewNotecard delegateFunc) @@ -534,7 +534,7 @@ namespace OpenSim.Region.Environment.Scenes CanViewNotecardCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) + public bool ExternalChecksCanViewNotecard(UUID script, UUID objectID, UUID user) { foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) { @@ -549,7 +549,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region EDIT SCRIPT - public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + public delegate bool CanEditScript(UUID script, UUID objectID, UUID user, Scene scene); private List CanEditScriptCheckFunctions = new List(); public void addCheckEditScript(CanEditScript delegateFunc) @@ -564,7 +564,7 @@ namespace OpenSim.Region.Environment.Scenes CanEditScriptCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) + public bool ExternalChecksCanEditScript(UUID script, UUID objectID, UUID user) { foreach (CanEditScript check in CanEditScriptCheckFunctions) { @@ -576,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); + public delegate bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene); private List CanEditNotecardCheckFunctions = new List(); public void addCheckEditNotecard(CanEditNotecard delegateFunc) @@ -591,7 +591,7 @@ namespace OpenSim.Region.Environment.Scenes CanEditNotecardCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) + public bool ExternalChecksCanEditNotecard(UUID script, UUID objectID, UUID user) { foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) { @@ -606,7 +606,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region RUN SCRIPT (When Script Placed in Object) - public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + public delegate bool CanRunScript(UUID script, UUID objectID, UUID user, Scene scene); private List CanRunScriptCheckFunctions = new List(); public void addCheckRunScript(CanRunScript delegateFunc) @@ -621,7 +621,7 @@ namespace OpenSim.Region.Environment.Scenes CanRunScriptCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) + public bool ExternalChecksCanRunScript(UUID script, UUID objectID, UUID user) { foreach (CanRunScript check in CanRunScriptCheckFunctions) { @@ -636,7 +636,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region START SCRIPT (When Script run box is Checked after placed in object) - public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); + public delegate bool CanStartScript(UUID script, UUID user, Scene scene); private List CanStartScriptCheckFunctions = new List(); public void addCheckStartScript(CanStartScript delegateFunc) @@ -651,7 +651,7 @@ namespace OpenSim.Region.Environment.Scenes CanStartScriptCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanStartScript(UUID script, UUID user) { foreach (CanStartScript check in CanStartScriptCheckFunctions) { @@ -666,7 +666,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region STOP SCRIPT (When Script run box is unchecked after placed in object) - public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); + public delegate bool CanStopScript(UUID script, UUID user, Scene scene); private List CanStopScriptCheckFunctions = new List(); public void addCheckStopScript(CanStopScript delegateFunc) @@ -681,7 +681,7 @@ namespace OpenSim.Region.Environment.Scenes CanStopScriptCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanStopScript(UUID script, UUID user) { foreach (CanStopScript check in CanStopScriptCheckFunctions) { @@ -696,7 +696,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region RESET SCRIPT - public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); + public delegate bool CanResetScript(UUID script, UUID user, Scene scene); private List CanResetScriptCheckFunctions = new List(); public void addCheckResetScript(CanResetScript delegateFunc) @@ -711,7 +711,7 @@ namespace OpenSim.Region.Environment.Scenes CanResetScriptCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanResetScript(UUID script, UUID user) { foreach (CanResetScript check in CanResetScriptCheckFunctions) { @@ -726,7 +726,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region TERRAFORM LAND - public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); + public delegate bool CanTerraformLand(UUID user, Vector3 position, Scene requestFromScene); private List CanTerraformLandCheckFunctions = new List(); public void addCheckTerraformLand(CanTerraformLand delegateFunc) @@ -741,7 +741,7 @@ namespace OpenSim.Region.Environment.Scenes CanTerraformLandCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) + public bool ExternalChecksCanTerraformLand(UUID user, Vector3 pos) { foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) { @@ -756,7 +756,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region RUN CONSOLE COMMAND - public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); + public delegate bool CanRunConsoleCommand(UUID user, Scene requestFromScene); private List CanRunConsoleCommandCheckFunctions = new List(); public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) @@ -771,7 +771,7 @@ namespace OpenSim.Region.Environment.Scenes CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanRunConsoleCommand(LLUUID user) + public bool ExternalChecksCanRunConsoleCommand(UUID user) { foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) { @@ -786,7 +786,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region CAN ISSUE ESTATE COMMAND - public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); + public delegate bool CanIssueEstateCommand(UUID user, Scene requestFromScene, bool ownerCommand); private List CanIssueEstateCommandCheckFunctions = new List(); public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) @@ -801,7 +801,7 @@ namespace OpenSim.Region.Environment.Scenes CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) + public bool ExternalChecksCanIssueEstateCommand(UUID user, bool ownerCommand) { foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) { @@ -815,7 +815,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region CAN BE GODLIKE - public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); + public delegate bool CanBeGodLike(UUID user, Scene requestFromScene); private List CanBeGodLikeCheckFunctions = new List(); public void addCheckBeGodLike(CanBeGodLike delegateFunc) @@ -830,7 +830,7 @@ namespace OpenSim.Region.Environment.Scenes CanBeGodLikeCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanBeGodLike(LLUUID user) + public bool ExternalChecksCanBeGodLike(UUID user) { foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) { @@ -844,7 +844,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region EDIT PARCEL - public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); + public delegate bool CanEditParcel(UUID user, ILandObject parcel, Scene scene); private List CanEditParcelCheckFunctions = new List(); public void addCheckEditParcel(CanEditParcel delegateFunc) @@ -859,7 +859,7 @@ namespace OpenSim.Region.Environment.Scenes CanEditParcelCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanEditParcel(UUID user, ILandObject parcel) { foreach (CanEditParcel check in CanEditParcelCheckFunctions) { @@ -873,7 +873,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region SELL PARCEL - public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); + public delegate bool CanSellParcel(UUID user, ILandObject parcel, Scene scene); private List CanSellParcelCheckFunctions = new List(); public void addCheckSellParcel(CanSellParcel delegateFunc) @@ -888,7 +888,7 @@ namespace OpenSim.Region.Environment.Scenes CanSellParcelCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanSellParcel(UUID user, ILandObject parcel) { foreach (CanSellParcel check in CanSellParcelCheckFunctions) { @@ -902,7 +902,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region ABANDON PARCEL - public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); + public delegate bool CanAbandonParcel(UUID user, ILandObject parcel, Scene scene); private List CanAbandonParcelCheckFunctions = new List(); public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) @@ -917,7 +917,7 @@ namespace OpenSim.Region.Environment.Scenes CanAbandonParcelCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanAbandonParcel(UUID user, ILandObject parcel) { foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) { @@ -930,7 +930,7 @@ namespace OpenSim.Region.Environment.Scenes } #endregion - public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); + public delegate bool CanReclaimParcel(UUID user, ILandObject parcel, Scene scene); private List CanReclaimParcelCheckFunctions = new List(); public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) @@ -945,7 +945,7 @@ namespace OpenSim.Region.Environment.Scenes CanReclaimParcelCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanReclaimParcel(UUID user, ILandObject parcel) { foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) { @@ -956,7 +956,7 @@ namespace OpenSim.Region.Environment.Scenes } return true; } - public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); + public delegate bool CanBuyLand(UUID user, ILandObject parcel, Scene scene); private List CanBuyLandCheckFunctions = new List(); public void addCheckCanBuyLand(CanBuyLand delegateFunc) @@ -971,7 +971,7 @@ namespace OpenSim.Region.Environment.Scenes CanBuyLandCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanBuyLand(UUID user, ILandObject parcel) { foreach (CanBuyLand check in CanBuyLandCheckFunctions) { @@ -983,7 +983,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); + public delegate bool CanLinkObject(UUID user, UUID objectID); private List CanLinkObjectCheckFunctions = new List(); public void addCheckCanLinkObject(CanLinkObject delegateFunc) @@ -998,7 +998,7 @@ namespace OpenSim.Region.Environment.Scenes CanLinkObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) + public bool ExternalChecksCanLinkObject(UUID user, UUID objectID) { foreach (CanLinkObject check in CanLinkObjectCheckFunctions) { @@ -1010,7 +1010,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); + public delegate bool CanDelinkObject(UUID user, UUID objectID); private List CanDelinkObjectCheckFunctions = new List(); public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) @@ -1025,7 +1025,7 @@ namespace OpenSim.Region.Environment.Scenes CanDelinkObjectCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) + public bool ExternalChecksCanDelinkObject(UUID user, UUID objectID) { foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) { @@ -1039,7 +1039,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion - public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); + public delegate bool CanCreateInventory(uint invType, UUID objectID, UUID userID); private List CanCreateInventoryCheckFunctions = new List(); public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) @@ -1054,7 +1054,7 @@ namespace OpenSim.Region.Environment.Scenes CanCreateInventoryCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanCreateInventory(uint invType, UUID objectID, UUID userID) { foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) { @@ -1066,7 +1066,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); + public delegate bool CanCopyInventory(UUID itemID, UUID objectID, UUID userID); private List CanCopyInventoryCheckFunctions = new List(); public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) @@ -1081,7 +1081,7 @@ namespace OpenSim.Region.Environment.Scenes CanCopyInventoryCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanCopyInventory(UUID itemID, UUID objectID, UUID userID) { foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) { @@ -1093,7 +1093,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); + public delegate bool CanDeleteInventory(UUID itemID, UUID objectID, UUID userID); private List CanDeleteInventoryCheckFunctions = new List(); public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) @@ -1108,7 +1108,7 @@ namespace OpenSim.Region.Environment.Scenes CanDeleteInventoryCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanDeleteInventory(UUID itemID, UUID objectID, UUID userID) { foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) { @@ -1120,7 +1120,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanTeleport(LLUUID userID); + public delegate bool CanTeleport(UUID userID); private List CanTeleportCheckFunctions = new List(); public void addCheckCanTeleport(CanTeleport delegateFunc) @@ -1135,7 +1135,7 @@ namespace OpenSim.Region.Environment.Scenes CanTeleportCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanTeleport(LLUUID userID) + public bool ExternalChecksCanTeleport(UUID userID) { foreach (CanTeleport check in CanTeleportCheckFunctions) { diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 5546618..472f446 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs @@ -29,7 +29,7 @@ using System; using System.Collections.Generic; using System.Net; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -190,7 +190,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void LoadCurrentSceneFromXml(string filename, bool generateNewIDs, LLVector3 loadOffset) + public void LoadCurrentSceneFromXml(string filename, bool generateNewIDs, Vector3 loadOffset) { CurrentOrFirstScene.LoadPrimsFromXml(filename, generateNewIDs, loadOffset); } @@ -320,7 +320,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public bool TrySetCurrentScene(LLUUID regionID) + public bool TrySetCurrentScene(UUID regionID) { Console.WriteLine("Searching for Region: '{0}'", regionID.ToString()); @@ -350,7 +350,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public bool TryGetScene(LLUUID regionID, out Scene scene) + public bool TryGetScene(UUID regionID, out Scene scene) { foreach (Scene mscene in m_localScenes) { @@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Scenes ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); } - public bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar) + public bool TryGetAvatar(UUID avatarId, out ScenePresence avatar) { foreach (Scene scene in m_localScenes) { @@ -495,7 +495,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public bool TryGetAvatarsScene(LLUUID avatarId, out Scene scene) + public bool TryGetAvatarsScene(UUID avatarId, out Scene scene) { ScenePresence avatar = null; foreach (Scene mScene in m_localScenes) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index 032d673..c6452f9 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs @@ -27,7 +27,7 @@ using System; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -133,9 +133,9 @@ namespace OpenSim.Region.Environment.Scenes /// The item UUID that should be used by the new item. /// public bool AddInventoryItem(IClientAPI remoteClient, uint localID, - InventoryItemBase item, LLUUID copyItemID) + InventoryItemBase item, UUID copyItemID) { - LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.ID; + UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID; SceneObjectPart part = GetChildPart(localID); if (part != null) @@ -183,7 +183,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// null if the item does not exist - public TaskInventoryItem GetInventoryItem(uint primID, LLUUID itemID) + public TaskInventoryItem GetInventoryItem(uint primID, UUID itemID) { SceneObjectPart part = GetChildPart(primID); if (part != null) @@ -227,7 +227,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public int RemoveInventoryItem(uint localID, LLUUID itemID) + public int RemoveInventoryItem(uint localID, UUID itemID) { SceneObjectPart part = GetChildPart(localID); if (part != null) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index b04e882..d465eaa 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -31,9 +31,8 @@ using System.Drawing; using System.IO; using System.Xml; using System.Xml.Serialization; -using Axiom.Math; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Physics.Manager; @@ -75,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes struct scriptPosTarget { - public LLVector3 targetPos; + public Vector3 targetPos; public float tolerance; } @@ -97,17 +96,17 @@ namespace OpenSim.Region.Environment.Scenes public float scriptScore = 0f; - private LLVector3 lastPhysGroupPos; - private LLQuaternion lastPhysGroupRot; + private Vector3 lastPhysGroupPos; + private Quaternion lastPhysGroupRot; /// /// The constituent parts of this group /// - protected Dictionary m_parts = new Dictionary(); + protected Dictionary m_parts = new Dictionary(); protected ulong m_regionHandle; protected SceneObjectPart m_rootPart; - // private Dictionary m_scriptEvents = new Dictionary(); + // private Dictionary m_scriptEvents = new Dictionary(); private Dictionary m_targets = new Dictionary(); @@ -142,18 +141,18 @@ namespace OpenSim.Region.Environment.Scenes get { return m_parts.Count; } } - public LLQuaternion GroupRotation + public Quaternion GroupRotation { get { return m_rootPart.RotationOffset; } } - public LLUUID GroupID + public UUID GroupID { get { return m_rootPart.GroupID; } set { m_rootPart.GroupID = value; } } - public Dictionary Children + public Dictionary Children { get { return m_parts; } set { m_parts = value; } @@ -181,7 +180,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public override LLVector3 AbsolutePosition + public override Vector3 AbsolutePosition { get { @@ -195,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes } set { - LLVector3 val = value; + Vector3 val = value; if ((val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) && !m_rootPart.IsAttachment) { m_scene.CrossPrimGroupIntoNewRegion(val, this); @@ -234,18 +233,18 @@ namespace OpenSim.Region.Environment.Scenes set { m_rootPart.LocalId = value; } } - public override LLUUID UUID + public override UUID UUID { get { return m_rootPart.UUID; } set { m_rootPart.UUID = value; } } - public LLUUID OwnerID + public UUID OwnerID { get { if (m_rootPart == null) - return LLUUID.Zero; + return UUID.Zero; return m_rootPart.OwnerID; } @@ -299,7 +298,7 @@ namespace OpenSim.Region.Environment.Scenes } // The UUID for the Region this Object is in. - public LLUUID RegionUUID + public UUID RegionUUID { get { @@ -307,7 +306,7 @@ namespace OpenSim.Region.Environment.Scenes { return m_scene.RegionInfo.RegionID; } - return LLUUID.Zero; + return UUID.Zero; } } @@ -455,14 +454,14 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, - LLQuaternion rot, PrimitiveBaseShape shape) + public SceneObjectGroup(Scene scene, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos, + Quaternion rot, PrimitiveBaseShape shape) { m_regionHandle = regionHandle; m_scene = scene; // this.Pos = pos; - LLVector3 rootOffset = new LLVector3(0, 0, 0); + Vector3 rootOffset = new Vector3(0, 0, 0); SceneObjectPart newPart = new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rot, rootOffset); newPart.LinkNum = 0; @@ -479,13 +478,13 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, + public SceneObjectGroup(Scene scene, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos, PrimitiveBaseShape shape) - : this(scene, regionHandle, ownerID, localID, pos, LLQuaternion.Identity, shape) + : this(scene, regionHandle, ownerID, localID, pos, Quaternion.Identity, shape) { } - public void SetFromAssetID(LLUUID AssetId) + public void SetFromAssetID(UUID AssetId) { lock (m_parts) { @@ -496,13 +495,13 @@ namespace OpenSim.Region.Environment.Scenes } } - public LLUUID GetFromAssetID() + public UUID GetFromAssetID() { if (m_rootPart != null) { return m_rootPart.FromAssetID; } - return LLUUID.Zero; + return UUID.Zero; } /// @@ -519,18 +518,18 @@ namespace OpenSim.Region.Environment.Scenes } } - public LLVector3 GroupScale() + public Vector3 GroupScale() { - LLVector3 minScale = new LLVector3(Constants.RegionSize,Constants.RegionSize,Constants.RegionSize); - LLVector3 maxScale = new LLVector3(0f,0f,0f); - LLVector3 finalScale = new LLVector3(0.5f, 0.5f, 0.5f); + Vector3 minScale = new Vector3(Constants.RegionSize,Constants.RegionSize,Constants.RegionSize); + Vector3 maxScale = new Vector3(0f,0f,0f); + Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f); lock (m_parts) { foreach (SceneObjectPart part in m_parts.Values) { - LLVector3 partscale = part.Scale; - LLVector3 partoffset = part.OffsetPosition; + Vector3 partscale = part.Scale; + Vector3 partoffset = part.OffsetPosition; minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X; minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.X + partoffset.Y : minScale.Y; @@ -563,8 +562,7 @@ namespace OpenSim.Region.Environment.Scenes // Temporary commented to stop compiler warning //Vector3 partPosition = // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); - Quaternion parentrotation = - new Quaternion(GroupRotation.W, GroupRotation.X, GroupRotation.Y, GroupRotation.Z); + Quaternion parentrotation = GroupRotation; // Telling the prim to raytrace. //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); @@ -684,7 +682,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void AttachToAgent(LLUUID agentID, uint attachmentpoint, LLVector3 AttachOffset) + public void AttachToAgent(UUID agentID, uint attachmentpoint, Vector3 AttachOffset) { ScenePresence avatar = m_scene.GetScenePresence(agentID); if (avatar != null) @@ -737,14 +735,14 @@ namespace OpenSim.Region.Environment.Scenes public void DetachToGround() { ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); - LLVector3 detachedpos = new LLVector3(127f,127f,127f); + Vector3 detachedpos = new Vector3(127f,127f,127f); if (avatar != null) { detachedpos = avatar.AbsolutePosition; avatar.RemoveAttachment(this); } AbsolutePosition = detachedpos; - m_rootPart.AttachedAvatar = LLUUID.Zero; + m_rootPart.AttachedAvatar = UUID.Zero; m_rootPart.SetParentLocalId(0); m_rootPart.SetAttachmentPoint((byte)0); m_rootPart.IsAttachment = false; @@ -758,14 +756,14 @@ namespace OpenSim.Region.Environment.Scenes public void DetachToInventoryPrep() { ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); - //LLVector3 detachedpos = new LLVector3(127f, 127f, 127f); + //Vector3 detachedpos = new Vector3(127f, 127f, 127f); if (avatar != null) { //detachedpos = avatar.AbsolutePosition; avatar.RemoveAttachment(this); } - m_rootPart.AttachedAvatar = LLUUID.Zero; + m_rootPart.AttachedAvatar = UUID.Zero; m_rootPart.SetParentLocalId(0); //m_rootPart.SetAttachmentPoint((byte)0); m_rootPart.IsAttachment = false; @@ -861,7 +859,7 @@ namespace OpenSim.Region.Environment.Scenes { foreach (SceneObjectPart part in m_parts.Values) { - part.UUID = LLUUID.Random(); + part.UUID = UUID.Random(); } } @@ -885,7 +883,7 @@ namespace OpenSim.Region.Environment.Scenes //HasGroupChanged = false; } - public LLUUID GetPartsFullID(uint localID) + public UUID GetPartsFullID(uint localID) { SceneObjectPart part = GetChildPart(localID); if (part != null) @@ -895,7 +893,7 @@ namespace OpenSim.Region.Environment.Scenes return null; } - public void ObjectGrabHandler(uint localId, LLVector3 offsetPos, IClientAPI remoteClient) + public void ObjectGrabHandler(uint localId, Vector3 offsetPos, IClientAPI remoteClient) { if (m_rootPart.LocalId == localId) { @@ -909,14 +907,14 @@ namespace OpenSim.Region.Environment.Scenes } } - public virtual void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient) + public virtual void OnGrabPart(SceneObjectPart part, Vector3 offsetPos, IClientAPI remoteClient) { part.StoreUndoState(); part.OnGrab(offsetPos, remoteClient); } - public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) + public virtual void OnGrabGroup(Vector3 offsetPos, IClientAPI remoteClient) { m_scene.EventManager.TriggerGroupGrab(UUID, offsetPos, remoteClient.AgentId); } @@ -949,7 +947,7 @@ namespace OpenSim.Region.Environment.Scenes } if (m_rootPart != null && part == m_rootPart) - avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); + avatars[i].ControllingClient.SendKiPrimitive(m_regionHandle, part.LocalId); } } @@ -975,7 +973,7 @@ namespace OpenSim.Region.Environment.Scenes } if (m_rootPart != null && part == m_rootPart) - avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); + avatars[i].ControllingClient.SendKiPrimitive(m_regionHandle, part.LocalId); } } } @@ -1047,9 +1045,9 @@ namespace OpenSim.Region.Environment.Scenes public override void SetText(string text, Vector3 color, double alpha) { Color = Color.FromArgb(0xff - (int) (alpha * 0xff), - (int) (color.x * 0xff), - (int) (color.y * 0xff), - (int) (color.z * 0xff)); + (int) (color.X * 0xff), + (int) (color.Y * 0xff), + (int) (color.Z * 0xff)); Text = text; HasGroupChanged = true; @@ -1085,7 +1083,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void SetOwnerId(LLUUID userId) + public void SetOwnerId(UUID userId) { ForEachPart(delegate(SceneObjectPart part) { part.OwnerID = userId; }); } @@ -1207,14 +1205,14 @@ namespace OpenSim.Region.Environment.Scenes /// Duplicates this object, including operations such as physics set up and attaching to the backup event. /// /// - public SceneObjectGroup Copy(LLUUID cAgentID, LLUUID cGroupID, bool userExposed) + public SceneObjectGroup Copy(UUID cAgentID, UUID cGroupID, bool userExposed) { SceneObjectGroup dupe = (SceneObjectGroup) MemberwiseClone(); - dupe.m_parts = new Dictionary(); + dupe.m_parts = new Dictionary(); dupe.m_parts.Clear(); //dupe.OwnerID = AgentID; //dupe.GroupID = GroupID; - dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); + dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); dupe.m_scene = m_scene; dupe.m_regionHandle = m_regionHandle; @@ -1231,11 +1229,9 @@ namespace OpenSim.Region.Environment.Scenes dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape( dupe.RootPart.Name, pbs, - new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, - dupe.RootPart.AbsolutePosition.Z), + new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, dupe.RootPart.AbsolutePosition.Z), new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), - new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X, - dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z), + dupe.RootPart.RotationOffset, dupe.RootPart.PhysActor.IsPhysical); dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId; @@ -1286,7 +1282,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void CopyRootPart(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID, bool userExposed) + public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed) { SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID, m_parts.Count, userExposed); newPart.SetParent(this); @@ -1308,9 +1304,9 @@ namespace OpenSim.Region.Environment.Scenes foreach (SceneObjectPart part in m_parts.Values) { if (UsePhysics) - part.AddFlag(LLObject.ObjectFlags.Physics); + part.AddFlag(PrimFlags.Physics); else - part.RemFlag(LLObject.ObjectFlags.Physics); + part.RemFlag(PrimFlags.Physics); part.DoPhysicsPropertyUpdate(UsePhysics, false); IsSelected = false; @@ -1327,7 +1323,7 @@ namespace OpenSim.Region.Environment.Scenes { if (PhantomStatus) { - part.AddFlag(LLObject.ObjectFlags.Phantom); + part.AddFlag(PrimFlags.Phantom); if (part.PhysActor != null) { m_scene.PhysicsScene.RemovePrim(part.PhysActor); @@ -1335,8 +1331,8 @@ namespace OpenSim.Region.Environment.Scenes } else { - part.RemFlag(LLObject.ObjectFlags.Phantom); - if ((part.GetEffectiveObjectFlags() & (int) LLObject.ObjectFlags.Physics) != 0) + part.RemFlag(PrimFlags.Phantom); + if ((part.GetEffectiveObjectFlags() & (int) PrimFlags.Physics) != 0) { part.DoPhysicsPropertyUpdate(true, false); } @@ -1372,7 +1368,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void moveToTarget(LLVector3 target, float tau) + public void moveToTarget(Vector3 target, float tau) { SceneObjectPart rootpart = m_rootPart; if (rootpart != null) @@ -1395,7 +1391,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void SetRootPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID) + public void SetRootPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID) { part.LastOwnerID = part.OwnerID; part.OwnerID = cAgentID; @@ -1417,7 +1413,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void CopyPart(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID, bool userExposed) + public void CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed) { SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID, m_parts.Count, userExposed); newPart.SetParent(this); @@ -1432,7 +1428,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// Reset the LLUUIDs for all the prims that make up this group. + /// Reset the UUIDs for all the prims that make up this group. /// /// This is called by methods which want to add a new group to an existing scene, in order /// to ensure that there are no clashes with groups already present. @@ -1454,7 +1450,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags) + public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, UUID AgentID, uint RequestFlags) { remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.ObjectOwner, RootPart.GroupID, RootPart.BaseMask, @@ -1463,7 +1459,7 @@ namespace OpenSim.Region.Environment.Scenes RootPart.CreatorID, RootPart.Name, RootPart.Description); } - public void SetPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID) + public void SetPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID) { part.OwnerID = cAgentID; part.GroupID = cGroupID; @@ -1640,7 +1636,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// null if a child part with the primID was not found - public SceneObjectPart GetChildPart(LLUUID primID) + public SceneObjectPart GetChildPart(UUID primID) { SceneObjectPart childPart = null; if (m_parts.ContainsKey(primID)) @@ -1677,7 +1673,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public bool HasChildPrim(LLUUID primID) + public bool HasChildPrim(UUID primID) { if (m_parts.ContainsKey(primID)) { @@ -1735,27 +1731,20 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectPart linkPart = objectGroup.m_rootPart; - Vector3 oldGroupPosition = - new Vector3(linkPart.GroupPosition.X, linkPart.GroupPosition.Y, linkPart.GroupPosition.Z); - Quaternion oldRootRotation = - new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y, - linkPart.RotationOffset.Z); + Vector3 oldGroupPosition = linkPart.GroupPosition; + Quaternion oldRootRotation = linkPart.RotationOffset; linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; linkPart.GroupPosition = AbsolutePosition; - Vector3 axPos = new Vector3(linkPart.OffsetPosition.X, linkPart.OffsetPosition.Y, linkPart.OffsetPosition.Z); + Vector3 axPos = linkPart.OffsetPosition; - Quaternion parentRot = - new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, - m_rootPart.RotationOffset.Z); - axPos = parentRot.Inverse() * axPos; + Quaternion parentRot = m_rootPart.RotationOffset; + axPos *= Quaternion.Inverse(parentRot); - linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); - Quaternion oldRot = - new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y, - linkPart.RotationOffset.Z); - Quaternion newRot = parentRot.Inverse() * oldRot; - linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w); + linkPart.OffsetPosition = axPos; + Quaternion oldRot = linkPart.RotationOffset; + Quaternion newRot = oldRot * Quaternion.Inverse(parentRot); + linkPart.RotationOffset = newRot; linkPart.ParentID = m_rootPart.LocalId; if (m_rootPart.LinkNum == 0) @@ -1769,7 +1758,7 @@ namespace OpenSim.Region.Environment.Scenes linkPart.LinkNum = m_parts.Count; linkPart.SetParent(this); - linkPart.AddFlag(LLObject.ObjectFlags.CreateSelected); + linkPart.AddFlag(PrimFlags.CreateSelected); //if (linkPart.PhysActor != null) //{ @@ -1821,7 +1810,7 @@ namespace OpenSim.Region.Environment.Scenes // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); - LLQuaternion worldRot = linkPart.GetWorldRotation(); + Quaternion worldRot = linkPart.GetWorldRotation(); // Remove the part from this object lock (m_parts) @@ -1850,23 +1839,14 @@ namespace OpenSim.Region.Environment.Scenes // We need to reset the child part's position // ready for life as a separate object after being a part of another object - Quaternion parentRot - = new Quaternion( - m_rootPart.RotationOffset.W, - m_rootPart.RotationOffset.X, - m_rootPart.RotationOffset.Y, - m_rootPart.RotationOffset.Z); - - Vector3 axPos - = new Vector3( - linkPart.OffsetPosition.X, - linkPart.OffsetPosition.Y, - linkPart.OffsetPosition.Z); - - axPos = parentRot * axPos; - linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); + Quaternion parentRot = m_rootPart.RotationOffset; + + Vector3 axPos = linkPart.OffsetPosition; + + axPos *= parentRot; + linkPart.OffsetPosition = new Vector3(axPos.X, axPos.Y, axPos.Z); linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition; - linkPart.OffsetPosition = new LLVector3(0, 0, 0); + linkPart.OffsetPosition = new Vector3(0, 0, 0); linkPart.RotationOffset = worldRot; @@ -1909,28 +1889,23 @@ namespace OpenSim.Region.Environment.Scenes part.LinkNum = m_parts.Count; - Vector3 axiomOldPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z); - axiomOldPos = oldGroupRotation * axiomOldPos; - axiomOldPos += oldGroupPosition; - LLVector3 oldAbsolutePosition = new LLVector3(axiomOldPos.x, axiomOldPos.y, axiomOldPos.z); + Vector3 oldPos = part.OffsetPosition; + oldPos *= oldGroupRotation; + oldPos += oldGroupPosition; + Vector3 oldAbsolutePosition = oldPos; part.OffsetPosition = oldAbsolutePosition - AbsolutePosition; - Quaternion axiomRootRotation = - new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, - m_rootPart.RotationOffset.Z); + Quaternion rootRotation = m_rootPart.RotationOffset; - Vector3 axiomPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z); - axiomPos = axiomRootRotation.Inverse() * axiomPos; - part.OffsetPosition = new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z); + Vector3 pos = part.OffsetPosition; + pos *= Quaternion.Inverse(rootRotation); + part.OffsetPosition = pos; - Quaternion axiomPartRotation = - new Quaternion(part.RotationOffset.W, part.RotationOffset.X, part.RotationOffset.Y, - part.RotationOffset.Z); + Quaternion partRotation = part.RotationOffset; - axiomPartRotation = oldGroupRotation * axiomPartRotation; - axiomPartRotation = axiomRootRotation.Inverse() * axiomPartRotation; - part.RotationOffset = - new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w); + partRotation *= oldGroupRotation; + partRotation *= Quaternion.Inverse(rootRotation); + part.RotationOffset = partRotation; } /// @@ -1940,7 +1915,7 @@ namespace OpenSim.Region.Environment.Scenes /// Always seems to be 0,0,0, so ignoring /// New position. We do the math here to turn it into a force /// - public void GrabMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) + public void GrabMovement(Vector3 offset, Vector3 pos, IClientAPI remoteClient) { if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) { @@ -1948,7 +1923,7 @@ namespace OpenSim.Region.Environment.Scenes { if (m_rootPart.PhysActor.IsPhysical) { - LLVector3 llmoveforce = pos - AbsolutePosition; + Vector3 llmoveforce = pos - AbsolutePosition; PhysicsVector grabforce = new PhysicsVector(llmoveforce.X, llmoveforce.Y, llmoveforce.Z); grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass; m_rootPart.PhysActor.AddForce(grabforce,true); @@ -1966,7 +1941,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void NonPhysicalGrabMovement(LLVector3 pos) + public void NonPhysicalGrabMovement(Vector3 pos) { AbsolutePosition = pos; m_rootPart.SendTerseUpdateToAllClients(); @@ -2013,7 +1988,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void SetPartText(string text, LLUUID partID) + public void SetPartText(string text, UUID partID) { SceneObjectPart part = GetChildPart(partID); if (part != null) @@ -2109,7 +2084,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void UpdatePermissions(LLUUID AgentID, byte field, uint localID, uint mask, byte addRemTF) + public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF) { SceneObjectPart updatePart = GetChildPart(localID); updatePart.UpdatePermissions(AgentID, field, localID, mask, addRemTF); @@ -2145,7 +2120,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void Resize(LLVector3 scale, uint localID) + public void Resize(Vector3 scale, uint localID) { if (scale.X > m_scene.m_maxNonphys) scale.X = m_scene.m_maxNonphys; @@ -2190,7 +2165,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void GroupResize(LLVector3 scale, uint localID) + public void GroupResize(Vector3 scale, uint localID) { SceneObjectPart part = GetChildPart(localID); if (part != null) @@ -2222,7 +2197,7 @@ namespace OpenSim.Region.Environment.Scenes { if (obPart.UUID != m_rootPart.UUID) { - LLVector3 oldSize = new LLVector3(obPart.Scale); + Vector3 oldSize = new Vector3(obPart.Scale); float f = 1.0f; float a = 1.0f; @@ -2286,7 +2261,7 @@ namespace OpenSim.Region.Environment.Scenes } } - LLVector3 prevScale = part.Scale; + Vector3 prevScale = part.Scale; prevScale.X *= x; prevScale.Y *= y; prevScale.Z *= z; @@ -2298,11 +2273,11 @@ namespace OpenSim.Region.Environment.Scenes { if (obPart.UUID != m_rootPart.UUID) { - LLVector3 currentpos = new LLVector3(obPart.OffsetPosition); + Vector3 currentpos = new Vector3(obPart.OffsetPosition); currentpos.X *= x; currentpos.Y *= y; currentpos.Z *= z; - LLVector3 newSize = new LLVector3(obPart.Scale); + Vector3 newSize = new Vector3(obPart.Scale); newSize.X *= x; newSize.Y *= y; newSize.Z *= z; @@ -2332,7 +2307,7 @@ namespace OpenSim.Region.Environment.Scenes /// Move this scene object /// /// - public void UpdateGroupPosition(LLVector3 pos) + public void UpdateGroupPosition(Vector3 pos) { if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) { @@ -2356,7 +2331,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void UpdateSinglePosition(LLVector3 pos, uint localID) + public void UpdateSinglePosition(Vector3 pos, uint localID) { SceneObjectPart part = GetChildPart(localID); @@ -2379,22 +2354,18 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - private void UpdateRootPosition(LLVector3 pos) + private void UpdateRootPosition(Vector3 pos) { - LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); - LLVector3 oldPos = - new LLVector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X, + Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); + Vector3 oldPos = + new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X, AbsolutePosition.Y + m_rootPart.OffsetPosition.Y, AbsolutePosition.Z + m_rootPart.OffsetPosition.Z); - LLVector3 diff = oldPos - newPos; + Vector3 diff = oldPos - newPos; Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); - Quaternion partRotation = - new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, - m_rootPart.RotationOffset.Z); - axDiff = partRotation.Inverse() * axDiff; - diff.X = axDiff.x; - diff.Y = axDiff.y; - diff.Z = axDiff.z; + Quaternion partRotation = m_rootPart.RotationOffset; + axDiff *= Quaternion.Inverse(partRotation); + diff = axDiff; lock (m_parts) { @@ -2413,7 +2384,7 @@ namespace OpenSim.Region.Environment.Scenes ScheduleGroupForTerseUpdate(); } - public void OffsetForNewRegion(LLVector3 offset) + public void OffsetForNewRegion(Vector3 offset) { m_rootPart.GroupPosition = offset; } @@ -2426,14 +2397,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void UpdateGroupRotation(LLQuaternion rot) + public void UpdateGroupRotation(Quaternion rot) { m_rootPart.UpdateRotation(rot); if (m_rootPart.PhysActor != null) { - m_rootPart.PhysActor.Orientation = - new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, - m_rootPart.RotationOffset.Z); + m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset; m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } @@ -2446,14 +2415,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) + public void UpdateGroupRotation(Vector3 pos, Quaternion rot) { m_rootPart.UpdateRotation(rot); if (m_rootPart.PhysActor != null) { - m_rootPart.PhysActor.Orientation = - new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, - m_rootPart.RotationOffset.Z); + m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset; m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } AbsolutePosition = pos; @@ -2467,7 +2434,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void UpdateSingleRotation(LLQuaternion rot, uint localID) + public void UpdateSingleRotation(Quaternion rot, uint localID) { SceneObjectPart part = GetChildPart(localID); if (part != null) @@ -2487,19 +2454,15 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - private void UpdateRootRotation(LLQuaternion rot) + private void UpdateRootRotation(Quaternion rot) { - Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); - Quaternion oldParentRot = - new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, - m_rootPart.RotationOffset.Z); + Quaternion axRot = rot; + Quaternion oldParentRot = m_rootPart.RotationOffset; m_rootPart.UpdateRotation(rot); if (m_rootPart.PhysActor != null) { - m_rootPart.PhysActor.Orientation = - new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, - m_rootPart.RotationOffset.Z); + m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset; m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } @@ -2509,16 +2472,14 @@ namespace OpenSim.Region.Environment.Scenes { if (prim.UUID != m_rootPart.UUID) { - Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z); - axPos = oldParentRot * axPos; - axPos = axRot.Inverse() * axPos; - prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); - Quaternion primsRot = - new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y, - prim.RotationOffset.Z); + Vector3 axPos = prim.OffsetPosition; + axPos *= oldParentRot; + axPos *= Quaternion.Inverse(axRot); + prim.OffsetPosition = axPos; + Quaternion primsRot = prim.RotationOffset; Quaternion newRot = oldParentRot * primsRot; - newRot = axRot.Inverse() * newRot; - prim.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w); + newRot *= Quaternion.Inverse(axRot); + prim.RotationOffset = newRot; prim.ScheduleTerseUpdate(); } } @@ -2562,7 +2523,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public int registerTargetWaypoint(LLVector3 target, float tolerance) + public int registerTargetWaypoint(Vector3 target, float tolerance) { scriptPosTarget waypoint = new scriptPosTarget(); waypoint.targetPos = target; @@ -2590,7 +2551,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_targets.Count > 0) { bool at_target = false; - //LLVector3 targetPos; + //Vector3 targetPos; //uint targetHandle; Dictionary atTargets = new Dictionary(); lock (m_targets) @@ -2681,11 +2642,11 @@ namespace OpenSim.Region.Environment.Scenes { if (RootPart != null) { - if ((RootPart.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == 0) + if ((RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) == 0) { foreach (SceneObjectPart part in m_parts.Values) { - if (part.Shape.SculptEntry && part.Shape.SculptTexture != LLUUID.Zero) + if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero) { m_scene.AssetCache.GetAsset(part.Shape.SculptTexture, part.SculptTextureCallback, true); } @@ -2700,7 +2661,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SetGroup(LLUUID GroupID, IClientAPI client) + public void SetGroup(UUID GroupID, IClientAPI client) { lock (m_parts) { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 3bfe7e9..2beb9bb 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.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.Framework.Communications.Cache; @@ -69,7 +69,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating + /// Reset UUIDs for all the items in the prim's inventory. This involves either generating /// new ones or setting existing UUIDs to the correct parent UUIDs. /// /// If this method is called and there are inventory items, then we regard the inventory as having changed. @@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Scenes /// Change every item in this prim's inventory to a new owner. /// /// - public void ChangeInventoryOwner(LLUUID ownerId) + public void ChangeInventoryOwner(UUID ownerId) { lock (TaskInventory) { @@ -172,13 +172,13 @@ namespace OpenSim.Region.Environment.Scenes if (!m_parentGroup.Scene.ExternalChecks.ExternalChecksCanRunScript(item.ItemID, UUID, item.OwnerID)) return; - AddFlag(LLObject.ObjectFlags.Scripted); + AddFlag(PrimFlags.Scripted); if (!m_parentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) { AssetCache cache = m_parentGroup.Scene.AssetCache; - cache.GetAsset(item.AssetID, delegate(LLUUID assetID, AssetBase asset) + cache.GetAsset(item.AssetID, delegate(UUID assetID, AssetBase asset) { if (null == asset) { @@ -190,8 +190,8 @@ namespace OpenSim.Region.Environment.Scenes else { m_taskInventory[item.ItemID].PermsMask = 0; - m_taskInventory[item.ItemID].PermsGranter = LLUUID.Zero; - string script = Helpers.FieldToUTF8String(asset.Data); + m_taskInventory[item.ItemID].PermsGranter = UUID.Zero; + string script = Utils.BytesToString(asset.Data); m_parentGroup.Scene.EventManager.TriggerRezScript(LocalId, item.ItemID, script, startParam, postOnRez); m_parentGroup.AddActiveScriptCount(1); @@ -205,9 +205,9 @@ namespace OpenSim.Region.Environment.Scenes /// Start a script which is in this prim's inventory. /// /// - /// A + /// A /// - public void CreateScriptInstance(LLUUID itemId, int startParam, bool postOnRez) + public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez) { lock (m_taskInventory) { @@ -229,7 +229,7 @@ namespace OpenSim.Region.Environment.Scenes /// Stop a script which is in this prim's inventory. /// /// - public void RemoveScriptInstance(LLUUID itemId) + public void RemoveScriptInstance(UUID itemId) { if (m_taskInventory.ContainsKey(itemId)) { @@ -370,7 +370,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// null if the item does not exist - public TaskInventoryItem GetInventoryItem(LLUUID itemId) + public TaskInventoryItem GetInventoryItem(UUID itemId) { TaskInventoryItem item; m_taskInventory.TryGetValue(itemId, out item); @@ -426,7 +426,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// Numeric asset type of the item removed. Returns -1 if the item did not exist /// in this prim's inventory. - public int RemoveInventoryItem(LLUUID itemID) + public int RemoveInventoryItem(UUID itemID) { lock (m_taskInventory) { @@ -455,7 +455,7 @@ namespace OpenSim.Region.Environment.Scenes if (scriptcount <= 0) { - RemFlag(LLObject.ObjectFlags.Scripted); + RemFlag(PrimFlags.Scripted); } ScheduleFullUpdate(); @@ -477,10 +477,10 @@ namespace OpenSim.Region.Environment.Scenes public string GetInventoryFileName() { if (m_inventoryFileName == String.Empty) - m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; + m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp"; if (m_inventoryFileNameSerial < m_inventorySerial) { - m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; + m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp"; } return m_inventoryFileName; } @@ -499,7 +499,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_inventorySerial > 0) { client.SendTaskInventory(m_uuid, (short)m_inventorySerial, - Helpers.StringToField(GetInventoryFileName())); + Utils.StringToBytes(GetInventoryFileName())); return true; } else @@ -520,13 +520,13 @@ namespace OpenSim.Region.Environment.Scenes // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality // isn't available (such as drag from prim inventory to agent inventory) - InventoryStringBuilder invString = new InventoryStringBuilder(UUID, LLUUID.Zero); + InventoryStringBuilder invString = new InventoryStringBuilder(UUID, UUID.Zero); lock (m_taskInventory) { foreach (TaskInventoryItem item in m_taskInventory.Values) { - LLUUID ownerID = item.OwnerID; + UUID ownerID = item.OwnerID; uint everyoneMask = 0; uint baseMask = item.BasePermissions; uint ownerMask = item.CurrentPermissions; @@ -587,10 +587,10 @@ namespace OpenSim.Region.Environment.Scenes } } - fileData = Helpers.StringToField(invString.BuildString); + fileData = Utils.StringToBytes(invString.BuildString); - //Console.WriteLine(Helpers.FieldToUTF8String(fileData)); - //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Helpers.FieldToUTF8String(fileData)); + //Console.WriteLine(Utils.BytesToString(fileData)); + //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Utils.BytesToString(fileData)); if (fileData.Length > 2) { @@ -619,7 +619,7 @@ namespace OpenSim.Region.Environment.Scenes { public string BuildString = String.Empty; - public InventoryStringBuilder(LLUUID folderID, LLUUID parentID) + public InventoryStringBuilder(UUID folderID, UUID parentID) { BuildString += "\tinv_object\t0\n\t{\n"; AddNameValueLine("obj_id", folderID.ToString()); @@ -746,9 +746,9 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public List GetInventoryList() + public List GetInventoryList() { - List ret = new List(); + List ret = new List(); foreach (TaskInventoryItem item in m_taskInventory.Values) ret.Add(item.ItemID); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 5861298..ea10fe6 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -33,10 +33,8 @@ using System.Security.Permissions; using System.Xml; using System.Xml.Serialization; -using Axiom.Math; - -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes.Scripting; @@ -114,7 +112,7 @@ namespace OpenSim.Region.Environment.Scenes // Not a big problem as long as the script that sets it remains in the prim on startup. // for SL compatibility it should be persisted though (set sound / displaytext / particlesystem, kill script) [XmlIgnore] - public LLUUID Sound; + public UUID Sound; [XmlIgnore] public byte SoundFlags; [XmlIgnore] @@ -128,15 +126,15 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public uint TimeStampTerse = 0; [XmlIgnore] - public LLUUID FromAssetID = LLUUID.Zero; + public UUID FromAssetID = UUID.Zero; [XmlIgnore] public bool IsAttachment = false; [XmlIgnore] public scriptEvents AggregateScriptEvents = 0; [XmlIgnore] - public LLUUID AttachedAvatar = LLUUID.Zero; + public UUID AttachedAvatar = UUID.Zero; [XmlIgnore] - public LLVector3 AttachedPos = LLVector3.Zero; + public Vector3 AttachedPos = Vector3.Zero; [XmlIgnore] public uint AttachmentPoint = (byte)0; [XmlIgnore] @@ -146,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes public bool Undoing = false; [XmlIgnore] - private LLObject.ObjectFlags LocalFlags = LLObject.ObjectFlags.None; + private PrimFlags LocalFlags = 0; private byte[] m_TextureAnimation; private byte m_clickAction = 0; private Color m_color = Color.Black; @@ -157,14 +155,14 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] private int m_scriptAccessPin = 0; [XmlIgnore] - private readonly Dictionary m_scriptEvents = new Dictionary(); + private readonly Dictionary m_scriptEvents = new Dictionary(); private string m_sitName = String.Empty; - private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1); - private Vector3 m_sitTargetPosition = new Vector3(0, 0, 0); + private Quaternion m_sitTargetOrientation = Quaternion.Identity; + private Vector3 m_sitTargetPosition = Vector3.Zero; private string m_text = String.Empty; private string m_touchName = String.Empty; private readonly UndoStack m_undo = new UndoStack(5); - private LLUUID _creatorID; + private UUID _creatorID; /// /// Only used internally to schedule client updates. @@ -176,29 +174,29 @@ namespace OpenSim.Region.Environment.Scenes /// private byte m_updateFlag; - protected LLVector3 m_acceleration; - protected LLVector3 m_angularVelocity; + protected Vector3 m_acceleration; + protected Vector3 m_angularVelocity; //unkown if this will be kept, added as a way of removing the group position from the group class - protected LLVector3 m_groupPosition; + protected Vector3 m_groupPosition; protected uint m_localId; - protected LLObject.MaterialType m_material = 0; + protected Material m_material = 0; protected string m_name; - protected LLVector3 m_offsetPosition; + protected Vector3 m_offsetPosition; // FIXME, TODO, ERROR: 'ParentGroup' can't be in here, move it out. protected SceneObjectGroup m_parentGroup; protected byte[] m_particleSystem = new byte[0]; protected ulong m_regionHandle; - protected LLQuaternion m_rotationOffset; + protected Quaternion m_rotationOffset; protected PrimitiveBaseShape m_shape = null; - protected LLUUID m_uuid; - protected LLVector3 m_velocity; + protected UUID m_uuid; + protected Vector3 m_velocity; // TODO: Those have to be changed into persistent properties at some later point, // or sit-camera on vehicles will break on sim-crossing. - private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); - private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); + private Vector3 m_cameraEyeOffset = new Vector3(0.0f, 0.0f, 0.0f); + private Vector3 m_cameraAtOffset = new Vector3(0.0f, 0.0f, 0.0f); private bool m_forceMouselook = false; #endregion Fields @@ -214,9 +212,9 @@ namespace OpenSim.Region.Environment.Scenes m_TextureAnimation = new byte[0]; } - public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, - PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition) - : this(regionHandle, parent, ownerID, localID, shape, groupPosition, LLQuaternion.Identity, offsetPosition) + public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, UUID ownerID, uint localID, + PrimitiveBaseShape shape, Vector3 groupPosition, Vector3 offsetPosition) + : this(regionHandle, parent, ownerID, localID, shape, groupPosition, Quaternion.Identity, offsetPosition) { } @@ -229,9 +227,9 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, - PrimitiveBaseShape shape, LLVector3 groupPosition, LLQuaternion rotationOffset, - LLVector3 offsetPosition) + public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, UUID ownerID, uint localID, + PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset, + Vector3 offsetPosition) { m_name = "Primitive"; m_regionHandle = regionHandle; @@ -240,8 +238,8 @@ namespace OpenSim.Region.Environment.Scenes _creationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; _ownerID = ownerID; _creatorID = _ownerID; - _lastOwnerID = LLUUID.Zero; - UUID = LLUUID.Random(); + _lastOwnerID = UUID.Zero; + UUID = UUID.Random(); LocalId = (uint) (localID); Shape = shape; // Todo: Add More Object Parameter from above! @@ -254,9 +252,9 @@ namespace OpenSim.Region.Environment.Scenes GroupPosition = groupPosition; OffsetPosition = offsetPosition; RotationOffset = rotationOffset; - Velocity = new LLVector3(0, 0, 0); - AngularVelocity = new LLVector3(0, 0, 0); - Acceleration = new LLVector3(0, 0, 0); + Velocity = new Vector3(0, 0, 0); + AngularVelocity = new Vector3(0, 0, 0); + Acceleration = new Vector3(0, 0, 0); m_TextureAnimation = new byte[0]; // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, @@ -264,7 +262,7 @@ namespace OpenSim.Region.Environment.Scenes // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log _flags = 0; - _flags |= LLObject.ObjectFlags.CreateSelected; + _flags |= PrimFlags.CreateSelected; TrimPermissions(); //m_undo = new UndoStack(ParentGroup.GetSceneMaxUndo()); @@ -282,9 +280,9 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, int creationDate, LLUUID ownerID, - LLUUID creatorID, LLUUID lastOwnerID, uint localID, PrimitiveBaseShape shape, - LLVector3 position, LLQuaternion rotation, uint flags) + public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, int creationDate, UUID ownerID, + UUID creatorID, UUID lastOwnerID, uint localID, PrimitiveBaseShape shape, + Vector3 position, Quaternion rotation, uint flags) { m_regionHandle = regionHandle; m_parentGroup = parent; @@ -293,7 +291,7 @@ namespace OpenSim.Region.Environment.Scenes _ownerID = ownerID; _creatorID = creatorID; _lastOwnerID = lastOwnerID; - UUID = LLUUID.Random(); + UUID = UUID.Random(); LocalId = (uint) (localID); Shape = shape; _ownershipCost = 0; @@ -307,7 +305,7 @@ namespace OpenSim.Region.Environment.Scenes // Since we don't store script state, this is only a 'temporary' objectflag now // If the object is scripted, the script will get loaded and this will be set again - ObjectFlags &= ~(uint)(LLObject.ObjectFlags.Scripted | LLObject.ObjectFlags.Touch); + ObjectFlags &= ~(uint)(PrimFlags.Scripted | PrimFlags.Touch); TrimPermissions(); // ApplyPhysics(); @@ -326,7 +324,7 @@ namespace OpenSim.Region.Environment.Scenes /* m_queue = (Queue)info.GetValue("m_queue", typeof(Queue)); - m_ids = (List)info.GetValue("m_ids", typeof(List)); + m_ids = (List)info.GetValue("m_ids", typeof(List)); */ //System.Console.WriteLine("SceneObjectPart Deserialize END"); @@ -336,24 +334,24 @@ namespace OpenSim.Region.Environment.Scenes #region XML Schema - private LLUUID _lastOwnerID; - private LLUUID _ownerID; - private LLUUID _groupID; + private UUID _lastOwnerID; + private UUID _ownerID; + private UUID _groupID; private int _ownershipCost; private byte _objectSaleType; private int _salePrice; private uint _category; private Int32 _creationDate; private uint _parentID = 0; - private LLUUID m_sitTargetAvatar = LLUUID.Zero; + private UUID m_sitTargetAvatar = UUID.Zero; private uint _baseMask = (uint)PermissionMask.All; private uint _ownerMask = (uint)PermissionMask.All; private uint _groupMask = (uint)PermissionMask.None; private uint _everyoneMask = (uint)PermissionMask.None; private uint _nextOwnerMask = (uint)PermissionMask.All; - private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; + private PrimFlags _flags = 0; - public LLUUID CreatorID { + public UUID CreatorID { get { return _creatorID; @@ -368,7 +366,7 @@ namespace OpenSim.Region.Environment.Scenes /// Exposing this is not particularly good, but it's one of the least evils at the moment to see /// folder id from prim inventory item data, since it's not (yet) actually stored with the prim. /// - public LLUUID FolderID + public UUID FolderID { get { return UUID; } set { } // Don't allow assignment, or legacy prims wil b0rk @@ -389,10 +387,10 @@ namespace OpenSim.Region.Environment.Scenes public uint ObjectFlags { get { return (uint)_flags; } - set { _flags = (LLObject.ObjectFlags)value; } + set { _flags = (PrimFlags)value; } } - public LLUUID UUID + public UUID UUID { get { return m_uuid; } set { m_uuid = value; } @@ -413,7 +411,7 @@ namespace OpenSim.Region.Environment.Scenes public byte Material { get { return (byte) m_material; } - set { m_material = (LLObject.MaterialType) value; } + set { m_material = (Material)value; } } public ulong RegionHandle @@ -435,7 +433,7 @@ namespace OpenSim.Region.Environment.Scenes set { m_TextureAnimation = value; } } - public LLVector3 GroupPosition + public Vector3 GroupPosition { get { @@ -479,10 +477,10 @@ namespace OpenSim.Region.Environment.Scenes // To move the child prim in respect to the group position and rotation we have to calculate - LLVector3 resultingposition = GetWorldPosition(); + Vector3 resultingposition = GetWorldPosition(); PhysActor.Position = new PhysicsVector(resultingposition.X, resultingposition.Y, resultingposition.Z); - LLQuaternion resultingrot = GetWorldRotation(); - PhysActor.Orientation = new Quaternion(resultingrot.W, resultingrot.X, resultingrot.Y, resultingrot.Z); + Quaternion resultingrot = GetWorldRotation(); + PhysActor.Orientation = resultingrot; } // Tell the physics engines that this prim changed. @@ -497,7 +495,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public LLVector3 OffsetPosition + public Vector3 OffsetPosition { get { return m_offsetPosition; } set @@ -518,20 +516,17 @@ namespace OpenSim.Region.Environment.Scenes } } - public LLQuaternion RotationOffset + public Quaternion RotationOffset { get { // We don't want the physics engine mucking up the rotations in a linkset if (PhysActor != null && _parentID == 0) { - if (PhysActor.Orientation.x != 0 || PhysActor.Orientation.y != 0 - || PhysActor.Orientation.z != 0 || PhysActor.Orientation.w != 0) + if (PhysActor.Orientation.X != 0 || PhysActor.Orientation.Y != 0 + || PhysActor.Orientation.Z != 0 || PhysActor.Orientation.W != 0) { - m_rotationOffset.X = PhysActor.Orientation.x; - m_rotationOffset.Y = PhysActor.Orientation.y; - m_rotationOffset.Z = PhysActor.Orientation.z; - m_rotationOffset.W = PhysActor.Orientation.w; + m_rotationOffset = PhysActor.Orientation; } } return m_rotationOffset; @@ -548,14 +543,14 @@ namespace OpenSim.Region.Environment.Scenes // Root prim gets value directly if (_parentID == 0) { - PhysActor.Orientation = new Quaternion(value.W, value.X, value.Y, value.Z); + PhysActor.Orientation = value; //m_log.Info("[PART]: RO1:" + PhysActor.Orientation.ToString()); } else { // Child prim we have to calculate it's world rotationwel - LLQuaternion resultingrotation = GetWorldRotation(); - PhysActor.Orientation = new Quaternion(resultingrotation.W, resultingrotation.X, resultingrotation.Y, resultingrotation.Z); + Quaternion resultingrotation = GetWorldRotation(); + PhysActor.Orientation = resultingrotation; //m_log.Info("[PART]: RO2:" + PhysActor.Orientation.ToString()); } m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); @@ -571,12 +566,12 @@ namespace OpenSim.Region.Environment.Scenes } /// - public LLVector3 Velocity + public Vector3 Velocity { get { - //if (PhysActor.Velocity.x != 0 || PhysActor.Velocity.y != 0 - //|| PhysActor.Velocity.z != 0) + //if (PhysActor.Velocity.X != 0 || PhysActor.Velocity.Y != 0 + //|| PhysActor.Velocity.Z != 0) //{ if (PhysActor != null) { @@ -605,14 +600,14 @@ namespace OpenSim.Region.Environment.Scenes } } - public LLVector3 RotationalVelocity + public Vector3 RotationalVelocity { get { return AngularVelocity; } set { AngularVelocity = value; } } /// - public LLVector3 AngularVelocity + public Vector3 AngularVelocity { get { @@ -626,7 +621,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - public LLVector3 Acceleration + public Vector3 Acceleration { get { return m_acceleration; } set { m_acceleration = value; } @@ -718,7 +713,7 @@ namespace OpenSim.Region.Environment.Scenes TriggerScriptChangedEvent(Changed.SHAPE); } } - public LLVector3 Scale + public Vector3 Scale { get { return m_shape.Scale; } set @@ -754,7 +749,7 @@ namespace OpenSim.Region.Environment.Scenes #region Public Properties with only Get - public LLVector3 AbsolutePosition + public Vector3 AbsolutePosition { get { if (IsAttachment) @@ -763,12 +758,12 @@ namespace OpenSim.Region.Environment.Scenes return m_offsetPosition + m_groupPosition; } } - public LLUUID ObjectCreator + public UUID ObjectCreator { get { return _creatorID; } } - public LLUUID ObjectOwner + public UUID ObjectOwner { get { return _ownerID; } } @@ -801,29 +796,27 @@ namespace OpenSim.Region.Environment.Scenes // This sort of sucks, but I'm adding these in to make some of // the mappings more consistant. - public LLVector3 SitTargetPositionLL + public Vector3 SitTargetPositionLL { - get { return new LLVector3(m_sitTargetPosition.x, m_sitTargetPosition.y,m_sitTargetPosition.z); } - set { m_sitTargetPosition = new Vector3(value.X, value.Y, value.Z); } + get { return new Vector3(m_sitTargetPosition.X, m_sitTargetPosition.Y,m_sitTargetPosition.Z); } + set { m_sitTargetPosition = value; } } - public LLQuaternion SitTargetOrientationLL + public Quaternion SitTargetOrientationLL { get { - return new LLQuaternion( - m_sitTargetOrientation.x, - m_sitTargetOrientation.y, - m_sitTargetOrientation.z, - m_sitTargetOrientation.w + return new Quaternion( + m_sitTargetOrientation.X, + m_sitTargetOrientation.Y, + m_sitTargetOrientation.Z, + m_sitTargetOrientation.W ); } set { m_sitTargetOrientation = new Quaternion(value.W, value.X, value.Y, value.Z); } } - - public bool Stopped { get { @@ -873,19 +866,19 @@ namespace OpenSim.Region.Environment.Scenes set { _ownershipCost = value; } } - public LLUUID GroupID + public UUID GroupID { get { return _groupID; } set { _groupID = value; } } - public LLUUID OwnerID + public UUID OwnerID { get { return _ownerID; } set { _ownerID = value; } } - public LLUUID LastOwnerID + public UUID LastOwnerID { get { return _lastOwnerID; } set { _lastOwnerID = value; } @@ -921,34 +914,34 @@ namespace OpenSim.Region.Environment.Scenes set { _nextOwnerMask = value; } } - public libsecondlife.LLObject.ObjectFlags Flags + public PrimFlags Flags { get { return _flags; } set { _flags = value; } } - public LLUUID SitTargetAvatar + public UUID SitTargetAvatar { get { return m_sitTargetAvatar; } set { m_sitTargetAvatar = value; } } [XmlIgnore] - public virtual LLUUID RegionID + public virtual UUID RegionID { get { if (ParentGroup != null && ParentGroup.Scene != null) return ParentGroup.Scene.RegionInfo.RegionID; else - return LLUUID.Zero; + return UUID.Zero; } set {} // read only } - private LLUUID _parentUUID = LLUUID.Zero; + private UUID _parentUUID = UUID.Zero; [XmlIgnore] - public LLUUID ParentUUID + public UUID ParentUUID { get { @@ -985,7 +978,7 @@ namespace OpenSim.Region.Environment.Scenes m_updateFlag = 0; } - private void SendObjectPropertiesToClient(LLUUID AgentID) + private void SendObjectPropertiesToClient(UUID AgentID) { List avatars = m_parentGroup.Scene.GetScenePresences(); for (int i = 0; i < avatars.Count; i++) @@ -1027,13 +1020,13 @@ namespace OpenSim.Region.Environment.Scenes #region Public Methods - public void AddFlag(LLObject.ObjectFlags flag) + public void AddFlag(PrimFlags flag) { - // LLObject.ObjectFlags prevflag = Flags; + // PrimFlags prevflag = Flags; //uint objflags = Flags; if ((ObjectFlags & (uint) flag) == 0) { - //Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString()); + //Console.WriteLine("Adding flag: " + ((PrimFlags) flag).ToString()); _flags |= flag; } //uint currflag = (uint)Flags; @@ -1091,7 +1084,7 @@ namespace OpenSim.Region.Environment.Scenes // The flags don't like conversion from uint to byte, so we have to do // it the crappy way. See the above function :( - data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++; + data[pos] = ConvertScriptUintToByte((uint)pTexAnim.Flags); pos++; data[pos] = (byte)pTexAnim.Face; pos++; data[pos] = (byte)pTexAnim.SizeX; pos++; data[pos] = (byte)pTexAnim.SizeY; pos++; @@ -1124,19 +1117,17 @@ namespace OpenSim.Region.Environment.Scenes /// /// Vector force /// true for the local frame, false for the global frame - public void ApplyImpulse(LLVector3 impulsei, bool localGlobalTF) + public void ApplyImpulse(Vector3 impulsei, bool localGlobalTF) { PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z); if (localGlobalTF) { - - LLQuaternion grot = GetWorldRotation(); - Quaternion AXgrot = new Quaternion(grot.W,grot.X,grot.Y,grot.Z); - Vector3 AXimpulsei = new Vector3(impulsei.X, impulsei.Y, impulsei.Z); - Vector3 newimpulse = AXgrot * AXimpulsei; - impulse = new PhysicsVector(newimpulse.x, newimpulse.y, newimpulse.z); - + Quaternion grot = GetWorldRotation(); + Quaternion AXgrot = grot; + Vector3 AXimpulsei = impulsei; + Vector3 newimpulse = AXimpulsei * AXgrot; + impulse = new PhysicsVector(newimpulse.X, newimpulse.Y, newimpulse.Z); } else { @@ -1155,8 +1146,8 @@ namespace OpenSim.Region.Environment.Scenes /// public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim) { - bool isPhysical = (((rootObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0) && m_physicalPrim); - bool isPhantom = ((rootObjectFlags & (uint) LLObject.ObjectFlags.Phantom) != 0); + bool isPhysical = (((rootObjectFlags & (uint) PrimFlags.Physics) != 0) && m_physicalPrim); + bool isPhantom = ((rootObjectFlags & (uint) PrimFlags.Phantom) != 0); // Added clarification.. since A rigid body is an object that you can kick around, etc. bool RigidBody = isPhysical && !isPhantom; @@ -1167,11 +1158,10 @@ namespace OpenSim.Region.Environment.Scenes PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( Name, Shape, - new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, - AbsolutePosition.Z), + new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z), new PhysicsVector(Scale.X, Scale.Y, Scale.Z), - new Quaternion(RotationOffset.W, RotationOffset.X, - RotationOffset.Y, RotationOffset.Z), RigidBody); + RotationOffset, + RigidBody); // Basic Physics returns null.. joy joy joy. if (PhysActor != null) @@ -1208,24 +1198,23 @@ namespace OpenSim.Region.Environment.Scenes /// Duplicates this part. /// /// - public SceneObjectPart Copy(uint localID, LLUUID AgentID, LLUUID GroupID, int linkNum, bool userExposed) + public SceneObjectPart Copy(uint localID, UUID AgentID, UUID GroupID, int linkNum, bool userExposed) { SceneObjectPart dupe = (SceneObjectPart) MemberwiseClone(); dupe.m_shape = m_shape.Copy(); dupe.m_regionHandle = m_regionHandle; if (userExposed) - dupe.UUID = LLUUID.Random(); + dupe.UUID = UUID.Random(); dupe.LocalId = localID; dupe._ownerID = AgentID; dupe._groupID = GroupID; - dupe.GroupPosition = new LLVector3(GroupPosition.X, GroupPosition.Y, GroupPosition.Z); - dupe.OffsetPosition = new LLVector3(OffsetPosition.X, OffsetPosition.Y, OffsetPosition.Z); - dupe.RotationOffset = - new LLQuaternion(RotationOffset.X, RotationOffset.Y, RotationOffset.Z, RotationOffset.W); - dupe.Velocity = new LLVector3(0, 0, 0); - dupe.Acceleration = new LLVector3(0, 0, 0); - dupe.AngularVelocity = new LLVector3(0, 0, 0); + dupe.GroupPosition = GroupPosition; + dupe.OffsetPosition = OffsetPosition; + dupe.RotationOffset = RotationOffset; + dupe.Velocity = Vector3.Zero; + dupe.Acceleration = Vector3.Zero; + dupe.AngularVelocity = Vector3.Zero; dupe.ObjectFlags = ObjectFlags; dupe._ownershipCost = _ownershipCost; @@ -1247,11 +1236,11 @@ namespace OpenSim.Region.Environment.Scenes if (userExposed) { - if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != LLUUID.Zero) + if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != UUID.Zero) { m_parentGroup.Scene.AssetCache.GetAsset(dupe.m_shape.SculptTexture, dupe.SculptTextureCallback, true); } - bool UsePhysics = ((dupe.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0); + bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0); dupe.DoPhysicsPropertyUpdate(UsePhysics, true); } return dupe; @@ -1260,13 +1249,13 @@ namespace OpenSim.Region.Environment.Scenes public static SceneObjectPart Create() { SceneObjectPart part = new SceneObjectPart(); - part.UUID = LLUUID.Random(); + part.UUID = UUID.Random(); PrimitiveBaseShape shape = PrimitiveBaseShape.Create(); part.Shape = shape; part.Name = "Primitive"; - part._ownerID = LLUUID.Random(); + part._ownerID = UUID.Random(); return part; } @@ -1295,16 +1284,8 @@ namespace OpenSim.Region.Environment.Scenes /// that's not wholesome. Had to make Scene public //PhysActor = null; - if ((ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) + if ((ObjectFlags & (uint) PrimFlags.Phantom) == 0) { - //PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( - //Name, - //Shape, - //new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, - //AbsolutePosition.Z), - //new PhysicsVector(Scale.X, Scale.Y, Scale.Z), - //new Quaternion(RotationOffset.W, RotationOffset.X, - //RotationOffset.Y, RotationOffset.Z), UsePhysics); if (UsePhysics) { ParentGroup.Scene.AddPhysicalPrim(1); @@ -1339,7 +1320,7 @@ namespace OpenSim.Region.Environment.Scenes return newobject; } - public LLUUID GetAvatarOnSitTarget() + public UUID GetAvatarOnSitTarget() { return m_sitTargetAvatar; } @@ -1356,30 +1337,30 @@ namespace OpenSim.Region.Environment.Scenes public double GetDistanceTo(Vector3 a, Vector3 b) { - float dx = a.x - b.x; - float dy = a.y - b.y; - float dz = a.z - b.z; + float dx = a.X - b.X; + float dy = a.Y - b.Y; + float dz = a.Z - b.Z; return Math.Sqrt(dx * dx + dy * dy + dz * dz); } public uint GetEffectiveObjectFlags() { - LLObject.ObjectFlags f = _flags; + PrimFlags f = _flags; if (m_parentGroup == null || m_parentGroup.RootPart == this) - f &= ~(LLObject.ObjectFlags.Touch | LLObject.ObjectFlags.Money); + f &= ~(PrimFlags.Touch | PrimFlags.Money); return (uint)_flags | (uint)LocalFlags; } - public LLVector3 GetGeometricCenter() + public Vector3 GetGeometricCenter() { if (PhysActor != null) { - return new LLVector3(PhysActor.CenterOfMass.X, PhysActor.CenterOfMass.Y, PhysActor.CenterOfMass.Z); + return new Vector3(PhysActor.CenterOfMass.X, PhysActor.CenterOfMass.Y, PhysActor.CenterOfMass.Z); } else { - return new LLVector3(0, 0, 0); + return new Vector3(0, 0, 0); } } @@ -1419,16 +1400,16 @@ namespace OpenSim.Region.Environment.Scenes Dictionary TaskInventory_work = new Dictionary(); - foreach (LLUUID id in TaskInventory.Keys) + foreach (UUID id in TaskInventory.Keys) { - TaskInventory_work.Add(id.UUID, TaskInventory[id]); + TaskInventory_work.Add(id.Guid, TaskInventory[id]); } info.AddValue("TaskInventory", TaskInventory_work); - info.AddValue("LastOwnerID", _lastOwnerID.UUID); - info.AddValue("OwnerID", _ownerID.UUID); - info.AddValue("GroupID", _groupID.UUID); + info.AddValue("LastOwnerID", _lastOwnerID.Guid); + info.AddValue("OwnerID", _ownerID.Guid); + info.AddValue("GroupID", _groupID.Guid); info.AddValue("OwnershipCost", _ownershipCost); info.AddValue("ObjectSaleType", _objectSaleType); @@ -1451,10 +1432,10 @@ namespace OpenSim.Region.Environment.Scenes info.AddValue("TimeStampLastActivity", TimeStampLastActivity); info.AddValue("m_updateFlag", m_updateFlag); - info.AddValue("CreatorID", _creatorID.UUID); + info.AddValue("CreatorID", _creatorID.Guid); info.AddValue("m_inventorySerial", m_inventorySerial); - info.AddValue("m_uuid", m_uuid.UUID); + info.AddValue("m_uuid", m_uuid.Guid); info.AddValue("m_localID", m_localId); info.AddValue("m_name", m_name); info.AddValue("m_flags", _flags); @@ -1503,7 +1484,7 @@ namespace OpenSim.Region.Environment.Scenes public void GetProperties(IClientAPI client) { - client.SendObjectPropertiesReply(LLUUID.Zero, (ulong)_creationDate, _creatorID, LLUUID.Zero, LLUUID.Zero, + client.SendObjectPropertiesReply(UUID.Zero, (ulong)_creationDate, _creatorID, UUID.Zero, UUID.Zero, _groupID, (short)InventorySerial, _lastOwnerID, UUID, _ownerID, ParentGroup.RootPart.TouchName, new byte[0], ParentGroup.RootPart.SitName, Name, Description, ParentGroup.RootPart._ownerMask, ParentGroup.RootPart._nextOwnerMask, ParentGroup.RootPart._groupMask, ParentGroup.RootPart._everyoneMask, @@ -1512,13 +1493,13 @@ namespace OpenSim.Region.Environment.Scenes ParentGroup.RootPart.SalePrice); } - public LLUUID GetRootPartUUID() + public UUID GetRootPartUUID() { if (m_parentGroup != null) { return m_parentGroup.UUID; } - return LLUUID.Zero; + return UUID.Zero; } /// @@ -1526,63 +1507,40 @@ namespace OpenSim.Region.Environment.Scenes /// Remember, the Group Position simply gives the position of the group itself /// /// A Linked Child Prim objects position in world - public LLVector3 GetWorldPosition() - { - Quaternion parentRot = new Quaternion( - ParentGroup.RootPart.RotationOffset.W, - ParentGroup.RootPart.RotationOffset.X, - ParentGroup.RootPart.RotationOffset.Y, - ParentGroup.RootPart.RotationOffset.Z); - - Vector3 axPos - = new Vector3( - OffsetPosition.X, - OffsetPosition.Y, - OffsetPosition.Z); - - axPos = parentRot * axPos; - LLVector3 translationOffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); - return GroupPosition + translationOffsetPosition; + public Vector3 GetWorldPosition() + { + Quaternion parentRot = ParentGroup.RootPart.RotationOffset; + + Vector3 axPos = OffsetPosition; - //return (new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z) + AbsolutePosition); + axPos *= parentRot; + Vector3 translationOffsetPosition = axPos; + return GroupPosition + translationOffsetPosition; } /// /// Gets the rotation of this prim offset by the group rotation /// /// - public LLQuaternion GetWorldRotation() + public Quaternion GetWorldRotation() { Quaternion newRot; if (this.LinkNum == 0) { - newRot = new Quaternion(RotationOffset.W,RotationOffset.X,RotationOffset.Y,RotationOffset.Z); - + newRot = RotationOffset; } else { - Quaternion parentRot = new Quaternion( - ParentGroup.RootPart.RotationOffset.W, - ParentGroup.RootPart.RotationOffset.X, - ParentGroup.RootPart.RotationOffset.Y, - ParentGroup.RootPart.RotationOffset.Z); - - Quaternion oldRot - = new Quaternion( - RotationOffset.W, - RotationOffset.X, - RotationOffset.Y, - RotationOffset.Z); - + Quaternion parentRot = ParentGroup.RootPart.RotationOffset; + Quaternion oldRot = RotationOffset; newRot = parentRot * oldRot; } - return new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w); - //return new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w); + return newRot; } - public void MoveToTarget(LLVector3 target, float tau) + public void MoveToTarget(Vector3 target, float tau) { if (tau > 0) { @@ -1594,7 +1552,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public virtual void OnGrab(LLVector3 offsetPos, IClientAPI remoteClient) + public virtual void OnGrab(Vector3 offsetPos, IClientAPI remoteClient) { } @@ -1694,7 +1652,7 @@ namespace OpenSim.Region.Environment.Scenes detobj.nameStr = av.ControllingClient.Name; detobj.ownerUUID = av.UUID; detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); + detobj.rotQuat = av.Rotation; detobj.velVector = av.Velocity; detobj.colliderType = 0; detobj.groupUUID = av.ControllingClient.ActiveGroupId; @@ -1760,7 +1718,7 @@ namespace OpenSim.Region.Environment.Scenes detobj.nameStr = av.Name; detobj.ownerUUID = av.UUID; detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); + detobj.rotQuat = av.Rotation; detobj.velVector = av.Velocity; detobj.colliderType = 0; detobj.groupUUID = av.ControllingClient.ActiveGroupId; @@ -1828,7 +1786,7 @@ namespace OpenSim.Region.Environment.Scenes detobj.nameStr = av.Name; detobj.ownerUUID = av.UUID; detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); + detobj.rotQuat = av.Rotation; detobj.velVector = av.Velocity; detobj.colliderType = 0; detobj.groupUUID = av.ControllingClient.ActiveGroupId; @@ -1857,7 +1815,7 @@ namespace OpenSim.Region.Environment.Scenes public void PhysicsOutOfBounds(PhysicsVector pos) { m_log.Info("[PHYSICS]: Physical Object went out of bounds."); - RemFlag(LLObject.ObjectFlags.Physics); + RemFlag(PrimFlags.Physics); DoPhysicsPropertyUpdate(false, true); //m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); } @@ -1866,7 +1824,7 @@ namespace OpenSim.Region.Environment.Scenes { if (PhysActor != null) { - LLVector3 newpos = new LLVector3(PhysActor.Position.GetBytes(), 0); + Vector3 newpos = new Vector3(PhysActor.Position.GetBytes(), 0); if (newpos.X > 257f || newpos.X < -1f || newpos.Y > 257f || newpos.Y < -1f) { m_parentGroup.AbsolutePosition = newpos; @@ -1880,16 +1838,16 @@ namespace OpenSim.Region.Environment.Scenes public void PreloadSound(string sound) { - // LLUUID ownerID = OwnerID; - LLUUID objectID = UUID; - LLUUID soundID = LLUUID.Zero; + // UUID ownerID = OwnerID; + UUID objectID = UUID; + UUID soundID = UUID.Zero; - if (!LLUUID.TryParse(sound, out soundID)) + if (!UUID.TryParse(sound, out soundID)) { //Trys to fetch sound id from prim's inventory. //Prim's inventory doesn't support non script items yet SceneObjectPart op = this; - foreach (KeyValuePair item in op.TaskInventory) + foreach (KeyValuePair item in op.TaskInventory) { if (item.Value.Name == sound) { @@ -1908,19 +1866,19 @@ namespace OpenSim.Region.Environment.Scenes } } - public void RemFlag(LLObject.ObjectFlags flag) + public void RemFlag(PrimFlags flag) { - // LLObject.ObjectFlags prevflag = Flags; + // PrimFlags prevflag = Flags; if ((ObjectFlags & (uint) flag) != 0) { - //Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString()); + //Console.WriteLine("Removing flag: " + ((PrimFlags)flag).ToString()); _flags &= ~flag; } //System.Console.WriteLine("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); //ScheduleFullUpdate(); } - public void RemoveScriptEvents(LLUUID scriptid) + public void RemoveScriptEvents(UUID scriptid) { lock (m_scriptEvents) { @@ -1938,13 +1896,13 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// Reset LLUUIDs for this part. This involves generate this part's own LLUUID and - /// generating new LLUUIDs for all the items in the inventory. + /// Reset UUIDs for this part. This involves generate this part's own UUID and + /// generating new UUIDs for all the items in the inventory. /// /// Link number for the part public void ResetIDs(int linkNum) { - UUID = LLUUID.Random(); + UUID = UUID.Random(); LinkNum = linkNum; ResetInventoryIDs(); @@ -1954,7 +1912,7 @@ namespace OpenSim.Region.Environment.Scenes /// Resize this part. /// /// - public void Resize(LLVector3 scale) + public void Resize(Vector3 scale) { StoreUndoState(); m_shape.Scale = scale; @@ -2032,7 +1990,7 @@ namespace OpenSim.Region.Environment.Scenes m_parentGroup.ScriptSetPhysicsStatus(UsePhysics); } - public void SculptTextureCallback(LLUUID textureID, AssetBase texture) + public void SculptTextureCallback(UUID textureID, AssetBase texture) { if (m_shape.SculptEntry) { @@ -2073,7 +2031,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void SendFullUpdateToAllClientsExcept(LLUUID agentID) + public void SendFullUpdateToAllClientsExcept(UUID agentID) { List avatars = m_parentGroup.Scene.GetScenePresences(); for (int i = 0; i < avatars.Count; i++) @@ -2094,7 +2052,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendFullUpdateToClient(IClientAPI remoteClient, uint clientflags) { - LLVector3 lPos; + Vector3 lPos; lPos = OffsetPosition; SendFullUpdateToClient(remoteClient, lPos, clientflags); } @@ -2105,16 +2063,16 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos, uint clientFlags) + public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos, uint clientFlags) { - clientFlags &= ~(uint) LLObject.ObjectFlags.CreateSelected; + clientFlags &= ~(uint) PrimFlags.CreateSelected; if (remoteClient.AgentId == _ownerID) { - if ((uint) (_flags & LLObject.ObjectFlags.CreateSelected) != 0) + if ((uint) (_flags & PrimFlags.CreateSelected) != 0) { - clientFlags |= (uint) LLObject.ObjectFlags.CreateSelected; - _flags &= ~LLObject.ObjectFlags.CreateSelected; + clientFlags |= (uint) PrimFlags.CreateSelected; + _flags &= ~PrimFlags.CreateSelected; } } //bool isattachment = IsAttachment; @@ -2140,7 +2098,7 @@ namespace OpenSim.Region.Environment.Scenes // This causes the Scene to 'poll' physical objects every couple of frames // bad, so it's been replaced by an event driven method. - //if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0) + //if ((ObjectFlags & (uint)PrimFlags.Physics) != 0) //{ // Only send the constant terse updates on physical objects! //ScheduleTerseUpdate(); @@ -2163,20 +2121,20 @@ namespace OpenSim.Region.Environment.Scenes if (volume < 0) volume = 0; - LLUUID ownerID = _ownerID; - LLUUID objectID = UUID; - LLUUID parentID = GetRootPartUUID(); - LLUUID soundID = LLUUID.Zero; - LLVector3 position = AbsolutePosition; // region local + UUID ownerID = _ownerID; + UUID objectID = UUID; + UUID parentID = GetRootPartUUID(); + UUID soundID = UUID.Zero; + Vector3 position = AbsolutePosition; // region local ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle; //byte flags = 0; - if (!LLUUID.TryParse(sound, out soundID)) + if (!UUID.TryParse(sound, out soundID)) { // search sound file from inventory SceneObjectPart op = this; - foreach (KeyValuePair item in op.TaskInventory) + foreach (KeyValuePair item in op.TaskInventory) { if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound) { @@ -2186,7 +2144,7 @@ namespace OpenSim.Region.Environment.Scenes } } - if (soundID == LLUUID.Zero) + if (soundID == UUID.Zero) return; List avatarts = m_parentGroup.Scene.GetAvatars(); @@ -2233,11 +2191,11 @@ namespace OpenSim.Region.Environment.Scenes public void SendTerseUpdateToClient(IClientAPI remoteClient) { - LLVector3 lPos; + Vector3 lPos; lPos = OffsetPosition; - LLQuaternion mRot = RotationOffset; + Quaternion mRot = RotationOffset; // TODO: I have no idea why we are making this check. This should be sorted out - if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0) + if ((ObjectFlags & (uint) PrimFlags.Physics) == 0) { remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity, RotationalVelocity, Shape.State, FromAssetID); } @@ -2249,9 +2207,9 @@ namespace OpenSim.Region.Environment.Scenes } } - public void SendTerseUpdateToClient(IClientAPI remoteClient, LLVector3 lPos) + public void SendTerseUpdateToClient(IClientAPI remoteClient, Vector3 lPos) { - LLQuaternion mRot = RotationOffset; + Quaternion mRot = RotationOffset; //bool isattachment = IsAttachment; //if (LocalId != ParentGroup.RootPart.LocalId) //isattachment = ParentGroup.RootPart.IsAttachment; @@ -2263,7 +2221,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) == 0) + if ((ObjectFlags & (uint)PrimFlags.Physics) == 0) { remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity, RotationalVelocity, Shape.State, FromAssetID); } @@ -2296,7 +2254,7 @@ namespace OpenSim.Region.Environment.Scenes //} } - public void SetAvatarOnSitTarget(LLUUID avatarID) + public void SetAvatarOnSitTarget(UUID avatarID) { m_sitTargetAvatar = avatarID; if (ParentGroup != null) @@ -2352,7 +2310,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void SetGroup(LLUUID groupID, IClientAPI client) + public void SetGroup(UUID groupID, IClientAPI client) { _groupID = groupID; GetProperties(client); @@ -2379,7 +2337,7 @@ namespace OpenSim.Region.Environment.Scenes m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); } - public void SetScriptEvents(LLUUID scriptid, int events) + public void SetScriptEvents(UUID scriptid, int events) { // scriptEvents oldparts; lock (m_scriptEvents) @@ -2399,24 +2357,6 @@ namespace OpenSim.Region.Environment.Scenes aggregateScriptEvents(); } - // public void SetSitTarget(Vector3 offset, Quaternion orientation) - // { - // m_sitTargetPosition = offset; - // m_sitTargetOrientation = orientation; - // } - - // // Utility function so the databases don't have to reference axiom.math - // public void SetSitTargetLL(LLVector3 offset, LLQuaternion orientation) - // { - // if ( - // !(offset.X == 0 && offset.Y == 0 && offset.Z == 0 && (orientation.W == 0 || orientation.W == 1) && - // orientation.X == 0 && orientation.Y == 0 && orientation.Z == 0)) - // { - // m_sitTargetPosition = new Vector3(offset.X, offset.Y, offset.Z); - // m_sitTargetOrientation = new Quaternion(orientation.W, orientation.X, orientation.Y, orientation.Z); - // } - // } - /// /// Set the text displayed for this part. /// @@ -2438,9 +2378,9 @@ namespace OpenSim.Region.Environment.Scenes public void SetText(string text, Vector3 color, double alpha) { Color = Color.FromArgb(0xff - (int) (alpha*0xff), - (int) (color.x*0xff), - (int) (color.y*0xff), - (int) (color.z*0xff)); + (int) (color.X*0xff), + (int) (color.Y*0xff), + (int) (color.Z*0xff)); SetText(text); } @@ -2491,33 +2431,22 @@ namespace OpenSim.Region.Environment.Scenes EntityIntersection returnresult = new EntityIntersection(); - Vector3 vAbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); - - Vector3 vScale = new Vector3(Scale.X, Scale.Y, Scale.Z); - // Quaternion qRotation = - // new Quaternion(RotationOffset.W, RotationOffset.X, RotationOffset.Y, RotationOffset.Z); - - - //Quaternion worldRotation = (qRotation*parentrot); - //Matrix3 worldRotM = worldRotation.ToRotationMatrix(); - - + Vector3 vAbsolutePosition = AbsolutePosition; + Vector3 vScale = Scale; Vector3 rOrigin = iray.Origin; Vector3 rDirection = iray.Direction; - - //rDirection = rDirection.Normalize(); // Buidling the first part of the Quadratic equation Vector3 r2ndDirection = rDirection*rDirection; - float itestPart1 = r2ndDirection.x + r2ndDirection.y + r2ndDirection.z; + float itestPart1 = r2ndDirection.X + r2ndDirection.Y + r2ndDirection.Z; // Buidling the second part of the Quadratic equation Vector3 tmVal2 = rOrigin - vAbsolutePosition; Vector3 r2Direction = rDirection*2.0f; Vector3 tmVal3 = r2Direction*tmVal2; - float itestPart2 = tmVal3.x + tmVal3.y + tmVal3.z; + float itestPart2 = tmVal3.X + tmVal3.Y + tmVal3.Z; // Buidling the third part of the Quadratic equation Vector3 tmVal4 = rOrigin*rOrigin; @@ -2528,12 +2457,12 @@ namespace OpenSim.Region.Environment.Scenes // Set Radius to the largest dimention of the prim float radius = 0f; - if (vScale.x > radius) - radius = vScale.x; - if (vScale.y > radius) - radius = vScale.y; - if (vScale.z > radius) - radius = vScale.z; + if (vScale.X > radius) + radius = vScale.X; + if (vScale.Y > radius) + radius = vScale.Y; + if (vScale.Z > radius) + radius = vScale.Z; // the second part of this is the default prim size // once we factor in the aabb of the prim we're adding we can @@ -2544,8 +2473,8 @@ namespace OpenSim.Region.Environment.Scenes //radius = radius; - float itestPart3 = tmVal4.x + tmVal4.y + tmVal4.z + tmVal5.x + tmVal5.y + tmVal5.z - - (2.0f*(tmVal6.x + tmVal6.y + tmVal6.z + (radius*radius))); + float itestPart3 = tmVal4.X + tmVal4.Y + tmVal4.Z + tmVal5.X + tmVal5.Y + tmVal5.Z - + (2.0f*(tmVal6.X + tmVal6.Y + tmVal6.Z + (radius*radius))); // Yuk Quadradrics.. Solve first float rootsqr = (itestPart2*itestPart2) - (4.0f*itestPart1*itestPart3); @@ -2572,21 +2501,21 @@ namespace OpenSim.Region.Environment.Scenes // We got an intersection. putting together an EntityIntersection object with the // intersection information Vector3 ipoint = - new Vector3(iray.Origin.x + (iray.Direction.x*root), iray.Origin.y + (iray.Direction.y*root), - iray.Origin.z + (iray.Direction.z*root)); + new Vector3(iray.Origin.X + (iray.Direction.X*root), iray.Origin.Y + (iray.Direction.Y*root), + iray.Origin.Z + (iray.Direction.Z*root)); returnresult.HitTF = true; returnresult.ipoint = ipoint; // Normal is calculated by the difference and then normalizing the result Vector3 normalpart = ipoint - vAbsolutePosition; - returnresult.normal = normalpart / normalpart.Length; + returnresult.normal = normalpart / normalpart.Length(); - // It's funny how the LLVector3 object has a Distance function, but the Axiom.Math object doesn't. + // It's funny how the Vector3 object has a Distance function, but the Axiom.Math object doesn't. // I can write a function to do it.. but I like the fact that this one is Static. - LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z); - LLVector3 distanceConvert2 = new LLVector3(ipoint.x, ipoint.y, ipoint.z); + Vector3 distanceConvert1 = new Vector3(iray.Origin.X, iray.Origin.Y, iray.Origin.Z); + Vector3 distanceConvert2 = new Vector3(ipoint.X, ipoint.Y, ipoint.Z); float distance = (float) Util.GetDistanceTo(distanceConvert1, distanceConvert2); returnresult.distance = distance; @@ -2621,21 +2550,21 @@ namespace OpenSim.Region.Environment.Scenes Vector3 AmBb = new Vector3(0, 0, 0); // Vertex B - Vertex C Vector3 cross = new Vector3(); - LLVector3 pos = GetWorldPosition(); - LLQuaternion rot = GetWorldRotation(); + Vector3 pos = GetWorldPosition(); + Quaternion rot = GetWorldRotation(); // Variables prefixed with AX are Axiom.Math copies of the LL variety. - Quaternion AXrot = new Quaternion(rot.W,rot.X,rot.Y,rot.Z); + Quaternion AXrot = rot; AXrot.Normalize(); - Vector3 AXpos = new Vector3(pos.X, pos.Y, pos.Z); + Vector3 AXpos = pos; // tScale is the offset to derive the vertex based on the scale. // it's different for each vertex because we've got to rotate it // to get the world position of the vertex to produce the Oriented Bounding Box - Vector3 tScale = new Vector3(); + Vector3 tScale = Vector3.Zero; Vector3 AXscale = new Vector3(m_shape.Scale.X * 0.5f, m_shape.Scale.Y * 0.5f, m_shape.Scale.Z * 0.5f); @@ -2680,97 +2609,97 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region Plane Decomposition of Oriented Bounding Box - tScale = new Vector3(AXscale.x, -AXscale.y, AXscale.z); - rScale = ((AXrot * tScale)); - vertexes[0] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.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; + tScale = new Vector3(AXscale.X, -AXscale.Y, AXscale.Z); + rScale = tScale * AXrot; + vertexes[0] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.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; FaceA[0] = vertexes[0]; FaceB[3] = vertexes[0]; FaceA[4] = vertexes[0]; tScale = AXscale; - rScale = ((AXrot * tScale)); - vertexes[1] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); + rScale = tScale * AXrot; + vertexes[1] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z))); - // vertexes[1].x = pos.X + vertexes[1].x; - // vertexes[1].y = pos.Y + vertexes[1].y; - //vertexes[1].z = pos.Z + vertexes[1].z; + // vertexes[1].X = pos.X + vertexes[1].X; + // vertexes[1].Y = pos.Y + vertexes[1].Y; + //vertexes[1].Z = pos.Z + vertexes[1].Z; FaceB[0] = vertexes[1]; FaceA[1] = vertexes[1]; FaceC[4] = vertexes[1]; - tScale = new Vector3(AXscale.x, -AXscale.y, -AXscale.z); - rScale = ((AXrot * tScale)); + tScale = new Vector3(AXscale.X, -AXscale.Y, -AXscale.Z); + rScale = tScale * AXrot; - vertexes[2] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); + vertexes[2] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z))); - //vertexes[2].x = pos.X + vertexes[2].x; - //vertexes[2].y = pos.Y + vertexes[2].y; - //vertexes[2].z = pos.Z + vertexes[2].z; + //vertexes[2].X = pos.X + vertexes[2].X; + //vertexes[2].Y = pos.Y + vertexes[2].Y; + //vertexes[2].Z = pos.Z + vertexes[2].Z; FaceC[0] = vertexes[2]; FaceD[3] = vertexes[2]; FaceC[5] = vertexes[2]; - tScale = new Vector3(AXscale.x, AXscale.y, -AXscale.z); - rScale = ((AXrot * tScale)); - vertexes[3] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); + tScale = new Vector3(AXscale.X, AXscale.Y, -AXscale.Z); + rScale = tScale * AXrot; + vertexes[3] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z))); - //vertexes[3].x = pos.X + vertexes[3].x; - // vertexes[3].y = pos.Y + vertexes[3].y; - // vertexes[3].z = pos.Z + vertexes[3].z; + //vertexes[3].X = pos.X + vertexes[3].X; + // vertexes[3].Y = pos.Y + vertexes[3].Y; + // vertexes[3].Z = pos.Z + vertexes[3].Z; FaceD[0] = vertexes[3]; FaceC[1] = vertexes[3]; FaceA[5] = vertexes[3]; - tScale = new Vector3(-AXscale.x, AXscale.y, AXscale.z); - rScale = ((AXrot * tScale)); - vertexes[4] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); + tScale = new Vector3(-AXscale.X, AXscale.Y, AXscale.Z); + rScale = tScale * AXrot; + vertexes[4] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z))); - // vertexes[4].x = pos.X + vertexes[4].x; - // vertexes[4].y = pos.Y + vertexes[4].y; - // vertexes[4].z = pos.Z + vertexes[4].z; + // vertexes[4].X = pos.X + vertexes[4].X; + // vertexes[4].Y = pos.Y + vertexes[4].Y; + // vertexes[4].Z = pos.Z + vertexes[4].Z; FaceB[1] = vertexes[4]; FaceA[2] = vertexes[4]; FaceD[4] = vertexes[4]; - tScale = new Vector3(-AXscale.x, AXscale.y, -AXscale.z); - rScale = ((AXrot * tScale)); - vertexes[5] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); + tScale = new Vector3(-AXscale.X, AXscale.Y, -AXscale.Z); + rScale = tScale * AXrot; + vertexes[5] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z))); - // vertexes[5].x = pos.X + vertexes[5].x; - // vertexes[5].y = pos.Y + vertexes[5].y; - // vertexes[5].z = pos.Z + vertexes[5].z; + // vertexes[5].X = pos.X + vertexes[5].X; + // vertexes[5].Y = pos.Y + vertexes[5].Y; + // vertexes[5].Z = pos.Z + vertexes[5].Z; FaceD[1] = vertexes[5]; FaceC[2] = vertexes[5]; FaceB[5] = vertexes[5]; - tScale = new Vector3(-AXscale.x, -AXscale.y, AXscale.z); - rScale = ((AXrot * tScale)); - vertexes[6] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); + tScale = new Vector3(-AXscale.X, -AXscale.Y, AXscale.Z); + rScale = tScale * AXrot; + vertexes[6] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z))); - // vertexes[6].x = pos.X + vertexes[6].x; - // vertexes[6].y = pos.Y + vertexes[6].y; - // vertexes[6].z = pos.Z + vertexes[6].z; + // vertexes[6].X = pos.X + vertexes[6].X; + // vertexes[6].Y = pos.Y + vertexes[6].Y; + // vertexes[6].Z = pos.Z + vertexes[6].Z; FaceB[2] = vertexes[6]; FaceA[3] = vertexes[6]; FaceB[4] = vertexes[6]; - tScale = new Vector3(-AXscale.x, -AXscale.y, -AXscale.z); - rScale = ((AXrot * tScale)); - vertexes[7] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); + tScale = new Vector3(-AXscale.X, -AXscale.Y, -AXscale.Z); + rScale = tScale * AXrot; + vertexes[7] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z))); - // vertexes[7].x = pos.X + vertexes[7].x; - // vertexes[7].y = pos.Y + vertexes[7].y; - // vertexes[7].z = pos.Z + vertexes[7].z; + // vertexes[7].X = pos.X + vertexes[7].X; + // vertexes[7].Y = pos.Y + vertexes[7].Y; + // vertexes[7].Z = pos.Z + vertexes[7].Z; FaceD[2] = vertexes[7]; FaceC[3] = vertexes[7]; @@ -2786,13 +2715,13 @@ namespace OpenSim.Region.Environment.Scenes AmBa = FaceA[i] - FaceB[i]; AmBb = FaceB[i] - FaceC[i]; - cross = AmBb.Cross(AmBa); + cross = Vector3.Cross(AmBb, AmBa); // normalize the cross product to get the normal. - normals[i] = cross / cross.Length; + normals[i] = cross / cross.Length(); //m_log.Info("[NORMALS]: normals[ " + i + "]" + normals[i].ToString()); - //distance[i] = (normals[i].x * AmBa.x + normals[i].y * AmBa.y + normals[i].z * AmBa.z) * -1; + //distance[i] = (normals[i].X * AmBa.X + normals[i].Y * AmBa.Y + normals[i].Z * AmBa.Z) * -1; } EntityIntersection returnresult = new EntityIntersection(); @@ -2862,7 +2791,7 @@ namespace OpenSim.Region.Environment.Scenes { AmBa = FaceA[i] - FaceB[i]; AmBb = FaceB[i] - FaceC[i]; - d = normals[i].Dot(FaceB[i]); + d = Vector3.Dot(normals[i], FaceB[i]); //if (faceCenters) //{ @@ -2870,30 +2799,26 @@ namespace OpenSim.Region.Environment.Scenes //} //else //{ - c = iray.Direction.Dot(normals[i]); + c = Vector3.Dot(iray.Direction, normals[i]); //} if (c == 0) continue; - a = (d - iray.Origin.Dot(normals[i])) / c; + a = (d - Vector3.Dot(iray.Origin, normals[i])) / c; if (a < 0) continue; // If the normal is pointing outside the object - - - - if (iray.Direction.Dot(normals[i]) < 0 || !frontFacesOnly) + if (Vector3.Dot(iray.Direction, normals[i]) < 0 || !frontFacesOnly) { - //if (faceCenters) //{ //(FaceA[i] + FaceB[i] + FaceC[1] + FaceD[i]) / 4f; // q = iray.Origin + a * normals[i]; //} //else //{ - q = iray.Origin + a * iray.Direction; + q = iray.Origin + iray.Direction * a; //} float distance2 = (float)GetDistanceTo(q, AXpos); @@ -2913,13 +2838,13 @@ namespace OpenSim.Region.Environment.Scenes //m_log.Info("[DIST]: " + distance2.ToString()); if (faceCenters) { - returnresult.normal = (AXrot * AAfacenormals[i]); + returnresult.normal = AAfacenormals[i] * AXrot; Vector3 scaleComponent = AAfacenormals[i]; float ScaleOffset = 0.5f; - if (scaleComponent.x != 0) ScaleOffset = AXscale.x; - if (scaleComponent.y != 0) ScaleOffset = AXscale.y; - if (scaleComponent.z != 0) ScaleOffset = AXscale.z; + if (scaleComponent.X != 0) ScaleOffset = AXscale.X; + if (scaleComponent.Y != 0) ScaleOffset = AXscale.Y; + if (scaleComponent.Z != 0) ScaleOffset = AXscale.Z; ScaleOffset = Math.Abs(ScaleOffset); Vector3 offset = returnresult.normal * ScaleOffset; returnresult.ipoint = AXpos + offset; @@ -2984,7 +2909,7 @@ namespace OpenSim.Region.Environment.Scenes if (type == 0x30) { - if (m_shape.SculptEntry && m_shape.SculptTexture != LLUUID.Zero) + if (m_shape.SculptEntry && m_shape.SculptTexture != UUID.Zero) { //AssetBase tx = m_parentGroup.Scene.getase m_parentGroup.Scene.AssetCache.GetAsset(m_shape.SculptTexture, SculptTextureCallback, true); @@ -2995,13 +2920,13 @@ namespace OpenSim.Region.Environment.Scenes ScheduleFullUpdate(); } - public void UpdateGroupPosition(LLVector3 pos) + public void UpdateGroupPosition(Vector3 pos) { if ((pos.X != GroupPosition.X) || (pos.Y != GroupPosition.Y) || (pos.Z != GroupPosition.Z)) { - LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); + Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); GroupPosition = newPos; ScheduleTerseUpdate(); } @@ -3015,19 +2940,19 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void UpdateOffSet(LLVector3 pos) + public void UpdateOffSet(Vector3 pos) { if ((pos.X != OffsetPosition.X) || (pos.Y != OffsetPosition.Y) || (pos.Z != OffsetPosition.Z)) { - LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); + Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); OffsetPosition = newPos; ScheduleTerseUpdate(); } } - public void UpdatePermissions(LLUUID AgentID, byte field, uint localID, uint mask, byte addRemTF) + public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF) { bool set = addRemTF == 1; @@ -3069,7 +2994,7 @@ namespace OpenSim.Region.Environment.Scenes bool IsTemporary = false; bool IsPhantom = false; // bool castsShadows = false; - bool wasUsingPhysics = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0); + bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0); //bool IsLocked = false; int i = 0; @@ -3091,7 +3016,7 @@ namespace OpenSim.Region.Environment.Scenes if (usePhysics) { - AddFlag(LLObject.ObjectFlags.Physics); + AddFlag(PrimFlags.Physics); if (!wasUsingPhysics) { DoPhysicsPropertyUpdate(usePhysics, false); @@ -3109,7 +3034,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - RemFlag(LLObject.ObjectFlags.Physics); + RemFlag(PrimFlags.Physics); if (wasUsingPhysics) { DoPhysicsPropertyUpdate(usePhysics, false); @@ -3118,7 +3043,7 @@ namespace OpenSim.Region.Environment.Scenes if (IsPhantom) { - AddFlag(LLObject.ObjectFlags.Phantom); + AddFlag(PrimFlags.Phantom); if (PhysActor != null) { m_parentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); @@ -3128,17 +3053,16 @@ namespace OpenSim.Region.Environment.Scenes } else { - RemFlag(LLObject.ObjectFlags.Phantom); + RemFlag(PrimFlags.Phantom); if (PhysActor == null) { PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( Name, Shape, - new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, - AbsolutePosition.Z), + new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z), new PhysicsVector(Scale.X, Scale.Y, Scale.Z), - new Quaternion(RotationOffset.W, RotationOffset.X, - RotationOffset.Y, RotationOffset.Z), usePhysics); + RotationOffset, + usePhysics); if (PhysActor != null) { @@ -3175,17 +3099,17 @@ namespace OpenSim.Region.Environment.Scenes if (IsTemporary) { - AddFlag(LLObject.ObjectFlags.TemporaryOnRez); + AddFlag(PrimFlags.TemporaryOnRez); } else { - RemFlag(LLObject.ObjectFlags.TemporaryOnRez); + RemFlag(PrimFlags.TemporaryOnRez); } // System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); ScheduleFullUpdate(); } - public void UpdateRotation(LLQuaternion rot) + public void UpdateRotation(Quaternion rot) { if ((rot.X != RotationOffset.X) || (rot.Y != RotationOffset.Y) || @@ -3193,7 +3117,7 @@ namespace OpenSim.Region.Environment.Scenes (rot.W != RotationOffset.W)) { //StoreUndoState(); - RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W); + RotationOffset = rot; ParentGroup.HasGroupChanged = true; ScheduleTerseUpdate(); } @@ -3235,9 +3159,9 @@ namespace OpenSim.Region.Environment.Scenes // Added to handle bug in libsecondlife's TextureEntry.ToBytes() // not handling RGBA properly. Cycles through, and "fixes" the color // info - public void UpdateTexture(LLObject.TextureEntry tex) + public void UpdateTexture(Primitive.TextureEntry tex) { - //LLColor tmpcolor; + //Color4 tmpcolor; //for (uint i = 0; i < 32; i++) //{ // if (tex.FaceTextures[i] != null) @@ -3291,17 +3215,17 @@ namespace OpenSim.Region.Environment.Scenes ((AggregateScriptEvents & scriptEvents.touch_start) != 0) ) { - objectflagupdate |= (uint) LLObject.ObjectFlags.Touch; + objectflagupdate |= (uint) PrimFlags.Touch; } if ((AggregateScriptEvents & scriptEvents.money) != 0) { - objectflagupdate |= (uint) LLObject.ObjectFlags.Money; + objectflagupdate |= (uint) PrimFlags.Money; } if (AllowedDrop) { - objectflagupdate |= (uint) LLObject.ObjectFlags.AllowInventoryDrop; + objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop; } if ( @@ -3326,7 +3250,7 @@ namespace OpenSim.Region.Environment.Scenes PhysActor.OnCollisionUpdate -= PhysicsCollision; } } - if ((GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Scripted) != 0) + if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0) { m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting; } @@ -3335,7 +3259,7 @@ namespace OpenSim.Region.Environment.Scenes m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting; } - LocalFlags=(LLObject.ObjectFlags)objectflagupdate; + LocalFlags=(PrimFlags)objectflagupdate; if (m_parentGroup != null && m_parentGroup.RootPart == this) m_parentGroup.aggregateScriptEvents(); @@ -3343,7 +3267,7 @@ namespace OpenSim.Region.Environment.Scenes ScheduleFullUpdate(); } - public int registerTargetWaypoint(LLVector3 target, float tolerance) + public int registerTargetWaypoint(Vector3 target, float tolerance) { if (m_parentGroup != null) { @@ -3360,11 +3284,11 @@ namespace OpenSim.Region.Environment.Scenes } } - public void SetCameraAtOffset(LLVector3 v) { + public void SetCameraAtOffset(Vector3 v) { m_cameraAtOffset = v; } - public void SetCameraEyeOffset(LLVector3 v) { + public void SetCameraEyeOffset(Vector3 v) { m_cameraEyeOffset = v; } @@ -3372,11 +3296,11 @@ namespace OpenSim.Region.Environment.Scenes m_forceMouselook = force; } - public LLVector3 GetCameraAtOffset() { + public Vector3 GetCameraAtOffset() { return m_cameraAtOffset; } - public LLVector3 GetCameraEyeOffset() { + public Vector3 GetCameraEyeOffset() { return m_cameraEyeOffset; } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 1694613..e51f1be 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -30,9 +30,8 @@ using System.Collections.Generic; using System.Reflection; using System.Runtime.Serialization; using System.Security.Permissions; -using Axiom.Math; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -60,7 +59,7 @@ namespace OpenSim.Region.Environment.Scenes struct ScriptControllers { - public LLUUID itemID; + public UUID itemID; public uint objID; public ScriptControlled ignoreControls; public ScriptControlled eventControls; @@ -78,9 +77,9 @@ namespace OpenSim.Region.Environment.Scenes public static byte[] DefaultTexture; - public LLUUID currentParcelUUID = LLUUID.Zero; + public UUID currentParcelUUID = UUID.Zero; private AnimationSet m_animations = new AnimationSet(); - private Dictionary scriptedcontrols = new Dictionary(); + private Dictionary scriptedcontrols = new Dictionary(); private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; private SceneObjectGroup proxyObjectGroup = null; @@ -94,11 +93,11 @@ namespace OpenSim.Region.Environment.Scenes private readonly List m_forcesList = new List(); private short m_updateCount = 0; private uint m_requestedSitTargetID = 0; - private LLUUID m_requestedSitTargetUUID = LLUUID.Zero; + private UUID m_requestedSitTargetUUID = UUID.Zero; - private LLVector3 m_requestedSitOffset = new LLVector3(); + private Vector3 m_requestedSitOffset = new Vector3(); - private LLVector3 m_LastFinitePos = new LLVector3(); + private Vector3 m_LastFinitePos = new Vector3(); private float m_sitAvatarHeight = 2.0f; @@ -108,14 +107,14 @@ namespace OpenSim.Region.Environment.Scenes // with varying parameters for sit target location, prim size, prim // rotation, prim cut, prim twist, prim taper, and prim shear. See mantis // issue #1716 - private static readonly LLVector3 m_sitTargetCorrectionOffset = new LLVector3(0.1f, 0.0f, 0.3f); + private static readonly Vector3 m_sitTargetCorrectionOffset = new Vector3(0.1f, 0.0f, 0.3f); private float m_godlevel = 0; private bool m_attachmentsTransported = false; private bool m_invulnerable = true; - private LLVector3 m_LastChildAgentUpdatePosition = new LLVector3(); + private Vector3 m_LastChildAgentUpdatePosition = new Vector3(); private int m_perfMonMS = 0; @@ -132,7 +131,7 @@ namespace OpenSim.Region.Environment.Scenes private bool m_newCoarseLocations = true; private float m_health = 100f; - private LLVector3 m_lastVelocity = LLVector3.Zero; + private Vector3 m_lastVelocity = Vector3.Zero; // Default AV Height private float m_avHeight = 127.0f; @@ -141,25 +140,25 @@ namespace OpenSim.Region.Environment.Scenes protected ulong crossingFromRegion = 0; private readonly Vector3[] Dir_Vectors = new Vector3[6]; - private LLVector3 lastPhysPos = new LLVector3(); + private Vector3 lastPhysPos = Vector3.Zero; // Position of agent's camera in world (region cordinates) - protected Vector3 m_CameraCenter = new Vector3(0, 0, 0); + protected Vector3 m_CameraCenter = Vector3.Zero; // Use these three vectors to figure out what the agent is looking at // Convert it to a Matrix and/or Quaternion - protected Vector3 m_CameraAtAxis = new Vector3(0, 0, 0); - protected Vector3 m_CameraLeftAxis = new Vector3(0, 0, 0); - protected Vector3 m_CameraUpAxis = new Vector3(0, 0, 0); - private uint m_AgentControlFlags = (uint) 0; - private LLQuaternion m_headrotation = new LLQuaternion(); - private byte m_state = (byte) 0; + protected Vector3 m_CameraAtAxis = Vector3.Zero; + protected Vector3 m_CameraLeftAxis = Vector3.Zero; + protected Vector3 m_CameraUpAxis = Vector3.Zero; + private uint m_AgentControlFlags = 0; + private Quaternion m_headrotation = Quaternion.Identity; + private byte m_state = 0; - //Reuse the LLVector3 instead of creating a new one on the UpdateMovement method - private LLVector3 movementvector = new LLVector3(); + //Reuse the Vector3 instead of creating a new one on the UpdateMovement method + private Vector3 movementvector = Vector3.Zero; private bool m_autopilotMoving = false; - private LLVector3 m_autoPilotTarget = LLVector3.Zero; + private Vector3 m_autoPilotTarget = Vector3.Zero; private bool m_sitAtAutoTarget = false; // Agent's Draw distance. @@ -189,12 +188,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// Position at which a significant movement was made /// - private LLVector3 posLastSignificantMove = new LLVector3(); + private Vector3 posLastSignificantMove = new Vector3(); private UpdateQueue m_partsUpdateQueue = new UpdateQueue(); private Queue m_pendingObjects = null; - private Dictionary m_updateTimes = new Dictionary(); + private Dictionary m_updateTimes = new Dictionary(); #region Properties @@ -282,12 +281,12 @@ namespace OpenSim.Region.Environment.Scenes set { m_controllingClient = value; } } - protected LLVector3 m_parentPosition = new LLVector3(); + protected Vector3 m_parentPosition = new Vector3(); /// /// Absolute position of this avatar in 'region cordinates' /// - public override LLVector3 AbsolutePosition + public override Vector3 AbsolutePosition { get { @@ -318,14 +317,14 @@ namespace OpenSim.Region.Environment.Scenes } m_pos = value; - m_parentPosition=new LLVector3(0, 0, 0); + m_parentPosition=new Vector3(0, 0, 0); } } /// /// Current Velocity of the avatar. /// - public override LLVector3 Velocity + public override Vector3 Velocity { get { @@ -486,7 +485,7 @@ namespace OpenSim.Region.Environment.Scenes // } } - public uint GenerateClientFlags(LLUUID ObjectID) + public uint GenerateClientFlags(UUID ObjectID) { return m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(m_uuid, ObjectID); } @@ -609,7 +608,7 @@ namespace OpenSim.Region.Environment.Scenes /// This is called when an agent teleports into a region, or if an /// agent crosses into this region from a neighbor over the border /// - public void MakeRootAgent(LLVector3 pos, bool isFlying) + public void MakeRootAgent(Vector3 pos, bool isFlying) { m_scene.SetRootAgentScene(m_uuid); @@ -625,7 +624,7 @@ namespace OpenSim.Region.Environment.Scenes if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0) { - LLVector3 emergencyPos = new LLVector3(128, 128, 128); + Vector3 emergencyPos = new Vector3(128, 128, 128); m_log.WarnFormat( "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", @@ -681,12 +680,12 @@ namespace OpenSim.Region.Environment.Scenes // "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", // Name, UUID, m_scene.RegionInfo.RegionName); - Velocity = new LLVector3(0, 0, 0); + Velocity = new Vector3(0, 0, 0); m_isChildAgent = true; m_scene.SwapRootAgentCount(true); RemoveFromPhysicalScene(); m_scene.EventManager.TriggerOnMakeChildAgent(this); - //this.Pos = new LLVector3(128, 128, 70); + //this.Pos = new Vector3(128, 128, 70); } /// @@ -708,10 +707,10 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void Teleport(LLVector3 pos) + public void Teleport(Vector3 pos) { RemoveFromPhysicalScene(); - Velocity = new LLVector3(0, 0, 0); + Velocity = new Vector3(0, 0, 0); AbsolutePosition = pos; AddToPhysicalScene(); SendTerseUpdateToAllClients(); @@ -735,11 +734,11 @@ namespace OpenSim.Region.Environment.Scenes if (m_avHeight != 127.0f) { - AbsolutePosition = AbsolutePosition + new LLVector3(0, 0, (m_avHeight / 6)); + AbsolutePosition = AbsolutePosition + new Vector3(0, 0, (m_avHeight / 6f)); } else { - AbsolutePosition = AbsolutePosition + new LLVector3(0, 0, (1.56f / 6)); + AbsolutePosition = AbsolutePosition + new Vector3(0, 0, (1.56f / 6f)); } TrySetMovementAnimation("LAND"); SendFullUpdateToAllClients(); @@ -788,10 +787,10 @@ namespace OpenSim.Region.Environment.Scenes /// public void CompleteMovement() { - LLVector3 look = Velocity; + Vector3 look = Velocity; if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) { - look = new LLVector3(0.99f, 0.042f, 0); + look = new Vector3(0.99f, 0.042f, 0); } m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); @@ -846,7 +845,7 @@ namespace OpenSim.Region.Environment.Scenes //ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); //if (land != null) //{ - //if (land.landData.landingType == (byte)1 && land.landData.userLocation != LLVector3.Zero) + //if (land.landData.landingType == (byte)1 && land.landData.userLocation != Vector3.Zero) //{ // agent.startpos = land.landData.userLocation; //} @@ -855,27 +854,17 @@ namespace OpenSim.Region.Environment.Scenes m_perfMonMS = System.Environment.TickCount; uint flags = agentData.ControlFlags; - LLQuaternion bodyRotation = agentData.BodyRotation; + Quaternion bodyRotation = agentData.BodyRotation; // Camera location in world. We'll need to raytrace // from this location from time to time. - m_CameraCenter.x = agentData.CameraCenter.X; - m_CameraCenter.y = agentData.CameraCenter.Y; - m_CameraCenter.z = agentData.CameraCenter.Z; + m_CameraCenter = agentData.CameraCenter; // Use these three vectors to figure out what the agent is looking at // Convert it to a Matrix and/or Quaternion - m_CameraAtAxis.x = agentData.CameraAtAxis.X; - m_CameraAtAxis.y = agentData.CameraAtAxis.Y; - m_CameraAtAxis.z = agentData.CameraAtAxis.Z; - - m_CameraLeftAxis.x = agentData.CameraLeftAxis.X; - m_CameraLeftAxis.y = agentData.CameraLeftAxis.Y; - m_CameraLeftAxis.z = agentData.CameraLeftAxis.Z; - - m_CameraUpAxis.x = agentData.CameraUpAxis.X; - m_CameraUpAxis.y = agentData.CameraUpAxis.Y; - m_CameraUpAxis.z = agentData.CameraUpAxis.Z; + m_CameraAtAxis = agentData.CameraAtAxis; + m_CameraLeftAxis = agentData.CameraLeftAxis; + m_CameraUpAxis = agentData.CameraUpAxis; // The Agent's Draw distance setting m_DrawDistance = agentData.Far; @@ -923,7 +912,7 @@ namespace OpenSim.Region.Environment.Scenes bool update_rotation = false; bool DCFlagKeyPressed = false; Vector3 agent_control_v3 = new Vector3(0, 0, 0); - Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); + Quaternion q = bodyRotation; if (PhysicsActor != null) { bool oldflying = PhysicsActor.Flying; @@ -1005,7 +994,7 @@ namespace OpenSim.Region.Environment.Scenes m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); } - public void DoAutoPilot(uint not_used, LLVector3 Pos, IClientAPI remote_client) + public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client) { m_autopilotMoving = true; m_autoPilotTarget = Pos; @@ -1014,17 +1003,17 @@ namespace OpenSim.Region.Environment.Scenes //proxy.PCode = (byte)PCode.ParticleSystem; uint nextUUID = m_scene.NextLocalId; - proxyObjectGroup = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, UUID, nextUUID, Pos, new LLQuaternion(Rotation.x, Rotation.y, Rotation.z, Rotation.w), proxy); + proxyObjectGroup = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, UUID, nextUUID, Pos, Rotation, proxy); if (proxyObjectGroup != null) { proxyObjectGroup.SendGroupFullUpdate(); - remote_client.SendSitResponse(proxyObjectGroup.UUID, LLVector3.Zero, LLQuaternion.Identity, true, LLVector3.Zero, LLVector3.Zero, false); + remote_client.SendSitResponse(proxyObjectGroup.UUID, Vector3.Zero, Quaternion.Identity, true, Vector3.Zero, Vector3.Zero, false); m_scene.DeleteSceneObject(proxyObjectGroup); } else { m_autopilotMoving = false; - m_autoPilotTarget = LLVector3.Zero; + m_autoPilotTarget = Vector3.Zero; ControllingClient.SendAlertMessage("Autopilot cancelled"); } @@ -1041,13 +1030,13 @@ namespace OpenSim.Region.Environment.Scenes if (part != null) { AbsolutePosition = part.AbsolutePosition; - Velocity = new LLVector3(0, 0, 0); + Velocity = new Vector3(0, 0, 0); SendFullUpdateToAllClients(); //HandleAgentSit(ControllingClient, m_requestedSitTargetUUID); } - //ControllingClient.SendSitResponse(m_requestedSitTargetID, m_requestedSitOffset, LLQuaternion.Identity, false, LLVector3.Zero, LLVector3.Zero, false); - m_requestedSitTargetUUID = LLUUID.Zero; + //ControllingClient.SendSitResponse(m_requestedSitTargetID, m_requestedSitOffset, Quaternion.Identity, false, Vector3.Zero, Vector3.Zero, false); + m_requestedSitTargetUUID = UUID.Zero; } else { @@ -1057,15 +1046,15 @@ namespace OpenSim.Region.Environment.Scenes //proxy.PCode = (byte)PCode.ParticleSystem; ////uint nextUUID = m_scene.NextLocalId; - //proxyObjectGroup = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, UUID, nextUUID, m_autoPilotTarget, LLQuaternion.Identity, proxy); + //proxyObjectGroup = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, UUID, nextUUID, m_autoPilotTarget, Quaternion.Identity, proxy); //if (proxyObjectGroup != null) //{ //proxyObjectGroup.SendGroupFullUpdate(); - //ControllingClient.SendSitResponse(LLUUID.Zero, m_autoPilotTarget, LLQuaternion.Identity, true, LLVector3.Zero, LLVector3.Zero, false); + //ControllingClient.SendSitResponse(UUID.Zero, m_autoPilotTarget, Quaternion.Identity, true, Vector3.Zero, Vector3.Zero, false); //m_scene.DeleteSceneObject(proxyObjectGroup); //} } - m_autoPilotTarget = LLVector3.Zero; + m_autoPilotTarget = Vector3.Zero; m_autopilotMoving = false; } } @@ -1082,7 +1071,7 @@ namespace OpenSim.Region.Environment.Scenes { // Reset sit target. if (part.GetAvatarOnSitTarget() == UUID) - part.SetAvatarOnSitTarget(LLUUID.Zero); + part.SetAvatarOnSitTarget(UUID.Zero); m_parentPosition = part.GetWorldPosition(); } @@ -1092,8 +1081,8 @@ namespace OpenSim.Region.Environment.Scenes AddToPhysicalScene(); } - m_pos += m_parentPosition + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight); - m_parentPosition = new LLVector3(); + m_pos += m_parentPosition + new Vector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight); + m_parentPosition = new Vector3(); m_parentID = 0; SendFullUpdateToAllClients(); @@ -1107,7 +1096,7 @@ namespace OpenSim.Region.Environment.Scenes TrySetMovementAnimation("STAND"); } - private SceneObjectPart FindNextAvailableSitTarget(LLUUID targetID) + private SceneObjectPart FindNextAvailableSitTarget(UUID targetID) { SceneObjectPart targetPart = m_scene.GetSceneObjectPart(targetID); if (targetPart == null) @@ -1133,12 +1122,12 @@ namespace OpenSim.Region.Environment.Scenes // Is a sit target available? Vector3 avSitOffSet = part.SitTargetPosition; Quaternion avSitOrientation = part.SitTargetOrientation; - LLUUID avOnTargetAlready = part.GetAvatarOnSitTarget(); + UUID avOnTargetAlready = part.GetAvatarOnSitTarget(); - bool SitTargetUnOccupied = (!(avOnTargetAlready != LLUUID.Zero)); + bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero)); bool SitTargetisSet = - (!(avSitOffSet.x == 0 && avSitOffSet.y == 0 && avSitOffSet.z == 0 && avSitOrientation.w == 0 && - avSitOrientation.x == 0 && avSitOrientation.y == 0 && avSitOrientation.z == 1)); + (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && avSitOrientation.W == 0f && + avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f)); if (SitTargetisSet && SitTargetUnOccupied) { @@ -1151,13 +1140,13 @@ namespace OpenSim.Region.Environment.Scenes return targetPart; } - private void SendSitResponse(IClientAPI remoteClient, LLUUID targetID, LLVector3 offset) + private void SendSitResponse(IClientAPI remoteClient, UUID targetID, Vector3 offset) { bool autopilot = true; - LLVector3 pos = new LLVector3(); - LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1); - LLVector3 cameraEyeOffset = LLVector3.Zero; - LLVector3 cameraAtOffset = LLVector3.Zero; + Vector3 pos = new Vector3(); + Quaternion sitOrientation = Quaternion.Identity; + Vector3 cameraEyeOffset = Vector3.Zero; + Vector3 cameraAtOffset = Vector3.Zero; bool forceMouselook = false; //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); @@ -1170,19 +1159,18 @@ namespace OpenSim.Region.Environment.Scenes // Is a sit target available? Vector3 avSitOffSet = part.SitTargetPosition; Quaternion avSitOrientation = part.SitTargetOrientation; - LLUUID avOnTargetAlready = part.GetAvatarOnSitTarget(); + UUID avOnTargetAlready = part.GetAvatarOnSitTarget(); - bool SitTargetUnOccupied = (!(avOnTargetAlready != LLUUID.Zero)); + bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero)); bool SitTargetisSet = - (!(avSitOffSet.x == 0 && avSitOffSet.y == 0 && avSitOffSet.z == 0 && avSitOrientation.w == 0 && - avSitOrientation.x == 0 && avSitOrientation.y == 0 && avSitOrientation.z == 1)); + (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && avSitOrientation.W == 0f && + avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f)); if (SitTargetisSet && SitTargetUnOccupied) { part.SetAvatarOnSitTarget(UUID); - offset = new LLVector3(avSitOffSet.x, avSitOffSet.y, avSitOffSet.z); - sitOrientation = - new LLQuaternion(avSitOrientation.x, avSitOrientation.y, avSitOrientation.z, avSitOrientation.w); + offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); + sitOrientation = avSitOrientation; autopilot = false; } @@ -1205,7 +1193,7 @@ namespace OpenSim.Region.Environment.Scenes autopilot = false; RemoveFromPhysicalScene(); - AbsolutePosition = pos + new LLVector3(0.0f, 0.0f, m_sitAvatarHeight); + AbsolutePosition = pos + new Vector3(0.0f, 0.0f, m_sitAvatarHeight); } } else @@ -1232,7 +1220,7 @@ namespace OpenSim.Region.Environment.Scenes HandleAgentSit(remoteClient, UUID); } - public void HandleAgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset) + public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset) { if (m_parentID != 0) { @@ -1254,7 +1242,7 @@ namespace OpenSim.Region.Environment.Scenes SendSitResponse(remoteClient, targetID, offset); } - public void HandleAgentSit(IClientAPI remoteClient, LLUUID agentID) + public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) { SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); @@ -1267,12 +1255,12 @@ namespace OpenSim.Region.Environment.Scenes Vector3 sitTargetPos = part.SitTargetPosition; Quaternion sitTargetOrient = part.SitTargetOrientation; - //Quaternion vq = new Quaternion(sitTargetPos.x, sitTargetPos.y+0.2f, sitTargetPos.z+0.2f, 0); - //Quaternion nq = new Quaternion(sitTargetOrient.w, -sitTargetOrient.x, -sitTargetOrient.y, -sitTargetOrient.z); + //Quaternion vq = new Quaternion(sitTargetPos.X, sitTargetPos.Y+0.2f, sitTargetPos.Z+0.2f, 0); + //Quaternion nq = new Quaternion(-sitTargetOrient.X, -sitTargetOrient.Y, -sitTargetOrient.Z, sitTargetOrient.w); //Quaternion result = (sitTargetOrient * vq) * nq; - m_pos = new LLVector3(sitTargetPos.x, sitTargetPos.y, sitTargetPos.z); + m_pos = new Vector3(sitTargetPos.X, sitTargetPos.Y, sitTargetPos.Z); m_pos += m_sitTargetCorrectionOffset; m_bodyRot = sitTargetOrient; //Rotation = sitTargetOrient; @@ -1293,7 +1281,7 @@ namespace OpenSim.Region.Environment.Scenes } m_parentID = m_requestedSitTargetID; - Velocity = new LLVector3(0, 0, 0); + Velocity = new Vector3(0, 0, 0); RemoveFromPhysicalScene(); TrySetMovementAnimation("SIT"); @@ -1317,7 +1305,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void AddAnimation(LLUUID animID) + public void AddAnimation(UUID animID) { if (m_isChildAgent) return; @@ -1333,14 +1321,14 @@ namespace OpenSim.Region.Environment.Scenes if (m_isChildAgent) return; - LLUUID animID = m_controllingClient.GetDefaultAnimation(name); - if (animID == LLUUID.Zero) + UUID animID = m_controllingClient.GetDefaultAnimation(name); + if (animID == UUID.Zero) return; AddAnimation(animID); } - public void RemoveAnimation(LLUUID animID) + public void RemoveAnimation(UUID animID) { if (m_isChildAgent) return; @@ -1356,27 +1344,27 @@ namespace OpenSim.Region.Environment.Scenes if (m_isChildAgent) return; - LLUUID animID = m_controllingClient.GetDefaultAnimation(name); - if (animID == LLUUID.Zero) + UUID animID = m_controllingClient.GetDefaultAnimation(name); + if (animID == UUID.Zero) return; RemoveAnimation(animID); } - public LLUUID[] GetAnimationArray() + public UUID[] GetAnimationArray() { - LLUUID[] animIDs; + UUID[] animIDs; int[] sequenceNums; m_animations.GetArrays( out animIDs, out sequenceNums ); return animIDs; } - public void HandleStartAnim(IClientAPI remoteClient, LLUUID animID) + public void HandleStartAnim(IClientAPI remoteClient, UUID animID) { AddAnimation(animID); } - public void HandleStopAnim(IClientAPI remoteClient, LLUUID animID) + public void HandleStopAnim(IClientAPI remoteClient, UUID animID) { RemoveAnimation(animID); } @@ -1385,7 +1373,7 @@ namespace OpenSim.Region.Environment.Scenes /// The movement animation is reserved for "main" animations /// that are mutually exclusive, e.g. flying and sitting. /// - protected void SetMovementAnimation(LLUUID animID) + protected void SetMovementAnimation(UUID animID) { if (m_animations.SetDefaultAnimation(animID, m_controllingClient.NextAnimationSequenceNumber)) { @@ -1494,10 +1482,10 @@ namespace OpenSim.Region.Environment.Scenes m_rotation = rotation; NewForce newVelocity = new NewForce(); - Vector3 direc = rotation*vec; + Vector3 direc = vec * rotation; direc.Normalize(); - direc *= 0.03f*128f; + direc *= 0.03f * 128f; if (m_physicsActor.Flying) { direc *= 4; @@ -1517,9 +1505,9 @@ namespace OpenSim.Region.Environment.Scenes { if (!m_physicsActor.Flying && m_physicsActor.IsColliding) { - if (direc.z > 2.0f) + if (direc.Z > 2.0f) { - direc.z *= 3; + direc.Z *= 3; // TODO: PreJump and jump happen too quickly. Many times prejump gets ignored. TrySetMovementAnimation("PREJUMP"); @@ -1528,9 +1516,9 @@ namespace OpenSim.Region.Environment.Scenes } } - newVelocity.X = direc.x; - newVelocity.Y = direc.y; - newVelocity.Z = direc.z; + newVelocity.X = direc.X; + newVelocity.Y = direc.Y; + newVelocity.Z = direc.Z; m_forcesList.Add(newVelocity); m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); @@ -1595,11 +1583,11 @@ namespace OpenSim.Region.Environment.Scenes { m_perfMonMS = System.Environment.TickCount; - LLVector3 pos = m_pos; - LLVector3 vel = Velocity; - LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); - remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new LLVector3(pos.X, pos.Y, pos.Z), - new LLVector3(vel.X, vel.Y, vel.Z), rot); + Vector3 pos = m_pos; + Vector3 vel = Velocity; + Quaternion rot = m_bodyRot; + remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z), + new Vector3(vel.X, vel.Y, vel.Z), rot); m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); m_scene.AddAgentUpdates(1); @@ -1625,7 +1613,7 @@ namespace OpenSim.Region.Environment.Scenes { m_perfMonMS = System.Environment.TickCount; - List CoarseLocations = new List(); + List CoarseLocations = new List(); List avatars = m_scene.GetAvatars(); for (int i = 0; i < avatars.Count; i++) { @@ -1660,8 +1648,8 @@ namespace OpenSim.Region.Environment.Scenes if (m_appearance.Texture == null) return; - // Note: because LLQuaternion is a struct, it can't be null - LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); + // Note: because Quaternion is a struct, it can't be null + Quaternion rot = m_bodyRot; remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId, m_pos, m_appearance.Texture.ToBytes(), @@ -1723,8 +1711,8 @@ namespace OpenSim.Region.Environment.Scenes // Needed for standalone m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); - // Note: because LLQuaternion is a struct, it can't be null - LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); + // Note: because Quaternion is a struct, it can't be null + Quaternion rot = m_bodyRot; m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId, m_pos, m_appearance.Texture.ToBytes(), m_parentID, rot); @@ -1813,7 +1801,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SendAnimPack(LLUUID[] animations, int[] seqs) + public void SendAnimPack(UUID[] animations, int[] seqs) { if (m_isChildAgent) return; @@ -1826,7 +1814,7 @@ namespace OpenSim.Region.Environment.Scenes { if (m_isChildAgent) return; - LLUUID[] animIDs; + UUID[] animIDs; int[] sequenceNums; m_animations.GetArrays(out animIDs, out sequenceNums); @@ -1842,7 +1830,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_isChildAgent) return; - LLUUID[] animIDs; + UUID[] animIDs; int[] sequenceNums; m_animations.GetArrays(out animIDs, out sequenceNums); @@ -1870,16 +1858,16 @@ namespace OpenSim.Region.Environment.Scenes if (Util.GetDistanceTo(AbsolutePosition,m_LastChildAgentUpdatePosition) > 32) { ChildAgentDataUpdate cadu = new ChildAgentDataUpdate(); - cadu.ActiveGroupID=LLUUID.Zero.UUID; - cadu.AgentID = UUID.UUID; + cadu.ActiveGroupID = UUID.Zero.Guid; + cadu.AgentID = UUID.Guid; cadu.alwaysrun = m_setAlwaysRun; cadu.AVHeight = m_avHeight; - LLVector3 tempCameraCenter = new LLVector3(m_CameraCenter.x, m_CameraCenter.y, m_CameraCenter.z); - cadu.cameraPosition = new sLLVector3(tempCameraCenter); + Vector3 tempCameraCenter = new Vector3(m_CameraCenter.X, m_CameraCenter.Y, m_CameraCenter.Z); + cadu.cameraPosition = tempCameraCenter; cadu.drawdistance = m_DrawDistance; cadu.godlevel = m_godlevel; cadu.GroupAccess = 0; - cadu.Position = new sLLVector3(AbsolutePosition); + cadu.Position = AbsolutePosition; cadu.regionHandle = m_scene.RegionInfo.RegionHandle; float multiplier = 1; int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); @@ -1899,7 +1887,7 @@ namespace OpenSim.Region.Environment.Scenes - cadu.Velocity = new sLLVector3(Velocity); + cadu.Velocity = Velocity; m_scene.SendOutChildAgentUpdates(cadu,this); m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y; @@ -1919,8 +1907,8 @@ namespace OpenSim.Region.Environment.Scenes if (IsChildAgent) return; - LLVector3 pos2 = AbsolutePosition; - LLVector3 vel = Velocity; + Vector3 pos2 = AbsolutePosition; + Vector3 vel = Velocity; float timeStep = 0.1f; pos2.X = pos2.X + (vel.X*timeStep); @@ -1946,8 +1934,8 @@ namespace OpenSim.Region.Environment.Scenes /// protected void CrossToNewRegion() { - LLVector3 pos = AbsolutePosition; - LLVector3 newpos = new LLVector3(pos.X, pos.Y, pos.Z); + Vector3 pos = AbsolutePosition; + Vector3 newpos = new Vector3(pos.X, pos.Y, pos.Z); uint neighbourx = m_regionInfo.RegionLocX; uint neighboury = m_regionInfo.RegionLocY; @@ -1979,7 +1967,7 @@ namespace OpenSim.Region.Environment.Scenes newpos.Y = enterDistance; } - LLVector3 vel = m_velocity; + Vector3 vel = m_velocity; ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); if (neighbourRegion != null && ValidateAttachments()) @@ -2023,7 +2011,7 @@ namespace OpenSim.Region.Environment.Scenes CrossAttachmentsIntoNewRegion(neighbourHandle); - m_scene.SendKillObject(m_localId); + m_scene.SendKiPrimitive(m_localId); m_scene.NotifyMyCoarseLocationChange(); // the user may change their profile information in other region, @@ -2047,7 +2035,7 @@ namespace OpenSim.Region.Environment.Scenes /// This allows the Sim owner the abiility to kick users from their sim currently. /// It tells the client that the agent has permission to do so. /// - public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token, bool godStatus) + public void GrantGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godStatus) { if (godStatus) { @@ -2082,11 +2070,11 @@ namespace OpenSim.Region.Environment.Scenes int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; m_DrawDistance = cAgentData.drawdistance; - m_pos = new LLVector3(cAgentData.Position.x + shiftx, cAgentData.Position.y + shifty, cAgentData.Position.z); + m_pos = new Vector3(cAgentData.Position.X + shiftx, cAgentData.Position.Y + shifty, cAgentData.Position.Z); // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region m_CameraCenter = - new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); + new Vector3(cAgentData.cameraPosition.X, cAgentData.cameraPosition.Y, cAgentData.cameraPosition.Z); m_godlevel = cAgentData.godlevel; @@ -2147,7 +2135,7 @@ namespace OpenSim.Region.Environment.Scenes static ScenePresence() { - LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); + Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); DefaultTexture = textu.ToBytes(); } @@ -2166,13 +2154,13 @@ namespace OpenSim.Region.Environment.Scenes [Serializable] public class ScenePartUpdate : ISerializable { - public LLUUID FullID; + public UUID FullID; public uint LastFullUpdateTime; public uint LastTerseUpdateTime; public ScenePartUpdate() { - FullID = LLUUID.Zero; + FullID = UUID.Zero; LastFullUpdateTime = 0; LastTerseUpdateTime = 0; } @@ -2186,7 +2174,7 @@ namespace OpenSim.Region.Environment.Scenes throw new ArgumentNullException("info"); } - FullID = new LLUUID((Guid)info.GetValue("FullID", typeof(Guid))); + FullID = new UUID((Guid)info.GetValue("FullID", typeof(Guid))); LastFullUpdateTime = (uint)info.GetValue("LastFullUpdateTime", typeof(uint)); LastTerseUpdateTime = (uint)info.GetValue("LastTerseUpdateTime", typeof(uint)); @@ -2203,7 +2191,7 @@ namespace OpenSim.Region.Environment.Scenes throw new ArgumentNullException("info"); } - info.AddValue("FullID", FullID.UUID); + info.AddValue("FullID", FullID.Guid); info.AddValue("LastFullUpdateTime", LastFullUpdateTime); info.AddValue("LastTerseUpdateTime", LastTerseUpdateTime); } @@ -2333,7 +2321,7 @@ namespace OpenSim.Region.Environment.Scenes */ if (DefaultTexture == null) { - LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); + Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); DefaultTexture = textu.ToBytes(); } } @@ -2421,8 +2409,8 @@ namespace OpenSim.Region.Environment.Scenes Animations = new AvatarAnimations(); Animations.LoadAnims(); - m_animations = new List(); - m_animations.Add(Animations.AnimsLLUUID["STAND"]); + m_animations = new List(); + m_animations.Add(Animations.AnimsUUID["STAND"]); m_animationSeqs.Add(m_controllingClient.NextAnimationSequenceNumber); SetDirectionVectors(); @@ -2447,7 +2435,7 @@ namespace OpenSim.Region.Environment.Scenes */ if (DefaultTexture == null) { - LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); + Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); DefaultTexture = textu.ToBytes(); } @@ -2459,7 +2447,7 @@ namespace OpenSim.Region.Environment.Scenes m_requestedSitTargetID = (uint)info.GetValue("m_requestedSitTargetID", typeof(uint)); m_requestedSitOffset - = new LLVector3( + = new Vector3( (float)info.GetValue("m_requestedSitOffset.X", typeof(float)), (float)info.GetValue("m_requestedSitOffset.Y", typeof(float)), (float)info.GetValue("m_requestedSitOffset.Z", typeof(float))); @@ -2470,10 +2458,10 @@ namespace OpenSim.Region.Environment.Scenes m_bodyRot = new Quaternion( - (float)info.GetValue("m_bodyRot.w", typeof(float)), - (float)info.GetValue("m_bodyRot.x", typeof(float)), - (float)info.GetValue("m_bodyRot.y", typeof(float)), - (float)info.GetValue("m_bodyRot.z", typeof(float))); + (float)info.GetValue("m_bodyRot.X", typeof(float)), + (float)info.GetValue("m_bodyRot.Y", typeof(float)), + (float)info.GetValue("m_bodyRot.Z", typeof(float)), + (float)info.GetValue("m_bodyRot.W", typeof(float))); IsRestrictedToRegion = (bool)info.GetValue("IsRestrictedToRegion", typeof(bool)); m_newForce = (bool)info.GetValue("m_newForce", typeof(bool)); @@ -2493,7 +2481,7 @@ namespace OpenSim.Region.Environment.Scenes Dir_Vectors = Dir_Vectors_work2.ToArray(); lastPhysPos - = new LLVector3( + = new Vector3( (float)info.GetValue("lastPhysPos.X", typeof(float)), (float)info.GetValue("lastPhysPos.Y", typeof(float)), (float)info.GetValue("lastPhysPos.Z", typeof(float))); @@ -2527,7 +2515,7 @@ namespace OpenSim.Region.Environment.Scenes m_knownChildRegions = (List)info.GetValue("m_knownChildRegions", typeof(List)); posLastSignificantMove - = new LLVector3( + = new Vector3( (float)info.GetValue("posLastSignificantMove.X", typeof(float)), (float)info.GetValue("posLastSignificantMove.Y", typeof(float)), (float)info.GetValue("posLastSignificantMove.Z", typeof(float))); @@ -2540,14 +2528,14 @@ namespace OpenSim.Region.Environment.Scenes foreach (Guid id in updateTimes_work.Keys) { - m_updateTimes.Add(new LLUUID(id), updateTimes_work[id]); + m_updateTimes.Add(new UUID(id), updateTimes_work[id]); } */ m_regionHandle = (ulong)info.GetValue("m_regionHandle", typeof(ulong)); m_firstname = (string)info.GetValue("m_firstname", typeof(string)); m_lastname = (string)info.GetValue("m_lastname", typeof(string)); m_allowMovement = (bool)info.GetValue("m_allowMovement", typeof(bool)); - m_parentPosition = new LLVector3((float)info.GetValue("m_parentPosition.X", typeof(float)), + m_parentPosition = new Vector3((float)info.GetValue("m_parentPosition.X", typeof(float)), (float)info.GetValue("m_parentPosition.Y", typeof(float)), (float)info.GetValue("m_parentPosition.Z", typeof(float))); @@ -2555,7 +2543,7 @@ namespace OpenSim.Region.Environment.Scenes m_parentID = (uint)info.GetValue("m_parentID", typeof(uint)); // for OpenSim_v0.5 - currentParcelUUID = new LLUUID((Guid)info.GetValue("currentParcelUUID", typeof(Guid))); + currentParcelUUID = new UUID((Guid)info.GetValue("currentParcelUUID", typeof(Guid))); lastKnownAllowedPosition = new Vector3( @@ -2566,7 +2554,7 @@ namespace OpenSim.Region.Environment.Scenes sentMessageAboutRestrictedParcelFlyingDown = (bool)info.GetValue("sentMessageAboutRestrictedParcelFlyingDown", typeof(bool)); m_LastChildAgentUpdatePosition - = new LLVector3( + = new Vector3( (float)info.GetValue("m_LastChildAgentUpdatePosition.X", typeof(float)), (float)info.GetValue("m_LastChildAgentUpdatePosition.Y", typeof(float)), (float)info.GetValue("m_LastChildAgentUpdatePosition.Z", typeof(float))); @@ -2575,11 +2563,11 @@ namespace OpenSim.Region.Environment.Scenes m_AgentControlFlags = (uint)info.GetValue("m_AgentControlFlags", typeof(uint)); m_headrotation - = new LLQuaternion( - (float)info.GetValue("m_headrotation.W", typeof(float)), + = new Quaternion( (float)info.GetValue("m_headrotation.X", typeof(float)), (float)info.GetValue("m_headrotation.Y", typeof(float)), - (float)info.GetValue("m_headrotation.Z", typeof(float))); + (float)info.GetValue("m_headrotation.Z", typeof(float)), + (float)info.GetValue("m_headrotation.W", typeof(float))); m_state = (byte)info.GetValue("m_state", typeof(byte)); @@ -2605,7 +2593,7 @@ namespace OpenSim.Region.Environment.Scenes info.AddValue("m_updateCount", m_updateCount); info.AddValue("m_requestedSitTargetID", m_requestedSitTargetID); - // LLVector3 + // Vector3 info.AddValue("m_requestedSitOffset.X", m_requestedSitOffset.X); info.AddValue("m_requestedSitOffset.Y", m_requestedSitOffset.Y); info.AddValue("m_requestedSitOffset.Z", m_requestedSitOffset.Z); @@ -2615,16 +2603,16 @@ namespace OpenSim.Region.Environment.Scenes info.AddValue("m_setAlwaysRun", m_setAlwaysRun); // Quaternion - info.AddValue("m_bodyRot.w", m_bodyRot.w); - info.AddValue("m_bodyRot.x", m_bodyRot.x); - info.AddValue("m_bodyRot.y", m_bodyRot.y); - info.AddValue("m_bodyRot.z", m_bodyRot.z); + info.AddValue("m_bodyRot.X", m_bodyRot.X); + info.AddValue("m_bodyRot.Y", m_bodyRot.Y); + info.AddValue("m_bodyRot.Z", m_bodyRot.Z); + info.AddValue("m_bodyRot.W", m_bodyRot.W); info.AddValue("IsRestrictedToRegion", IsRestrictedToRegion); info.AddValue("m_newForce", m_newForce); //info.AddValue("m_newAvatar", m_newAvatar); info.AddValue("m_newCoarseLocations", m_newCoarseLocations); - info.AddValue("m_gotAllObjectsInScene", false); + info.AddValue("m_gotAPrimitivesInScene", false); info.AddValue("m_avHeight", m_avHeight); // info.AddValue("m_regionInfo", m_regionInfo); @@ -2635,41 +2623,41 @@ namespace OpenSim.Region.Environment.Scenes foreach (Vector3 v3 in Dir_Vectors) { - Dir_Vectors_work.Add(new float[] { v3.x, v3.y, v3.z }); + Dir_Vectors_work.Add(new float[] { v3.X, v3.Y, v3.Z }); } info.AddValue("Dir_Vectors", Dir_Vectors_work); - // LLVector3 + // Vector3 info.AddValue("lastPhysPos.X", lastPhysPos.X); info.AddValue("lastPhysPos.Y", lastPhysPos.Y); info.AddValue("lastPhysPos.Z", lastPhysPos.Z); // Vector3 - info.AddValue("m_CameraCenter.X", m_CameraCenter.x); - info.AddValue("m_CameraCenter.Y", m_CameraCenter.y); - info.AddValue("m_CameraCenter.Z", m_CameraCenter.z); + info.AddValue("m_CameraCenter.X", m_CameraCenter.X); + info.AddValue("m_CameraCenter.Y", m_CameraCenter.Y); + info.AddValue("m_CameraCenter.Z", m_CameraCenter.Z); // Vector3 - info.AddValue("m_CameraAtAxis.X", m_CameraAtAxis.x); - info.AddValue("m_CameraAtAxis.Y", m_CameraAtAxis.y); - info.AddValue("m_CameraAtAxis.Z", m_CameraAtAxis.z); + info.AddValue("m_CameraAtAxis.X", m_CameraAtAxis.X); + info.AddValue("m_CameraAtAxis.Y", m_CameraAtAxis.Y); + info.AddValue("m_CameraAtAxis.Z", m_CameraAtAxis.Z); // Vector3 - info.AddValue("m_CameraLeftAxis.X", m_CameraLeftAxis.x); - info.AddValue("m_CameraLeftAxis.Y", m_CameraLeftAxis.y); - info.AddValue("m_CameraLeftAxis.Z", m_CameraLeftAxis.z); + info.AddValue("m_CameraLeftAxis.X", m_CameraLeftAxis.X); + info.AddValue("m_CameraLeftAxis.Y", m_CameraLeftAxis.Y); + info.AddValue("m_CameraLeftAxis.Z", m_CameraLeftAxis.Z); // Vector3 - info.AddValue("m_CameraUpAxis.X", m_CameraUpAxis.x); - info.AddValue("m_CameraUpAxis.Y", m_CameraUpAxis.y); - info.AddValue("m_CameraUpAxis.Z", m_CameraUpAxis.z); + info.AddValue("m_CameraUpAxis.X", m_CameraUpAxis.X); + info.AddValue("m_CameraUpAxis.Y", m_CameraUpAxis.Y); + info.AddValue("m_CameraUpAxis.Z", m_CameraUpAxis.Z); info.AddValue("m_DrawDistance", m_DrawDistance); info.AddValue("m_appearance", m_appearance); info.AddValue("m_knownChildRegions", m_knownChildRegions); - // LLVector3 + // Vector3 info.AddValue("posLastSignificantMove.X", posLastSignificantMove.X); info.AddValue("posLastSignificantMove.Y", posLastSignificantMove.Y); info.AddValue("posLastSignificantMove.Z", posLastSignificantMove.Z); @@ -2679,7 +2667,7 @@ namespace OpenSim.Region.Environment.Scenes /* Dictionary updateTimes_work = new Dictionary(); - foreach (LLUUID id in m_updateTimes.Keys) + foreach (UUID id in m_updateTimes.Keys) { updateTimes_work.Add(id.UUID, m_updateTimes[id]); } @@ -2699,11 +2687,11 @@ namespace OpenSim.Region.Environment.Scenes info.AddValue("m_parentID", m_parentID); // for OpenSim_v0.5 - info.AddValue("currentParcelUUID", currentParcelUUID.UUID); + info.AddValue("currentParcelUUID", currentParcelUUID.Guid); - info.AddValue("lastKnownAllowedPosition.X", lastKnownAllowedPosition.x); - info.AddValue("lastKnownAllowedPosition.Y", lastKnownAllowedPosition.y); - info.AddValue("lastKnownAllowedPosition.Z", lastKnownAllowedPosition.z); + info.AddValue("lastKnownAllowedPosition.X", lastKnownAllowedPosition.X); + info.AddValue("lastKnownAllowedPosition.Y", lastKnownAllowedPosition.Y); + info.AddValue("lastKnownAllowedPosition.Z", lastKnownAllowedPosition.Z); info.AddValue("sentMessageAboutRestrictedParcelFlyingDown", sentMessageAboutRestrictedParcelFlyingDown); @@ -2734,13 +2722,13 @@ namespace OpenSim.Region.Environment.Scenes } } - public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, LLUUID Script_item_LLUUID) + public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, UUID Script_item_UUID) { ScriptControllers obj = new ScriptControllers(); obj.ignoreControls = ScriptControlled.CONTROL_ZERO; obj.eventControls = ScriptControlled.CONTROL_ZERO; - obj.itemID = Script_item_LLUUID; + obj.itemID = Script_item_UUID; obj.objID = Obj_localID; if (pass_on == 0 && accept == 0) { @@ -2766,27 +2754,27 @@ namespace OpenSim.Region.Environment.Scenes if (pass_on == 1 && accept == 0) { IgnoredControls &= ~(ScriptControlled)controls; - if (scriptedcontrols.ContainsKey(Script_item_LLUUID)) - scriptedcontrols.Remove(Script_item_LLUUID); + if (scriptedcontrols.ContainsKey(Script_item_UUID)) + scriptedcontrols.Remove(Script_item_UUID); } else { - if (scriptedcontrols.ContainsKey(Script_item_LLUUID)) + if (scriptedcontrols.ContainsKey(Script_item_UUID)) { - scriptedcontrols[Script_item_LLUUID] = obj; + scriptedcontrols[Script_item_UUID] = obj; } else { - scriptedcontrols.Add(Script_item_LLUUID, obj); + scriptedcontrols.Add(Script_item_UUID, obj); } } } ControllingClient.SendTakeControls(controls, pass_on == 1 ? true : false, true); } - public void HandleForceReleaseControls(IClientAPI remoteClient, LLUUID agentID) + public void HandleForceReleaseControls(IClientAPI remoteClient, UUID agentID) { IgnoredControls = ScriptControlled.CONTROL_ZERO; lock (scriptedcontrols) @@ -2796,13 +2784,13 @@ namespace OpenSim.Region.Environment.Scenes ControllingClient.SendTakeControls(int.MaxValue, false, false); } - public void UnRegisterControlEventsToScript(uint Obj_localID, LLUUID Script_item_LLUUID) + public void UnRegisterControlEventsToScript(uint Obj_localID, UUID Script_item_UUID) { lock (scriptedcontrols) { - if (scriptedcontrols.ContainsKey(Script_item_LLUUID)) + if (scriptedcontrols.ContainsKey(Script_item_UUID)) { - scriptedcontrols.Remove(Script_item_LLUUID); + scriptedcontrols.Remove(Script_item_UUID); IgnoredControls = ScriptControlled.CONTROL_ZERO; foreach (ScriptControllers scData in scriptedcontrols.Values) { @@ -2864,7 +2852,7 @@ namespace OpenSim.Region.Environment.Scenes { lock (scriptedcontrols) { - foreach (LLUUID scriptUUID in scriptedcontrols.Keys) + foreach (UUID scriptUUID in scriptedcontrols.Keys) { ScriptControllers scriptControlData = scriptedcontrols[scriptUUID]; ScriptControlled localHeld = allflags & scriptControlData.eventControls; // the flags interesting for us @@ -2916,14 +2904,14 @@ namespace OpenSim.Region.Environment.Scenes return flags; } - private void ItemReceived(LLUUID itemID) + private void ItemReceived(UUID itemID) { int attachpoint = m_appearance.GetAttachpoint(itemID); if (attachpoint == 0) return; - LLUUID asset = m_appearance.GetAttachedAsset(attachpoint); - if (asset == LLUUID.Zero) // We have just logged in + UUID asset = m_appearance.GetAttachedAsset(attachpoint); + if (asset == UUID.Zero) // We have just logged in { m_log.InfoFormat("[ATTACHMENT] Rez attachment {0}", itemID.ToString()); @@ -2947,7 +2935,7 @@ namespace OpenSim.Region.Environment.Scenes // Attach from world, if not already attached if (att.ParentGroup != null && !att.IsAttachment) - m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, LLVector3.Zero); + m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, Vector3.Zero); } } } diff --git a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs index dbe2516..152825f 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs @@ -25,8 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using Axiom.Math; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Scenes.Scripting { @@ -35,10 +34,10 @@ namespace OpenSim.Region.Environment.Scenes.Scripting string Name { get; set; } string Description { get; set; } - LLUUID UUID { get; } - LLUUID ObjectOwner { get; } - LLUUID ObjectCreator { get; } - LLVector3 AbsolutePosition { get; } + UUID UUID { get; } + UUID ObjectOwner { get; } + UUID ObjectCreator { get; } + Vector3 AbsolutePosition { get; } string SitName { get; set; } string TouchName { get; set; } diff --git a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs index 4b1b56a..37f5d43 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs @@ -26,14 +26,13 @@ */ using System; -using Axiom.Math; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Scenes.Scripting { public class NullScriptHost : IScriptHost { - private LLVector3 m_pos = new LLVector3(128, 128, 30); + private Vector3 m_pos = new Vector3(128, 128, 30); public string Name { @@ -59,22 +58,22 @@ namespace OpenSim.Region.Environment.Scenes.Scripting set { } } - public LLUUID UUID + public UUID UUID { - get { return LLUUID.Zero; } + get { return UUID.Zero; } } - public LLUUID ObjectOwner + public UUID ObjectOwner { - get { return LLUUID.Zero; } + get { return UUID.Zero; } } - public LLUUID ObjectCreator + public UUID ObjectCreator { - get { return LLUUID.Zero; } + get { return UUID.Zero; } } - public LLVector3 AbsolutePosition + public Vector3 AbsolutePosition { get { return m_pos; } } diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index 0e551cb..5f0f316 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs @@ -27,7 +27,7 @@ using System; using System.Timers; -using libsecondlife.Packets; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Framework.Statistics; using OpenSim.Region.Environment.Interfaces; diff --git a/OpenSim/Region/Environment/Scenes/UndoState.cs b/OpenSim/Region/Environment/Scenes/UndoState.cs index fdbfa8c..d828d8d 100644 --- a/OpenSim/Region/Environment/Scenes/UndoState.cs +++ b/OpenSim/Region/Environment/Scenes/UndoState.cs @@ -25,17 +25,17 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Environment.Scenes { public class UndoState { - public LLVector3 Position = LLVector3.Zero; - public LLVector3 Scale = LLVector3.Zero; - public LLQuaternion Rotation = LLQuaternion.Identity; + public Vector3 Position = Vector3.Zero; + public Vector3 Scale = Vector3.Zero; + public Quaternion Rotation = Quaternion.Identity; - public UndoState(LLVector3 pos, LLQuaternion rot, LLVector3 scale) + public UndoState(Vector3 pos, Quaternion rot, Vector3 scale) { Position = pos; Rotation = rot; diff --git a/OpenSim/Region/Environment/Types/UpdateQueue.cs b/OpenSim/Region/Environment/Types/UpdateQueue.cs index e9133ac..0c86df2 100644 --- a/OpenSim/Region/Environment/Types/UpdateQueue.cs +++ b/OpenSim/Region/Environment/Types/UpdateQueue.cs @@ -29,7 +29,7 @@ using System; using System.Collections.Generic; using System.Runtime.Serialization; using System.Security.Permissions; -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.Environment.Scenes; namespace OpenSim.Region.Environment.Types @@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Types { private Queue m_queue; - private List m_ids; + private List m_ids; private object m_syncObject = new object(); @@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Types public UpdateQueue() { m_queue = new Queue(); - m_ids = new List(); + m_ids = new List(); } public void Clear() @@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Types foreach (Guid guid in ids_work) { - m_ids.Add(new LLUUID(guid)); + m_ids.Add(new UUID(guid)); } //System.Console.WriteLine("UpdateQueue Deserialize END"); @@ -122,9 +122,9 @@ namespace OpenSim.Region.Environment.Types List ids_work = new List(); - foreach (LLUUID uuid in m_ids) + foreach (UUID uuid in m_ids) { - ids_work.Add(uuid.UUID); + ids_work.Add(uuid.Guid); } info.AddValue("m_queue", m_queue); diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index 16636e0..c8c4624 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; @@ -33,7 +33,7 @@ namespace OpenSim.Region.Examples.SimpleModule { public class ComplexObject : SceneObjectGroup { - private readonly LLQuaternion m_rotationDirection; + private readonly Quaternion m_rotationDirection; protected override bool InSceneBackup { @@ -45,21 +45,21 @@ namespace OpenSim.Region.Examples.SimpleModule private class RotatingWheel : SceneObjectPart { - private readonly LLQuaternion m_rotationDirection; + private readonly Quaternion m_rotationDirection; public RotatingWheel() { } - public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, - LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection) + public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, UUID ownerID, uint localID, + Vector3 groupPosition, Vector3 offsetPosition, Quaternion rotationDirection) : base( regionHandle, parent, ownerID, localID, PrimitiveBaseShape.Default, groupPosition, offsetPosition ) { m_rotationDirection = rotationDirection; - Flags |= LLObject.ObjectFlags.Touch; + Flags |= PrimFlags.Touch; } public override void UpdateMovement() @@ -79,55 +79,55 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) + public ComplexObject(Scene scene, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos) : base(scene, regionHandle, ownerID, localID, pos, PrimitiveBaseShape.Default) { - m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f); + m_rotationDirection = new Quaternion(0.05f, 0.1f, 0.15f); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 0.75f), - new LLQuaternion(0.05f, 0, 0))); + new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0, 0.75f), + new Quaternion(0.05f, 0, 0))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -0.75f), - new LLQuaternion(-0.05f, 0, 0))); + new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0, -0.75f), + new Quaternion(-0.05f, 0, 0))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0.75f, 0), - new LLQuaternion(0.5f, 0, 0.05f))); + new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0.75f, 0), + new Quaternion(0.5f, 0, 0.05f))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, -0.75f, 0), - new LLQuaternion(-0.5f, 0, -0.05f))); + new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, -0.75f, 0), + new Quaternion(-0.5f, 0, -0.05f))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0.75f, 0, 0), - new LLQuaternion(0, 0.5f, 0.05f))); + new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0.75f, 0, 0), + new Quaternion(0, 0.5f, 0.05f))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(-0.75f, 0, 0), - new LLQuaternion(0, -0.5f, -0.05f))); + new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(-0.75f, 0, 0), + new Quaternion(0, -0.5f, -0.05f))); - RootPart.Flags |= LLObject.ObjectFlags.Touch; + RootPart.Flags |= PrimFlags.Touch; UpdateParentIDs(); } - public override void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient) + public override void OnGrabPart(SceneObjectPart part, Vector3 offsetPos, IClientAPI remoteClient) { m_parts.Remove(part.UUID); - remoteClient.SendKillObject(m_regionHandle, part.LocalId); + remoteClient.SendKiPrimitive(m_regionHandle, part.LocalId); remoteClient.AddMoney(1); - remoteClient.SendChatMessage("Poof!", 1, AbsolutePosition, "Party Party", LLUUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); + remoteClient.SendChatMessage("Poof!", 1, AbsolutePosition, "Party Party", UUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); } - public override void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) + public override void OnGrabGroup(Vector3 offsetPos, IClientAPI remoteClient) { if (m_parts.Count == 1) { m_parts.Remove(m_rootPart.UUID); m_scene.DeleteSceneObject(this); - remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId); + remoteClient.SendKiPrimitive(m_regionHandle, m_rootPart.LocalId); remoteClient.AddMoney(50); - remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); + remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", UUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); } } } diff --git a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs index e7d5db8..126ccd3 100644 --- a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs @@ -27,7 +27,7 @@ using System; using System.Diagnostics; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; @@ -45,7 +45,7 @@ namespace OpenSim.Region.Examples.SimpleModule private PerformanceCounter m_counter; - public CpuCounterObject(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) + public CpuCounterObject(Scene world, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos) : base(world, regionHandle, ownerID, localID, pos, PrimitiveBaseShape.Default) { String objectName = "Processor"; @@ -58,7 +58,7 @@ namespace OpenSim.Region.Examples.SimpleModule public override void UpdateMovement() { float cpu = m_counter.NextValue()/40f; - LLVector3 size = new LLVector3(cpu, cpu, cpu); + Vector3 size = new Vector3(cpu, cpu, cpu); RootPart.Resize(size); diff --git a/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs b/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs index 34ed086..3b43c7a 100644 --- a/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs @@ -26,7 +26,7 @@ */ using System.IO; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; @@ -34,8 +34,8 @@ namespace OpenSim.Region.Examples.SimpleModule { public class FileSystemObject : SceneObjectGroup { - public FileSystemObject(Scene world, FileInfo fileInfo, LLVector3 pos) - : base(world, world.RegionInfo.RegionHandle, LLUUID.Zero, world.NextLocalId, pos, PrimitiveBaseShape.Default) + public FileSystemObject(Scene world, FileInfo fileInfo, Vector3 pos) + : base(world, world.RegionInfo.RegionHandle, UUID.Zero, world.NextLocalId, pos, PrimitiveBaseShape.Default) { Text = fileInfo.Name; } diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 3ea518f..8f579bd 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.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,7 +39,7 @@ namespace OpenSim.Region.Examples.SimpleModule { private uint movementFlag = 0; private short flyState = 0; - private LLQuaternion bodyDirection = LLQuaternion.Identity; + private Quaternion bodyDirection = Quaternion.Identity; private short count = 0; private short frame = 0; private Scene m_scene; @@ -117,7 +117,7 @@ namespace OpenSim.Region.Examples.SimpleModule 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; @@ -216,37 +216,37 @@ namespace OpenSim.Region.Examples.SimpleModule #pragma warning restore 67 - private LLUUID myID = LLUUID.Random(); + private UUID myID = UUID.Random(); public MyNpcCharacter(Scene scene) { - // startPos = new LLVector3(128, (float)(Util.RandomClass.NextDouble()*100), 2); + // startPos = new Vector3(128, (float)(Util.RandomClass.NextDouble()*100), 2); m_scene = scene; m_scene.EventManager.OnFrame += Update; } - private LLVector3 startPos = new LLVector3(128, 128, 2); + private Vector3 startPos = new Vector3(128, 128, 2); - public virtual LLVector3 StartPos + public virtual Vector3 StartPos { get { return startPos; } set { } } - public virtual LLUUID AgentId + public virtual UUID AgentId { get { return myID; } } - 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 @@ -272,9 +272,9 @@ namespace OpenSim.Region.Examples.SimpleModule set { } } - public LLUUID ActiveGroupId + public UUID ActiveGroupId { - get { return LLUUID.Zero; } + get { return UUID.Zero; } } public string ActiveGroupName @@ -287,10 +287,10 @@ namespace OpenSim.Region.Examples.SimpleModule get { return 0; } } - public ulong GetGroupPowers(LLUUID groupID) - { - return 0; - } + public ulong GetGroupPowers(UUID groupID) + { + return 0; + } public virtual int NextAnimationSequenceNumber { @@ -307,7 +307,7 @@ namespace OpenSim.Region.Examples.SimpleModule set { } } - public virtual void ActivateGesture(LLUUID assetId, LLUUID gestureId) + public virtual void ActivateGesture(UUID assetId, UUID gestureId) { } @@ -320,7 +320,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) + public virtual void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) { } @@ -336,12 +336,12 @@ namespace OpenSim.Region.Examples.SimpleModule { } - 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) { } @@ -354,27 +354,27 @@ namespace OpenSim.Region.Examples.SimpleModule } - 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) { } @@ -390,7 +390,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public virtual void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) + public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) { } @@ -403,7 +403,7 @@ namespace OpenSim.Region.Examples.SimpleModule 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) { } @@ -412,7 +412,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public virtual void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) + public virtual void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags) { } @@ -429,66 +429,66 @@ namespace OpenSim.Region.Examples.SimpleModule { } - 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, @@ -496,7 +496,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public virtual void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) + public virtual void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item) { } @@ -504,7 +504,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public virtual void SendRemoveInventoryItem(LLUUID itemID) + public virtual void SendRemoveInventoryItem(UUID itemID) { } @@ -513,16 +513,16 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public LLUUID GetDefaultAnimation(string name) + public UUID GetDefaultAnimation(string name) { - return LLUUID.Zero; + return UUID.Zero; } public void SendTakeControls(int controls, bool passToAgent, bool TakeControls) { } - public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) + public virtual void SendTaskInventory(UUID taskID, short serial, byte[] fileName) { } @@ -537,24 +537,24 @@ namespace OpenSim.Region.Examples.SimpleModule { } - 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) { } @@ -571,7 +571,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - 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) { } @@ -588,7 +588,7 @@ namespace OpenSim.Region.Examples.SimpleModule OnCompleteMovementToRegion(); } } - public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID) + public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) { } @@ -596,11 +596,11 @@ namespace OpenSim.Region.Examples.SimpleModule { } - 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) { } @@ -612,37 +612,37 @@ namespace OpenSim.Region.Examples.SimpleModule { } - 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) { } - 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) { } @@ -692,7 +692,7 @@ namespace OpenSim.Region.Examples.SimpleModule args.Message = "Hey You! Get out of my Home. This is my Region"; args.Channel = 0; args.From = FirstName + " " + LastName; - args.Position = new LLVector3(128, 128, 26); + args.Position = new Vector3(128, 128, 26); args.Sender = this; args.Type = ChatTypeEnum.Shout; @@ -710,7 +710,7 @@ namespace OpenSim.Region.Examples.SimpleModule 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) { } @@ -718,9 +718,9 @@ namespace OpenSim.Region.Examples.SimpleModule { } - 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) { } @@ -751,7 +751,7 @@ namespace OpenSim.Region.Examples.SimpleModule 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) { } @@ -772,41 +772,41 @@ namespace OpenSim.Region.Examples.SimpleModule { } - 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) @@ -818,13 +818,13 @@ namespace OpenSim.Region.Examples.SimpleModule } - public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, byte autoScale, string mediaType, + public void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID, byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop) { } - public void SendGroupNameReply(LLUUID groupLLUID, string GroupName) + public void SendGroupNameReply(UUID groupLLUID, string GroupName) { } @@ -832,7 +832,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public void SendScriptRunningReply(LLUUID objectID, LLUUID itemID, bool running) + public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running) { } @@ -845,19 +845,19 @@ namespace OpenSim.Region.Examples.SimpleModule } - 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/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs index 441c696..4fc0dbb 100644 --- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs +++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs @@ -27,7 +27,7 @@ using System.Collections.Generic; using System.IO; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; @@ -50,7 +50,7 @@ namespace OpenSim.Region.Examples.SimpleModule { // RegionInfo regionInfo = m_scene.RegionInfo; - // LLVector3 pos = new LLVector3(110, 129, 27); + // Vector3 pos = new Vector3(110, 129, 27); //AddCpuCounter(regionInfo, pos); // AddComplexObjects(regionInfo, pos); @@ -67,7 +67,7 @@ namespace OpenSim.Region.Examples.SimpleModule // foreach (FileInfo fileInfo in dirInfo.GetFiles()) // { - // LLVector3 filePos = new LLVector3(100 + x, 129, 27 + z); + // Vector3 filePos = new Vector3(100 + x, 129, 27 + z); // x = x + 2; // if (x > 50) // { @@ -92,29 +92,29 @@ namespace OpenSim.Region.Examples.SimpleModule foreach (ScenePresence avatar in avatars) { avatar.AbsolutePosition = - new LLVector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2); + new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2); } } - // private void AddComplexObjects(RegionInfo regionInfo, LLVector3 pos) + // private void AddComplexObjects(RegionInfo regionInfo, Vector3 pos) // { // int objs = 3; // for (int i = 0; i < (objs*objs*objs); i++) // { - // LLVector3 posOffset = new LLVector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4); + // Vector3 posOffset = new Vector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4); // ComplexObject complexObject = - // new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), + // new ComplexObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.PrimIDAllocate(), // pos + posOffset); // m_scene.AddNewSceneObject(complexObject, true); // } // } - // private void AddCpuCounter(RegionInfo regionInfo, LLVector3 pos) + // private void AddCpuCounter(RegionInfo regionInfo, Vector3 pos) // { // SceneObjectGroup sceneObject = - // new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), - // pos + new LLVector3(1f, 1f, 1f)); + // new CpuCounterObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.PrimIDAllocate(), + // pos + new Vector3(1f, 1f, 1f)); // m_scene.AddNewSceneObject(sceneObject, true); // } diff --git a/OpenSim/Region/Interfaces/IMoneyModule.cs b/OpenSim/Region/Interfaces/IMoneyModule.cs index 5636857..37caa39 100644 --- a/OpenSim/Region/Interfaces/IMoneyModule.cs +++ b/OpenSim/Region/Interfaces/IMoneyModule.cs @@ -27,18 +27,18 @@ using System; using OpenSim.Framework; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.Interfaces { - public delegate void ObjectPaid(LLUUID objectID, LLUUID agentID, int amount); + public delegate void ObjectPaid(UUID objectID, UUID agentID, int amount); public interface IMoneyModule { - bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, + bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount); int GetBalance(IClientAPI client); - void ApplyUploadCharge(LLUUID agentID); + void ApplyUploadCharge(UUID agentID); bool UploadCovered(IClientAPI client); event ObjectPaid OnObjectPaid; diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs index 671b854..ab86d10 100644 --- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs @@ -30,7 +30,7 @@ using System.Collections.Generic; using System.Reflection; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Data.Base; @@ -48,7 +48,7 @@ namespace OpenSim.Region.Modules.AvatarFactory private Scene m_scene = null; private static readonly AvatarAppearance def = new AvatarAppearance(); - public bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance) + public bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance) { CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(avatarId); //if ((profile != null) && (profile.RootFolder != null)) @@ -69,7 +69,7 @@ namespace OpenSim.Region.Modules.AvatarFactory } - private AvatarAppearance CreateDefault(LLUUID avatarId) + private AvatarAppearance CreateDefault(UUID avatarId) { AvatarAppearance appearance = null; AvatarWearable[] wearables; @@ -127,13 +127,13 @@ namespace OpenSim.Region.Modules.AvatarFactory { for (int i = 0; i < 13; i++) { - if (appearance.Wearables[i].ItemID == LLUUID.Zero) + if (appearance.Wearables[i].ItemID == UUID.Zero) { - appearance.Wearables[i].AssetID = LLUUID.Zero; + appearance.Wearables[i].AssetID = UUID.Zero; } else { - // LLUUID assetId; + // UUID assetId; InventoryItemBase baseItem = profile.RootFolder.FindItem(appearance.Wearables[i].ItemID); @@ -201,7 +201,7 @@ namespace OpenSim.Region.Modules.AvatarFactory wearables = AvatarWearable.DefaultWearables; } - public void UpdateDatabase(LLUUID user, AvatarAppearance appearance) + public void UpdateDatabase(UUID user, AvatarAppearance appearance) { m_scene.CommsManager.AvatarService.UpdateUserAppearance(user, appearance); } diff --git a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs index a1c1b88..4bab7c9 100644 --- a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs +++ b/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs @@ -57,7 +57,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser private string m_svnpass = "password"; private TimeSpan m_svnperiod = new TimeSpan(0, 0, 15, 0, 0); - private string m_svnurl = "svn://insert.your.svn/here/"; + private string m_svnurl = "svn://insert.Your.svn/here/"; private string m_svnuser = "username"; #region SvnModule Core @@ -117,7 +117,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser public void LoadRegion(Scene scene) { scene.LoadPrimsFromXml2(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID + - Slash.DirectorySeparatorChar + "objects.xml"); + Slash.DirectorySeparatorChar + "objects.Xml"); scene.RequestModuleInterface().LoadFromFile(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID + Slash.DirectorySeparatorChar + "heightmap.r32"); m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ")."); diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 3bf0956..e38a12b 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -26,8 +26,8 @@ */ using System.Collections.Generic; -using Axiom.Math; using Nini.Config; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index cc55f6e..c969f9a 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs @@ -29,13 +29,15 @@ using System; using System.Collections.Generic; +using OpenMetaverse; using MonoXnaCompactMaths; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; using XnaDevRu.BulletX; using XnaDevRu.BulletX.Dynamics; using Nini.Config; -using AxiomQuaternion = Axiom.Math.Quaternion; +using Vector3 = MonoXnaCompactMaths.Vector3; +using Quaternion = MonoXnaCompactMaths.Quaternion; #endregion @@ -61,14 +63,14 @@ namespace OpenSim.Region.Physics.BulletXPlugin } //Quaternion - public static Quaternion AxiomQuaternionToXnaQuaternion(AxiomQuaternion axiomQuaternion) + public static Quaternion QuaternionToXnaQuaternion(OpenMetaverse.Quaternion quaternion) { - return new Quaternion(axiomQuaternion.x, axiomQuaternion.y, axiomQuaternion.z, axiomQuaternion.w); + return new Quaternion(quaternion.X, quaternion.Y, quaternion.Z, quaternion.W); } - public static AxiomQuaternion XnaQuaternionToAxiomQuaternion(Quaternion xnaQuaternion) + public static OpenMetaverse.Quaternion XnaQuaternionToQuaternion(Quaternion xnaQuaternion) { - return new AxiomQuaternion(xnaQuaternion.W, xnaQuaternion.X, xnaQuaternion.Y, xnaQuaternion.Z); + return new OpenMetaverse.Quaternion(xnaQuaternion.W, xnaQuaternion.X, xnaQuaternion.Y, xnaQuaternion.Z); } //Next methods are extracted from XnaDevRu.BulletX(See 3rd party license): @@ -92,7 +94,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin internal static Quaternion GetRotation(Matrix m) { - Quaternion q = new Quaternion(); + Quaternion q; float trace = m.M11 + m.M22 + m.M33; @@ -108,6 +110,8 @@ namespace OpenSim.Region.Physics.BulletXPlugin } else { + q.X = q.Y = q.Z = q.W = 0f; + int i = m.M11 < m.M22 ? (m.M22 < m.M33 ? 2 : 1) @@ -601,13 +605,13 @@ namespace OpenSim.Region.Physics.BulletXPlugin } public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, - PhysicsVector size, AxiomQuaternion rotation) + PhysicsVector size, OpenMetaverse.Quaternion rotation) { return AddPrimShape(primName, pbs, position, size, rotation, false); } public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, - PhysicsVector size, AxiomQuaternion rotation, bool isPhysical) + PhysicsVector size, OpenMetaverse.Quaternion rotation, bool isPhysical) { PhysicsActor result; @@ -634,7 +638,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin return result; } - public PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, AxiomQuaternion rotation, + public PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, OpenMetaverse.Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical) { BulletXPrim newPrim = null; @@ -680,7 +684,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin //Try to remove garbage RemoveForgottenRigidBodies(); //End of remove - MoveAllObjects(timeStep); + MoveAPrimitives(timeStep); fps = (timeStep*simulationSubSteps); @@ -694,7 +698,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin return fps; } - private void MoveAllObjects(float timeStep) + private void MoveAPrimitives(float timeStep) { foreach (BulletXCharacter actor in _characters.Values) { @@ -867,7 +871,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin protected PhysicsVector _velocity; protected PhysicsVector _size; protected PhysicsVector _acceleration; - protected AxiomQuaternion _orientation; + protected OpenMetaverse.Quaternion _orientation; protected PhysicsVector m_rotationalVelocity = PhysicsVector.Zero; protected RigidBody rigidBody; protected int m_PhysicsActorType; @@ -972,7 +976,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin get { return _acceleration; } } - public override AxiomQuaternion Orientation + public override OpenMetaverse.Quaternion Orientation { get { return _orientation; } set @@ -1148,10 +1152,10 @@ namespace OpenSim.Region.Physics.BulletXPlugin ReOrient(_orientation); } - protected internal void ReOrient(AxiomQuaternion _newOrient) + protected internal void ReOrient(OpenMetaverse.Quaternion _newOrient) { Quaternion _newOrientation; - _newOrientation = BulletXMaths.AxiomQuaternionToXnaQuaternion(_newOrient); + _newOrientation = BulletXMaths.QuaternionToXnaQuaternion(_newOrient); Matrix _comTransform = rigidBody.CenterOfMassTransform; BulletXMaths.SetRotation(ref _comTransform, _newOrientation); rigidBody.CenterOfMassTransform = _comTransform; @@ -1206,12 +1210,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin public BulletXCharacter(String avName, BulletXScene parent_scene, PhysicsVector pos) : this(avName, parent_scene, pos, new PhysicsVector(), new PhysicsVector(), new PhysicsVector(), - AxiomQuaternion.Identity) + OpenMetaverse.Quaternion.Identity) { } public BulletXCharacter(String avName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector velocity, - PhysicsVector size, PhysicsVector acceleration, AxiomQuaternion orientation) + PhysicsVector size, PhysicsVector acceleration, OpenMetaverse.Quaternion orientation) : base(avName) { //This fields will be removed. They're temporal @@ -1289,7 +1293,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin get { return base.Acceleration; } } - public override AxiomQuaternion Orientation + public override OpenMetaverse.Quaternion Orientation { get { return base.Orientation; } set { base.Orientation = value; } @@ -1404,7 +1408,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector size, - AxiomQuaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical) + OpenMetaverse.Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical) : this( primName, parent_scene, pos, new PhysicsVector(), size, new PhysicsVector(), rotation, mesh, pbs, isPhysical) @@ -1413,12 +1417,14 @@ namespace OpenSim.Region.Physics.BulletXPlugin public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector velocity, PhysicsVector size, - PhysicsVector acceleration, AxiomQuaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, + PhysicsVector acceleration, OpenMetaverse.Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical) : base(primName) { - if ((size.X == 0) || (size.Y == 0) || (size.Z == 0)) throw new Exception("Size 0"); - if (rotation.Norm == 0f) rotation = AxiomQuaternion.Identity; + if ((size.X == 0) || (size.Y == 0) || (size.Z == 0)) + throw new Exception("Size 0"); + if (OpenMetaverse.Quaternion.Normalize(rotation).Length() == 0f) + rotation = OpenMetaverse.Quaternion.Identity; _position = pos; _physical = isPhysical; @@ -1468,7 +1474,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin get { return base.Acceleration; } } - public override AxiomQuaternion Orientation + public override OpenMetaverse.Quaternion Orientation { get { return base.Orientation; } set { base.Orientation = value; } @@ -1565,7 +1571,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin _position = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.CenterOfMassPosition); _velocity = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.LinearVelocity); - _orientation = BulletXMaths.XnaQuaternionToAxiomQuaternion(rigidBody.Orientation); + _orientation = BulletXMaths.XnaQuaternionToQuaternion(rigidBody.Orientation); if ((Math.Abs(m_prev_position.X - _position.X) < 0.03) && (Math.Abs(m_prev_position.Y - _position.Y) < 0.03) @@ -1687,7 +1693,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin { private PhysicsVector _staticPosition; // private PhysicsVector _staticVelocity; -// private AxiomQuaternion _staticOrientation; +// private OpenMetaverse.Quaternion _staticOrientation; private float _mass; // private BulletXScene _parentscene; internal float[] _heightField; @@ -1702,7 +1708,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin { _staticPosition = new PhysicsVector(BulletXScene.MaxXY/2, BulletXScene.MaxXY/2, 0); // _staticVelocity = new PhysicsVector(); -// _staticOrientation = AxiomQuaternion.Identity; +// _staticOrientation = OpenMetaverse.Quaternion.Identity; _mass = 0; //No active // _parentscene = parent_scene; _heightField = heightField; diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index d4af271..482b478 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -27,8 +27,8 @@ using System; using System.Collections.Generic; -using Axiom.Math; using OpenSim.Framework; +using OpenMetaverse; namespace OpenSim.Region.Physics.Manager { diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index 3d9207f..db41251 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs @@ -115,43 +115,73 @@ namespace OpenSim.Region.Physics.Manager // that the LoadFrom context be avoided. This can be done by installing assemblies in the // Global Assembly Cache or in the ApplicationBase directory and using Assembly. // Load when explicitly loading assemblies. - Assembly pluginAssembly = Assembly.LoadFrom(FileName); + Assembly pluginAssembly = null; + Type[] types = null; - foreach (Type pluginType in pluginAssembly.GetTypes()) + try { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type physTypeInterface = pluginType.GetInterface("IPhysicsPlugin", true); - - if (physTypeInterface != null) - { - IPhysicsPlugin plug = - (IPhysicsPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Init(); - if (!_PhysPlugins.ContainsKey(plug.GetName())) - { - _PhysPlugins.Add(plug.GetName(), plug); - m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName()); - } - } + pluginAssembly = Assembly.LoadFrom(FileName); + } + catch (Exception ex) + { + m_log.Error("Failed to load plugin from " + FileName, ex); + } - Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true); + if (pluginAssembly != null) + { + try + { + types = pluginAssembly.GetTypes(); + } + catch (ReflectionTypeLoadException ex) + { + m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + FileName + ": " + + ex.LoaderExceptions[0].Message, ex); + } + catch (Exception ex) + { + m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + FileName, ex); + } - if (meshTypeInterface != null) + if (types != null) + { + foreach (Type pluginType in types) + { + if (pluginType.IsPublic) { - IMeshingPlugin plug = - (IMeshingPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - if (!_MeshPlugins.ContainsKey(plug.GetName())) + if (!pluginType.IsAbstract) { - _MeshPlugins.Add(plug.GetName(), plug); - m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName()); + Type physTypeInterface = pluginType.GetInterface("IPhysicsPlugin", true); + + if (physTypeInterface != null) + { + IPhysicsPlugin plug = + (IPhysicsPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + plug.Init(); + if (!_PhysPlugins.ContainsKey(plug.GetName())) + { + _PhysPlugins.Add(plug.GetName(), plug); + m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName()); + } + } + + Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true); + + if (meshTypeInterface != null) + { + IMeshingPlugin plug = + (IMeshingPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + if (!_MeshPlugins.ContainsKey(plug.GetName())) + { + _MeshPlugins.Add(plug.GetName(), plug); + m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName()); + } + } + + physTypeInterface = null; + meshTypeInterface = null; } } - - physTypeInterface = null; - meshTypeInterface = null; } } } diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index f9d990b..3575a51 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs @@ -27,10 +27,10 @@ using System.Collections.Generic; using System.Reflection; -using Axiom.Math; using log4net; using Nini.Config; using OpenSim.Framework; +using OpenMetaverse; namespace OpenSim.Region.Physics.Manager { diff --git a/OpenSim/Region/Physics/Manager/PhysicsVector.cs b/OpenSim/Region/Physics/Manager/PhysicsVector.cs index adf4715..bbd6464 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsVector.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsVector.cs @@ -60,7 +60,7 @@ namespace OpenSim.Region.Physics.Manager } /// - /// These routines are the easiest way to store XYZ values in an LLVector3 without requiring 3 calls. + /// These routines are the easiest way to store XYZ values in an Vector3 without requiring 3 calls. /// /// public byte[] GetBytes() diff --git a/OpenSim/Region/Physics/Meshing/Extruder.cs b/OpenSim/Region/Physics/Meshing/Extruder.cs index a47b6ae..1fc65e3 100644 --- a/OpenSim/Region/Physics/Meshing/Extruder.cs +++ b/OpenSim/Region/Physics/Meshing/Extruder.cs @@ -26,6 +26,7 @@ */ //#define SPAM +using OpenMetaverse; using OpenSim.Region.Physics.Manager; namespace OpenSim.Region.Physics.Meshing @@ -72,9 +73,6 @@ namespace OpenSim.Region.Physics.Meshing { Mesh result = new Mesh(); - // Quaternion tt = new Quaternion(); - // Vertex v2 = new Vertex(0, 0, 0); - Mesh newLayer; Mesh lastLayer = null; @@ -163,7 +161,7 @@ namespace OpenSim.Region.Physics.Meshing // apply twist rotation to the profile layer and position the layer in the prim - Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); + Quaternion profileRot = Quaternion.CreateFromAxisAngle(new Vector3(0.0f, 0.0f, 1.0f), twist); foreach (Vertex v in newLayer.vertices) { if (v != null) @@ -259,9 +257,6 @@ namespace OpenSim.Region.Physics.Meshing { Mesh result = new Mesh(); - // Quaternion tt = new Quaternion(); - // Vertex v2 = new Vertex(0, 0, 0); - Mesh newLayer; Mesh lastLayer = null; @@ -377,7 +372,7 @@ namespace OpenSim.Region.Physics.Meshing // next apply twist rotation to the profile layer if (twistTotal != 0.0f || twistBot != 0.0f) { - Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); + Quaternion profileRot = new Quaternion(new Vector3(0.0f, 0.0f, 1.0f), twist); foreach (Vertex v in newLayer.vertices) { if (v != null) @@ -392,7 +387,7 @@ namespace OpenSim.Region.Physics.Meshing // now orient the rotation of the profile layer relative to it's position on the path // adding pushY to the angle used to generate the quat appears to approximate the viewer - Quaternion layerRot = new Quaternion(new Vertex(1.0f, 0.0f, 0.0f), (float)angle + pushY * 0.9f); + Quaternion layerRot = Quaternion.CreateFromAxisAngle(new Vector3(1.0f, 0.0f, 0.0f), (float)angle + pushY * 0.9f); foreach (Vertex v in newLayer.vertices) { if (v != null) diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/Meshing/HelperTypes.cs index 2cb8d04..7491782 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/Physics/Meshing/HelperTypes.cs @@ -29,70 +29,10 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; +using OpenMetaverse; using OpenSim.Region.Physics.Manager; using OpenSim.Region.Physics.Meshing; -public class Quaternion -{ - public float x = 0; - public float y = 0; - public float z = 0; - public float w = 1; - - public Quaternion() - { - - } - public Quaternion(float x1, float y1, float z1, float w1) - { - x = x1; y = y1; z = z1; w = w1; - } - public Quaternion(Vertex axis, float angle) - { - // using (* 0.5) instead of (/2) - w = (float)Math.Cos(angle * 0.5f); - float sin = (float)Math.Sin(angle * 0.5f); - //x = axis.X * (float)Math.Sin(angle * 0.5f); - //y = axis.Y * (float)Math.Sin(angle * 0.5f); - //z = axis.Z * (float)Math.Sin(angle * 0.5f); - x = axis.X * sin; - y = axis.Y * sin; - z = axis.Z * sin; - normalize(); - } - public static Quaternion operator *(Quaternion a, Quaternion b) - { - Quaternion c = new Quaternion(); - c.x = a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y; - c.y = a.w * b.y + a.y * b.w + a.z * b.x - a.x * b.z; - c.z = a.w * b.z + a.z * b.w + a.x * b.y - a.y * b.x; - c.w = a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z; - return c; - } - - public void normalize() - { - //float mag = length(); - - //w /= mag; - //x /= mag; - //y /= mag; - //z /= mag; - float iMag = 1.0f / length(); - - w *= iMag; - x *= iMag; - y *= iMag; - z *= iMag; - } - public float length() - { - return (float)Math.Sqrt(w * w + x * x + y * y + z * z); - } -} - - - public class Vertex : PhysicsVector, IComparable { public Vertex(float x, float y, float z) @@ -129,34 +69,34 @@ public class Vertex : PhysicsVector, IComparable Vertex v2 = new Vertex(0f, 0f, 0f); - v2.X = q.w * q.w * v.X + - 2f * q.y * q.w * v.Z - - 2f * q.z * q.w * v.Y + - q.x * q.x * v.X + - 2f * q.y * q.x * v.Y + - 2f * q.z * q.x * v.Z - - q.z * q.z * v.X - - q.y * q.y * v.X; + v2.X = q.W * q.W * v.X + + 2f * q.Y * q.W * v.Z - + 2f * q.Z * q.W * v.Y + + q.X * q.X * v.X + + 2f * q.Y * q.X * v.Y + + 2f * q.Z * q.X * v.Z - + q.Z * q.Z * v.X - + q.Y * q.Y * v.X; v2.Y = - 2f * q.x * q.y * v.X + - q.y * q.y * v.Y + - 2f * q.z * q.y * v.Z + - 2f * q.w * q.z * v.X - - q.z * q.z * v.Y + - q.w * q.w * v.Y - - 2f * q.x * q.w * v.Z - - q.x * q.x * v.Y; + 2f * q.X * q.Y * v.X + + q.Y * q.Y * v.Y + + 2f * q.Z * q.Y * v.Z + + 2f * q.W * q.Z * v.X - + q.Z * q.Z * v.Y + + q.W * q.W * v.Y - + 2f * q.X * q.W * v.Z - + q.X * q.X * v.Y; v2.Z = - 2f * q.x * q.z * v.X + - 2f * q.y * q.z * v.Y + - q.z * q.z * v.Z - - 2f * q.w * q.y * v.X - - q.y * q.y * v.Z + - 2f * q.w * q.x * v.Y - - q.x * q.x * v.Z + - q.w * q.w * v.Z; + 2f * q.X * q.Z * v.X + + 2f * q.Y * q.Z * v.Y + + q.Z * q.Z * v.Z - + 2f * q.W * q.Y * v.X - + q.Y * q.Y * v.Z + + 2f * q.W * q.X * v.Y - + q.X * q.X * v.Z + + q.W * q.W * v.Z; return v2; } diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index ecde92a..f955c52 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -30,6 +30,7 @@ using System; using System.Collections.Generic; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; +using OpenMetaverse; namespace OpenSim.Region.Physics.Meshing { @@ -1559,7 +1560,7 @@ namespace OpenSim.Region.Physics.Meshing if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Circle) { - Quaternion zFlip = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), (float)Math.PI); + Quaternion zFlip = Quaternion.CreateFromAxisAngle(new Vector3(0.0f, 0.0f, 1.0f), (float)Math.PI); Vertex vTmp = new Vertex(0.0f, 0.0f, 0.0f); foreach (Vertex v in cuttedHull.getVertices()) if (v != null) diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs index 86bdabc..08b2d10 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.IO; using OpenSim.Region.Physics.Manager; +using OpenMetaverse; namespace OpenSim.Region.Physics.Meshing { @@ -783,7 +784,7 @@ angles24 = [ Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides); if (initialProfileRot != 0.0f) - profile.AddRot(new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), initialProfileRot)); + profile.AddRot(Quaternion.CreateFromAxisAngle(new Vector3(0.0f, 0.0f, 1.0f), initialProfileRot)); bool done = false; while (!done) @@ -807,7 +808,7 @@ angles24 = [ float twist = twistBegin + twistTotal * percentOfPath; if (twist != 0.0f) - newLayer.AddRot(new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist)); + newLayer.AddRot(Quaternion.CreateFromAxisAngle(new Vector3(0.0f, 0.0f, 1.0f), twist)); newLayer.AddPos(xOffset, yOffset, zOffset); @@ -948,7 +949,7 @@ angles24 = [ Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides); if (initialProfileRot != 0.0f) - profile.AddRot(new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), initialProfileRot)); + profile.AddRot(Quaternion.CreateFromAxisAngle(new Vector3(0.0f, 0.0f, 1.0f), initialProfileRot)); bool done = false; while (!done) // loop through the length of the path and add the layers @@ -991,12 +992,12 @@ angles24 = [ // next apply twist rotation to the profile layer if (twistTotal != 0.0f || twistBegin != 0.0f) - newLayer.AddRot(new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist)); + newLayer.AddRot(Quaternion.CreateFromAxisAngle(new Vector3(0.0f, 0.0f, 1.0f), twist)); // now orient the rotation of the profile layer relative to it's position on the path // adding taperY to the angle used to generate the quat appears to approximate the viewer //newLayer.AddRot(new Quaternion(new Vertex(1.0f, 0.0f, 0.0f), angle + this.topShearY * 0.9f)); - newLayer.AddRot(new Quaternion(new Vertex(1.0f, 0.0f, 0.0f), angle + this.topShearY)); + newLayer.AddRot(Quaternion.CreateFromAxisAngle(new Vector3(1.0f, 0.0f, 0.0f), angle + this.topShearY)); newLayer.AddPos(xOffset, yOffset, zOffset); if (angle == startAngle) diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index 360b2f7..707c0e3 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs @@ -30,14 +30,14 @@ using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.Text; -using OpenJPEGNet; -using Image = System.Drawing.Image; +using OpenMetaverse.Imaging; namespace OpenSim.Region.Physics.Meshing { // This functionality based on the XNA SculptPreview by John Hurliman. public class SculptMesh : Mesh { + ManagedImage managedImage; Image idata = null; Bitmap bLOD = null; Bitmap bBitmap = null; @@ -55,7 +55,7 @@ namespace OpenSim.Region.Physics.Meshing try { - idata = OpenJPEG.DecodeToImage(jpegData); + OpenJPEG.DecodeToImage(jpegData, out managedImage, out idata); //int i = 0; //i = i / i; } @@ -64,6 +64,7 @@ namespace OpenSim.Region.Physics.Meshing System.Console.WriteLine("[PHYSICS]: Unable to generate a Sculpty physics proxy. Sculpty texture decode failed!"); return; } + if (idata != null) { bBitmap = new Bitmap(idata); diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 5d3e986..38d4060 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -26,7 +26,7 @@ */ using System; -using Axiom.Math; +using OpenMetaverse; using Ode.NET; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; @@ -587,7 +587,6 @@ namespace OpenSim.Region.Physics.OdePlugin //Matrix3 or = Orientation.ToRotationMatrix(); //d.Matrix3 ord = new d.Matrix3(or.m00, or.m10, or.m20, or.m01, or.m11, or.m21, or.m02, or.m12, or.m22); //d.BodySetRotation(Body, ref ord); - } } diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index eafce5a..21e514b 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -30,8 +30,8 @@ using System.Collections.Generic; using System.Reflection; using System.Runtime.InteropServices; using System.Threading; -using Axiom.Math; using log4net; +using OpenMetaverse; using Ode.NET; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; @@ -294,10 +294,10 @@ namespace OpenSim.Region.Physics.OdePlugin setMass(); d.BodySetPosition(Body, _position.X, _position.Y, _position.Z); d.Quaternion myrot = new d.Quaternion(); - myrot.W = _orientation.w; - myrot.X = _orientation.x; - myrot.Y = _orientation.y; - myrot.Z = _orientation.z; + myrot.X = _orientation.X; + myrot.Y = _orientation.Y; + myrot.Z = _orientation.Z; + myrot.W = _orientation.W; d.BodySetQuaternion(Body, ref myrot); d.GeomSetBody(prim_geom, Body); m_collisionCategories |= CollisionCategories.Body; @@ -1021,10 +1021,10 @@ namespace OpenSim.Region.Physics.OdePlugin { d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); d.Quaternion myrot = new d.Quaternion(); - myrot.W = _orientation.w; - myrot.X = _orientation.x; - myrot.Y = _orientation.y; - myrot.Z = _orientation.z; + myrot.X = _orientation.X; + myrot.Y = _orientation.Y; + myrot.Z = _orientation.Z; + myrot.W = _orientation.W; d.GeomSetQuaternion(prim_geom, ref myrot); } @@ -1220,10 +1220,10 @@ namespace OpenSim.Region.Physics.OdePlugin public void rotate(float timestep) { d.Quaternion myrot = new d.Quaternion(); - myrot.W = _orientation.w; - myrot.X = _orientation.x; - myrot.Y = _orientation.y; - myrot.Z = _orientation.z; + myrot.X = _orientation.X; + myrot.Y = _orientation.Y; + myrot.Z = _orientation.Z; + myrot.W = _orientation.W; d.GeomSetQuaternion(prim_geom, ref myrot); if (m_isphysical && Body != (IntPtr) 0) { @@ -1339,10 +1339,10 @@ namespace OpenSim.Region.Physics.OdePlugin setMesh(_parent_scene, mesh); d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); d.Quaternion myrot = new d.Quaternion(); - myrot.W = _orientation.w; - myrot.X = _orientation.x; - myrot.Y = _orientation.y; - myrot.Z = _orientation.z; + myrot.X = _orientation.X; + myrot.Y = _orientation.Y; + myrot.Z = _orientation.Z; + myrot.W = _orientation.W; d.GeomSetQuaternion(prim_geom, ref myrot); //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); @@ -1388,10 +1388,10 @@ namespace OpenSim.Region.Physics.OdePlugin //prim_geom = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z); d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); d.Quaternion myrot = new d.Quaternion(); - myrot.W = _orientation.w; - myrot.X = _orientation.x; - myrot.Y = _orientation.y; - myrot.Z = _orientation.z; + myrot.X = _orientation.X; + myrot.Y = _orientation.Y; + myrot.Z = _orientation.Z; + myrot.W = _orientation.W; d.GeomSetQuaternion(prim_geom, ref myrot); } } @@ -1452,9 +1452,9 @@ namespace OpenSim.Region.Physics.OdePlugin // d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); // d.Quaternion myrot = new d.Quaternion(); // myrot.W = _orientation.w; - // myrot.X = _orientation.x; - // myrot.Y = _orientation.y; - // myrot.Z = _orientation.z; + // myrot.X = _orientation.X; + // myrot.Y = _orientation.Y; + // myrot.Z = _orientation.Z; // d.GeomSetQuaternion(prim_geom, ref myrot); // //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); @@ -1512,9 +1512,9 @@ namespace OpenSim.Region.Physics.OdePlugin // d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); // d.Quaternion myrot = new d.Quaternion(); // myrot.W = _orientation.w; - // myrot.X = _orientation.x; - // myrot.Y = _orientation.y; - // myrot.Z = _orientation.z; + // myrot.X = _orientation.X; + // myrot.Y = _orientation.Y; + // myrot.Z = _orientation.Z; // d.GeomSetQuaternion(prim_geom, ref myrot); // } // } @@ -1553,9 +1553,9 @@ namespace OpenSim.Region.Physics.OdePlugin // d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); // d.Quaternion myrot = new d.Quaternion(); // myrot.W = _orientation.w; - // myrot.X = _orientation.x; - // myrot.Y = _orientation.y; - // myrot.Z = _orientation.z; + // myrot.X = _orientation.X; + // myrot.Y = _orientation.Y; + // myrot.Z = _orientation.Z; // d.GeomSetQuaternion(prim_geom, ref myrot); // //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); @@ -1626,10 +1626,10 @@ namespace OpenSim.Region.Physics.OdePlugin setMesh(_parent_scene, mesh); d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); d.Quaternion myrot = new d.Quaternion(); - myrot.W = _orientation.w; - myrot.X = _orientation.x; - myrot.Y = _orientation.y; - myrot.Z = _orientation.z; + myrot.X = _orientation.X; + myrot.Y = _orientation.Y; + myrot.Z = _orientation.Z; + myrot.W = _orientation.W; d.GeomSetQuaternion(prim_geom, ref myrot); //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); @@ -1684,10 +1684,10 @@ namespace OpenSim.Region.Physics.OdePlugin //prim_geom = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z); d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); d.Quaternion myrot = new d.Quaternion(); - myrot.W = _orientation.w; - myrot.X = _orientation.x; - myrot.Y = _orientation.y; - myrot.Z = _orientation.z; + myrot.X = _orientation.X; + myrot.Y = _orientation.Y; + myrot.Z = _orientation.Z; + myrot.W = _orientation.W; d.GeomSetQuaternion(prim_geom, ref myrot); } } @@ -1726,9 +1726,9 @@ namespace OpenSim.Region.Physics.OdePlugin // d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); // d.Quaternion myrot = new d.Quaternion(); // myrot.W = _orientation.w; - // myrot.X = _orientation.x; - // myrot.Y = _orientation.y; - // myrot.Z = _orientation.z; + // myrot.X = _orientation.X; + // myrot.Y = _orientation.Y; + // myrot.Z = _orientation.Z; // d.GeomSetQuaternion(prim_geom, ref myrot); // //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); @@ -2106,9 +2106,9 @@ namespace OpenSim.Region.Physics.OdePlugin _acceleration.Z = 0; //_orientation.w = 0f; - //_orientation.x = 0f; - //_orientation.y = 0f; - //_orientation.z = 0f; + //_orientation.X = 0f; + //_orientation.Y = 0f; + //_orientation.Z = 0f; m_rotationalVelocity.X = 0; m_rotationalVelocity.Y = 0; m_rotationalVelocity.Z = 0; @@ -2154,10 +2154,10 @@ namespace OpenSim.Region.Physics.OdePlugin } //System.Console.WriteLine("ODE: " + m_rotationalVelocity.ToString()); - _orientation.w = ori.W; - _orientation.x = ori.X; - _orientation.y = ori.Y; - _orientation.z = ori.Z; + _orientation.X = ori.X; + _orientation.Y = ori.Y; + _orientation.Z = ori.Z; + _orientation.W = ori.W; m_lastUpdateSent = false; if (!m_throttleUpdates || throttleCounter > _parent_scene.geomUpdatesPerThrottledUpdate) { diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs index 074170a..606134a 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs @@ -26,9 +26,9 @@ */ using System; -using Axiom.Math; using Nini.Config; using NUnit.Framework; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; @@ -74,7 +74,7 @@ namespace OpenSim.Region.Physics.OdePlugin PrimitiveBaseShape newcube = PrimitiveBaseShape.CreateBox(); PhysicsVector position = new PhysicsVector(128, 128, 128); PhysicsVector size = new PhysicsVector(0.5f, 0.5f, 0.5f); - Quaternion rot = new Quaternion(1, 0, 0, 0); + Quaternion rot = Quaternion.Identity; PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true); OdePrim oprim = (OdePrim)prim; OdeScene pscene = (OdeScene) ps; diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index f285911..5a501ef 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -31,13 +31,12 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Threading; using System.IO; -using Axiom.Math; using log4net; using Nini.Config; using Ode.NET; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; -using libsecondlife; +using OpenMetaverse; //using OpenSim.Region.Physics.OdePlugin.Meshing; @@ -1129,11 +1128,7 @@ namespace OpenSim.Region.Physics.OdePlugin siz.X = size.X; siz.Y = size.Y; siz.Z = size.Z; - Quaternion rot = new Quaternion(); - rot.w = rotation.w; - rot.x = rotation.x; - rot.y = rotation.y; - rot.z = rotation.z; + Quaternion rot = rotation; OdePrim newPrim; lock (OdeLock) @@ -1524,8 +1519,8 @@ namespace OpenSim.Region.Physics.OdePlugin // but we still need to check for sculptie meshing being enabled so this is the most // convenient place to do it for now... - // //if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle && pbs.ProfileCurve == (byte)LLObject.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f) - // //Console.WriteLine("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + LLObject.UnpackPathScale(pbs.PathScaleY).ToString()); + // //if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle && pbs.ProfileCurve == (byte)Primitive.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f) + // //Console.WriteLine("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + Primitive.UnpackPathScale(pbs.PathScaleY).ToString()); if (pbs.SculptEntry && !meshSculptedPrim) { return false; @@ -1555,19 +1550,19 @@ namespace OpenSim.Region.Physics.OdePlugin // return true; // // test for torus - // if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle - // && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.Circle - // && LLObject.UnpackPathScale(pbs.PathScaleY) <= 0.75f) + // if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle + // && (pbs.ProfileCurve & 0x07) == (byte)Primitive.ProfileCurve.Circle + // && Primitive.UnpackPathScale(pbs.PathScaleY) <= 0.75f) // return true; // // test for tube - // if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle - // && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.EqualTriangle) + // if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle + // && (pbs.ProfileCurve & 0x07) == (byte)Primitive.ProfileCurve.EqualTriangle) // return true; // // test for ring - // if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle - // && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.EqualTriangle) + // if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle + // && (pbs.ProfileCurve & 0x07) == (byte)Primitive.ProfileCurve.EqualTriangle) // return true; // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) @@ -2132,17 +2127,17 @@ namespace OpenSim.Region.Physics.OdePlugin d.Matrix3 R = new d.Matrix3(); - Quaternion q1 = Quaternion.FromAngleAxis(1.5707f, new Vector3(1, 0, 0)); - Quaternion q2 = Quaternion.FromAngleAxis(1.5707f, new Vector3(0, 1, 0)); + Quaternion q1 = Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), 1.5707f); + Quaternion q2 = Quaternion.CreateFromAxisAngle(new Vector3(0, 1, 0), 1.5707f); //Axiom.Math.Quaternion q3 = Axiom.Math.Quaternion.FromAngleAxis(3.14f, new Axiom.Math.Vector3(0, 0, 1)); q1 = q1*q2; //q1 = q1 * q3; - Vector3 v3 = new Vector3(); - float angle = 0; - q1.ToAngleAxis(ref angle, ref v3); + Vector3 v3; + float angle; + q1.GetAxisAngle(out v3, out angle); - d.RFromAxisAndAngle(out R, v3.x, v3.y, v3.z, angle); + d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle); d.GeomSetRotation(LandGeom, ref R); d.GeomSetPosition(LandGeom, 128, 128, 0); } @@ -2197,17 +2192,17 @@ namespace OpenSim.Region.Physics.OdePlugin d.Matrix3 R = new d.Matrix3(); - Quaternion q1 = Quaternion.FromAngleAxis(1.5707f, new Vector3(1, 0, 0)); - Quaternion q2 = Quaternion.FromAngleAxis(1.5707f, new Vector3(0, 1, 0)); + Quaternion q1 = Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), 1.5707f); + Quaternion q2 = Quaternion.CreateFromAxisAngle(new Vector3(0, 1, 0), 1.5707f); //Axiom.Math.Quaternion q3 = Axiom.Math.Quaternion.FromAngleAxis(3.14f, new Axiom.Math.Vector3(0, 0, 1)); q1 = q1 * q2; //q1 = q1 * q3; - Vector3 v3 = new Vector3(); - float angle = 0; - q1.ToAngleAxis(ref angle, ref v3); + Vector3 v3; + float angle; + q1.GetAxisAngle(out v3, out angle); - d.RFromAxisAndAngle(out R, v3.x, v3.y, v3.z, angle); + d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle); d.GeomSetRotation(WaterGeom, ref R); d.GeomSetPosition(WaterGeom, 128, 128, 0); } diff --git a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs index c674d15..400280f 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs @@ -27,8 +27,8 @@ using System; using System.Collections.Generic; -using Axiom.Math; using Nini.Config; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs index 65f10f9..c8cbcf5 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Axiom.Math; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; diff --git a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs index fed67dd..69cd19c 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs @@ -27,8 +27,8 @@ using System; using System.Collections.Generic; -using Axiom.Math; using Nini.Config; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; diff --git a/OpenSim/Region/Physics/POSPlugin/POSScene.cs b/OpenSim/Region/Physics/POSPlugin/POSScene.cs index a32021d..9771a62 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSScene.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSScene.cs @@ -27,8 +27,8 @@ using System; using System.Collections.Generic; -using Axiom.Math; using Nini.Config; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; @@ -109,14 +109,13 @@ namespace OpenSim.Region.Physics.POSPlugin private bool isColliding(POSCharacter c, POSPrim p) { - Vector3 rotatedPos = p.Orientation.Inverse() * - new Vector3(c.Position.X - p.Position.X, c.Position.Y - p.Position.Y, - c.Position.Z - p.Position.Z); - Vector3 avatarSize = p.Orientation.Inverse()*new Vector3(c.Size.X, c.Size.Y, c.Size.Z); - - if (Math.Abs(rotatedPos.x) >= (p.Size.X*0.5 + Math.Abs(avatarSize.x)) || - Math.Abs(rotatedPos.y) >= (p.Size.Y*0.5 + Math.Abs(avatarSize.y)) || - Math.Abs(rotatedPos.z) >= (p.Size.Z*0.5 + Math.Abs(avatarSize.z))) + Vector3 rotatedPos = new Vector3(c.Position.X - p.Position.X, c.Position.Y - p.Position.Y, + c.Position.Z - p.Position.Z) * Quaternion.Inverse(p.Orientation); + Vector3 avatarSize = new Vector3(c.Size.X, c.Size.Y, c.Size.Z) * Quaternion.Inverse(p.Orientation); + + if (Math.Abs(rotatedPos.X) >= (p.Size.X*0.5 + Math.Abs(avatarSize.X)) || + Math.Abs(rotatedPos.Y) >= (p.Size.Y*0.5 + Math.Abs(avatarSize.Y)) || + Math.Abs(rotatedPos.Z) >= (p.Size.Z*0.5 + Math.Abs(avatarSize.Z))) { return false; } diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index 197da0a..37e2a2f 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs @@ -31,7 +31,7 @@ using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; using PhysXWrapper; -using Quaternion=Axiom.Math.Quaternion; +using Quaternion=OpenMetaverse.Quaternion; namespace OpenSim.Region.Physics.PhysXPlugin { @@ -614,12 +614,12 @@ namespace OpenSim.Region.Physics.PhysXPlugin { get { - Quaternion res = new Quaternion(); + Quaternion res; PhysXWrapper.Quaternion quat = _prim.GetOrientation(); - res.w = quat.W; - res.x = quat.X; - res.y = quat.Y; - res.z = quat.Z; + res.W = quat.W; + res.X = quat.X; + res.Y = quat.Y; + res.Z = quat.Z; return res; } set { } diff --git a/OpenSim/Region/ScriptEngine/Common/BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/BuilIn_Commands.cs index 1a50f0b..9c45ab5 100644 --- a/OpenSim/Region/ScriptEngine/Common/BuilIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/BuilIn_Commands.cs @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.Environment.Scenes; namespace OpenSim.Region.ScriptEngine.Common @@ -36,7 +36,7 @@ namespace OpenSim.Region.ScriptEngine.Common public class BuilIn_Commands : OSSL_BuilIn_Commands { public BuilIn_Commands(ScriptEngineBase.ScriptEngine scriptEngine, SceneObjectPart host, uint localID, - LLUUID itemID) : base(scriptEngine, host, localID, itemID) + UUID itemID) : base(scriptEngine, host, localID, itemID) { } } diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index bcdff8f..0c5d60b 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -32,9 +32,8 @@ using System.Runtime.Remoting.Lifetime; using System.Text; using System.Threading; using Nini.Config; -using Axiom.Math; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Region.Environment; @@ -60,10 +59,10 @@ namespace OpenSim.Region.ScriptEngine.Common internal ScriptEngineBase.ScriptEngine m_ScriptEngine; internal SceneObjectPart m_host; internal uint m_localID; - internal LLUUID m_itemID; + internal UUID m_itemID; internal bool throwErrorOnNotImplemented = true; - public LSL_BuiltIn_Commands(ScriptEngineBase.ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) + public LSL_BuiltIn_Commands(ScriptEngineBase.ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) { m_ScriptEngine = ScriptEngine; m_host = host; @@ -151,11 +150,11 @@ namespace OpenSim.Region.ScriptEngine.Common return World.GetCommander(name); } - private LLUUID InventorySelf() + private UUID InventorySelf() { - LLUUID invItemID = new LLUUID(); + UUID invItemID = new UUID(); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID) { @@ -167,54 +166,54 @@ namespace OpenSim.Region.ScriptEngine.Common return invItemID; } - private LLUUID InventoryKey(string name, int type) + private UUID InventoryKey(string name, int type) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { if (inv.Value.Type != type) - return LLUUID.Zero; + return UUID.Zero; return inv.Value.AssetID.ToString(); } } - return LLUUID.Zero; + return UUID.Zero; } - private LLUUID InventoryKey(string name) + private UUID InventoryKey(string name) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { return inv.Value.AssetID.ToString(); } } - return LLUUID.Zero; + return UUID.Zero; } /// - /// accepts a valid LLUUID, -or- a name of an inventory item. - /// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found + /// accepts a valid UUID, -or- a name of an inventory item. + /// Returns a valid UUID or UUID.Zero if key invalid and item not found /// in prim inventory. /// /// /// - private LLUUID KeyOrName(string k) + private UUID KeyOrName(string k) { - LLUUID key = LLUUID.Zero; + UUID key = UUID.Zero; // if we can parse the string as a key, use it. - if (LLUUID.TryParse(k, out key)) + if (UUID.TryParse(k, out key)) { return key; } // else try to locate the name in inventory of object. found returns key, - // not found returns LLUUID.Zero which will translate to the default particle texture + // not found returns UUID.Zero which will translate to the default particle texture else { return InventoryKey(k); @@ -573,7 +572,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (text.Length > 1023) text = text.Substring(0, 1023); - World.SimChat(Helpers.StringToField(text), + World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); @@ -587,7 +586,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (text.Length > 1023) text = text.Substring(0, 1023); - World.SimChat(Helpers.StringToField(text), + World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); @@ -601,7 +600,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (text.Length > 1023) text = text.Substring(0, 1023); - World.SimChat(Helpers.StringToField(text), + World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); @@ -628,8 +627,8 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llListen(int channelID, string name, string ID, string msg) { m_host.AddScriptLPS(1); - LLUUID keyID; - LLUUID.TryParse(ID, out keyID); + UUID keyID; + UUID.TryParse(ID, out keyID); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg); } @@ -651,8 +650,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSensor(string name, string id, int type, double range, double arc) { m_host.AddScriptLPS(1); - LLUUID keyID = LLUUID.Zero; - LLUUID.TryParse(id, out keyID); + UUID keyID = UUID.Zero; + UUID.TryParse(id, out keyID); m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); } @@ -660,8 +659,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) { m_host.AddScriptLPS(1); - LLUUID keyID = LLUUID.Zero; - LLUUID.TryParse(id, out keyID); + UUID keyID = UUID.Zero; + UUID.TryParse(id, out keyID); m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host); } @@ -672,7 +671,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.UnSetSenseRepeaterEvents(m_localID, m_itemID); } - public string resolveName(LLUUID objecUUID) + public string resolveName(UUID objecUUID) { // try avatar username surname CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID); @@ -708,7 +707,7 @@ namespace OpenSim.Region.ScriptEngine.Common { if ((number >= 0) && (number <= SenseList.Length)) { - LLUUID SensedUUID = (LLUUID)SenseList.Data[number]; + UUID SensedUUID = (UUID)SenseList.Data[number]; return resolveName(SensedUUID); } } @@ -741,14 +740,14 @@ namespace OpenSim.Region.ScriptEngine.Common return String.Empty; } - public LLUUID uuidDetectedKey(int number) + public UUID uuidDetectedKey(int number) { LSL_Types.list SenseList = m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.GetSensorList(m_localID, m_itemID); if (SenseList != null) { if ((number >= 0) && (number < SenseList.Length)) { - LLUUID SensedUUID = (LLUUID)SenseList.Data[number]; + UUID SensedUUID = (UUID)SenseList.Data[number]; return SensedUUID; } } @@ -768,14 +767,14 @@ namespace OpenSim.Region.ScriptEngine.Common { if (script.llDetectParams._key[number]) { - return new LLUUID(script.llDetectParams._key[number]); + return new UUID(script.llDetectParams._key[number]); } } } } } } - return LLUUID.Zero; + return UUID.Zero; } public EntityBase entityDetectedKey(int number) @@ -785,7 +784,7 @@ namespace OpenSim.Region.ScriptEngine.Common { if ((number >= 0) && (number < SenseList.Length)) { - LLUUID SensedUUID = (LLUUID)SenseList.Data[number]; + UUID SensedUUID = (UUID)SenseList.Data[number]; EntityBase SensedObject = null; lock (World.Entities) { @@ -810,7 +809,7 @@ namespace OpenSim.Region.ScriptEngine.Common { if (script.llDetectParams._key[number]) { - LLUUID SensedUUID = new LLUUID(script.llDetectParams._key[number]); + UUID SensedUUID = new UUID(script.llDetectParams._key[number]); EntityBase SensedObject = null; lock (World.Entities) { @@ -830,8 +829,8 @@ namespace OpenSim.Region.ScriptEngine.Common public string llDetectedKey(int number) { m_host.AddScriptLPS(1); - LLUUID SensedUUID = uuidDetectedKey(number); - if (SensedUUID == LLUUID.Zero) + UUID SensedUUID = uuidDetectedKey(number); + if (SensedUUID == UUID.Zero) return String.Empty; return SensedUUID.ToString(); } @@ -843,7 +842,7 @@ namespace OpenSim.Region.ScriptEngine.Common EntityBase SensedObject = entityDetectedKey(number); if (SensedObject ==null) return String.Empty; - LLUUID SensedUUID = uuidDetectedKey(number); + UUID SensedUUID = uuidDetectedKey(number); if (World.GetScenePresence(SensedUUID) == null) { // sensed object is not an avatar @@ -870,7 +869,7 @@ namespace OpenSim.Region.ScriptEngine.Common return 0; int mask = 0; - LLUUID SensedUUID = uuidDetectedKey(number); + UUID SensedUUID = uuidDetectedKey(number); LSL_Types.Vector3 ZeroVector = new LSL_Types.Vector3(0, 0, 0); if (World.GetScenePresence(SensedUUID) != null) mask |= 0x01; // actor @@ -888,7 +887,10 @@ namespace OpenSim.Region.ScriptEngine.Common EntityBase SensedObject = entityDetectedKey(number); if (SensedObject == null) return new LSL_Types.Vector3(0, 0, 0); - return new LSL_Types.Vector3(SensedObject.AbsolutePosition.X,SensedObject.AbsolutePosition.Y,SensedObject.AbsolutePosition.Z); + return new LSL_Types.Vector3( + SensedObject.AbsolutePosition.X, + SensedObject.AbsolutePosition.Y, + SensedObject.AbsolutePosition.Z); } public LSL_Types.Vector3 llDetectedVel(int number) @@ -897,7 +899,10 @@ namespace OpenSim.Region.ScriptEngine.Common EntityBase SensedObject = entityDetectedKey(number); if (SensedObject == null) return new LSL_Types.Vector3(0, 0, 0); - return new LSL_Types.Vector3(SensedObject.Velocity.X, SensedObject.Velocity.Y, SensedObject.Velocity.Z); + return new LSL_Types.Vector3( + SensedObject.Velocity.X, + SensedObject.Velocity.Y, + SensedObject.Velocity.Z); } public LSL_Types.Vector3 llDetectedGrab(int number) @@ -910,7 +915,7 @@ namespace OpenSim.Region.ScriptEngine.Common return new LSL_Types.Vector3( SensedObject.AbsolutePosition.X, SensedObject.AbsolutePosition.Y, - SensedObject.AbsolutePosition.Y); + SensedObject.AbsolutePosition.Z); } public LSL_Types.Quaternion llDetectedRot(int number) @@ -919,7 +924,11 @@ namespace OpenSim.Region.ScriptEngine.Common EntityBase SensedObject = entityDetectedKey(number); if (SensedObject == null) return new LSL_Types.Quaternion(); - return new LSL_Types.Quaternion(SensedObject.Rotation.x, SensedObject.Rotation.y, SensedObject.Rotation.z, SensedObject.Rotation.w); + return new LSL_Types.Quaternion( + SensedObject.Rotation.X, + SensedObject.Rotation.Y, + SensedObject.Rotation.Z, + SensedObject.Rotation.W); } public LSL_Types.LSLInteger llDetectedGroup(int number) @@ -1005,7 +1014,7 @@ namespace OpenSim.Region.ScriptEngine.Common if ((status & BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) == BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) { - m_host.AddFlag(LLObject.ObjectFlags.CastShadows); + m_host.AddFlag(PrimFlags.CastShadows); } if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) @@ -1055,25 +1064,25 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llGetStatus(int status) { m_host.AddScriptLPS(1); - // Console.WriteLine(m_host.UUID.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); + // Console.WriteLine(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); switch (status) { case BuiltIn_Commands_BaseClass.STATUS_PHYSICS: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == (uint)LLObject.ObjectFlags.Physics) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Physics) == (uint)PrimFlags.Physics) { return 1; } return 0; case BuiltIn_Commands_BaseClass.STATUS_PHANTOM: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) == (uint)PrimFlags.Phantom) { return 1; } return 0; case BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.CastShadows) == (uint)PrimFlags.CastShadows) { return 1; } @@ -1140,7 +1149,7 @@ namespace OpenSim.Region.ScriptEngine.Common scale.y = World.m_maxNonphys; if (scale.z > World.m_maxNonphys) scale.z = World.m_maxNonphys; - LLVector3 tmp = part.Scale; + Vector3 tmp = part.Scale; tmp.X = (float)scale.x; tmp.Y = (float)scale.y; tmp.Z = (float)scale.z; @@ -1163,8 +1172,8 @@ namespace OpenSim.Region.ScriptEngine.Common private void SetColor(SceneObjectPart part, LSL_Types.Vector3 color, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -1200,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void SetGlow(SceneObjectPart part, int face, float glow) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { tex.CreateFace((uint) face); @@ -1247,7 +1256,7 @@ namespace OpenSim.Region.ScriptEngine.Common break; } - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { tex.CreateFace((uint) face); @@ -1275,7 +1284,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void SetFullBright(SceneObjectPart part, int face, bool bright) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { tex.CreateFace((uint) face); @@ -1301,7 +1310,7 @@ namespace OpenSim.Region.ScriptEngine.Common public double llGetAlpha(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color { return (double)((tex.DefaultTexture.RGBA.A * 255) / 255); @@ -1322,8 +1331,8 @@ namespace OpenSim.Region.ScriptEngine.Common private void SetAlpha(SceneObjectPart part, double alpha, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -1450,8 +1459,8 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.Vector3 llGetColor(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = m_host.Shape.Textures; + Color4 texcolor; LSL_Types.Vector3 rgb; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color { @@ -1484,21 +1493,21 @@ namespace OpenSim.Region.ScriptEngine.Common private void SetTexture(SceneObjectPart part, string texture, int face) { - LLUUID textureID=new LLUUID(); + UUID textureID=new UUID(); - if (!LLUUID.TryParse(texture, out textureID)) + if (!UUID.TryParse(texture, out textureID)) { textureID=InventoryKey(texture, (int)AssetType.Texture); } - if (textureID == LLUUID.Zero) + if (textureID == UUID.Zero) return; - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { - LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); + Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.TextureID = textureID; tex.FaceTextures[face] = texface; part.UpdateTexture(tex); @@ -1529,10 +1538,10 @@ namespace OpenSim.Region.ScriptEngine.Common private void ScaleTexture(SceneObjectPart part, double u, double v, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { - LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); + Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.RepeatU = (float)u; texface.RepeatV = (float)v; tex.FaceTextures[face] = texface; @@ -1565,10 +1574,10 @@ namespace OpenSim.Region.ScriptEngine.Common private void OffsetTexture(SceneObjectPart part, double u, double v, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { - LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); + Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.OffsetU = (float)u; texface.OffsetV = (float)v; tex.FaceTextures[face] = texface; @@ -1601,10 +1610,10 @@ namespace OpenSim.Region.ScriptEngine.Common private void RotateTexture(SceneObjectPart part, double rotation, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { - LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); + Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.Rotation = (float)rotation; tex.FaceTextures[face] = texface; part.UpdateTexture(tex); @@ -1628,14 +1637,14 @@ namespace OpenSim.Region.ScriptEngine.Common public string llGetTexture(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; if (face == -1) { face = 0; } if (face > -1) { - LLObject.TextureEntryFace texface; + Primitive.TextureEntryFace texface; texface = tex.GetFace((uint)face); return texface.TextureID.ToString(); } @@ -1665,11 +1674,11 @@ namespace OpenSim.Region.ScriptEngine.Common if (part.ParentID != 0) { - part.UpdateOffSet(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); + part.UpdateOffSet(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); } else { - part.UpdateGroupPosition(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); + part.UpdateGroupPosition(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); } } @@ -1709,7 +1718,7 @@ namespace OpenSim.Region.ScriptEngine.Common private void SetRot(SceneObjectPart part, LSL_Types.Quaternion rot) { - part.UpdateRotation(new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s)); + part.UpdateRotation(new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s)); // Update rotation does not move the object in the physics scene if it's a linkset. part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; } @@ -1717,14 +1726,18 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.Quaternion llGetRot() { m_host.AddScriptLPS(1); - LLQuaternion q = m_host.RotationOffset; + Quaternion q = m_host.RotationOffset; return new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); } public LSL_Types.Quaternion llGetLocalRot() { m_host.AddScriptLPS(1); - return new LSL_Types.Quaternion(m_host.RotationOffset.X, m_host.RotationOffset.Y, m_host.RotationOffset.Z, m_host.RotationOffset.W); + return new LSL_Types.Quaternion( + m_host.RotationOffset.X, + m_host.RotationOffset.Y, + m_host.RotationOffset.Z, + m_host.RotationOffset.W); } public void llSetForce(LSL_Types.Vector3 force, int local) @@ -1769,7 +1782,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llTarget(LSL_Types.Vector3 position, double range) { m_host.AddScriptLPS(1); - return m_host.registerTargetWaypoint(new LLVector3((float)position.x, (float)position.y, (float)position.z), (float)range); + return m_host.registerTargetWaypoint(new Vector3((float)position.x, (float)position.y, (float)position.z), (float)range); } @@ -1795,7 +1808,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llMoveToTarget(LSL_Types.Vector3 target, double tau) { m_host.AddScriptLPS(1); - m_host.MoveToTarget(new LLVector3((float)target.x, (float)target.y, (float)target.z), (float)tau); + m_host.MoveToTarget(new Vector3((float)target.x, (float)target.y, (float)target.z), (float)tau); } public void llStopMoveToTarget() @@ -1816,7 +1829,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (force.z > 20000) force.z = 20000; - m_host.ApplyImpulse(new LLVector3((float)force.x, (float)force.y, (float)force.z), local != 0); + m_host.ApplyImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0); } public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) @@ -1925,7 +1938,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); - if (m_host.Sound != LLUUID.Zero) + if (m_host.Sound != UUID.Zero) llStopSound(); m_host.Sound = KeyOrName(sound); @@ -1967,7 +1980,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); - m_host.Sound = LLUUID.Zero; + m_host.Sound = UUID.Zero; m_host.SoundGain = 0; m_host.SoundFlags = 0; m_host.SoundRadius = 0; @@ -1975,7 +1988,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.ScheduleFullUpdate(); m_host.SendFullUpdateToAllClients(); - // m_host.SendSound(LLUUID.Zero.ToString(), 1.0, false, 2); + // m_host.SendSound(UUID.Zero.ToString(), 1.0, false, 2); } public void llPreloadSound(string sound) @@ -2223,13 +2236,13 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llGiveMoney(string destination, int amount) { - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return 0; m_host.AddScriptLPS(1); - if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) + if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) return 0; if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_DEBIT) == 0) @@ -2238,9 +2251,9 @@ namespace OpenSim.Region.ScriptEngine.Common return 0; } - LLUUID toID=new LLUUID(); + UUID toID=new UUID(); - if (!LLUUID.TryParse(destination, out toID)) + if (!UUID.TryParse(destination, out toID)) { LSLError("Bad key in llGiveMoney"); return 0; @@ -2303,7 +2316,7 @@ namespace OpenSim.Region.ScriptEngine.Common // it's possible to have two items with the same task inventory name. // this is an easter egg of sorts. - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == inventory) { @@ -2314,18 +2327,18 @@ namespace OpenSim.Region.ScriptEngine.Common continue; } - LLVector3 llpos = new LLVector3((float)pos.x, (float)pos.y, (float)pos.z); + Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z); // test if we're further away then 10m if (Util.GetDistanceTo(llpos, m_host.AbsolutePosition) > 10) return; // wiki says, if it's further away then 10m, silently fail. - LLVector3 llvel = new LLVector3((float)vel.x, (float)vel.y, (float)vel.z); + Vector3 llvel = new Vector3((float)vel.x, (float)vel.y, (float)vel.z); // need the magnitude later float velmag = (float)Util.GetMagnitude(llvel); - SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param); + SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param); // If either of these are null, then there was an unknown error. if (new_group == null) @@ -2336,7 +2349,7 @@ namespace OpenSim.Region.ScriptEngine.Common // objects rezzed with this method are die_at_edge by default. new_group.RootPart.SetDieAtEdge(true); - m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "object_rez", EventQueueManager.llDetectNull, new Object[] { new LSL_Types.LSLString(new_group.RootPart.UUID.ToString()) }); + m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "object_rez", EventQueueManager.llDetectNull, new Object[] { new LSL_Types.LSLString(new_group.RootPart.ToString()) }); float groupmass = new_group.GetMass(); //Recoil. @@ -2401,7 +2414,7 @@ namespace OpenSim.Region.ScriptEngine.Common return; } - if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) + if (m_host.TaskInventory[InventorySelf()].PermsGranter != UUID.Zero) { ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); @@ -2428,7 +2441,7 @@ namespace OpenSim.Region.ScriptEngine.Common return; } - if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) + if (m_host.TaskInventory[InventorySelf()].PermsGranter != UUID.Zero) { ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); @@ -2489,14 +2502,14 @@ namespace OpenSim.Region.ScriptEngine.Common // TODO: figure out values for client, fromSession, and imSessionID // client.SendInstantMessage(m_host.UUID, fromSession, message, user, imSessionID, m_host.Name, AgentManager.InstantMessageDialog.MessageFromAgent, (uint)Util.UnixTimeSinceEpoch()); - LLUUID friendTransactionID = LLUUID.Random(); + UUID friendTransactionID = UUID.Random(); //m_pendingFriendRequests.Add(friendTransactionID, fromAgentID); GridInstantMessage msg = new GridInstantMessage(); - msg.fromAgentID = new Guid(m_host.UUID.ToString()); // fromAgentID.UUID; + msg.fromAgentID = new Guid(m_host.ToString()); // fromAgentID.Guid; msg.fromAgentSession = new Guid(friendTransactionID.ToString());// fromAgentSession.UUID; - msg.toAgentID = new Guid(user); // toAgentID.UUID; + msg.toAgentID = new Guid(user); // toAgentID.Guid; msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here // Console.WriteLine("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); // Console.WriteLine("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); @@ -2514,8 +2527,8 @@ namespace OpenSim.Region.ScriptEngine.Common msg.fromGroup = false;// fromGroup; msg.offline = (byte)0; //offline; msg.ParentEstateID = 0; //ParentEstateID; - msg.Position = new sLLVector3();// new sLLVector3(m_host.AbsolutePosition); - msg.RegionID = World.RegionInfo.RegionID.UUID;//RegionID.UUID; + msg.Position = Vector3.Zero;// new Vector3(m_host.AbsolutePosition); + msg.RegionID = World.RegionInfo.RegionID.Guid;//RegionID.Guid; msg.binaryBucket = new byte[0];// binaryBucket; World.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); // ScriptSleep(2000); @@ -2543,7 +2556,7 @@ namespace OpenSim.Region.ScriptEngine.Common public string llGetKey() { m_host.AddScriptLPS(1); - return m_host.UUID.ToString(); + return m_host.ToString(); } public void llSetBuoyancy(double buoyancy) @@ -2607,11 +2620,11 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return; - if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) + if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) return; if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) @@ -2620,9 +2633,9 @@ namespace OpenSim.Region.ScriptEngine.Common if (presence != null) { - // Do NOT try to parse LLUUID, animations cannot be triggered by ID - LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); - if (animID == LLUUID.Zero) + // Do NOT try to parse UUID, animations cannot be triggered by ID + UUID animID=InventoryKey(anim, (int)AssetType.Animation); + if (animID == UUID.Zero) presence.AddAnimation(anim); else presence.AddAnimation(animID); @@ -2634,30 +2647,30 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return; - if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) + if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) return; if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) { - LLUUID animID = new LLUUID(); + UUID animID = new UUID(); - if (!LLUUID.TryParse(anim, out animID)) + if (!UUID.TryParse(anim, out animID)) { animID=InventoryKey(anim); } - if (animID == LLUUID.Zero) + if (animID == UUID.Zero) return; ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); if (presence != null) { - if (animID == LLUUID.Zero) + if (animID == UUID.Zero) presence.RemoveAnimation(anim); else presence.RemoveAnimation(animID); @@ -2680,8 +2693,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) { m_host.AddScriptLPS(1); - m_host.RotationalVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); - m_host.AngularVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); + m_host.RotationalVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); + m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); m_host.ScheduleTerseUpdate(); m_host.SendTerseUpdateToAllClients(); } @@ -2700,19 +2713,19 @@ namespace OpenSim.Region.ScriptEngine.Common public void llRequestPermissions(string agent, int perm) { - LLUUID agentID=new LLUUID(); + UUID agentID=new UUID(); - if (!LLUUID.TryParse(agent, out agentID)) + if (!UUID.TryParse(agent, out agentID)) return; - LLUUID invItemID=InventorySelf(); + UUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == UUID.Zero) return; // Not in a prim? How?? - if (agentID == LLUUID.Zero || perm == 0) // Releasing permissions + if (agentID == UUID.Zero || perm == 0) // Releasing permissions { - m_host.TaskInventory[invItemID].PermsGranter=LLUUID.Zero; + m_host.TaskInventory[invItemID].PermsGranter=UUID.Zero; m_host.TaskInventory[invItemID].PermsMask=0; m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( @@ -2786,14 +2799,14 @@ namespace OpenSim.Region.ScriptEngine.Common m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {new LSL_Types.LSLInteger(0)}); } - void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer) + void handleScriptAnswer(IClientAPI client, UUID taskID, UUID itemID, int answer) { if (taskID != m_host.UUID) return; - LLUUID invItemID=InventorySelf(); + UUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == UUID.Zero) return; client.OnScriptAnswer-=handleScriptAnswer; @@ -2816,7 +2829,7 @@ namespace OpenSim.Region.ScriptEngine.Common } } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public LSL_Types.LSLInteger llGetPermissions() @@ -2854,8 +2867,8 @@ namespace OpenSim.Region.ScriptEngine.Common SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); if (linknumber > -1) { - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -2901,8 +2914,8 @@ namespace OpenSim.Region.ScriptEngine.Common { linknumber = w; part = m_host.ParentGroup.GetLinkNumPart(linknumber); - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -2945,7 +2958,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llCreateLink(string target, int parent) { m_host.AddScriptLPS(1); - LLUUID invItemID = InventorySelf(); + UUID invItemID = InventorySelf(); if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CHANGE_LINKS) == 0) { ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); return; @@ -2970,7 +2983,7 @@ namespace OpenSim.Region.ScriptEngine.Common childPrim.RootPart.UpdateFlag = uf; } parentPrim.TriggerScriptChangedEvent(Changed.LINK); - parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected); + parentPrim.RootPart.AddFlag(PrimFlags.CreateSelected); parentPrim.GetProperties(client); ScriptSleep(1000); @@ -2994,11 +3007,11 @@ namespace OpenSim.Region.ScriptEngine.Common SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); if (part != null) { - return part.UUID.ToString(); + return part.ToString(); } else { - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } } @@ -3020,7 +3033,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); int count = 0; - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Type == type || type == -1) { @@ -3034,7 +3047,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); ArrayList keys = new ArrayList(); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Type == type || type == -1) { @@ -3055,7 +3068,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetScriptState(string name, int run) { - LLUUID item; + UUID item; ScriptManager sm; IScript script = null; @@ -3064,7 +3077,7 @@ namespace OpenSim.Region.ScriptEngine.Common // These functions are supposed to be robust, // so get the state one step at a time. - if ((item = ScriptByName(name)) != LLUUID.Zero) + if ((item = ScriptByName(name)) != UUID.Zero) { if ((sm = m_ScriptEngine.m_ScriptManager) != null) { @@ -3098,17 +3111,17 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); bool found = false; - LLUUID destId = LLUUID.Zero; - LLUUID objId = LLUUID.Zero; + UUID destId = UUID.Zero; + UUID objId = UUID.Zero; - if (!LLUUID.TryParse(destination, out destId)) + if (!UUID.TryParse(destination, out destId)) { llSay(0, "Could not parse key " + destination); return; } // move the first object found with this inventory name - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == inventory) { @@ -3186,22 +3199,22 @@ namespace OpenSim.Region.ScriptEngine.Common { if (item.Type == 3 && item.Name == name) { - LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( + UUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( m_localID, m_itemID, item.AssetID.ToString()); - LLVector3 region = new LLVector3( + Vector3 region = new Vector3( World.RegionInfo.RegionLocX * Constants.RegionSize, World.RegionInfo.RegionLocY * Constants.RegionSize, 0); World.AssetCache.GetAsset(item.AssetID, - delegate(LLUUID i, AssetBase a) + delegate(UUID i, AssetBase a) { AssetLandmark lm = new AssetLandmark(a); float rx = (uint)(lm.RegionHandle >> 32); float ry = (uint)lm.RegionHandle; - region = lm.Position + new LLVector3(rx, ry, 0) - region; + region = lm.Position + new Vector3(rx, ry, 0) - region; string reply = region.ToString(); m_ScriptEngine.m_ASYNCLSLCommandManager. @@ -3226,8 +3239,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llTeleportAgentHome(string agent) { m_host.AddScriptLPS(1); - LLUUID agentId = new LLUUID(); - if (LLUUID.TryParse(agent, out agentId)) + UUID agentId = new UUID(); + if (UUID.TryParse(agent, out agentId)) { ScenePresence presence = World.GetScenePresence(agentId); if (presence != null) @@ -3243,7 +3256,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llModifyLand(int action, int brush) { m_host.AddScriptLPS(1); - World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0)); + World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new Vector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0)); } public void llCollisionSound(string impact_sound, double impact_volume) @@ -3277,7 +3290,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); uint partLocalID; - LLUUID partItemID; + UUID partItemID; switch ((int)linknum) { @@ -3452,7 +3465,7 @@ namespace OpenSim.Region.ScriptEngine.Common SceneObjectPart targ = World.GetSceneObjectPart(target); if (targ == null) return; - targ.ApplyImpulse(new LLVector3((float)impulse.x, (float)impulse.y, (float)impulse.z), local != 0); + targ.ApplyImpulse(new Vector3((float)impulse.x, (float)impulse.y, (float)impulse.z), local != 0); } public void llPassCollisions(int pass) @@ -3731,7 +3744,7 @@ namespace OpenSim.Region.ScriptEngine.Common public string llGetInventoryKey(string name) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { @@ -3741,11 +3754,11 @@ namespace OpenSim.Region.ScriptEngine.Common } else { - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } } } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public void llAllowInventoryDrop(int add) @@ -3763,10 +3776,10 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); LSL_Types.Vector3 SunDoubleVector3; - LLVector3 SunFloatVector3; + Vector3 SunFloatVector3; // sunPosition estate setting is set in OpenSim.Region.Environment.Modules.SunModule - // have to convert from LLVector3 (float) to LSL_Types.Vector3 (double) + // have to convert from Vector3 (float) to LSL_Types.Vector3 (double) SunFloatVector3 = World.RegionInfo.RegionSettings.SunVector; SunDoubleVector3.x = (double)SunFloatVector3.X; SunDoubleVector3.y = (double)SunFloatVector3.Y; @@ -3778,7 +3791,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.Vector3 llGetTextureOffset(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; LSL_Types.Vector3 offset; if (face == -1) { @@ -3793,7 +3806,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.Vector3 llGetTextureScale(int side) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; LSL_Types.Vector3 scale; if (side == -1) { @@ -3808,7 +3821,7 @@ namespace OpenSim.Region.ScriptEngine.Common public double llGetTextureRot(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; if (face == -1) { face = 0; @@ -3825,14 +3838,14 @@ namespace OpenSim.Region.ScriptEngine.Common public string llGetOwnerKey(string id) { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id, out key)) + UUID key = new UUID(); + if (UUID.TryParse(id, out key)) { return World.GetSceneObjectPart(World.Entities[key].LocalId).OwnerID.ToString(); } else { - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } } @@ -4041,8 +4054,8 @@ namespace OpenSim.Region.ScriptEngine.Common return 2; if (src.Data[index] is String) { - LLUUID tuuid; - if (LLUUID.TryParse(src.Data[index].ToString(), out tuuid)) + UUID tuuid; + if (UUID.TryParse(src.Data[index].ToString(), out tuuid)) { return 3; } @@ -4454,8 +4467,8 @@ namespace OpenSim.Region.ScriptEngine.Common public string llKey2Name(string id) { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id,out key)) + UUID key = new UUID(); + if (UUID.TryParse(id,out key)) { ScenePresence presence = World.GetScenePresence(key); @@ -4479,7 +4492,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); - pTexAnim.Flags =(uint) mode; + pTexAnim.Flags =(Primitive.TextureAnimMode)mode; //ALL_SIDES if (face == -1) @@ -4568,8 +4581,8 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llOverMyLand(string id) { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id,out key)) + UUID key = new UUID(); + if (UUID.TryParse(id,out key)) { ScenePresence presence = World.GetScenePresence(key); if (presence != null) // object is an avatar @@ -4612,8 +4625,8 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id, out key)) + UUID key = new UUID(); + if (UUID.TryParse(id, out key)) { ScenePresence av = World.GetScenePresence(key); @@ -4751,8 +4764,8 @@ namespace OpenSim.Region.ScriptEngine.Common Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); // TODO find out about the other defaults and add them here - ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); - ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); + ps.PartStartColor = new Color4(1.0f, 1.0f, 1.0f, 1.0f); + ps.PartEndColor = new Color4(1.0f, 1.0f, 1.0f, 1.0f); ps.PartStartScaleX = 1.0f; ps.PartStartScaleY = 1.0f; ps.PartEndScaleX = 1.0f; @@ -4800,7 +4813,7 @@ namespace OpenSim.Region.ScriptEngine.Common case (int)BuiltIn_Commands_BaseClass.PSYS_PART_END_COLOR: tempv = (LSL_Types.Vector3)rules.Data[i + 1]; - //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1); + //prules.PartEndColor = new Color4(tempv.x,tempv.y,tempv.z,1); prules.PartEndColor.R = (float)tempv.x; prules.PartEndColor.G = (float)tempv.y; @@ -4879,8 +4892,8 @@ namespace OpenSim.Region.ScriptEngine.Common break; case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_TARGET_KEY: - LLUUID key = LLUUID.Zero; - if (LLUUID.TryParse(rules.Data[i + 1].ToString(), out key)) + UUID key = UUID.Zero; + if (UUID.TryParse(rules.Data[i + 1].ToString(), out key)) { prules.Target = key; } @@ -4924,37 +4937,37 @@ namespace OpenSim.Region.ScriptEngine.Common NotImplemented("llGroundRepel"); } - private LLUUID GetTaskInventoryItem(string name) + private UUID GetTaskInventoryItem(string name) { - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) return inv.Key; } - return LLUUID.Zero; + return UUID.Zero; } public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory) { m_host.AddScriptLPS(1); - LLUUID destID; - if (!LLUUID.TryParse(destination, out destID)) + UUID destID; + if (!UUID.TryParse(destination, out destID)) return; - List itemList = new List(); + List itemList = new List(); foreach (Object item in inventory.Data) { - LLUUID itemID; - if (LLUUID.TryParse(item.ToString(), out itemID)) + UUID itemID; + if (UUID.TryParse(item.ToString(), out itemID)) { itemList.Add(itemID); } else { itemID = GetTaskInventoryItem(item.ToString()); - if (itemID != LLUUID.Zero) + if (itemID != UUID.Zero) itemList.Add(itemID); } } @@ -5015,7 +5028,7 @@ namespace OpenSim.Region.ScriptEngine.Common rot.z = 1; // ZERO_ROTATION = 0,0,0,1 m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z); - m_host.SitTargetOrientation = new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z); + m_host.SitTargetOrientation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); } public string llAvatarOnSitTarget() @@ -5027,12 +5040,12 @@ namespace OpenSim.Region.ScriptEngine.Common public void llAddToLandPassList(string avatar, double hours) { m_host.AddScriptLPS(1); - LLUUID key; + UUID key; LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; if (land.OwnerID == m_host.OwnerID) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); - if (LLUUID.TryParse(avatar, out key)) + if (UUID.TryParse(avatar, out key)) { entry.AgentID = key; entry.Flags = ParcelManager.AccessList.Access; @@ -5058,13 +5071,13 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) { m_host.AddScriptLPS(1); - m_host.SetCameraEyeOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z)); + m_host.SetCameraEyeOffset(new Vector3((float)offset.x, (float)offset.y, (float)offset.z)); } public void llSetCameraAtOffset(LSL_Types.Vector3 offset) { m_host.AddScriptLPS(1); - m_host.SetCameraAtOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z)); + m_host.SetCameraAtOffset(new Vector3((float)offset.x, (float)offset.y, (float)offset.z)); } public string llDumpList2String(LSL_Types.list src, string seperator) @@ -5086,7 +5099,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llScriptDanger(LSL_Types.Vector3 pos) { m_host.AddScriptLPS(1); - bool result = World.scriptDanger(m_host.LocalId, new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); + bool result = World.scriptDanger(m_host.LocalId, new Vector3((float)pos.x, (float)pos.y, (float)pos.z)); if (result) { return 1; @@ -5101,8 +5114,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel) { m_host.AddScriptLPS(1); - LLUUID av = new LLUUID(); - if (!LLUUID.TryParse(avatar,out av)) + UUID av = new UUID(); + if (!UUID.TryParse(avatar,out av)) { LSLError("First parameter to llDialog needs to be a key"); return; @@ -5127,7 +5140,7 @@ namespace OpenSim.Region.ScriptEngine.Common } buts[i] = buttons.Data[i].ToString(); } - World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); + World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); // ScriptSleep(1000); } @@ -5144,7 +5157,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llResetOtherScript(string name) { - LLUUID item; + UUID item; ScriptManager sm; IScript script = null; @@ -5153,7 +5166,7 @@ namespace OpenSim.Region.ScriptEngine.Common // These functions are supposed to be robust, // so get the state one step at a time. - if ((item = ScriptByName(name)) != LLUUID.Zero) + if ((item = ScriptByName(name)) != UUID.Zero) if ((sm = m_ScriptEngine.m_ScriptManager) != null) sm.ResetScript(m_localID, item); @@ -5168,7 +5181,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llGetScriptState(string name) { - LLUUID item; + UUID item; ScriptManager sm; IScript script = null; @@ -5177,7 +5190,7 @@ namespace OpenSim.Region.ScriptEngine.Common // These functions are supposed to be robust, // so get the state one step at a time. - if ((item = ScriptByName(name)) != LLUUID.Zero) + if ((item = ScriptByName(name)) != UUID.Zero) { if ((sm = m_ScriptEngine.m_ScriptManager) != null) { @@ -5216,10 +5229,10 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); bool found = false; - LLUUID destId = LLUUID.Zero; - LLUUID srcId = LLUUID.Zero; + UUID destId = UUID.Zero; + UUID srcId = UUID.Zero; - if (!LLUUID.TryParse(target, out destId)) + if (!UUID.TryParse(target, out destId)) { llSay(0, "Could not parse key " + target); return; @@ -5232,7 +5245,7 @@ namespace OpenSim.Region.ScriptEngine.Common } // copy the first script found with this inventory name - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { @@ -5264,8 +5277,8 @@ namespace OpenSim.Region.ScriptEngine.Common IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface(); if (xmlrpcMod.IsEnabled()) { - LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, LLUUID.Zero); - object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(LLUUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) }; + UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, UUID.Zero); + object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(UUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) }; m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", EventQueueManager.llDetectNull, resobj); } // ScriptSleep(1000); @@ -5583,9 +5596,9 @@ namespace OpenSim.Region.ScriptEngine.Common private void SetPrimitiveShapeParams(SceneObjectPart part, string map, int type) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); - LLUUID sculptId; + UUID sculptId; - if (!LLUUID.TryParse(map, out sculptId)) + if (!UUID.TryParse(map, out sculptId)) { llSay(0, "Could not parse key " + map); return; @@ -6015,9 +6028,9 @@ namespace OpenSim.Region.ScriptEngine.Common ScenePresence av = World.GetScenePresence(id); if (av == null) return l; - LLUUID[] anims; + UUID[] anims; anims = av.GetAnimationArray(); - foreach (LLUUID foo in anims) + foreach (UUID foo in anims) l.Add(foo.ToString()); return l; } @@ -6025,8 +6038,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetParcelMusicURL(string url) { m_host.AddScriptLPS(1); - LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (landowner == LLUUID.Zero) + UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + if (landowner == UUID.Zero) { return; } @@ -6041,9 +6054,9 @@ namespace OpenSim.Region.ScriptEngine.Common public void osSetParcelMediaURL(string url) { m_host.AddScriptLPS(1); - LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (landowner == LLUUID.Zero) + if (landowner == UUID.Zero) { return; } @@ -6059,13 +6072,20 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.Vector3 llGetRootPosition() { m_host.AddScriptLPS(1); - return new LSL_Types.Vector3(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, m_host.ParentGroup.AbsolutePosition.Z); + return new LSL_Types.Vector3( + m_host.ParentGroup.AbsolutePosition.X, + m_host.ParentGroup.AbsolutePosition.Y, + m_host.ParentGroup.AbsolutePosition.Z); } public LSL_Types.Quaternion llGetRootRotation() { m_host.AddScriptLPS(1); - return new LSL_Types.Quaternion(m_host.ParentGroup.GroupRotation.X, m_host.ParentGroup.GroupRotation.Y, m_host.ParentGroup.GroupRotation.Z, m_host.ParentGroup.GroupRotation.W); + return new LSL_Types.Quaternion( + m_host.ParentGroup.GroupRotation.X, + m_host.ParentGroup.GroupRotation.Y, + m_host.ParentGroup.GroupRotation.Z, + m_host.ParentGroup.GroupRotation.W); } public string llGetObjectDesc() @@ -6097,8 +6117,8 @@ namespace OpenSim.Region.ScriptEngine.Common SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); if (linknumber > -1) { - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -6136,8 +6156,8 @@ namespace OpenSim.Region.ScriptEngine.Common { linknumber = w; part = m_host.ParentGroup.GetLinkNumPart(linknumber); - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -6184,7 +6204,8 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.Vector3 llGetGeometricCenter() { - return new LSL_Types.Vector3(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z); + return new LSL_Types.Vector3( + m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z); } public LSL_Types.list llGetPrimitiveParams(LSL_Types.list rules) @@ -6205,21 +6226,21 @@ namespace OpenSim.Region.ScriptEngine.Common break; case (int)BuiltIn_Commands_BaseClass.PRIM_PHYSICS: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) != 0) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Physics) != 0) res.Add(new LSL_Types.LSLInteger(1)); else res.Add(new LSL_Types.LSLInteger(0)); break; case (int)BuiltIn_Commands_BaseClass.PRIM_TEMP_ON_REZ: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) != 0) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) != 0) res.Add(new LSL_Types.LSLInteger(1)); else res.Add(new LSL_Types.LSLInteger(0)); break; case (int)BuiltIn_Commands_BaseClass.PRIM_PHANTOM: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) != 0) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0) res.Add(new LSL_Types.LSLInteger(1)); else res.Add(new LSL_Types.LSLInteger(0)); @@ -6324,8 +6345,8 @@ namespace OpenSim.Region.ScriptEngine.Common if (face == -1) face = 0; - LLObject.TextureEntry tex = m_host.Shape.Textures; - LLObject.TextureEntryFace texface = tex.GetFace((uint)face); + Primitive.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); res.Add(new LSL_Types.LSLString(texface.TextureID.ToString())); res.Add(new LSL_Types.Vector3(texface.RepeatU, @@ -6344,7 +6365,7 @@ namespace OpenSim.Region.ScriptEngine.Common face=Convert.ToInt32("" + rules.Data[idx++]); tex = m_host.Shape.Textures; - LLColor texcolor; + Color4 texcolor; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color texcolor = tex.DefaultTexture.RGBA; else @@ -6698,7 +6719,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetLocalRot(LSL_Types.Quaternion rot) { m_host.AddScriptLPS(1); - m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); + m_host.RotationOffset = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); // ScriptSleep(200); } @@ -6954,7 +6975,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llGetInventoryPermMask(string item, int mask) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == item) { @@ -6985,7 +7006,7 @@ namespace OpenSim.Region.ScriptEngine.Common public string llGetInventoryCreator(string item) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == item) { @@ -7000,7 +7021,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); - World.SimChatBroadcast(Helpers.StringToField(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); + World.SimChatBroadcast(Utils.StringToBytes(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); // IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); // wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg); } @@ -7021,7 +7042,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (info == null) { // ScriptSleep(1000); - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } reply = new LSL_Types.Vector3( info.RegionLocX * Constants.RegionSize, @@ -7038,7 +7059,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (info == null) { // ScriptSleep(1000); - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } int access = info.RegionSettings.Maturity; if (access == 0) @@ -7053,11 +7074,11 @@ namespace OpenSim.Region.ScriptEngine.Common break; default: // ScriptSleep(1000); - return LLUUID.Zero.ToString(); // Raise no event + return UUID.Zero.ToString(); // Raise no event } - LLUUID rq = LLUUID.Random(); + UUID rq = UUID.Random(); - LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. + UUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. m_Dataserver.RegisterRequest(m_localID, m_itemID, rq.ToString()); m_ScriptEngine.m_ASYNCLSLCommandManager. @@ -7069,7 +7090,7 @@ namespace OpenSim.Region.ScriptEngine.Common catch(Exception e) { Console.WriteLine(e.ToString()); - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } } @@ -7082,8 +7103,8 @@ namespace OpenSim.Region.ScriptEngine.Common public double llGetObjectMass(string id) { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id,out key)) + UUID key = new UUID(); + if (UUID.TryParse(id,out key)) { return (double)World.GetSceneObjectPart(World.Entities[key].LocalId).GetMass(); } @@ -7175,7 +7196,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llLoadURL(string avatar_id, string message, string url) { m_host.AddScriptLPS(1); - LLUUID avatarId = new LLUUID(avatar_id); + UUID avatarId = new UUID(avatar_id); m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, url); // ScriptSleep(10000); @@ -7321,7 +7342,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llGetInventoryType(string name) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { @@ -7350,10 +7371,10 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.Vector3 llGetCameraPos() { m_host.AddScriptLPS(1); - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return new LSL_Types.Vector3(); - if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) + if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) return new LSL_Types.Vector3(); if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA) == 0) { @@ -7363,7 +7384,10 @@ namespace OpenSim.Region.ScriptEngine.Common ScenePresence presence = World.GetScenePresence(m_host.OwnerID); if (presence != null) { - LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); + LSL_Types.Vector3 pos = new LSL_Types.Vector3( + presence.CameraPosition.X, + presence.CameraPosition.Y, + presence.CameraPosition.Z); return pos; } return new LSL_Types.Vector3(); @@ -7426,12 +7450,12 @@ namespace OpenSim.Region.ScriptEngine.Common public void llAddToLandBanList(string avatar, double hours) { m_host.AddScriptLPS(1); - LLUUID key; + UUID key; LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; if (land.OwnerID == m_host.OwnerID) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); - if (LLUUID.TryParse(avatar, out key)) + if (UUID.TryParse(avatar, out key)) { entry.AgentID = key; entry.Flags = ParcelManager.AccessList.Ban; @@ -7445,11 +7469,11 @@ namespace OpenSim.Region.ScriptEngine.Common public void llRemoveFromLandPassList(string avatar) { m_host.AddScriptLPS(1); - LLUUID key; + UUID key; LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; if (land.OwnerID == m_host.OwnerID) { - if (LLUUID.TryParse(avatar, out key)) + if (UUID.TryParse(avatar, out key)) { foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) { @@ -7467,11 +7491,11 @@ namespace OpenSim.Region.ScriptEngine.Common public void llRemoveFromLandBanList(string avatar) { m_host.AddScriptLPS(1); - LLUUID key; + UUID key; LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; if (land.OwnerID == m_host.OwnerID) { - if (LLUUID.TryParse(avatar, out key)) + if (UUID.TryParse(avatar, out key)) { foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) { @@ -7491,16 +7515,16 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); // our key in the object we are in - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) return; + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return; // the object we are in - LLUUID objectID = m_host.ParentUUID; - if (objectID == LLUUID.Zero) return; + UUID objectID = m_host.ParentUUID; + if(objectID == UUID.Zero) return; // we need the permission first, to know which avatar we want to set the camera for - LLUUID agentID = m_host.TaskInventory[invItemID].PermsGranter; - if (agentID == LLUUID.Zero) return; + UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; + if (agentID == UUID.Zero) return; if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); @@ -7542,16 +7566,16 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); // our key in the object we are in - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) return; + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return; // the object we are in - LLUUID objectID = m_host.ParentUUID; - if (objectID == LLUUID.Zero) return; + UUID objectID = m_host.ParentUUID; + if(objectID == UUID.Zero) return; // we need the permission first, to know which avatar we want to clear the camera for - LLUUID agentID = m_host.TaskInventory[invItemID].PermsGranter; - if (agentID == LLUUID.Zero) return; + UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; + if (agentID == UUID.Zero) return; if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); @@ -7650,9 +7674,9 @@ namespace OpenSim.Region.ScriptEngine.Common param.Add(o.ToString()); } - LLVector3 position = m_host.AbsolutePosition; - LLVector3 velocity = m_host.Velocity; - LLQuaternion rotation = m_host.RotationOffset; + Vector3 position = m_host.AbsolutePosition; + Vector3 velocity = m_host.Velocity; + Quaternion rotation = m_host.RotationOffset; ScenePresence scenePresence = World.GetScenePresence(m_host.ObjectOwner); RegionInfo regionInfo = World.RegionInfo; @@ -7668,10 +7692,10 @@ namespace OpenSim.Region.ScriptEngine.Common httpHeaders["X-SecondLife-Owner-Name"] = scenePresence == null ? string.Empty : scenePresence.ControllingClient.Name; httpHeaders["X-SecondLife-Owner-Key"] = m_host.ObjectOwner.ToString(); - LLUUID reqID = httpScriptMod. + UUID reqID = httpScriptMod. StartHttpRequest(m_localID, m_itemID, url, param, httpHeaders, body); - if (reqID != LLUUID.Zero) + if (reqID != UUID.Zero) return reqID.ToString(); else return null; @@ -7781,7 +7805,7 @@ namespace OpenSim.Region.ScriptEngine.Common LSL_Types.list ret = new LSL_Types.list(); if (land != null) { - foreach (KeyValuePair d in land.getLandObjectOwners()) + foreach (KeyValuePair d in land.getLandObjectOwners()) { ret.Add(d.Key.ToString()); ret.Add(d.Value); @@ -7794,7 +7818,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llGetObjectPrimCount(string object_id) { m_host.AddScriptLPS(1); - SceneObjectPart part = World.GetSceneObjectPart(new LLUUID(object_id)); + SceneObjectPart part = World.GetSceneObjectPart(new UUID(object_id)); if (part == null) { return 0; @@ -7900,8 +7924,8 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); LSL_Types.list ret = new LSL_Types.list(); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id, out key)) + UUID key = new UUID(); + if (UUID.TryParse(id, out key)) { ScenePresence av = World.GetScenePresence(key); @@ -7921,19 +7945,19 @@ namespace OpenSim.Region.ScriptEngine.Common ret.Add(new LSL_Types.Vector3((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z)); break; case "4": - ret.Add(new LSL_Types.Quaternion((double)av.Rotation.x, (double)av.Rotation.y, (double)av.Rotation.z, (double)av.Rotation.w)); + ret.Add(new LSL_Types.Quaternion((double)av.Rotation.X, (double)av.Rotation.Y, (double)av.Rotation.Z, (double)av.Rotation.W)); break; case "5": - ret.Add(new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z)); + ret.Add(new LSL_Types.Vector3(av.Velocity.X, av.Velocity.Y, av.Velocity.Z)); break; case "6": ret.Add(id); break; case "7": - ret.Add(LLUUID.Zero.ToString()); + ret.Add(UUID.Zero.ToString()); break; case "8": - ret.Add(LLUUID.Zero.ToString()); + ret.Add(UUID.Zero.ToString()); break; } } @@ -7953,7 +7977,7 @@ namespace OpenSim.Region.ScriptEngine.Common ret.Add(obj.Description); break; case "3": - ret.Add(new LSL_Types.Vector3(obj.AbsolutePosition.X,obj.AbsolutePosition.Y,obj.AbsolutePosition.Z)); + ret.Add(new LSL_Types.Vector3(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z)); break; case "4": ret.Add(new LSL_Types.Quaternion(obj.RotationOffset.X, obj.RotationOffset.Y, obj.RotationOffset.Z, obj.RotationOffset.W)); @@ -7979,14 +8003,14 @@ namespace OpenSim.Region.ScriptEngine.Common } - internal LLUUID ScriptByName(string name) + internal UUID ScriptByName(string name) { foreach (TaskInventoryItem item in m_host.TaskInventory.Values) { if (item.Type == 10 && item.Name == name) return item.ItemID; } - return LLUUID.Zero; + return UUID.Zero; } internal void ShoutError(string msg) @@ -8063,7 +8087,7 @@ namespace OpenSim.Region.ScriptEngine.Common String[] notecardLines = { "0" }; notecardLines[0] = String.Empty; - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if ((inv.Value.Name == name) && (inv.Value.InvType == (int)InventoryType.Notecard)) { diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index 581b820..8c24ae3 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs @@ -123,7 +123,7 @@ namespace OpenSim.Region.ScriptEngine.Common Vector3 vector = (Vector3)o; - return (x == vector.x && x == vector.x && z == vector.z); + return (x == vector.x && y == vector.y && z == vector.y); } public static Vector3 operator -(Vector3 vector) diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs index 687d5e1..b410eec 100644 --- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs @@ -25,8 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; -using Axiom.Math; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework.Console; using OpenSim.Region.Environment.Interfaces; @@ -40,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Common public class OSSL_BuilIn_Commands : LSL_BuiltIn_Commands, OSSL_BuilIn_Commands_Interface { public OSSL_BuilIn_Commands(ScriptEngineBase.ScriptEngine scriptEngine, SceneObjectPart host, uint localID, - LLUUID itemID) + UUID itemID) : base(scriptEngine, host, localID, itemID) { Prim = new OSSLPrim(this); @@ -259,7 +258,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (x > 255 || x < 0 || y > 255 || y < 0) LSLError("osTerrainSetHeight: Coordinate out of bounds"); - if (World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new LLVector3(x, y, 0))) + if (World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) { World.Heightmap[x, y] = val; return 1; @@ -299,7 +298,7 @@ namespace OpenSim.Region.ScriptEngine.Common World.SendGeneralAlert(msg); } - public void osSetRot(LLUUID target, Quaternion rotation) + public void osSetRot(UUID target, Quaternion rotation) { m_host.AddScriptLPS(1); if (World.Entities.ContainsKey(target)) @@ -319,7 +318,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); - LLUUID createdTexture = + UUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, extraParams, timer); return createdTexture.ToString(); @@ -329,7 +328,7 @@ namespace OpenSim.Region.ScriptEngine.Common //TODO update existing dynamic textures } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, @@ -339,7 +338,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); - LLUUID createdTexture = + UUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, extraParams, timer, true, (byte) alpha); return createdTexture.ToString(); @@ -349,7 +348,7 @@ namespace OpenSim.Region.ScriptEngine.Common //TODO update existing dynamic textures } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, @@ -361,7 +360,7 @@ namespace OpenSim.Region.ScriptEngine.Common IDynamicTextureManager textureManager = World.RequestModuleInterface(); if (textureManager != null) { - LLUUID createdTexture = + UUID createdTexture = textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, extraParams, timer); return createdTexture.ToString(); @@ -372,7 +371,7 @@ namespace OpenSim.Region.ScriptEngine.Common //TODO update existing dynamic textures } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, @@ -384,7 +383,7 @@ namespace OpenSim.Region.ScriptEngine.Common IDynamicTextureManager textureManager = World.RequestModuleInterface(); if (textureManager != null) { - LLUUID createdTexture = + UUID createdTexture = textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, extraParams, timer, true, (byte) alpha); return createdTexture.ToString(); @@ -395,7 +394,7 @@ namespace OpenSim.Region.ScriptEngine.Common //TODO update existing dynamic textures } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public bool osConsoleCommand(string command) @@ -538,8 +537,8 @@ namespace OpenSim.Region.ScriptEngine.Common IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface(); if (xmlrpcMod.IsEnabled()) { - LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, new LLUUID(channel)); - object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(LLUUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) }; + UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, new UUID(channel)); + object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(UUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) }; m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", EventQueueManager.llDetectNull, resobj); } } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs index 64f6970..ee86500 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs @@ -27,7 +27,7 @@ using System.Collections; using System.Threading; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugins; @@ -153,7 +153,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// /// /// - public void RemoveScript(uint localID, LLUUID itemID) + public void RemoveScript(uint localID, UUID itemID) { // Remove a specific script diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs index 77cc7ea..378610a 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugins @@ -48,28 +48,28 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin private class DataserverRequest { public uint localID; - public LLUUID itemID; + public UUID itemID; - public LLUUID ID; + public UUID ID; public string handle; public DateTime startTime; } - public LLUUID RegisterRequest(uint localID, LLUUID itemID, + public UUID RegisterRequest(uint localID, UUID itemID, string identifier) { lock (DataserverRequests) { if (DataserverRequests.ContainsKey(identifier)) - return LLUUID.Zero; + return UUID.Zero; DataserverRequest ds = new DataserverRequest(); ds.localID = localID; ds.itemID = itemID; - ds.ID = LLUUID.Random(); + ds.ID = UUID.Random(); ds.handle = identifier; ds.startTime = DateTime.Now; @@ -99,7 +99,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin new LSL_Types.LSLString(reply)}); } - public void RemoveEvents(uint localID, LLUUID itemID) + public void RemoveEvents(uint localID, UUID itemID) { lock (DataserverRequests) { diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs index 9b636fd..0fce1f2 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs @@ -27,7 +27,7 @@ //#define SPAM using System; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; using OpenSim.Framework.Communications.Cache; @@ -43,8 +43,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin m_CmdManager = CmdManager; } - public Dictionary> SenseEvents = - new Dictionary>(); + public Dictionary> SenseEvents = + new Dictionary>(); private Object SenseLock = new Object(); // @@ -53,12 +53,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin private class SenseRepeatClass { public uint localID; - public LLUUID itemID; + public UUID itemID; public double interval; public DateTime next; public string name; - public LLUUID keyID; + public UUID keyID; public int type; public double range; public double arc; @@ -68,8 +68,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin private List SenseRepeaters = new List(); private object SenseRepeatListLock = new object(); - public void SetSenseRepeatEvent(uint m_localID, LLUUID m_itemID, - string name, LLUUID keyID, int type, double range, double arc, double sec, SceneObjectPart host) + public void SetSenseRepeatEvent(uint m_localID, UUID m_itemID, + string name, UUID keyID, int type, double range, double arc, double sec, SceneObjectPart host) { #if SPAM Console.WriteLine("SetSensorEvent"); @@ -98,7 +98,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin } } - public void UnSetSenseRepeaterEvents(uint m_localID, LLUUID m_itemID) + public void UnSetSenseRepeaterEvents(uint m_localID, UUID m_itemID) { // Remove from timer lock (SenseRepeatListLock) @@ -138,8 +138,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin } // lock } - public void SenseOnce(uint m_localID, LLUUID m_itemID, - string name, LLUUID keyID, int type, + public void SenseOnce(uint m_localID, UUID m_itemID, + string name, UUID keyID, int type, double range, double arc, SceneObjectPart host) { // Add to timer @@ -156,11 +156,11 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin SensorSweep(ts); } - public LSL_Types.list GetSensorList(uint m_localID, LLUUID m_itemID) + public LSL_Types.list GetSensorList(uint m_localID, UUID m_itemID) { lock (SenseLock) { - Dictionary Obj = null; + Dictionary Obj = null; if (!SenseEvents.TryGetValue(m_localID, out Obj)) { #if SPAM @@ -199,11 +199,11 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin } //m_ScriptEngine.Log.Info("[AsyncLSL]: Enter SensorSweep Scan"); - LLVector3 sensorPos = SensePoint.AbsolutePosition; - LLVector3 regionPos = new LLVector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0); - LLVector3 fromRegionPos = sensorPos + regionPos; + Vector3 sensorPos = SensePoint.AbsolutePosition; + Vector3 regionPos = new Vector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0); + Vector3 fromRegionPos = sensorPos + regionPos; - LLQuaternion q = SensePoint.RotationOffset; + Quaternion q = SensePoint.RotationOffset; LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); @@ -215,7 +215,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin foreach (EntityBase ent in m_CmdManager.m_ScriptEngine.World.Entities.Values) { - LLVector3 toRegionPos = ent.AbsolutePosition + regionPos; + Vector3 toRegionPos = ent.AbsolutePosition + regionPos; double dis = Math.Abs((double)Util.GetDistanceTo(toRegionPos, fromRegionPos)); if (dis <= ts.range) { @@ -248,7 +248,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin double ang_obj = 0; try { - LLVector3 diff = toRegionPos - fromRegionPos; + Vector3 diff = toRegionPos - fromRegionPos; LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3(diff.X, diff.Y, diff.Z); double dot = LSL_Types.Vector3.Dot(forward_dir, obj_dir); double mag_obj = LSL_Types.Vector3.Mag(obj_dir); @@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin if (ang_obj > ts.arc) keep = false; } - if (keep && (ts.keyID != LLUUID.Zero) && (ts.keyID != ent.UUID)) + if (keep && (ts.keyID != UUID.Zero) && (ts.keyID != ent.UUID)) { keep = false; } @@ -303,10 +303,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin // Create object if it doesn't exist if (SenseEvents.ContainsKey(ts.localID) == false) { - SenseEvents.Add(ts.localID, new Dictionary()); + SenseEvents.Add(ts.localID, new Dictionary()); } // clear if previous traces exist - Dictionary Obj; + Dictionary Obj; SenseEvents.TryGetValue(ts.localID, out Obj); if (Obj.ContainsKey(ts.itemID) == true) Obj.Remove(ts.itemID); diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs index 09af34a..7940b36 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugins { @@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin private class TimerClass { public uint localID; - public LLUUID itemID; + public UUID itemID; //public double interval; public long interval; //public DateTime next; @@ -57,7 +57,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin private List Timers = new List(); private object TimerListLock = new object(); - public void SetTimerEvent(uint m_localID, LLUUID m_itemID, double sec) + public void SetTimerEvent(uint m_localID, UUID m_itemID, double sec) { // Console.WriteLine("SetTimerEvent"); @@ -82,7 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin } } - public void UnSetTimerEvents(uint m_localID, LLUUID m_itemID) + public void UnSetTimerEvents(uint m_localID, UUID m_itemID) { // Remove from timer lock (TimerListLock) diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index 3fdfd8a..89d7045 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; using OpenSim.Region.Environment; @@ -96,7 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase { } - private void HandleObjectPaid(LLUUID objectID, LLUUID agentID, int amount) + private void HandleObjectPaid(UUID objectID, UUID agentID, int amount) { SceneObjectPart part=myScriptEngine.World.GetSceneObjectPart(objectID); if (part != null) @@ -117,7 +117,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "state_entry", EventQueueManager.llDetectNull, new object[] { }); } - public void touch_start(uint localID, uint originalID, LLVector3 offsetPos, IClientAPI remoteClient) + public void touch_start(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient) { // Add to queue for all scripts in ObjectID object EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); @@ -135,7 +135,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); detstruct._string[0] = remoteClient.Name; detstruct._int[0] = 0; - detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.x,av.Rotation.y,av.Rotation.z,av.Rotation.w); + detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.X,av.Rotation.Y,av.Rotation.Z,av.Rotation.W); detstruct._Vector3[0] = new LSL_Types.Vector3(av.AbsolutePosition.X,av.AbsolutePosition.Y,av.AbsolutePosition.Z); detstruct._Vector32[0] = new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z); } @@ -170,7 +170,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); detstruct._string[0] = remoteClient.Name; detstruct._int[0] = 0; - detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); + detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.X, av.Rotation.Y, av.Rotation.Z, av.Rotation.W); detstruct._Vector3[0] = new LSL_Types.Vector3(av.AbsolutePosition.X, av.AbsolutePosition.Y, av.AbsolutePosition.Z); detstruct._Vector32[0] = new LSL_Types.Vector3(av.Velocity.X, av.Velocity.Y, av.Velocity.Z); } @@ -187,14 +187,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) }); } - public void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez) + public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez) { myScriptEngine.Log.Debug("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + script.Length); myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script, startParam, postOnRez); } - public void OnRemoveScript(uint localID, LLUUID itemID) + public void OnRemoveScript(uint localID, UUID itemID) { myScriptEngine.Log.Debug("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString()); myScriptEngine.m_ScriptManager.StopScript( @@ -203,7 +203,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase ); } - public void money(uint localID, LLUUID agentID, int amount) + public void money(uint localID, UUID agentID, int amount) { myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "money", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLString(agentID.ToString()), new LSL_Types.LSLInteger(amount) }); } @@ -220,12 +220,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "state_exit", EventQueueManager.llDetectNull, new object[] { }); } - public void touch(uint localID, uint originalID, LLUUID itemID) + public void touch(uint localID, uint originalID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch", EventQueueManager.llDetectNull); } - public void touch_end(uint localID, uint originalID, LLUUID itemID) + public void touch_end(uint localID, uint originalID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) }); } @@ -314,7 +314,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "collision_end", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(col.Colliders.Count) }); } - public void land_collision_start(uint localID, LLUUID itemID) + public void land_collision_start(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_start", EventQueueManager.llDetectNull); } @@ -324,48 +324,48 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "land_collision", EventQueueManager.llDetectNull); } - public void land_collision_end(uint localID, LLUUID itemID) + public void land_collision_end(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_end", EventQueueManager.llDetectNull); } // Handled by long commands - public void timer(uint localID, LLUUID itemID) + public void timer(uint localID, UUID itemID) { //myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, String.Empty); } - public void listen(uint localID, LLUUID itemID) + public void listen(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "listen", EventQueueManager.llDetectNull); } - public void on_rez(uint localID, LLUUID itemID) + public void on_rez(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "on_rez", EventQueueManager.llDetectNull); } - public void sensor(uint localID, LLUUID itemID) + public void sensor(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "sensor", EventQueueManager.llDetectNull); } - public void no_sensor(uint localID, LLUUID itemID) + public void no_sensor(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "no_sensor", EventQueueManager.llDetectNull); } - public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change) + public void control(uint localID, UUID itemID, UUID agentID, uint held, uint change) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLString(agentID.ToString()), new LSL_Types.LSLInteger(held), new LSL_Types.LSLInteger(change)}); } - public void email(uint localID, LLUUID itemID) + public void email(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "email", EventQueueManager.llDetectNull); } - public void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos) + public void at_target(uint localID, uint handle, Vector3 targetpos, Vector3 atpos) { myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "at_target", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(handle), new LSL_Types.Vector3(targetpos.X,targetpos.Y,targetpos.Z), new LSL_Types.Vector3(atpos.X,atpos.Y,atpos.Z) }); } @@ -375,63 +375,63 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "not_at_target", EventQueueManager.llDetectNull); } - public void at_rot_target(uint localID, LLUUID itemID) + public void at_rot_target(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_rot_target", EventQueueManager.llDetectNull); } - public void not_at_rot_target(uint localID, LLUUID itemID) + public void not_at_rot_target(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_rot_target", EventQueueManager.llDetectNull); } - public void run_time_permissions(uint localID, LLUUID itemID) + public void run_time_permissions(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "run_time_permissions", EventQueueManager.llDetectNull); } - public void changed(uint localID, LLUUID itemID) + public void changed(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "changed", EventQueueManager.llDetectNull); } - public void attach(uint localID, LLUUID itemID) + public void attach(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "attach", EventQueueManager.llDetectNull); } - public void dataserver(uint localID, LLUUID itemID) + public void dataserver(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "dataserver", EventQueueManager.llDetectNull); } - public void link_message(uint localID, LLUUID itemID) + public void link_message(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "link_message", EventQueueManager.llDetectNull); } - public void moving_start(uint localID, LLUUID itemID) + public void moving_start(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_start", EventQueueManager.llDetectNull); } - public void moving_end(uint localID, LLUUID itemID) + public void moving_end(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_end", EventQueueManager.llDetectNull); } - public void object_rez(uint localID, LLUUID itemID) + public void object_rez(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "object_rez", EventQueueManager.llDetectNull); } - public void remote_data(uint localID, LLUUID itemID) + public void remote_data(uint localID, UUID itemID) { myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "remote_data", EventQueueManager.llDetectNull); } // Handled by long commands - public void http_response(uint localID, LLUUID itemID) + public void http_response(uint localID, UUID itemID) { // myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "http_response", EventQueueManager.llDetectNull); } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index 5c57874..1a08795 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase { @@ -134,7 +134,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public struct QueueItemStruct { public uint localID; - public LLUUID itemID; + public UUID itemID; public string functionName; public Queue_llDetectParams_Struct llDetectParams; public object[] param; @@ -308,10 +308,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase return; } - Dictionary.KeyCollection scriptKeys = + Dictionary.KeyCollection scriptKeys = m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID); - foreach (LLUUID itemID in scriptKeys) + foreach (UUID itemID in scriptKeys) { // Add to each script in that object // TODO: Some scripts may not subscribe to this event. Should we NOT add it? Does it matter? @@ -326,7 +326,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// Region script ID /// Name of the function, will be state + "_event_" + FunctionName /// Array of parameters to match event mask - public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) + public void AddToScriptQueue(uint localID, UUID itemID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) { lock (eventQueue) { diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index 4376e00..1e71ae5 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs @@ -31,7 +31,7 @@ using System.Reflection; using System.Text.RegularExpressions; using System.Threading; using System.Globalization; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes.Scripting; @@ -327,7 +327,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); //if (m_host != null) //{ - m_ScriptEngine.World.SimChat(Helpers.StringToField(text), + m_ScriptEngine.World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.DebugChannel, 2147483647, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs index 99bbdee..60333b1 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs @@ -31,7 +31,7 @@ using System.IO; using System.Reflection; using System.Runtime.Serialization.Formatters.Binary; using System.Threading; -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.Environment.Scenes; namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase @@ -69,7 +69,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase private struct LUStruct { public uint localID; - public LLUUID itemID; + public UUID itemID; public string script; public LUType Action; public int startParam; @@ -84,13 +84,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } // Xantor 20080525: Keep a list of compiled scripts this session for reuse - public Dictionary scriptList = new Dictionary(); + public Dictionary scriptList = new Dictionary(); // Object> // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory. // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! - public Dictionary> Scripts = - new Dictionary>(); + public Dictionary> Scripts = + new Dictionary>(); public Scene World @@ -254,7 +254,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// /// /// - public void StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) + public void StartScript(uint localID, UUID itemID, string Script, int startParam, bool postOnRez) { lock (LUQueue) { @@ -280,7 +280,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// /// /// - public void StopScript(uint localID, LLUUID itemID) + public void StopScript(uint localID, UUID itemID) { LUStruct ls = new LUStruct(); ls.localID = localID; @@ -297,8 +297,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase // Create a new instance of the compiler (reuse) //private Compiler.LSL.Compiler LSLCompiler = new Compiler.LSL.Compiler(); - public abstract void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez); - public abstract void _StopScript(uint localID, LLUUID itemID); + public abstract void _StartScript(uint localID, UUID itemID, string Script, int startParam, bool postOnRez); + public abstract void _StopScript(uint localID, UUID itemID); #endregion @@ -312,7 +312,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// Script ID /// Name of function /// Arguments to pass to function - internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, EventQueueManager.Queue_llDetectParams_Struct qParams, object[] args) + internal void ExecuteEvent(uint localID, UUID itemID, string FunctionName, EventQueueManager.Queue_llDetectParams_Struct qParams, object[] args) { //cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined ///#if DEBUG @@ -335,7 +335,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase Script.Exec.ExecuteEvent(FunctionName, args); } - public int GetStateEventFlags(uint localID, LLUUID itemID) + public int GetStateEventFlags(uint localID, UUID itemID) { // Console.WriteLine("GetStateEventFlags for <" + localID + "," + itemID + ">"); try @@ -360,25 +360,25 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase #region Internal functions to keep track of script - public Dictionary.KeyCollection GetScriptKeys(uint localID) + public Dictionary.KeyCollection GetScriptKeys(uint localID) { if (Scripts.ContainsKey(localID) == false) return null; - Dictionary Obj; + Dictionary Obj; Scripts.TryGetValue(localID, out Obj); return Obj.Keys; } - public IScript GetScript(uint localID, LLUUID itemID) + public IScript GetScript(uint localID, UUID itemID) { lock (scriptLock) { if (Scripts.ContainsKey(localID) == false) return null; - Dictionary Obj; + Dictionary Obj; Scripts.TryGetValue(localID, out Obj); if (Obj.ContainsKey(itemID) == false) return null; @@ -390,18 +390,18 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } } - public void SetScript(uint localID, LLUUID itemID, IScript Script) + public void SetScript(uint localID, UUID itemID, IScript Script) { lock (scriptLock) { // Create object if it doesn't exist if (Scripts.ContainsKey(localID) == false) { - Scripts.Add(localID, new Dictionary()); + Scripts.Add(localID, new Dictionary()); } // Delete script if it exists - Dictionary Obj; + Dictionary Obj; Scripts.TryGetValue(localID, out Obj); if (Obj.ContainsKey(itemID) == true) Obj.Remove(itemID); @@ -411,14 +411,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } } - public void RemoveScript(uint localID, LLUUID itemID) + public void RemoveScript(uint localID, UUID itemID) { // Don't have that object? if (Scripts.ContainsKey(localID) == false) return; // Delete script if it exists - Dictionary Obj; + Dictionary Obj; Scripts.TryGetValue(localID, out Obj); if (Obj.ContainsKey(itemID) == true) Obj.Remove(itemID); @@ -427,21 +427,21 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase #endregion - public void ResetScript(uint localID, LLUUID itemID) + public void ResetScript(uint localID, UUID itemID) { IScript s = GetScript(localID, itemID); string script = s.Source; StopScript(localID, itemID); SceneObjectPart part = World.GetSceneObjectPart(localID); part.GetInventoryItem(itemID).PermsMask = 0; - part.GetInventoryItem(itemID).PermsGranter = LLUUID.Zero; + part.GetInventoryItem(itemID).PermsGranter = UUID.Zero; StartScript(localID, itemID, script, s.StartParam, false); } #region Script serialization/deserialization - public void GetSerializedScript(uint localID, LLUUID itemID) + public void GetSerializedScript(uint localID, UUID itemID) { // Serialize the script and return it // Should not be a problem @@ -451,7 +451,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase fs.Close(); } - public void PutSerializedScript(uint localID, LLUUID itemID) + public void PutSerializedScript(uint localID, UUID itemID) { // Deserialize the script and inject it into an AppDomain diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index 41fde02..a6473ee 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; @@ -38,40 +38,40 @@ namespace OpenSim.Region.ScriptEngine.Common { public interface RemoteEvents { - void touch_start(uint localID, uint originalID, LLVector3 offsetPos, IClientAPI remoteClient); - void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez); - void OnRemoveScript(uint localID, LLUUID itemID); + void touch_start(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient); + void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez); + void OnRemoveScript(uint localID, UUID itemID); void state_exit(uint localID); - void touch(uint localID, uint originalID, LLUUID itemID); - void touch_end(uint localID, uint originalID, LLUUID itemID); + void touch(uint localID, uint originalID, UUID itemID); + void touch_end(uint localID, uint originalID, UUID itemID); void collision_start(uint localID, ColliderArgs col); void collision(uint localID, ColliderArgs col); void collision_end(uint localID, ColliderArgs col); - void land_collision_start(uint localID, LLUUID itemID); + void land_collision_start(uint localID, UUID itemID); void land_collision(uint localID, ColliderArgs col); - void land_collision_end(uint localID, LLUUID itemID); - void timer(uint localID, LLUUID itemID); - void listen(uint localID, LLUUID itemID); - void on_rez(uint localID, LLUUID itemID); - void sensor(uint localID, LLUUID itemID); - void no_sensor(uint localID, LLUUID itemID); - void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change); - void money(uint LocalID, LLUUID agentID, int amount); - void email(uint localID, LLUUID itemID); - void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos); + void land_collision_end(uint localID, UUID itemID); + void timer(uint localID, UUID itemID); + void listen(uint localID, UUID itemID); + void on_rez(uint localID, UUID itemID); + void sensor(uint localID, UUID itemID); + void no_sensor(uint localID, UUID itemID); + void control(uint localID, UUID itemID, UUID agentID, uint held, uint change); + void money(uint LocalID, UUID agentID, int amount); + void email(uint localID, UUID itemID); + void at_target(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); void not_at_target(uint localID); - void at_rot_target(uint localID, LLUUID itemID); - void not_at_rot_target(uint localID, LLUUID itemID); - void run_time_permissions(uint localID, LLUUID itemID); - void changed(uint localID, LLUUID itemID); - void attach(uint localID, LLUUID itemID); - void dataserver(uint localID, LLUUID itemID); - void link_message(uint localID, LLUUID itemID); - void moving_start(uint localID, LLUUID itemID); - void moving_end(uint localID, LLUUID itemID); - void object_rez(uint localID, LLUUID itemID); - void remote_data(uint localID, LLUUID itemID); - void http_response(uint localID, LLUUID itemID); + void at_rot_target(uint localID, UUID itemID); + void not_at_rot_target(uint localID, UUID itemID); + void run_time_permissions(uint localID, UUID itemID); + void changed(uint localID, UUID itemID); + void attach(uint localID, UUID itemID); + void dataserver(uint localID, UUID itemID); + void link_message(uint localID, UUID itemID); + void moving_start(uint localID, UUID itemID); + void moving_end(uint localID, UUID itemID); + void object_rez(uint localID, UUID itemID); + void remote_data(uint localID, UUID itemID); + void http_response(uint localID, UUID itemID); } public interface ServerRemotingObject diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs index a310978..b02f2f5 100644 --- a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs +++ b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs @@ -31,7 +31,7 @@ using System.Diagnostics; using System.Net; using System.Text; using System.Web; -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.ScriptEngine.Common.TRPC; namespace OpenSim.Region.ScriptEngine.Common @@ -53,7 +53,7 @@ namespace OpenSim.Region.ScriptEngine.Common typeof(Double), typeof(Decimal), typeof(Array), - typeof(LLUUID), + typeof(UUID), typeof(UInt16), typeof(UInt32), typeof(UInt64) diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 371ba45..cf1d489 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs @@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL //System.Console.WriteLine("SCRIPT:" + checkscript); // checks for alpha.alpha way of referring to objects in C# - // ignores alpha.x alpha.y, alpha.z for refering to vector components + // ignores alpha.X alpha.Y, alpha.Z for refering to vector components Match SecurityM; diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index c94b56a..8176d3f 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs @@ -28,7 +28,7 @@ using System; using System.Reflection; using log4net; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Scenes; using OpenSim.Region.ScriptEngine.Common; @@ -54,13 +54,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine } // KEEP TRACK OF SCRIPTS - //internal Dictionary> Scripts = new Dictionary>(); + //internal Dictionary> Scripts = new Dictionary>(); // LOAD SCRIPT // UNLOAD SCRIPT // PROVIDE SCRIPT WITH ITS INTERFACE TO OpenSim - public override void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) + public override void _StartScript(uint localID, UUID itemID, string Script, int startParam, bool postOnRez) { m_log.DebugFormat( "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", @@ -84,7 +84,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine } // Xantor 20080525: I need assetID here to see if we already compiled this one previously - LLUUID assetID = LLUUID.Zero; + UUID assetID = UUID.Zero; TaskInventoryItem taskInventoryItem = new TaskInventoryItem(); if (m_host.TaskInventory.TryGetValue(itemID, out taskInventoryItem)) assetID = taskInventoryItem.AssetID; @@ -153,7 +153,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine string text = "Error compiling script:\r\n" + e.Message.ToString(); if (text.Length > 1500) text = text.Substring(0, 1499); // 0-1499 is 1500 characters - World.SimChat(Helpers.StringToField(text), ChatTypeEnum.DebugChannel, 2147483647, + World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.DebugChannel, 2147483647, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); } catch (Exception e2) // LEGIT: User Scripting @@ -165,7 +165,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine } } - public override void _StopScript(uint localID, LLUUID itemID) + public override void _StopScript(uint localID, UUID itemID) { // Stop script #if DEBUG diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs index 2df41d0..e94de68 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs @@ -26,7 +26,7 @@ */ using System; -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.Environment.Scenes; @@ -38,6 +38,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces // Each API has an identifier, which is used to load the // proper runtime assembly at load time. // - void Initialize(IScriptEngine engine, SceneObjectPart part, uint localID, LLUUID item); + void Initialize(IScriptEngine engine, SceneObjectPart part, uint localID, UUID item); } } diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs index 6b3804c..4b46c21 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs @@ -29,7 +29,7 @@ using log4net; using System; using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.Environment.Scenes; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Region.ScriptEngine.Interfaces; using Amib.Threading; @@ -49,16 +49,16 @@ namespace OpenSim.Region.ScriptEngine.Interfaces ILog Log { get; } string ScriptEngineName { get; } - bool PostScriptEvent(LLUUID itemID, EventParams parms); + bool PostScriptEvent(UUID itemID, EventParams parms); bool PostObjectEvent(uint localID, EventParams parms); - void ApiResetScript(LLUUID itemID); - void ResetScript(LLUUID itemID); - void SetScriptState(LLUUID itemID, bool state); - bool GetScriptState(LLUUID itemID); - void SetState(LLUUID itemID, string newState); - int GetStartParameter(LLUUID itemID); + void ApiResetScript(UUID itemID); + void ResetScript(UUID itemID); + void SetScriptState(UUID itemID, bool state); + bool GetScriptState(UUID itemID); + void SetState(UUID itemID, string newState); + int GetStartParameter(UUID itemID); IScriptWorkItem QueueEventHandler(object parms); - DetectParams GetDetectParams(LLUUID item, int number); + DetectParams GetDetectParams(UUID item, int number); } } diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index 3aeb602..f79c1a3 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using log4net; using OpenSim.Framework; using OpenSim.Region.ScriptEngine.Shared; @@ -55,13 +55,13 @@ namespace OpenSim.Region.ScriptEngine.Interfaces bool Running { get; set; } string State { get; set; } IScriptEngine Engine { get; } - LLUUID AppDomain { get; set; } + UUID AppDomain { get; set; } string PrimName { get; } string ScriptName { get; } - LLUUID ItemID { get; } - LLUUID ObjectID { get; } + UUID ItemID { get; } + UUID ObjectID { get; } uint LocalID { get; } - LLUUID AssetID { get; } + UUID AssetID { get; } Queue EventQueue { get; } void ClearQueue(); @@ -82,7 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces Dictionary GetVars(); void SetVars(Dictionary vars); DetectParams GetDetectParams(int idx); - LLUUID GetDetectID(int idx); + UUID GetDetectID(int idx); void SaveState(string assembly); } } diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index 21888fa..afb7311 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs @@ -28,7 +28,7 @@ /* Original code: Tedd Hansen */ using System; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.ScriptEngine.Common; using OpenSim.Region.ScriptEngine.Common.TRPC; @@ -77,7 +77,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer } } - public void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez) + public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez) { // WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID myScriptEngine.Log.Info("[RemoteEngine]: Creating new script (with connection)"); @@ -90,7 +90,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer //remoteScript[localID].Events().OnRezScript(localID, itemID, script); } - public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) + public void touch_start(uint localID, Vector3 offsetPos, IClientAPI remoteClient) { //remoteScript[localID].Events.touch_start(localID, offsetPos, remoteClient); RPC.SendCommand(myScriptServerID, "touch_start", offsetPos, "How to transfer IClientAPI?"); @@ -100,162 +100,162 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer // PLACEHOLDERS -- CODE WILL CHANGE! - //public void OnRemoveScript(uint localID, LLUUID itemID) + //public void OnRemoveScript(uint localID, UUID itemID) //{ // remoteScript[localID].Events.OnRemoveScript(localID, itemID); //} - //public void state_exit(uint localID, LLUUID itemID) + //public void state_exit(uint localID, UUID itemID) //{ // remoteScript[localID].Events.state_exit(localID, itemID); //} - //public void touch(uint localID, LLUUID itemID) + //public void touch(uint localID, UUID itemID) //{ // remoteScript[localID].Events.touch(localID, itemID); //} - //public void touch_end(uint localID, LLUUID itemID) + //public void touch_end(uint localID, UUID itemID) //{ // remoteScript[localID].Events.touch_end(localID, itemID); //} - //public void collision_start(uint localID, LLUUID itemID) + //public void collision_start(uint localID, UUID itemID) //{ // remoteScript[localID].Events.collision_start(localID, itemID); //} - //public void collision(uint localID, LLUUID itemID) + //public void collision(uint localID, UUID itemID) //{ // remoteScript[localID].Events.collision(localID, itemID); //} - //public void collision_end(uint localID, LLUUID itemID) + //public void collision_end(uint localID, UUID itemID) //{ // remoteScript[localID].Events.collision_end(localID, itemID); //} - //public void land_collision_start(uint localID, LLUUID itemID) + //public void land_collision_start(uint localID, UUID itemID) //{ // remoteScript[localID].Events.land_collision_start(localID, itemID); //} - //public void land_collision(uint localID, LLUUID itemID) + //public void land_collision(uint localID, UUID itemID) //{ // remoteScript[localID].Events.land_collision(localID, itemID); //} - //public void land_collision_end(uint localID, LLUUID itemID) + //public void land_collision_end(uint localID, UUID itemID) //{ // remoteScript[localID].Events.land_collision_end(localID, itemID); //} - //public void timer(uint localID, LLUUID itemID) + //public void timer(uint localID, UUID itemID) //{ // remoteScript[localID].Events.timer(localID, itemID); //} - //public void listen(uint localID, LLUUID itemID) + //public void listen(uint localID, UUID itemID) //{ // remoteScript[localID].Events.listen(localID, itemID); //} - //public void on_rez(uint localID, LLUUID itemID) + //public void on_rez(uint localID, UUID itemID) //{ // remoteScript[localID].Events.on_rez(localID, itemID); //} - //public void sensor(uint localID, LLUUID itemID) + //public void sensor(uint localID, UUID itemID) //{ // remoteScript[localID].Events.sensor(localID, itemID); //} - //public void no_sensor(uint localID, LLUUID itemID) + //public void no_sensor(uint localID, UUID itemID) //{ // remoteScript[localID].Events.no_sensor(localID, itemID); //} - //public void control(uint localID, LLUUID itemID) + //public void control(uint localID, UUID itemID) //{ // remoteScript[localID].Events.control(localID, itemID); //} - //public void money(uint localID, LLUUID itemID) + //public void money(uint localID, UUID itemID) //{ // remoteScript[localID].Events.money(localID, itemID); //} - //public void email(uint localID, LLUUID itemID) + //public void email(uint localID, UUID itemID) //{ // remoteScript[localID].Events.email(localID, itemID); //} - //public void at_target(uint localID, LLUUID itemID) + //public void at_target(uint localID, UUID itemID) //{ // remoteScript[localID].Events.at_target(localID, itemID); //} - //public void not_at_target(uint localID, LLUUID itemID) + //public void not_at_target(uint localID, UUID itemID) //{ // remoteScript[localID].Events.not_at_target(localID, itemID); //} - //public void at_rot_target(uint localID, LLUUID itemID) + //public void at_rot_target(uint localID, UUID itemID) //{ // remoteScript[localID].Events.at_rot_target(localID, itemID); //} - //public void not_at_rot_target(uint localID, LLUUID itemID) + //public void not_at_rot_target(uint localID, UUID itemID) //{ // remoteScript[localID].Events.not_at_rot_target(localID, itemID); //} - //public void run_time_permissions(uint localID, LLUUID itemID) + //public void run_time_permissions(uint localID, UUID itemID) //{ // remoteScript[localID].Events.run_time_permissions(localID, itemID); //} - //public void changed(uint localID, LLUUID itemID) + //public void changed(uint localID, UUID itemID) //{ // remoteScript[localID].Events.changed(localID, itemID); //} - //public void attach(uint localID, LLUUID itemID) + //public void attach(uint localID, UUID itemID) //{ // remoteScript[localID].Events.attach(localID, itemID); //} - //public void dataserver(uint localID, LLUUID itemID) + //public void dataserver(uint localID, UUID itemID) //{ // remoteScript[localID].Events.dataserver(localID, itemID); //} - //public void link_message(uint localID, LLUUID itemID) + //public void link_message(uint localID, UUID itemID) //{ // remoteScript[localID].Events.link_message(localID, itemID); //} - //public void moving_start(uint localID, LLUUID itemID) + //public void moving_start(uint localID, UUID itemID) //{ // remoteScript[localID].Events.moving_start(localID, itemID); //} - //public void moving_end(uint localID, LLUUID itemID) + //public void moving_end(uint localID, UUID itemID) //{ // remoteScript[localID].Events.moving_end(localID, itemID); //} - //public void object_rez(uint localID, LLUUID itemID) + //public void object_rez(uint localID, UUID itemID) //{ // remoteScript[localID].Events.object_rez(localID, itemID); //} - //public void remote_data(uint localID, LLUUID itemID) + //public void remote_data(uint localID, UUID itemID) //{ // remoteScript[localID].Events.remote_data(localID, itemID); //} - //public void http_response(uint localID, LLUUID itemID) + //public void http_response(uint localID, UUID itemID) //{ // remoteScript[localID].Events.http_response(localID, itemID); //} diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index fcd1df8..93a1a80 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs @@ -29,7 +29,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Threading; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.ScriptEngine.Interfaces; @@ -192,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// - public void RemoveScript(uint localID, LLUUID itemID) + public void RemoveScript(uint localID, UUID itemID) { // Remove a specific script @@ -219,7 +219,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } - public Object[] GetSerializationData(LLUUID itemID) + public Object[] GetSerializationData(UUID itemID) { List data = new List(); @@ -250,7 +250,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return data.ToArray(); } - public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID, + public void CreateFromData(uint localID, UUID itemID, UUID hostID, Object[] data) { int idx = 0; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 93dfeea..b2be0df 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -32,9 +32,8 @@ using System.Runtime.Remoting.Lifetime; using System.Text; using System.Threading; using Nini.Config; -using Axiom.Math; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -63,13 +62,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal IScriptEngine m_ScriptEngine; internal SceneObjectPart m_host; internal uint m_localID; - internal LLUUID m_itemID; + internal UUID m_itemID; internal bool throwErrorOnNotImplemented = true; internal AsyncCommandManager AsyncCommands = null; internal float m_ScriptDelayFactor = 1.0f; internal float m_ScriptDistanceFactor = 1.0f; - public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) + public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) { m_ScriptEngine = ScriptEngine; m_host = host; @@ -129,11 +128,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return World.GetCommander(name); } - private LLUUID InventorySelf() + private UUID InventorySelf() { - LLUUID invItemID = new LLUUID(); + UUID invItemID = new UUID(); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID) { @@ -145,54 +144,54 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return invItemID; } - private LLUUID InventoryKey(string name, int type) + private UUID InventoryKey(string name, int type) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { if (inv.Value.Type != type) - return LLUUID.Zero; + return UUID.Zero; return inv.Value.AssetID.ToString(); } } - return LLUUID.Zero; + return UUID.Zero; } - private LLUUID InventoryKey(string name) + private UUID InventoryKey(string name) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { return inv.Value.AssetID.ToString(); } } - return LLUUID.Zero; + return UUID.Zero; } /// - /// accepts a valid LLUUID, -or- a name of an inventory item. - /// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found + /// accepts a valid UUID, -or- a name of an inventory item. + /// Returns a valid UUID or UUID.Zero if key invalid and item not found /// in prim inventory. /// /// /// - private LLUUID KeyOrName(string k) + private UUID KeyOrName(string k) { - LLUUID key = LLUUID.Zero; + UUID key = UUID.Zero; // if we can parse the string as a key, use it. - if (LLUUID.TryParse(k, out key)) + if (UUID.TryParse(k, out key)) { return key; } // else try to locate the name in inventory of object. found returns key, - // not found returns LLUUID.Zero which will translate to the default particle texture + // not found returns UUID.Zero which will translate to the default particle texture else { return InventoryKey(k); @@ -551,7 +550,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (text.Length > 1023) text = text.Substring(0, 1023); - World.SimChat(Helpers.StringToField(text), + World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); @@ -565,7 +564,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (text.Length > 1023) text = text.Substring(0, 1023); - World.SimChat(Helpers.StringToField(text), + World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); @@ -579,7 +578,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (text.Length > 1023) text = text.Substring(0, 1023); - World.SimChat(Helpers.StringToField(text), + World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); @@ -606,8 +605,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llListen(int channelID, string name, string ID, string msg) { m_host.AddScriptLPS(1); - LLUUID keyID; - LLUUID.TryParse(ID, out keyID); + UUID keyID; + UUID.TryParse(ID, out keyID); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg); } @@ -629,8 +628,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSensor(string name, string id, int type, double range, double arc) { m_host.AddScriptLPS(1); - LLUUID keyID = LLUUID.Zero; - LLUUID.TryParse(id, out keyID); + UUID keyID = UUID.Zero; + UUID.TryParse(id, out keyID); AsyncCommands.SensorRepeatPlugin.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); } @@ -638,8 +637,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) { m_host.AddScriptLPS(1); - LLUUID keyID = LLUUID.Zero; - LLUUID.TryParse(id, out keyID); + UUID keyID = UUID.Zero; + UUID.TryParse(id, out keyID); AsyncCommands.SensorRepeatPlugin.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host); } @@ -650,7 +649,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AsyncCommands.SensorRepeatPlugin.UnSetSenseRepeaterEvents(m_localID, m_itemID); } - public string resolveName(LLUUID objecUUID) + public string resolveName(UUID objecUUID) { // try avatar username surname CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID); @@ -841,7 +840,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((status & ScriptBaseClass.STATUS_CAST_SHADOWS) == ScriptBaseClass.STATUS_CAST_SHADOWS) { - m_host.AddFlag(LLObject.ObjectFlags.CastShadows); + m_host.AddFlag(PrimFlags.CastShadows); } if ((status & ScriptBaseClass.STATUS_ROTATE_X) == ScriptBaseClass.STATUS_ROTATE_X) @@ -891,25 +890,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llGetStatus(int status) { m_host.AddScriptLPS(1); - // Console.WriteLine(m_host.UUID.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); + // Console.WriteLine(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); switch (status) { case ScriptBaseClass.STATUS_PHYSICS: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == (uint)LLObject.ObjectFlags.Physics) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Physics) == (uint)PrimFlags.Physics) { return 1; } return 0; case ScriptBaseClass.STATUS_PHANTOM: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) == (uint)PrimFlags.Phantom) { return 1; } return 0; case ScriptBaseClass.STATUS_CAST_SHADOWS: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.CastShadows) == (uint)PrimFlags.CastShadows) { return 1; } @@ -976,7 +975,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api scale.y = World.m_maxNonphys; if (scale.z > World.m_maxNonphys) scale.z = World.m_maxNonphys; - LLVector3 tmp = part.Scale; + Vector3 tmp = part.Scale; tmp.X = (float)scale.x; tmp.Y = (float)scale.y; tmp.Z = (float)scale.z; @@ -999,8 +998,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void SetColor(SceneObjectPart part, LSL_Types.Vector3 color, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -1036,7 +1035,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void SetGlow(SceneObjectPart part, int face, float glow) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { tex.CreateFace((uint) face); @@ -1083,7 +1082,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; } - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { tex.CreateFace((uint) face); @@ -1111,7 +1110,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void SetFullBright(SceneObjectPart part, int face, bool bright) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { tex.CreateFace((uint) face); @@ -1137,7 +1136,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public double llGetAlpha(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color { return (double)((tex.DefaultTexture.RGBA.A * 255) / 255); @@ -1158,8 +1157,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void SetAlpha(SceneObjectPart part, double alpha, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -1286,8 +1285,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.Vector3 llGetColor(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = m_host.Shape.Textures; + Color4 texcolor; LSL_Types.Vector3 rgb; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color { @@ -1320,21 +1319,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void SetTexture(SceneObjectPart part, string texture, int face) { - LLUUID textureID=new LLUUID(); + UUID textureID=new UUID(); - if (!LLUUID.TryParse(texture, out textureID)) + if (!UUID.TryParse(texture, out textureID)) { textureID=InventoryKey(texture, (int)AssetType.Texture); } - if (textureID == LLUUID.Zero) + if (textureID == UUID.Zero) return; - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { - LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); + Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.TextureID = textureID; tex.FaceTextures[face] = texface; part.UpdateTexture(tex); @@ -1365,10 +1364,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void ScaleTexture(SceneObjectPart part, double u, double v, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { - LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); + Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.RepeatU = (float)u; texface.RepeatV = (float)v; tex.FaceTextures[face] = texface; @@ -1401,10 +1400,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void OffsetTexture(SceneObjectPart part, double u, double v, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { - LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); + Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.OffsetU = (float)u; texface.OffsetV = (float)v; tex.FaceTextures[face] = texface; @@ -1437,10 +1436,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void RotateTexture(SceneObjectPart part, double rotation, int face) { - LLObject.TextureEntry tex = part.Shape.Textures; + Primitive.TextureEntry tex = part.Shape.Textures; if (face > -1) { - LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); + Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.Rotation = (float)rotation; tex.FaceTextures[face] = texface; part.UpdateTexture(tex); @@ -1464,14 +1463,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string llGetTexture(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; if (face == -1) { face = 0; } if (face > -1) { - LLObject.TextureEntryFace texface; + Primitive.TextureEntryFace texface; texface = tex.GetFace((uint)face); return texface.TextureID.ToString(); } @@ -1501,11 +1500,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (part.ParentID != 0) { - part.UpdateOffSet(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); + part.UpdateOffSet(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); } else { - part.UpdateGroupPosition(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); + part.UpdateGroupPosition(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); } } @@ -1545,7 +1544,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void SetRot(SceneObjectPart part, LSL_Types.Quaternion rot) { - part.UpdateRotation(new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s)); + part.UpdateRotation(new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s)); // Update rotation does not move the object in the physics scene if it's a linkset. part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; } @@ -1553,7 +1552,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.Quaternion llGetRot() { m_host.AddScriptLPS(1); - LLQuaternion q = m_host.RotationOffset; + Quaternion q = m_host.RotationOffset; return new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); } @@ -1605,7 +1604,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llTarget(LSL_Types.Vector3 position, double range) { m_host.AddScriptLPS(1); - return m_host.registerTargetWaypoint(new LLVector3((float)position.x, (float)position.y, (float)position.z), (float)range); + return m_host.registerTargetWaypoint(new Vector3((float)position.x, (float)position.y, (float)position.z), (float)range); } @@ -1631,7 +1630,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llMoveToTarget(LSL_Types.Vector3 target, double tau) { m_host.AddScriptLPS(1); - m_host.MoveToTarget(new LLVector3((float)target.x, (float)target.y, (float)target.z), (float)tau); + m_host.MoveToTarget(new Vector3((float)target.x, (float)target.y, (float)target.z), (float)tau); } public void llStopMoveToTarget() @@ -1652,7 +1651,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (force.z > 20000) force.z = 20000; - m_host.ApplyImpulse(new LLVector3((float)force.x, (float)force.y, (float)force.z), local != 0); + m_host.ApplyImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0); } public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) @@ -1761,7 +1760,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - if (m_host.Sound != LLUUID.Zero) + if (m_host.Sound != UUID.Zero) llStopSound(); m_host.Sound = KeyOrName(sound); @@ -1803,7 +1802,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - m_host.Sound = LLUUID.Zero; + m_host.Sound = UUID.Zero; m_host.SoundGain = 0; m_host.SoundFlags = 0; m_host.SoundRadius = 0; @@ -1811,7 +1810,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.ScheduleFullUpdate(); m_host.SendFullUpdateToAllClients(); - // m_host.SendSound(LLUUID.Zero.ToString(), 1.0, false, 2); + // m_host.SendSound(UUID.Zero.ToString(), 1.0, false, 2); } public void llPreloadSound(string sound) @@ -2059,13 +2058,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llGiveMoney(string destination, int amount) { - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return 0; m_host.AddScriptLPS(1); - if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) + if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) return 0; if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0) @@ -2074,9 +2073,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return 0; } - LLUUID toID=new LLUUID(); + UUID toID=new UUID(); - if (!LLUUID.TryParse(destination, out toID)) + if (!UUID.TryParse(destination, out toID)) { LSLError("Bad key in llGiveMoney"); return 0; @@ -2140,7 +2139,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // it's possible to have two items with the same task inventory name. // this is an easter egg of sorts. - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == inventory) { @@ -2151,18 +2150,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api continue; } - LLVector3 llpos = new LLVector3((float)pos.x, (float)pos.y, (float)pos.z); + Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z); // test if we're further away then 10m if (Util.GetDistanceTo(llpos, m_host.AbsolutePosition) > 10) return; // wiki says, if it's further away then 10m, silently fail. - LLVector3 llvel = new LLVector3((float)vel.x, (float)vel.y, (float)vel.z); + Vector3 llvel = new Vector3((float)vel.x, (float)vel.y, (float)vel.z); // need the magnitude later float velmag = (float)Util.GetMagnitude(llvel); - SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param); + SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param); // If either of these are null, then there was an unknown error. if (new_group == null) @@ -2176,7 +2175,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( "object_rez", new Object[] { new LSL_Types.LSLString( - new_group.RootPart.UUID.ToString()) }, + new_group.RootPart.ToString()) }, new DetectParams[0])); float groupmass = new_group.GetMass(); @@ -2243,7 +2242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } - if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) + if (m_host.TaskInventory[InventorySelf()].PermsGranter != UUID.Zero) { ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); @@ -2270,7 +2269,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } - if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) + if (m_host.TaskInventory[InventorySelf()].PermsGranter != UUID.Zero) { ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); @@ -2331,14 +2330,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // TODO: figure out values for client, fromSession, and imSessionID // client.SendInstantMessage(m_host.UUID, fromSession, message, user, imSessionID, m_host.Name, AgentManager.InstantMessageDialog.MessageFromAgent, (uint)Util.UnixTimeSinceEpoch()); - LLUUID friendTransactionID = LLUUID.Random(); + UUID friendTransactionID = UUID.Random(); //m_pendingFriendRequests.Add(friendTransactionID, fromAgentID); GridInstantMessage msg = new GridInstantMessage(); - msg.fromAgentID = new Guid(m_host.UUID.ToString()); // fromAgentID.UUID; + msg.fromAgentID = new Guid(m_host.ToString()); // fromAgentID.Guid; msg.fromAgentSession = new Guid(friendTransactionID.ToString());// fromAgentSession.UUID; - msg.toAgentID = new Guid(user); // toAgentID.UUID; + msg.toAgentID = new Guid(user); // toAgentID.Guid; msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here // Console.WriteLine("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); // Console.WriteLine("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); @@ -2356,8 +2355,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api msg.fromGroup = false;// fromGroup; msg.offline = (byte)0; //offline; msg.ParentEstateID = 0; //ParentEstateID; - msg.Position = new sLLVector3();// new sLLVector3(m_host.AbsolutePosition); - msg.RegionID = World.RegionInfo.RegionID.UUID;//RegionID.UUID; + msg.Position = Vector3.Zero;// new Vector3(m_host.AbsolutePosition); + msg.RegionID = World.RegionInfo.RegionID.Guid;//RegionID.Guid; msg.binaryBucket = new byte[0];// binaryBucket; World.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); // ScriptSleep(2000); @@ -2404,7 +2403,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string llGetKey() { m_host.AddScriptLPS(1); - return m_host.UUID.ToString(); + return m_host.ToString(); } public void llSetBuoyancy(double buoyancy) @@ -2468,11 +2467,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return; - if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) + if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) return; if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) @@ -2481,9 +2480,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence != null) { - // Do NOT try to parse LLUUID, animations cannot be triggered by ID - LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); - if (animID == LLUUID.Zero) + // Do NOT try to parse UUID, animations cannot be triggered by ID + UUID animID=InventoryKey(anim, (int)AssetType.Animation); + if (animID == UUID.Zero) presence.AddAnimation(anim); else presence.AddAnimation(animID); @@ -2495,30 +2494,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return; - if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) + if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) return; if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) { - LLUUID animID = new LLUUID(); + UUID animID = new UUID(); - if (!LLUUID.TryParse(anim, out animID)) + if (!UUID.TryParse(anim, out animID)) { animID=InventoryKey(anim); } - if (animID == LLUUID.Zero) + if (animID == UUID.Zero) return; ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); if (presence != null) { - if (animID == LLUUID.Zero) + if (animID == UUID.Zero) presence.RemoveAnimation(anim); else presence.RemoveAnimation(animID); @@ -2541,8 +2540,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) { m_host.AddScriptLPS(1); - m_host.RotationalVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); - m_host.AngularVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); + m_host.RotationalVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); + m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); m_host.ScheduleTerseUpdate(); m_host.SendTerseUpdateToAllClients(); } @@ -2561,19 +2560,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRequestPermissions(string agent, int perm) { - LLUUID agentID=new LLUUID(); + UUID agentID=new UUID(); - if (!LLUUID.TryParse(agent, out agentID)) + if (!UUID.TryParse(agent, out agentID)) return; - LLUUID invItemID=InventorySelf(); + UUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == UUID.Zero) return; // Not in a prim? How?? - if (agentID == LLUUID.Zero || perm == 0) // Releasing permissions + if (agentID == UUID.Zero || perm == 0) // Releasing permissions { - m_host.TaskInventory[invItemID].PermsGranter=LLUUID.Zero; + m_host.TaskInventory[invItemID].PermsGranter=UUID.Zero; m_host.TaskInventory[invItemID].PermsMask=0; m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( @@ -2655,14 +2654,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api new DetectParams[0])); } - void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer) + void handleScriptAnswer(IClientAPI client, UUID taskID, UUID itemID, int answer) { if (taskID != m_host.UUID) return; - LLUUID invItemID=InventorySelf(); + UUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == UUID.Zero) return; client.OnScriptAnswer-=handleScriptAnswer; @@ -2687,7 +2686,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public LSL_Types.LSLInteger llGetPermissions() @@ -2725,8 +2724,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); if (linknumber > -1) { - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -2772,8 +2771,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { linknumber = w; part = m_host.ParentGroup.GetLinkNumPart(linknumber); - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -2816,7 +2815,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCreateLink(string target, int parent) { m_host.AddScriptLPS(1); - LLUUID invItemID = InventorySelf(); + UUID invItemID = InventorySelf(); if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0) { ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); return; @@ -2841,7 +2840,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api childPrim.RootPart.UpdateFlag = uf; } parentPrim.TriggerScriptChangedEvent(Changed.LINK); - parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected); + parentPrim.RootPart.AddFlag(PrimFlags.CreateSelected); parentPrim.GetProperties(client); ScriptSleep(1000); @@ -2865,11 +2864,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); if (part != null) { - return part.UUID.ToString(); + return part.ToString(); } else { - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } } @@ -2891,7 +2890,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); int count = 0; - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Type == type || type == -1) { @@ -2905,7 +2904,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); ArrayList keys = new ArrayList(); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Type == type || type == -1) { @@ -2926,14 +2925,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetScriptState(string name, int run) { - LLUUID item; + UUID item; m_host.AddScriptLPS(1); // These functions are supposed to be robust, // so get the state one step at a time. - if ((item = ScriptByName(name)) != LLUUID.Zero) + if ((item = ScriptByName(name)) != UUID.Zero) { m_ScriptEngine.SetScriptState(item, run == 0 ? false : true); } @@ -2954,17 +2953,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); bool found = false; - LLUUID destId = LLUUID.Zero; - LLUUID objId = LLUUID.Zero; + UUID destId = UUID.Zero; + UUID objId = UUID.Zero; - if (!LLUUID.TryParse(destination, out destId)) + if (!UUID.TryParse(destination, out destId)) { llSay(0, "Could not parse key " + destination); return; } // move the first object found with this inventory name - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == inventory) { @@ -3037,7 +3036,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api World.CommsManager.UserService.GetAgentByUUID(id); if (userProfile == null || userAgent == null) - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); string reply = String.Empty; @@ -3065,12 +3064,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api reply = "0"; break; default: - return LLUUID.Zero.ToString(); // Raise no event + return UUID.Zero.ToString(); // Raise no event } - LLUUID rq = LLUUID.Random(); + UUID rq = UUID.Random(); - LLUUID tid = AsyncCommands. + UUID tid = AsyncCommands. DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString()); @@ -3089,23 +3088,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Type == 3 && item.Name == name) { - LLUUID tid = AsyncCommands. + UUID tid = AsyncCommands. DataserverPlugin.RegisterRequest(m_localID, m_itemID, item.AssetID.ToString()); - LLVector3 region = new LLVector3( + Vector3 region = new Vector3( World.RegionInfo.RegionLocX * Constants.RegionSize, World.RegionInfo.RegionLocY * Constants.RegionSize, 0); World.AssetCache.GetAsset(item.AssetID, - delegate(LLUUID i, AssetBase a) + delegate(UUID i, AssetBase a) { AssetLandmark lm = new AssetLandmark(a); float rx = (uint)(lm.RegionHandle >> 32); float ry = (uint)lm.RegionHandle; - region = lm.Position + new LLVector3(rx, ry, 0) - region; + region = lm.Position + new Vector3(rx, ry, 0) - region; string reply = region.ToString(); AsyncCommands. @@ -3130,8 +3129,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTeleportAgentHome(string agent) { m_host.AddScriptLPS(1); - LLUUID agentId = new LLUUID(); - if (LLUUID.TryParse(agent, out agentId)) + UUID agentId = new UUID(); + if (UUID.TryParse(agent, out agentId)) { ScenePresence presence = World.GetScenePresence(agentId); if (presence != null) @@ -3147,7 +3146,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llModifyLand(int action, int brush) { m_host.AddScriptLPS(1); - World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0)); + World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new Vector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0)); } public void llCollisionSound(string impact_sound, double impact_volume) @@ -3182,7 +3181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); // uint partLocalID; - LLUUID partItemID; + UUID partItemID; switch ((int)linknum) { @@ -3357,7 +3356,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SceneObjectPart targ = World.GetSceneObjectPart(target); if (targ == null) return; - targ.ApplyImpulse(new LLVector3((float)impulse.x, (float)impulse.y, (float)impulse.z), local != 0); + targ.ApplyImpulse(new Vector3((float)impulse.x, (float)impulse.y, (float)impulse.z), local != 0); } public void llPassCollisions(int pass) @@ -3636,7 +3635,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string llGetInventoryKey(string name) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { @@ -3646,11 +3645,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } } } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public void llAllowInventoryDrop(int add) @@ -3668,10 +3667,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); LSL_Types.Vector3 SunDoubleVector3; - LLVector3 SunFloatVector3; + Vector3 SunFloatVector3; // sunPosition estate setting is set in OpenSim.Region.Environment.Modules.SunModule - // have to convert from LLVector3 (float) to LSL_Types.Vector3 (double) + // have to convert from Vector3 (float) to LSL_Types.Vector3 (double) SunFloatVector3 = World.RegionInfo.RegionSettings.SunVector; SunDoubleVector3.x = (double)SunFloatVector3.X; SunDoubleVector3.y = (double)SunFloatVector3.Y; @@ -3683,7 +3682,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.Vector3 llGetTextureOffset(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; LSL_Types.Vector3 offset; if (face == -1) { @@ -3698,7 +3697,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.Vector3 llGetTextureScale(int side) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; LSL_Types.Vector3 scale; if (side == -1) { @@ -3713,7 +3712,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public double llGetTextureRot(int face) { m_host.AddScriptLPS(1); - LLObject.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntry tex = m_host.Shape.Textures; if (face == -1) { face = 0; @@ -3730,14 +3729,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string llGetOwnerKey(string id) { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id, out key)) + UUID key = new UUID(); + if (UUID.TryParse(id, out key)) { return World.GetSceneObjectPart(World.Entities[key].LocalId).OwnerID.ToString(); } else { - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } } @@ -3946,8 +3945,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return 2; if (src.Data[index] is String) { - LLUUID tuuid; - if (LLUUID.TryParse(src.Data[index].ToString(), out tuuid)) + UUID tuuid; + if (UUID.TryParse(src.Data[index].ToString(), out tuuid)) { return 3; } @@ -4359,8 +4358,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string llKey2Name(string id) { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id,out key)) + UUID key = new UUID(); + if (UUID.TryParse(id,out key)) { ScenePresence presence = World.GetScenePresence(key); @@ -4384,7 +4383,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); - pTexAnim.Flags =(uint) mode; + pTexAnim.Flags = (Primitive.TextureAnimMode)mode; //ALL_SIDES if (face == -1) @@ -4473,8 +4472,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llOverMyLand(string id) { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id,out key)) + UUID key = new UUID(); + if (UUID.TryParse(id,out key)) { ScenePresence presence = World.GetScenePresence(key); if (presence != null) // object is an avatar @@ -4517,8 +4516,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id, out key)) + UUID key = new UUID(); + if (UUID.TryParse(id, out key)) { ScenePresence av = World.GetScenePresence(key); @@ -4656,8 +4655,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); // TODO find out about the other defaults and add them here - ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); - ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); + ps.PartStartColor = new Color4(1.0f, 1.0f, 1.0f, 1.0f); + ps.PartEndColor = new Color4(1.0f, 1.0f, 1.0f, 1.0f); ps.PartStartScaleX = 1.0f; ps.PartStartScaleY = 1.0f; ps.PartEndScaleX = 1.0f; @@ -4705,7 +4704,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PSYS_PART_END_COLOR: tempv = (LSL_Types.Vector3)rules.Data[i + 1]; - //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1); + //prules.PartEndColor = new Color4(tempv.x,tempv.y,tempv.z,1); prules.PartEndColor.R = (float)tempv.x; prules.PartEndColor.G = (float)tempv.y; @@ -4784,8 +4783,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PSYS_SRC_TARGET_KEY: - LLUUID key = LLUUID.Zero; - if (LLUUID.TryParse(rules.Data[i + 1].ToString(), out key)) + UUID key = UUID.Zero; + if (UUID.TryParse(rules.Data[i + 1].ToString(), out key)) { prules.Target = key; } @@ -4829,37 +4828,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api NotImplemented("llGroundRepel"); } - private LLUUID GetTaskInventoryItem(string name) + private UUID GetTaskInventoryItem(string name) { - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) return inv.Key; } - return LLUUID.Zero; + return UUID.Zero; } public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory) { m_host.AddScriptLPS(1); - LLUUID destID; - if (!LLUUID.TryParse(destination, out destID)) + UUID destID; + if (!UUID.TryParse(destination, out destID)) return; - List itemList = new List(); + List itemList = new List(); foreach (Object item in inventory.Data) { - LLUUID itemID; - if (LLUUID.TryParse(item.ToString(), out itemID)) + UUID itemID; + if (UUID.TryParse(item.ToString(), out itemID)) { itemList.Add(itemID); } else { itemID = GetTaskInventoryItem(item.ToString()); - if (itemID != LLUUID.Zero) + if (itemID != UUID.Zero) itemList.Add(itemID); } } @@ -4920,7 +4919,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api rot.z = 1; // ZERO_ROTATION = 0,0,0,1 m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z); - m_host.SitTargetOrientation = new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z); + m_host.SitTargetOrientation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); } public string llAvatarOnSitTarget() @@ -4932,12 +4931,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llAddToLandPassList(string avatar, double hours) { m_host.AddScriptLPS(1); - LLUUID key; + UUID key; LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; if (land.OwnerID == m_host.OwnerID) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); - if (LLUUID.TryParse(avatar, out key)) + if (UUID.TryParse(avatar, out key)) { entry.AgentID = key; entry.Flags = ParcelManager.AccessList.Access; @@ -4963,13 +4962,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) { m_host.AddScriptLPS(1); - m_host.SetCameraEyeOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z)); + m_host.SetCameraEyeOffset(new Vector3((float)offset.x, (float)offset.y, (float)offset.z)); } public void llSetCameraAtOffset(LSL_Types.Vector3 offset) { m_host.AddScriptLPS(1); - m_host.SetCameraAtOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z)); + m_host.SetCameraAtOffset(new Vector3((float)offset.x, (float)offset.y, (float)offset.z)); } public string llDumpList2String(LSL_Types.list src, string seperator) @@ -4991,7 +4990,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llScriptDanger(LSL_Types.Vector3 pos) { m_host.AddScriptLPS(1); - bool result = World.scriptDanger(m_host.LocalId, new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); + bool result = World.scriptDanger(m_host.LocalId, new Vector3((float)pos.x, (float)pos.y, (float)pos.z)); if (result) { return 1; @@ -5006,8 +5005,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel) { m_host.AddScriptLPS(1); - LLUUID av = new LLUUID(); - if (!LLUUID.TryParse(avatar,out av)) + UUID av = new UUID(); + if (!UUID.TryParse(avatar,out av)) { LSLError("First parameter to llDialog needs to be a key"); return; @@ -5032,7 +5031,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } buts[i] = buttons.Data[i].ToString(); } - World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); + World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); // ScriptSleep(1000); } @@ -5049,11 +5048,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llResetOtherScript(string name) { - LLUUID item; + UUID item; m_host.AddScriptLPS(1); - if ((item = ScriptByName(name)) != LLUUID.Zero) + if ((item = ScriptByName(name)) != UUID.Zero) m_ScriptEngine.ResetScript(item); else ShoutError("llResetOtherScript: script "+name+" not found"); @@ -5061,11 +5060,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llGetScriptState(string name) { - LLUUID item; + UUID item; m_host.AddScriptLPS(1); - if ((item = ScriptByName(name)) != LLUUID.Zero) + if ((item = ScriptByName(name)) != UUID.Zero) { return m_ScriptEngine.GetScriptState(item) ?1:0; } @@ -5095,10 +5094,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); bool found = false; - LLUUID destId = LLUUID.Zero; - LLUUID srcId = LLUUID.Zero; + UUID destId = UUID.Zero; + UUID srcId = UUID.Zero; - if (!LLUUID.TryParse(target, out destId)) + if (!UUID.TryParse(target, out destId)) { llSay(0, "Could not parse key " + target); return; @@ -5111,7 +5110,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } // copy the first script found with this inventory name - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { @@ -5143,8 +5142,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface(); if (xmlrpcMod.IsEnabled()) { - LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, LLUUID.Zero); - object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(LLUUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) }; + UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, UUID.Zero); + object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(UUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) }; m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( "remote_data", resobj, new DetectParams[0])); @@ -5464,9 +5463,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void SetPrimitiveShapeParams(SceneObjectPart part, string map, int type) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); - LLUUID sculptId; + UUID sculptId; - if (!LLUUID.TryParse(map, out sculptId)) + if (!UUID.TryParse(map, out sculptId)) { llSay(0, "Could not parse key " + map); return; @@ -5896,9 +5895,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence av = World.GetScenePresence(id); if (av == null) return l; - LLUUID[] anims; + UUID[] anims; anims = av.GetAnimationArray(); - foreach (LLUUID foo in anims) + foreach (UUID foo in anims) l.Add(foo.ToString()); return l; } @@ -5906,8 +5905,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetParcelMusicURL(string url) { m_host.AddScriptLPS(1); - LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (landowner == LLUUID.Zero) + UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + if (landowner == UUID.Zero) { return; } @@ -5922,9 +5921,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetParcelMediaURL(string url) { m_host.AddScriptLPS(1); - LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (landowner == LLUUID.Zero) + if (landowner == UUID.Zero) { return; } @@ -5978,8 +5977,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); if (linknumber > -1) { - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -6017,8 +6016,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { linknumber = w; part = m_host.ParentGroup.GetLinkNumPart(linknumber); - LLObject.TextureEntry tex = part.Shape.Textures; - LLColor texcolor; + Primitive.TextureEntry tex = part.Shape.Textures; + Color4 texcolor; if (face > -1) { texcolor = tex.CreateFace((uint)face).RGBA; @@ -6086,21 +6085,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_PHYSICS: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) != 0) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Physics) != 0) res.Add(new LSL_Types.LSLInteger(1)); else res.Add(new LSL_Types.LSLInteger(0)); break; case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) != 0) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) != 0) res.Add(new LSL_Types.LSLInteger(1)); else res.Add(new LSL_Types.LSLInteger(0)); break; case (int)ScriptBaseClass.PRIM_PHANTOM: - if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) != 0) + if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0) res.Add(new LSL_Types.LSLInteger(1)); else res.Add(new LSL_Types.LSLInteger(0)); @@ -6205,8 +6204,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (face == -1) face = 0; - LLObject.TextureEntry tex = m_host.Shape.Textures; - LLObject.TextureEntryFace texface = tex.GetFace((uint)face); + Primitive.TextureEntry tex = m_host.Shape.Textures; + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); res.Add(new LSL_Types.LSLString(texface.TextureID.ToString())); res.Add(new LSL_Types.Vector3(texface.RepeatU, @@ -6225,7 +6224,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api face=Convert.ToInt32(rules.Data[idx++].ToString()); tex = m_host.Shape.Textures; - LLColor texcolor; + Color4 texcolor; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color texcolor = tex.DefaultTexture.RGBA; else @@ -6579,7 +6578,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetLocalRot(LSL_Types.Quaternion rot) { m_host.AddScriptLPS(1); - m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); + m_host.RotationOffset = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); // ScriptSleep(200); } @@ -6835,7 +6834,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llGetInventoryPermMask(string item, int mask) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == item) { @@ -6866,7 +6865,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string llGetInventoryCreator(string item) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == item) { @@ -6881,7 +6880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - World.SimChatBroadcast(Helpers.StringToField(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); + World.SimChatBroadcast(Utils.StringToBytes(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); // IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); // wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg); } @@ -6902,7 +6901,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (info == null) { // ScriptSleep(1000); - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } reply = new LSL_Types.Vector3( info.RegionLocX * Constants.RegionSize, @@ -6919,7 +6918,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (info == null) { // ScriptSleep(1000); - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } int access = info.RegionSettings.Maturity; if (access == 0) @@ -6934,11 +6933,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; default: // ScriptSleep(1000); - return LLUUID.Zero.ToString(); // Raise no event + return UUID.Zero.ToString(); // Raise no event } - LLUUID rq = LLUUID.Random(); + UUID rq = UUID.Random(); - LLUUID tid = AsyncCommands. + UUID tid = AsyncCommands. DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString()); AsyncCommands. @@ -6950,7 +6949,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api catch(Exception e) { Console.WriteLine(e.ToString()); - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } } @@ -6963,8 +6962,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public double llGetObjectMass(string id) { m_host.AddScriptLPS(1); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id,out key)) + UUID key = new UUID(); + if (UUID.TryParse(id,out key)) { return (double)World.GetSceneObjectPart(World.Entities[key].LocalId).GetMass(); } @@ -7056,7 +7055,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLoadURL(string avatar_id, string message, string url) { m_host.AddScriptLPS(1); - LLUUID avatarId = new LLUUID(avatar_id); + UUID avatarId = new UUID(avatar_id); m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, url); // ScriptSleep(10000); @@ -7202,7 +7201,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llGetInventoryType(string name) { m_host.AddScriptLPS(1); - foreach (KeyValuePair inv in m_host.TaskInventory) + foreach (KeyValuePair inv in m_host.TaskInventory) { if (inv.Value.Name == name) { @@ -7231,10 +7230,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.Vector3 llGetCameraPos() { m_host.AddScriptLPS(1); - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return new LSL_Types.Vector3(); - if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) + if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) return new LSL_Types.Vector3(); if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) { @@ -7244,7 +7243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence presence = World.GetScenePresence(m_host.OwnerID); if (presence != null) { - LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); + LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.X, presence.CameraPosition.Y, presence.CameraPosition.Z); return pos; } return new LSL_Types.Vector3(); @@ -7307,12 +7306,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llAddToLandBanList(string avatar, double hours) { m_host.AddScriptLPS(1); - LLUUID key; + UUID key; LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; if (land.OwnerID == m_host.OwnerID) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); - if (LLUUID.TryParse(avatar, out key)) + if (UUID.TryParse(avatar, out key)) { entry.AgentID = key; entry.Flags = ParcelManager.AccessList.Ban; @@ -7326,11 +7325,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRemoveFromLandPassList(string avatar) { m_host.AddScriptLPS(1); - LLUUID key; + UUID key; LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; if (land.OwnerID == m_host.OwnerID) { - if (LLUUID.TryParse(avatar, out key)) + if (UUID.TryParse(avatar, out key)) { foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) { @@ -7348,11 +7347,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRemoveFromLandBanList(string avatar) { m_host.AddScriptLPS(1); - LLUUID key; + UUID key; LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; if (land.OwnerID == m_host.OwnerID) { - if (LLUUID.TryParse(avatar, out key)) + if (UUID.TryParse(avatar, out key)) { foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) { @@ -7372,16 +7371,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); // our key in the object we are in - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) return; + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return; // the object we are in - LLUUID objectID = m_host.ParentUUID; - if (objectID == LLUUID.Zero) return; + UUID objectID = m_host.ParentUUID; + if(objectID == UUID.Zero) return; // we need the permission first, to know which avatar we want to set the camera for - LLUUID agentID = m_host.TaskInventory[invItemID].PermsGranter; - if (agentID == LLUUID.Zero) return; + UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; + if (agentID == UUID.Zero) return; if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); @@ -7423,16 +7422,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); // our key in the object we are in - LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) return; + UUID invItemID=InventorySelf(); + if (invItemID == UUID.Zero) return; // the object we are in - LLUUID objectID = m_host.ParentUUID; - if (objectID == LLUUID.Zero) return; + UUID objectID = m_host.ParentUUID; + if(objectID == UUID.Zero) return; // we need the permission first, to know which avatar we want to clear the camera for - LLUUID agentID = m_host.TaskInventory[invItemID].PermsGranter; - if (agentID == LLUUID.Zero) return; + UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; + if (agentID == UUID.Zero) return; if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); @@ -7531,9 +7530,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api param.Add(o.ToString()); } - LLVector3 position = m_host.AbsolutePosition; - LLVector3 velocity = m_host.Velocity; - LLQuaternion rotation = m_host.RotationOffset; + Vector3 position = m_host.AbsolutePosition; + Vector3 velocity = m_host.Velocity; + Quaternion rotation = m_host.RotationOffset; ScenePresence scenePresence = World.GetScenePresence(m_host.ObjectOwner); RegionInfo regionInfo = World.RegionInfo; @@ -7549,10 +7548,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api httpHeaders["X-SecondLife-Owner-Name"] = scenePresence == null ? string.Empty : scenePresence.ControllingClient.Name; httpHeaders["X-SecondLife-Owner-Key"] = m_host.ObjectOwner.ToString(); - LLUUID reqID = httpScriptMod. + UUID reqID = httpScriptMod. StartHttpRequest(m_localID, m_itemID, url, param, httpHeaders, body); - if (reqID != LLUUID.Zero) + if (reqID != UUID.Zero) return reqID.ToString(); else return null; @@ -7662,7 +7661,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_Types.list ret = new LSL_Types.list(); if (land != null) { - foreach (KeyValuePair d in land.getLandObjectOwners()) + foreach (KeyValuePair d in land.getLandObjectOwners()) { ret.Add(d.Key.ToString()); ret.Add(d.Value); @@ -7675,7 +7674,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llGetObjectPrimCount(string object_id) { m_host.AddScriptLPS(1); - SceneObjectPart part = World.GetSceneObjectPart(new LLUUID(object_id)); + SceneObjectPart part = World.GetSceneObjectPart(new UUID(object_id)); if (part == null) { return 0; @@ -7781,8 +7780,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); LSL_Types.list ret = new LSL_Types.list(); - LLUUID key = new LLUUID(); - if (LLUUID.TryParse(id, out key)) + UUID key = new UUID(); + if (UUID.TryParse(id, out key)) { ScenePresence av = World.GetScenePresence(key); @@ -7802,19 +7801,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ret.Add(new LSL_Types.Vector3((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z)); break; case "4": - ret.Add(new LSL_Types.Quaternion((double)av.Rotation.x, (double)av.Rotation.y, (double)av.Rotation.z, (double)av.Rotation.w)); + ret.Add(new LSL_Types.Quaternion((double)av.Rotation.X, (double)av.Rotation.Y, (double)av.Rotation.Z, (double)av.Rotation.W)); break; case "5": - ret.Add(new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z)); + ret.Add(new LSL_Types.Vector3(av.Velocity.X, av.Velocity.Y, av.Velocity.Z)); break; case "6": ret.Add(id); break; case "7": - ret.Add(LLUUID.Zero.ToString()); + ret.Add(UUID.Zero.ToString()); break; case "8": - ret.Add(LLUUID.Zero.ToString()); + ret.Add(UUID.Zero.ToString()); break; } } @@ -7834,7 +7833,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ret.Add(obj.Description); break; case "3": - ret.Add(new LSL_Types.Vector3(obj.AbsolutePosition.X,obj.AbsolutePosition.Y,obj.AbsolutePosition.Z)); + ret.Add(new LSL_Types.Vector3(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z)); break; case "4": ret.Add(new LSL_Types.Quaternion(obj.RotationOffset.X, obj.RotationOffset.Y, obj.RotationOffset.Z, obj.RotationOffset.W)); @@ -7860,14 +7859,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } - internal LLUUID ScriptByName(string name) + internal UUID ScriptByName(string name) { foreach (TaskInventoryItem item in m_host.TaskInventory.Values) { if (item.Type == 10 && item.Name == name) return item.ItemID; } - return LLUUID.Zero; + return UUID.Zero; } internal void ShoutError(string msg) @@ -7893,10 +7892,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api throw new Exception("LSL Runtime Error: " + msg); } - public delegate void AssetRequestCallback(LLUUID assetID, AssetBase asset); - private void WithNotecard(LLUUID assetID, AssetRequestCallback cb) + public delegate void AssetRequestCallback(UUID assetID, AssetBase asset); + private void WithNotecard(UUID assetID, AssetRequestCallback cb) { - World.AssetCache.GetAsset(assetID, delegate(LLUUID i, AssetBase a) { cb(i, a); }, false); + World.AssetCache.GetAsset(assetID, delegate(UUID i, AssetBase a) { cb(i, a); }, false); } public string llGetNumberOfNotecardLines(string name) @@ -7907,7 +7906,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Type == 7 && item.Name == name) { - LLUUID tid = AsyncCommands. + UUID tid = AsyncCommands. DataserverPlugin.RegisterRequest(m_localID, m_itemID, item.AssetID.ToString()); if (NotecardCache.IsCached(item.AssetID)) @@ -7918,7 +7917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // ScriptSleep(100); return tid.ToString(); } - WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) + WithNotecard(item.AssetID, delegate (UUID id, AssetBase a) { System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); @@ -7934,7 +7933,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } // ScriptSleep(100); - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public string llGetNotecardLine(string name, int line) @@ -7945,7 +7944,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Type == 7 && item.Name == name) { - LLUUID tid = AsyncCommands. + UUID tid = AsyncCommands. DataserverPlugin.RegisterRequest(m_localID, m_itemID, item.AssetID.ToString()); if (NotecardCache.IsCached(item.AssetID)) @@ -7956,7 +7955,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // ScriptSleep(100); return tid.ToString(); } - WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) + WithNotecard(item.AssetID, delegate (UUID id, AssetBase a) { System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); @@ -7987,10 +7986,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public DateTime lastRef; } - private static Dictionary m_Notecards = - new Dictionary(); + private static Dictionary m_Notecards = + new Dictionary(); - public static void Cache(LLUUID assetID, string text) + public static void Cache(UUID assetID, string text) { CacheCheck(); @@ -8081,7 +8080,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return output.ToArray(); } - public static bool IsCached(LLUUID assetID) + public static bool IsCached(UUID assetID) { lock (m_Notecards) { @@ -8089,7 +8088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - public static int GetLines(LLUUID assetID) + public static int GetLines(UUID assetID) { if (!IsCached(assetID)) return -1; @@ -8101,7 +8100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - public static string GetLine(LLUUID assetID, int line) + public static string GetLine(UUID assetID, int line) { if (line < 0) return ""; @@ -8128,7 +8127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public static void CacheCheck() { - foreach (LLUUID key in new List(m_Notecards.Keys)) + foreach (UUID key in new List(m_Notecards.Keys)) { Notecard nc = m_Notecards[key]; if (nc.lastRef.AddSeconds(30) < DateTime.Now) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 257b17b..0f598ea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -26,8 +26,7 @@ */ using System; using System.Runtime.Remoting.Lifetime; -using Axiom.Math; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework.Console; using OpenSim.Region.Environment.Interfaces; @@ -46,9 +45,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal IScriptEngine m_ScriptEngine; internal SceneObjectPart m_host; internal uint m_localID; - internal LLUUID m_itemID; + internal UUID m_itemID; - public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) + public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) { m_ScriptEngine = ScriptEngine; m_host = host; @@ -86,7 +85,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (x > 255 || x < 0 || y > 255 || y < 0) OSSLError("osTerrainSetHeight: Coordinate out of bounds"); - if (World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new LLVector3(x, y, 0))) + if (World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) { World.Heightmap[x, y] = val; return 1; @@ -144,7 +143,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api World.SendGeneralAlert(msg); } - public void osSetRot(LLUUID target, Quaternion rotation) + public void osSetRot(UUID target, Quaternion rotation) { if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false)) { @@ -176,7 +175,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); - LLUUID createdTexture = + UUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, extraParams, timer); return createdTexture.ToString(); @@ -186,7 +185,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //TODO update existing dynamic textures } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, @@ -202,7 +201,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); - LLUUID createdTexture = + UUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, extraParams, timer, true, (byte) alpha); return createdTexture.ToString(); @@ -212,7 +211,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //TODO update existing dynamic textures } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, @@ -230,7 +229,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IDynamicTextureManager textureManager = World.RequestModuleInterface(); if (textureManager != null) { - LLUUID createdTexture = + UUID createdTexture = textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, extraParams, timer); return createdTexture.ToString(); @@ -241,7 +240,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //TODO update existing dynamic textures } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, @@ -259,7 +258,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IDynamicTextureManager textureManager = World.RequestModuleInterface(); if (textureManager != null) { - LLUUID createdTexture = + UUID createdTexture = textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, extraParams, timer, true, (byte) alpha); return createdTexture.ToString(); @@ -270,7 +269,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //TODO update existing dynamic textures } - return LLUUID.Zero.ToString(); + return UUID.Zero.ToString(); } public bool osConsoleCommand(string command) @@ -539,9 +538,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } m_host.AddScriptLPS(1); - LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (landowner == LLUUID.Zero) + if (landowner == UUID.Zero) { return; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs index 52d277e..7300f10 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Shared.Api; @@ -49,28 +49,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins private class DataserverRequest { public uint localID; - public LLUUID itemID; + public UUID itemID; - public LLUUID ID; + public UUID ID; public string handle; public DateTime startTime; } - public LLUUID RegisterRequest(uint localID, LLUUID itemID, + public UUID RegisterRequest(uint localID, UUID itemID, string identifier) { lock (DataserverRequests) { if (DataserverRequests.ContainsKey(identifier)) - return LLUUID.Zero; + return UUID.Zero; DataserverRequest ds = new DataserverRequest(); ds.localID = localID; ds.itemID = itemID; - ds.ID = LLUUID.Random(); + ds.ID = UUID.Random(); ds.handle = identifier; ds.startTime = DateTime.Now; @@ -101,7 +101,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins new DetectParams[0])); } - public void RemoveEvents(uint localID, LLUUID itemID) + public void RemoveEvents(uint localID, UUID itemID) { lock (DataserverRequests) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs index 11b45b1..b353cba 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs @@ -26,7 +26,7 @@ */ using System; -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Modules.Scripting.WorldComm; using OpenSim.Region.ScriptEngine.Shared; @@ -74,14 +74,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } } - public Object[] GetSerializationData(LLUUID itemID) + public Object[] GetSerializationData(UUID itemID) { IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface(); return comms.GetSerializationData(itemID); } - public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID, + public void CreateFromData(uint localID, UUID itemID, UUID hostID, Object[] data) { IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index eaf4bd0..d1e3921 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Region.Environment.Scenes; @@ -45,8 +45,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins m_CmdManager = CmdManager; } - public Dictionary> SenseEvents = - new Dictionary>(); + public Dictionary> SenseEvents = + new Dictionary>(); private Object SenseLock = new Object(); // @@ -55,12 +55,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins private class SenseRepeatClass { public uint localID; - public LLUUID itemID; + public UUID itemID; public double interval; public DateTime next; public string name; - public LLUUID keyID; + public UUID keyID; public int type; public double range; public double arc; @@ -70,8 +70,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins private List SenseRepeaters = new List(); private object SenseRepeatListLock = new object(); - public void SetSenseRepeatEvent(uint m_localID, LLUUID m_itemID, - string name, LLUUID keyID, int type, double range, + public void SetSenseRepeatEvent(uint m_localID, UUID m_itemID, + string name, UUID keyID, int type, double range, double arc, double sec, SceneObjectPart host) { // Always remove first, in case this is a re-set @@ -98,7 +98,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } } - public void UnSetSenseRepeaterEvents(uint m_localID, LLUUID m_itemID) + public void UnSetSenseRepeaterEvents(uint m_localID, UUID m_itemID) { // Remove from timer lock (SenseRepeatListLock) @@ -138,8 +138,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } // lock } - public void SenseOnce(uint m_localID, LLUUID m_itemID, - string name, LLUUID keyID, int type, + public void SenseOnce(uint m_localID, UUID m_itemID, + string name, UUID keyID, int type, double range, double arc, SceneObjectPart host) { // Add to timer @@ -156,11 +156,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins SensorSweep(ts); } - public LSL_Types.list GetSensorList(uint m_localID, LLUUID m_itemID) + public LSL_Types.list GetSensorList(uint m_localID, UUID m_itemID) { lock (SenseLock) { - Dictionary Obj = null; + Dictionary Obj = null; if (!SenseEvents.TryGetValue(m_localID, out Obj)) { return null; @@ -187,11 +187,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins return; } - LLVector3 sensorPos = SensePoint.AbsolutePosition; - LLVector3 regionPos = new LLVector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0); - LLVector3 fromRegionPos = sensorPos + regionPos; + Vector3 sensorPos = SensePoint.AbsolutePosition; + Vector3 regionPos = new Vector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0); + Vector3 fromRegionPos = sensorPos + regionPos; - LLQuaternion q = SensePoint.RotationOffset; + Quaternion q = SensePoint.RotationOffset; LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); @@ -203,7 +203,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins foreach (EntityBase ent in m_CmdManager.m_ScriptEngine.World.Entities.Values) { - LLVector3 toRegionPos = ent.AbsolutePosition + regionPos; + Vector3 toRegionPos = ent.AbsolutePosition + regionPos; double dis = Math.Abs((double)Util.GetDistanceTo(toRegionPos, fromRegionPos)); if (dis <= ts.range) { @@ -239,7 +239,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins double ang_obj = 0; try { - LLVector3 diff = toRegionPos - fromRegionPos; + Vector3 diff = toRegionPos - fromRegionPos; LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3(diff.X, diff.Y, diff.Z); double dot = LSL_Types.Vector3.Dot(forward_dir, obj_dir); double mag_obj = LSL_Types.Vector3.Mag(obj_dir); @@ -252,7 +252,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins if (ang_obj > ts.arc) keep = false; } - if (keep && (ts.keyID != LLUUID.Zero) && (ts.keyID != ent.UUID)) + if (keep && (ts.keyID != UUID.Zero) && (ts.keyID != ent.UUID)) { keep = false; } @@ -292,10 +292,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins // Create object if it doesn't exist if (SenseEvents.ContainsKey(ts.localID) == false) { - SenseEvents.Add(ts.localID, new Dictionary()); + SenseEvents.Add(ts.localID, new Dictionary()); } // clear if previous traces exist - Dictionary Obj; + Dictionary Obj; SenseEvents.TryGetValue(ts.localID, out Obj); if (Obj.ContainsKey(ts.itemID) == true) Obj.Remove(ts.itemID); @@ -320,7 +320,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins for (idx = 0; idx < SensedObjects.Length; idx++) { detect[idx] = new DetectParams(); - detect[idx].Key=(LLUUID)(SensedObjects.Data[idx]); + detect[idx].Key=(UUID)(SensedObjects.Data[idx]); detect[idx].Populate(m_CmdManager.m_ScriptEngine.World); } @@ -333,7 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } } - public Object[] GetSerializationData(LLUUID itemID) + public Object[] GetSerializationData(UUID itemID) { List data = new List(); @@ -352,7 +352,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins return data.ToArray(); } - public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID, + public void CreateFromData(uint localID, UUID itemID, UUID objectID, Object[] data) { SceneObjectPart part = @@ -373,7 +373,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins ts.interval = (double)data[idx]; ts.name = (string)data[idx+1]; - ts.keyID = (LLUUID)data[idx+2]; + ts.keyID = (UUID)data[idx+2]; ts.type = (int)data[idx+3]; ts.range = (double)data[idx+4]; ts.arc = (double)data[idx+5]; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs index 36e992b..ec7cd35 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Region.ScriptEngine.Shared.Api; namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins @@ -48,7 +48,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins private class TimerClass { public uint localID; - public LLUUID itemID; + public UUID itemID; //public double interval; public long interval; //public DateTime next; @@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins private List Timers = new List(); private object TimerListLock = new object(); - public void SetTimerEvent(uint m_localID, LLUUID m_itemID, double sec) + public void SetTimerEvent(uint m_localID, UUID m_itemID, double sec) { // Always remove first, in case this is a re-set UnSetTimerEvents(m_localID, m_itemID); @@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } } - public void UnSetTimerEvents(uint m_localID, LLUUID m_itemID) + public void UnSetTimerEvents(uint m_localID, UUID m_itemID) { // Remove from timer lock (TimerListLock) @@ -122,7 +122,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } } - public Object[] GetSerializationData(LLUUID itemID) + public Object[] GetSerializationData(UUID itemID) { List data = new List(); @@ -140,7 +140,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins return data.ToArray(); } - public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID, + public void CreateFromData(uint localID, UUID itemID, UUID objectID, Object[] data) { int idx = 0; diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs index 45f92e3..57efb2e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs @@ -118,7 +118,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools //System.Console.WriteLine("SCRIPT:" + checkscript); // checks for alpha.alpha way of referring to objects in C# - // ignores alpha.x alpha.y, alpha.z for refering to vector components + // ignores alpha.X alpha.Y, alpha.Z for refering to vector components Match SecurityM; // BROKEN: this check is very wrong. It block's any url in strings. diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs index d3222e7..8599e06 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs @@ -31,7 +31,7 @@ using System.Threading; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment; using OpenSim.Region.Environment.Scenes; @@ -70,24 +70,24 @@ namespace OpenSim.Region.ScriptEngine.Shared { public DetectParams() { - Key = LLUUID.Zero; + Key = UUID.Zero; OffsetPos = new LSL_Types.Vector3(); LinkNum = 0; - Group = LLUUID.Zero; + Group = UUID.Zero; Name = String.Empty; - Owner = LLUUID.Zero; + Owner = UUID.Zero; Position = new LSL_Types.Vector3(); Rotation = new LSL_Types.Quaternion(); Type = 0; Velocity = new LSL_Types.Vector3(); } - public LLUUID Key; + public UUID Key; public LSL_Types.Vector3 OffsetPos; public int LinkNum; - public LLUUID Group; + public UUID Group; public string Name; - public LLUUID Owner; + public UUID Owner; public LSL_Types.Vector3 Position; public LSL_Types.Quaternion Rotation; public int Type; @@ -109,17 +109,17 @@ namespace OpenSim.Region.ScriptEngine.Shared presence.AbsolutePosition.Y, presence.AbsolutePosition.Z); Rotation = new LSL_Types.Quaternion( - presence.Rotation.x, - presence.Rotation.y, - presence.Rotation.z, - presence.Rotation.w); + presence.Rotation.X, + presence.Rotation.Y, + presence.Rotation.Z, + presence.Rotation.W); Velocity = new LSL_Types.Vector3( presence.Velocity.X, presence.Velocity.Y, presence.Velocity.Z); Type = 0x01; // Avatar - if (presence.Velocity != LLVector3.Zero) + if (presence.Velocity != Vector3.Zero) Type |= 0x02; // Active Group = presence.ControllingClient.ActiveGroupId; @@ -134,7 +134,7 @@ namespace OpenSim.Region.ScriptEngine.Shared Group = part.GroupID; Name = part.Name; Owner = part.OwnerID; - if (part.Velocity == LLVector3.Zero) + if (part.Velocity == Vector3.Zero) Type = 0x04; // Passive else Type = 0x02; // Passive @@ -152,7 +152,7 @@ namespace OpenSim.Region.ScriptEngine.Shared part.AbsolutePosition.Y, part.AbsolutePosition.Z); - LLQuaternion wr = part.GetWorldRotation(); + Quaternion wr = part.GetWorldRotation(); Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W); Velocity = new LSL_Types.Vector3(part.Velocity.X, diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index e3dd9e9..d35bfa8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -34,7 +34,7 @@ using System.Security.Policy; using System.Reflection; using System.Globalization; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Amib.Threading; @@ -56,12 +56,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance private IScriptWorkItem m_CurrentResult=null; private Queue m_EventQueue = new Queue(32); private bool m_RunEvents = false; - private LLUUID m_ItemID; + private UUID m_ItemID; private uint m_LocalID; - private LLUUID m_ObjectID; - private LLUUID m_AssetID; + private UUID m_ObjectID; + private UUID m_AssetID; private IScript m_Script; - private LLUUID m_AppDomain; + private UUID m_AppDomain; private DetectParams[] m_DetectParams; private bool m_TimerQueued; private DateTime m_EventStart; @@ -98,7 +98,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance get { return m_Engine; } } - public LLUUID AppDomain + public UUID AppDomain { get { return m_AppDomain; } set { m_AppDomain = value; } @@ -114,12 +114,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance get { return m_ScriptName; } } - public LLUUID ItemID + public UUID ItemID { get { return m_ItemID; } } - public LLUUID ObjectID + public UUID ObjectID { get { return m_ObjectID; } } @@ -129,7 +129,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance get { return m_LocalID; } } - public LLUUID AssetID + public UUID AssetID { get { return m_AssetID; } } @@ -152,7 +152,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance } public ScriptInstance(IScriptEngine engine, uint localID, - LLUUID objectID, LLUUID itemID, LLUUID assetID, string assembly, + UUID objectID, UUID itemID, UUID assetID, string assembly, AppDomain dom, string primName, string scriptName, int startParam, bool postOnRez, StateSource stateSource, int maxScriptQueue) @@ -520,7 +520,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance string text = "Runtime error:\n" + e.InnerException.ToString(); if (text.Length > 1000) text = text.Substring(0, 1000); - m_Engine.World.SimChat(Helpers.StringToField(text), + m_Engine.World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.DebugChannel, 2147483647, part.AbsolutePosition, part.Name, part.UUID, false); @@ -581,7 +581,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance Stop(0); SceneObjectPart part=m_Engine.World.GetSceneObjectPart(m_LocalID); part.GetInventoryItem(m_ItemID).PermsMask = 0; - part.GetInventoryItem(m_ItemID).PermsGranter = LLUUID.Zero; + part.GetInventoryItem(m_ItemID).PermsGranter = UUID.Zero; AsyncCommandManager async = (AsyncCommandManager)m_Engine.AsyncCommands; async.RemoveScript(m_LocalID, m_ItemID); m_EventQueue.Clear(); @@ -602,7 +602,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance m_Script.ResetVars(); SceneObjectPart part=m_Engine.World.GetSceneObjectPart(m_LocalID); part.GetInventoryItem(m_ItemID).PermsMask = 0; - part.GetInventoryItem(m_ItemID).PermsGranter = LLUUID.Zero; + part.GetInventoryItem(m_ItemID).PermsGranter = UUID.Zero; AsyncCommandManager async = (AsyncCommandManager)m_Engine.AsyncCommands; async.RemoveScript(m_LocalID, m_ItemID); if (m_CurrentEvent != "state_entry") @@ -630,10 +630,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance return m_DetectParams[idx]; } - public LLUUID GetDetectID(int idx) + public UUID GetDetectID(int idx) { if (idx < 0 || idx >= m_DetectParams.Length) - return LLUUID.Zero; + return UUID.Zero; return m_DetectParams[idx].Key; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs index ba003c5..bc9b174 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs @@ -34,7 +34,7 @@ using System.Security.Policy; using System.Reflection; using System.Globalization; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Amib.Threading; @@ -264,9 +264,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance new LSL_Types.Vector3(vect); int d_linkNum=0; - LLUUID d_group = LLUUID.Zero; + UUID d_group = UUID.Zero; string d_name = String.Empty; - LLUUID d_owner = LLUUID.Zero; + UUID d_owner = UUID.Zero; LSL_Types.Vector3 d_position = new LSL_Types.Vector3(); LSL_Types.Quaternion d_rotation = @@ -285,14 +285,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance tmp = det.Attributes.GetNamedItem( "group").Value; - LLUUID.TryParse(tmp, out d_group); + UUID.TryParse(tmp, out d_group); d_name = det.Attributes.GetNamedItem( "name").Value; tmp = det.Attributes.GetNamedItem( "owner").Value; - LLUUID.TryParse(tmp, out d_owner); + UUID.TryParse(tmp, out d_owner); tmp = det.Attributes.GetNamedItem( "position").Value; @@ -318,8 +318,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance { } - LLUUID uuid = new LLUUID(); - LLUUID.TryParse(det.InnerText, + UUID uuid = new UUID(); + UUID.TryParse(det.InnerText, out uuid); DetectParams d = new DetectParams(); @@ -427,10 +427,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if (itemType == "list") return ReadList(tag); - if (itemType == "libsecondlife.LLUUID") + if (itemType == "libsecondlife.UUID") { - LLUUID val = new LLUUID(); - LLUUID.TryParse(tag.InnerText, out val); + UUID val = new UUID(); + UUID.TryParse(tag.InnerText, out val); return val; } diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 4713283..3820dae 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -123,7 +123,7 @@ namespace OpenSim.Region.ScriptEngine.Shared Vector3 vector = (Vector3)o; - return (x == vector.x && x == vector.x && z == vector.z); + return (x == vector.x && y == vector.y && z == vector.z); } public static Vector3 operator -(Vector3 vector) diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index d431286..22abd79 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; -using libsecondlife; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; using OpenSim.Region.Interfaces; @@ -36,7 +36,6 @@ using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Interfaces; -using Axiom.Math; namespace OpenSim.Region.ScriptEngine.XEngine { @@ -68,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine } } - private void HandleObjectPaid(LLUUID objectID, LLUUID agentID, + private void HandleObjectPaid(UUID objectID, UUID agentID, int amount) { SceneObjectPart part = @@ -80,7 +79,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine } } - public void touch_start(uint localID, uint originalID, LLVector3 offsetPos, + public void touch_start(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient) { // Add to queue for all scripts in ObjectID object @@ -108,7 +107,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine det)); } - public void touch(uint localID, uint originalID, LLVector3 offsetPos, + public void touch(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient) { // Add to queue for all scripts in ObjectID object @@ -177,7 +176,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine // state_entry: not processed here // state_exit: not processed here - public void money(uint localID, LLUUID agentID, int amount) + public void money(uint localID, UUID agentID, int amount) { myScriptEngine.PostObjectEvent(localID, new EventParams( "money", new object[] { @@ -242,7 +241,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine det.ToArray())); } - public void land_collision_start(uint localID, LLUUID itemID) + public void land_collision_start(uint localID, UUID itemID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "land_collision_start", @@ -250,7 +249,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine new DetectParams[0])); } - public void land_collision(uint localID, LLUUID itemID) + public void land_collision(uint localID, UUID itemID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "land_collision", @@ -258,7 +257,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine new DetectParams[0])); } - public void land_collision_end(uint localID, LLUUID itemID) + public void land_collision_end(uint localID, UUID itemID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "land_collision_end", @@ -269,7 +268,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine // timer: not handled here // listen: not handled here - public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change) + public void control(uint localID, UUID itemID, UUID agentID, uint held, uint change) { myScriptEngine.PostObjectEvent(localID, new EventParams( "control",new object[] { @@ -279,7 +278,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine new DetectParams[0])); } - public void email(uint localID, LLUUID itemID, string timeSent, + public void email(uint localID, UUID itemID, string timeSent, string address, string subject, string message, int numLeft) { myScriptEngine.PostObjectEvent(localID, new EventParams( @@ -292,8 +291,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine new DetectParams[0])); } - public void at_target(uint localID, uint handle, LLVector3 targetpos, - LLVector3 atpos) + public void at_target(uint localID, uint handle, Vector3 targetpos, + Vector3 atpos) { myScriptEngine.PostObjectEvent(localID, new EventParams( "at_target", new object[] { @@ -310,14 +309,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine new DetectParams[0])); } - public void at_rot_target(uint localID, LLUUID itemID) + public void at_rot_target(uint localID, UUID itemID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "at_rot_target",new object[0], new DetectParams[0])); } - public void not_at_rot_target(uint localID, LLUUID itemID) + public void not_at_rot_target(uint localID, UUID itemID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "not_at_rot_target",new object[0], @@ -326,7 +325,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine // run_time_permissions: not handled here - public void attach(uint localID, LLUUID itemID, LLUUID avatar) + public void attach(uint localID, UUID itemID, UUID avatar) { myScriptEngine.PostObjectEvent(localID, new EventParams( "attach",new object[] { @@ -337,14 +336,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine // dataserver: not handled here // link_message: not handled here - public void moving_start(uint localID, LLUUID itemID) + public void moving_start(uint localID, UUID itemID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "moving_start",new object[0], new DetectParams[0])); } - public void moving_end(uint localID, LLUUID itemID) + public void moving_end(uint localID, UUID itemID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "moving_end",new object[0], diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 8ad8110..485531d 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -34,7 +34,7 @@ using System.Security.Policy; using System.Reflection; using System.Globalization; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Amib.Threading; @@ -76,28 +76,28 @@ namespace OpenSim.Region.ScriptEngine.XEngine // Maps the local id to the script inventory items in it - private Dictionary > m_PrimObjects = - new Dictionary >(); + private Dictionary > m_PrimObjects = + new Dictionary >(); - // Maps the LLUUID above to the script instance + // Maps the UUID above to the script instance - private Dictionary m_Scripts = - new Dictionary(); + private Dictionary m_Scripts = + new Dictionary(); // Maps the asset ID to the assembly - private Dictionary m_Assemblies = - new Dictionary(); + private Dictionary m_Assemblies = + new Dictionary(); // This will list AppDomains by script asset - private Dictionary m_AppDomains = - new Dictionary(); + private Dictionary m_AppDomains = + new Dictionary(); // List the scripts running in each appdomain - private Dictionary > m_DomainScripts = - new Dictionary >(); + private Dictionary > m_DomainScripts = + new Dictionary >(); private Queue m_CompileQueue = new Queue(100); IWorkItemResult m_CurrentCompile = null; @@ -125,7 +125,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine // private struct RezScriptParms // { // uint LocalID; - // LLUUID ItemID; + // UUID ItemID; // string Script; // } @@ -314,7 +314,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine get { return false; } } - public void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez) + public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez) { Object[] parms = new Object[]{localID, itemID, script, startParam, postOnRez}; @@ -395,7 +395,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine { Object[] p = (Object[])parm; uint localID = (uint)p[0]; - LLUUID itemID = (LLUUID)p[1]; + UUID itemID = (UUID)p[1]; string script =(string)p[2]; int startParam = (int)p[3]; bool postOnRez = (bool)p[4]; @@ -411,7 +411,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (item == null) return false; - LLUUID assetID = item.AssetID; + UUID assetID = item.AssetID; // m_log.DebugFormat("[XEngine] Compiling script {0} ({1})", // item.Name, itemID.ToString()); @@ -430,7 +430,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine string text = "Error compiling script:\r\n" + e.Message.ToString(); if (text.Length > 1000) text = text.Substring(0, 1000); - World.SimChat(Helpers.StringToField(text), + World.SimChat(Utils.StringToBytes(text), ChatTypeEnum.DebugChannel, 2147483647, part.AbsolutePosition, part.Name, part.UUID, false); @@ -455,7 +455,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine if ((!m_Scripts.ContainsKey(itemID)) || (m_Scripts[itemID].AssetID != assetID)) { - LLUUID appDomain = assetID; + UUID appDomain = assetID; if (part.ParentGroup.RootPart.IsAttachment) appDomain = part.ParentGroup.RootPart.UUID; @@ -480,7 +480,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_AppDomains[appDomain].AssemblyResolve += new ResolveEventHandler( AssemblyResolver.OnAssemblyResolve); - m_DomainScripts[appDomain] = new List(); + m_DomainScripts[appDomain] = new List(); } catch (Exception e) { @@ -507,7 +507,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine } if (!m_PrimObjects.ContainsKey(localID)) - m_PrimObjects[localID] = new List(); + m_PrimObjects[localID] = new List(); if (!m_PrimObjects[localID].Contains(itemID)) m_PrimObjects[localID].Add(itemID); @@ -518,7 +518,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine return true; } - public void OnRemoveScript(uint localID, LLUUID itemID) + public void OnRemoveScript(uint localID, UUID itemID) { lock (m_Scripts) { @@ -569,24 +569,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine } } - public void OnScriptReset(uint localID, LLUUID itemID) + public void OnScriptReset(uint localID, UUID itemID) { ResetScript(itemID); } - public void OnStartScript(uint localID, LLUUID itemID) + public void OnStartScript(uint localID, UUID itemID) { StartScript(itemID); } - public void OnStopScript(uint localID, LLUUID itemID) + public void OnStopScript(uint localID, UUID itemID) { StopScript(itemID); } private void CleanAssemblies() { - List assetIDList = new List(m_Assemblies.Keys); + List assetIDList = new List(m_Assemblies.Keys); foreach (IScriptInstance i in m_Scripts.Values) { @@ -594,7 +594,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine assetIDList.Remove(i.AssetID); } - foreach (LLUUID assetID in assetIDList) + foreach (UUID assetID in assetIDList) { // m_log.DebugFormat("[XEngine] Removing unreferenced assembly {0}", m_Assemblies[assetID]); try @@ -615,7 +615,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine } } - private void UnloadAppDomain(LLUUID id) + private void UnloadAppDomain(UUID id) { if (m_AppDomains.ContainsKey(id)) { @@ -681,7 +681,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (!m_PrimObjects.ContainsKey(localID)) return false; - foreach (LLUUID itemID in m_PrimObjects[localID]) + foreach (UUID itemID in m_PrimObjects[localID]) { if (m_Scripts.ContainsKey(itemID)) { @@ -699,7 +699,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine // // Post an event to a single script // - public bool PostScriptEvent(LLUUID itemID, EventParams p) + public bool PostScriptEvent(UUID itemID, EventParams p) { if (m_Scripts.ContainsKey(itemID)) { @@ -737,7 +737,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine return null; } - private IScriptInstance GetInstance(LLUUID itemID) + private IScriptInstance GetInstance(UUID itemID) { IScriptInstance instance; lock (m_Scripts) @@ -749,7 +749,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine return instance; } - public void SetScriptState(LLUUID itemID, bool running) + public void SetScriptState(UUID itemID, bool running) { IScriptInstance instance = GetInstance(itemID); if (instance != null) @@ -761,7 +761,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine } } - public bool GetScriptState(LLUUID itemID) + public bool GetScriptState(UUID itemID) { IScriptInstance instance = GetInstance(itemID); if (instance != null) @@ -769,35 +769,35 @@ namespace OpenSim.Region.ScriptEngine.XEngine return false; } - public void ApiResetScript(LLUUID itemID) + public void ApiResetScript(UUID itemID) { IScriptInstance instance = GetInstance(itemID); if (instance != null) instance.ApiResetScript(); } - public void ResetScript(LLUUID itemID) + public void ResetScript(UUID itemID) { IScriptInstance instance = GetInstance(itemID); if (instance != null) instance.ResetScript(); } - public void StartScript(LLUUID itemID) + public void StartScript(UUID itemID) { IScriptInstance instance = GetInstance(itemID); if (instance != null) instance.Start(); } - public void StopScript(LLUUID itemID) + public void StopScript(UUID itemID) { IScriptInstance instance = GetInstance(itemID); if (instance != null) instance.Stop(0); } - public DetectParams GetDetectParams(LLUUID itemID, int idx) + public DetectParams GetDetectParams(UUID itemID, int idx) { IScriptInstance instance = GetInstance(itemID); if (instance != null) @@ -805,22 +805,22 @@ namespace OpenSim.Region.ScriptEngine.XEngine return null; } - public LLUUID GetDetectID(LLUUID itemID, int idx) + public UUID GetDetectID(UUID itemID, int idx) { IScriptInstance instance = GetInstance(itemID); if (instance != null) return instance.GetDetectID(idx); - return LLUUID.Zero; + return UUID.Zero; } - public void SetState(LLUUID itemID, string newState) + public void SetState(UUID itemID, string newState) { IScriptInstance instance = GetInstance(itemID); if (instance == null) return; instance.SetState(newState); } - public string GetState(LLUUID itemID) + public string GetState(UUID itemID) { IScriptInstance instance = GetInstance(itemID); if (instance == null) @@ -828,7 +828,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine return instance.State; } - public int GetStartParameter(LLUUID itemID) + public int GetStartParameter(UUID itemID) { IScriptInstance instance = GetInstance(itemID); if (instance == null) @@ -836,7 +836,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine return instance.StartParam; } - public bool GetScriptRunning(LLUUID objectID, LLUUID itemID) + public bool GetScriptRunning(UUID objectID, UUID itemID) { return GetScriptState(itemID); } -- cgit v1.1