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/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 +- 24 files changed, 1254 insertions(+), 1385 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') 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; -- cgit v1.1