From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- .../Interfaces/IAgentAssetTransactions.cs | 2 +- .../Framework/Interfaces/IAttachmentsModule.cs | 4 +- .../Region/Framework/Interfaces/IBuySellModule.cs | 2 +- .../Framework/Interfaces/ICapabilitiesModule.cs | 12 +- .../Region/Framework/Interfaces/ICloudModule.cs | 2 +- OpenSim/Region/Framework/Interfaces/ICommander.cs | 4 +- .../Framework/Interfaces/IDynamicFloaterModule.cs | 2 +- .../Framework/Interfaces/IDynamicTextureManager.cs | 4 +- .../Region/Framework/Interfaces/IEntityCreator.cs | 2 +- .../Framework/Interfaces/IEntityInventory.cs | 20 +- .../Framework/Interfaces/IEntityTransferModule.cs | 4 +- OpenSim/Region/Framework/Interfaces/IEventQueue.cs | 6 +- .../Framework/Interfaces/IExternalCapsModule.cs | 2 +- OpenSim/Region/Framework/Interfaces/IGodsModule.cs | 2 +- .../Framework/Interfaces/IGroupsMessagingModule.cs | 12 +- .../Region/Framework/Interfaces/IGroupsModule.cs | 6 +- .../Region/Framework/Interfaces/IHttpRequests.cs | 2 +- .../Framework/Interfaces/IJsonStoreModule.cs | 6 +- .../Framework/Interfaces/IMessageTransferModule.cs | 2 +- OpenSim/Region/Framework/Interfaces/IMoapModule.cs | 8 +- OpenSim/Region/Framework/Interfaces/INPCModule.cs | 4 +- .../Framework/Interfaces/IPermissionsModule.cs | 2 +- .../Region/Framework/Interfaces/IPresenceModule.cs | 2 +- .../Framework/Interfaces/IRegionArchiverModule.cs | 28 +-- .../Framework/Interfaces/IRegionModuleBase.cs | 2 +- .../Interfaces/IRegionSerialiserModule.cs | 4 +- .../Framework/Interfaces/ISimulationDataStore.cs | 8 +- OpenSim/Region/Framework/Interfaces/ISnmpModule.cs | 6 +- .../Region/Framework/Interfaces/ITerrainModule.cs | 4 +- OpenSim/Region/Framework/Interfaces/IUrlModule.cs | 2 +- .../Region/Framework/Interfaces/IVoiceModule.cs | 2 +- OpenSim/Region/Framework/Interfaces/IWindModule.cs | 2 +- OpenSim/Region/Framework/Interfaces/IWorldComm.cs | 2 +- .../Region/Framework/Properties/AssemblyInfo.cs | 8 +- .../Framework/Scenes/Animation/AnimationSet.cs | 18 +- .../Framework/Scenes/Animation/BinBVHAnimation.cs | 40 +-- .../Scenes/Animation/DefaultAvatarAnimations.cs | 2 +- .../Scenes/Animation/ScenePresenceAnimator.cs | 6 +- .../Framework/Scenes/AsyncInventorySender.cs | 4 +- .../Scenes/AsyncSceneObjectGroupDeleter.cs | 38 +-- .../Framework/Scenes/CoalescedSceneObjects.cs | 40 +-- OpenSim/Region/Framework/Scenes/CollisionSounds.cs | 2 +- OpenSim/Region/Framework/Scenes/EntityManager.cs | 4 +- OpenSim/Region/Framework/Scenes/EventManager.cs | 260 +++++++++---------- OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 8 +- OpenSim/Region/Framework/Scenes/Prioritizer.cs | 30 +-- .../Region/Framework/Scenes/RegionStatsHandler.cs | 8 +- OpenSim/Region/Framework/Scenes/SOPMaterial.cs | 2 +- OpenSim/Region/Framework/Scenes/SOPVehicle.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 82 +++--- .../Framework/Scenes/Scene.PacketHandlers.cs | 32 +-- .../Region/Framework/Scenes/Scene.Permissions.cs | 58 ++--- OpenSim/Region/Framework/Scenes/Scene.cs | 192 +++++++------- OpenSim/Region/Framework/Scenes/SceneBase.cs | 18 +- .../Framework/Scenes/SceneCommunicationService.cs | 6 +- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 58 ++--- OpenSim/Region/Framework/Scenes/SceneManager.cs | 10 +- .../Framework/Scenes/SceneObjectGroup.Inventory.cs | 26 +- .../Region/Framework/Scenes/SceneObjectGroup.cs | 192 +++++++------- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 244 +++++++++--------- .../Framework/Scenes/SceneObjectPartInventory.cs | 58 ++--- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 278 ++++++++++----------- .../Framework/Scenes/ScenePresenceStateMachine.cs | 6 +- .../CoalescedSceneObjectsSerializer.cs | 60 ++--- .../Scenes/Serialization/SceneObjectSerializer.cs | 28 +-- .../Region/Framework/Scenes/SimStatsReporter.cs | 46 ++-- OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 4 +- .../Region/Framework/Scenes/TerrainCompressor.cs | 16 +- .../Framework/Scenes/Tests/EntityManagerTests.cs | 22 +- .../Framework/Scenes/Tests/SceneGraphTests.cs | 18 +- .../Scenes/Tests/SceneObjectBasicTests.cs | 28 +-- .../Framework/Scenes/Tests/SceneObjectCopyTests.cs | 32 +-- .../Scenes/Tests/SceneObjectCrossingTests.cs | 2 +- .../Scenes/Tests/SceneObjectDeRezTests.cs | 38 +-- .../Scenes/Tests/SceneObjectLinkingTests.cs | 54 ++-- .../Scenes/Tests/SceneObjectSpatialTests.cs | 2 +- .../Scenes/Tests/SceneObjectStatusTests.cs | 10 +- .../Scenes/Tests/SceneObjectUserGroupTests.cs | 32 +-- .../Scenes/Tests/ScenePresenceAgentTests.cs | 8 +- .../Scenes/Tests/ScenePresenceTeleportTests.cs | 6 +- .../Framework/Scenes/Tests/SceneTelehubTests.cs | 4 +- .../Region/Framework/Scenes/Tests/SceneTests.cs | 4 +- .../Scenes/Tests/SharedRegionModuleTests.cs | 18 +- .../Framework/Scenes/Tests/TaskInventoryTests.cs | 20 +- .../Framework/Scenes/Tests/UserInventoryTests.cs | 2 +- .../Framework/Scenes/Tests/UuidGathererTests.cs | 18 +- OpenSim/Region/Framework/Scenes/UndoState.cs | 12 +- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 28 +-- 88 files changed, 1208 insertions(+), 1208 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs b/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs index e0aad2b..b8278d6 100644 --- a/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs +++ b/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs @@ -39,7 +39,7 @@ namespace OpenSim.Region.Framework.Interfaces bool HandleItemCreationFromTransaction(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask); - + void HandleTaskItemUpdateFromTransaction( IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item); diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index b008068..2f5ff9b 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -112,7 +112,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void RezMultipleAttachmentsFromInventory(IScenePresence sp,List> rezlist); - + /// /// Detach the given item to the ground. /// @@ -135,7 +135,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /param> /// The attachment to detach. void DetachSingleAttachmentToInv(IScenePresence sp, SceneObjectGroup grp); - + /// Update the position of an attachment. /// /// diff --git a/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs index d1ce4c0..1bbf10e 100644 --- a/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs @@ -31,7 +31,7 @@ using OpenSim.Framework; namespace OpenSim.Region.Framework.Interfaces { public interface IBuySellModule - { + { /// /// Try to buy an object /// diff --git a/OpenSim/Region/Framework/Interfaces/ICapabilitiesModule.cs b/OpenSim/Region/Framework/Interfaces/ICapabilitiesModule.cs index 30d404e..761b1bb 100644 --- a/OpenSim/Region/Framework/Interfaces/ICapabilitiesModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ICapabilitiesModule.cs @@ -41,13 +41,13 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void CreateCaps(UUID agentId, uint circuitCode); - + /// /// Remove the caps handler for a given agent. /// /// void RemoveCaps(UUID agentId, uint circuitCode); - + /// /// Will return null if the agent doesn't have a caps handler registered /// @@ -55,13 +55,13 @@ namespace OpenSim.Region.Framework.Interfaces Caps GetCapsForUser(uint circuitCode); void SetAgentCapsSeeds(AgentCircuitData agent); - + Dictionary GetChildrenSeeds(UUID agentID); - + string GetChildSeed(UUID agentID, ulong handle); - + void SetChildrenSeed(UUID agentID, Dictionary seeds); - + void DropChildSeed(UUID agentID, ulong handle); string GetCapsPath(UUID agentId); diff --git a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs index 54172bd..a73b564 100644 --- a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs @@ -27,7 +27,7 @@ namespace OpenSim.Region.Framework.Interfaces { - public interface ICloudModule + public interface ICloudModule { /// /// Retrieves the cloud density at the given region coordinates diff --git a/OpenSim/Region/Framework/Interfaces/ICommander.cs b/OpenSim/Region/Framework/Interfaces/ICommander.cs index 6b872c1..5d6428a 100644 --- a/OpenSim/Region/Framework/Interfaces/ICommander.cs +++ b/OpenSim/Region/Framework/Interfaces/ICommander.cs @@ -40,12 +40,12 @@ namespace OpenSim.Region.Framework.Interfaces /// Provide general help information about this commander. /// string Help { get; } - + /// /// The commands available for this commander /// Dictionary Commands { get; } - + void ProcessConsoleCommand(string function, string[] args); void RegisterCommand(string commandName, ICommand command); void Run(string function, object[] args); diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs index 7684ce3..1ff8fd2 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs @@ -36,7 +36,7 @@ namespace OpenSim.Region.Framework.Interfaces public abstract class FloaterData { - public abstract int Channel { get; } + public abstract int Channel { get; } public abstract string FloaterName { get; set; } public virtual string XmlName { get; set; } public virtual string XmlText { get; set; } diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index 6df5cc2..441076d 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -112,7 +112,7 @@ namespace OpenSim.Region.Framework.Interfaces UUID AddDynamicTextureData( UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face); - + void GetDrawStringSize(string contentType, string text, string fontName, int fontSize, out double xSize, out double ySize); } @@ -140,7 +140,7 @@ namespace OpenSim.Region.Framework.Interfaces bool AsyncConvertUrl(UUID id, string url, string extraParams); bool AsyncConvertData(UUID id, string bodyData, string extraParams); - void GetDrawStringSize(string text, string fontName, int fontSize, + void GetDrawStringSize(string text, string fontName, int fontSize, out double xSize, out double ySize); } diff --git a/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs b/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs index c39627c..1df6486 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// PCode[] CreationCapabilities { get; } - + /// /// Create an entity /// diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index b85fd8b..0c4017e 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs @@ -36,8 +36,8 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Interface to an entity's (SceneObjectPart's) inventory /// - /// - /// This is not a finished 1.0 candidate interface + /// + /// This is not a finished 1.0 candidate interface public interface IEntityInventory { /// @@ -48,21 +48,21 @@ namespace OpenSim.Region.Framework.Interfaces /// /// 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. - /// + /// /// Link number for the part void ResetInventoryIDs(); /// /// Reset parent object UUID for all the items in the prim's inventory. /// - /// + /// /// If this method is called and there are inventory items, then we regard the inventory as having changed. - /// + /// /// Link number for the part void ResetObjectID(); @@ -87,7 +87,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Number of scripts started. int CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource); - + ArrayList GetScriptErrors(UUID itemID); void ResumeScripts(); @@ -238,10 +238,10 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Get the scene object(s) referenced by an inventory item. /// - /// + /// /// This is returned in a 'rez ready' state. That is, name, description, permissions and other details have /// been adjusted to reflect the part and item from which it originates. - /// + /// /// Inventory item /// The scene objects /// Relative offsets for each object @@ -312,7 +312,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// List GetInventoryList(); - + /// /// Get the xml representing the saved states of scripts in this inventory. /// diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs index d172780..9585082 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs @@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// The agent ID /// true if the agent is in the process of being teleported, false otherwise. - bool IsInTransit(UUID id); + bool IsInTransit(UUID id); bool Cross(ScenePresence agent, bool isFlying); @@ -95,7 +95,7 @@ namespace OpenSim.Region.Framework.Interfaces GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, EntityTransferContext ctx, out Vector3 newpos, out string reason); - GridRegion GetObjectDestination(SceneObjectGroup grp, Vector3 targetPosition, out Vector3 newpos); + GridRegion GetObjectDestination(SceneObjectGroup grp, Vector3 targetPosition, out Vector3 newpos); bool checkAgentAccessToRegion(ScenePresence agent, GridRegion destiny, Vector3 position, EntityTransferContext ctx, out string reason); bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent, bool removeScripts); diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs index 3f54ea5..7af56cb 100644 --- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs +++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs @@ -41,11 +41,11 @@ namespace OpenSim.Region.Framework.Interfaces // These are required to decouple Scenes from EventQueueHelper void DisableSimulator(ulong handle, UUID avatarID); void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY); - void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint, + void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint, string capsPath, ulong regionHandle, int regionSizeX, int regionSizeY); - void TeleportFinishEvent(ulong regionHandle, byte simAccess, + void TeleportFinishEvent(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, - uint locationID, uint flags, string capsURL, + uint locationID, uint flags, string capsURL, UUID agentID, int regionSizeX, int regionSizeY); void CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, diff --git a/OpenSim/Region/Framework/Interfaces/IExternalCapsModule.cs b/OpenSim/Region/Framework/Interfaces/IExternalCapsModule.cs index a730cfd..4ce150f 100644 --- a/OpenSim/Region/Framework/Interfaces/IExternalCapsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IExternalCapsModule.cs @@ -37,7 +37,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// This function extends the simple URL configuration in the caps handlers /// to facilitate more interesting computation when an external handler is - /// sent to the viewer. + /// sent to the viewer. /// /// New user UUID /// Internal caps registry, where the external handler will be registered diff --git a/OpenSim/Region/Framework/Interfaces/IGodsModule.cs b/OpenSim/Region/Framework/Interfaces/IGodsModule.cs index 1cb9a30..52615e3 100644 --- a/OpenSim/Region/Framework/Interfaces/IGodsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IGodsModule.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void RequestGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godLike); - + /// /// Kicks User specified from the simulator. This logs them off of the grid. /// diff --git a/OpenSim/Region/Framework/Interfaces/IGroupsMessagingModule.cs b/OpenSim/Region/Framework/Interfaces/IGroupsMessagingModule.cs index 7dc1552..46d6863 100644 --- a/OpenSim/Region/Framework/Interfaces/IGroupsMessagingModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IGroupsMessagingModule.cs @@ -34,9 +34,9 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Provide mechanisms for messaging groups. /// - /// + /// /// TODO: Provide a mechanism for receiving group messages as well as sending them - /// + /// public interface IGroupsMessagingModule { /// @@ -56,13 +56,13 @@ namespace OpenSim.Region.Framework.Interfaces /// True if the chat session was started successfully, false otherwise. /// bool StartGroupChatSession(UUID agentID, UUID groupID); - + /// /// Send a message to each member of a group whose chat session is active. /// /// /// The message itself. The fields that must be populated are - /// + /// /// imSessionID - Populate this with the group ID (session ID and group ID are currently identical) /// fromAgentName - Populate this with whatever arbitrary name you want to show up in the chat dialog /// message - The message itself @@ -76,7 +76,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// The message itself. The fields that must be populated are - /// + /// /// imSessionID - Populate this with the group ID (session ID and group ID are currently identical) /// fromAgentName - Populate this with whatever arbitrary name you want to show up in the chat dialog /// message - The message itself @@ -84,7 +84,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// - /// The requesting agent to use when querying the groups service. Sometimes this is different from + /// The requesting agent to use when querying the groups service. Sometimes this is different from /// im.fromAgentID, with group notices, for example. /// /// diff --git a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs index 110cb00..0d1f4f4 100644 --- a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// The UUID of the created group UUID CreateGroup( - IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, + IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); /// @@ -67,7 +67,7 @@ namespace OpenSim.Region.Framework.Interfaces /// ID of the group /// The group's data. Null if there is no such group. GroupRecord GetGroupRecord(UUID GroupID); - + void ActivateGroup(IClientAPI remoteClient, UUID groupID); List GroupTitlesRequest(IClientAPI remoteClient, UUID groupID); List GroupMembersRequest(IClientAPI remoteClient, UUID groupID); @@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Interfaces void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile); void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID); - + GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID); string GetGroupTitle(UUID avatarID); void GroupRoleUpdate(IClientAPI remoteClient, UUID GroupID, UUID RoleID, string name, string description, string title, ulong powers, byte updateType); diff --git a/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs b/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs index efc9ddc..978c248 100644 --- a/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs +++ b/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs @@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Interfaces /// then returned via IServiceRequest when the response is asynchronously fetched. /// UUID StartHttpRequest( - uint localID, UUID itemID, string url, List parameters, Dictionary headers, string body, + uint localID, UUID itemID, string url, List parameters, Dictionary headers, string body, out HttpInitialRequestStatus status); /// diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs index 1a89721..86aca8e 100644 --- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs @@ -1,5 +1,5 @@ /* - * Copyright (c) Contributors + * Copyright (c) Contributors * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ namespace OpenSim.Region.Framework.Interfaces Array = 2, Value = 3 } - + public enum JsonStoreValueType { Undefined = 0, @@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Interfaces String = 4, UUID = 5 } - + public struct JsonStoreStats { public int StoreCount; diff --git a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs index 290b826..b06ff2b 100644 --- a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs @@ -31,7 +31,7 @@ namespace OpenSim.Region.Framework.Interfaces { public delegate void MessageResultNotification(bool success); public delegate void UndeliveredMessage(GridInstantMessage im); - + public interface IMessageTransferModule { event UndeliveredMessage OnUndeliveredMessage; diff --git a/OpenSim/Region/Framework/Interfaces/IMoapModule.cs b/OpenSim/Region/Framework/Interfaces/IMoapModule.cs index 1d3d240..e8be70f 100644 --- a/OpenSim/Region/Framework/Interfaces/IMoapModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IMoapModule.cs @@ -45,7 +45,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// MediaEntry GetMediaEntry(SceneObjectPart part, int face); - + /// /// Set the media entry for a given prim face. /// @@ -53,13 +53,13 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me); - + /// /// Clear the media entry for a given prim face. /// - /// + /// /// This is the equivalent of setting a media entry of null - /// + /// /// /// /param> void ClearMediaEntry(SceneObjectPart part, int face); diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index 813be4f..df872f4 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.Framework.Interfaces /// public interface INPC { - + /// /// Should this NPC be sensed by LSL sensors as an 'agent' /// (interpreted here to mean a normal user) rather than an OpenSim @@ -301,7 +301,7 @@ namespace OpenSim.Region.Framework.Interfaces /// agent, the agent is unowned or the agent was not an NPC. /// UUID GetOwner(UUID agentID); - + NPCOptionsFlags NPCOptionFlags {get;} } } diff --git a/OpenSim/Region/Framework/Interfaces/IPermissionsModule.cs b/OpenSim/Region/Framework/Interfaces/IPermissionsModule.cs index 1ed978b..933ca14 100644 --- a/OpenSim/Region/Framework/Interfaces/IPermissionsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IPermissionsModule.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.Framework.Interfaces public interface IPermissionsModule { - + /// /// Returns the type of permissions that the user has over an object. /// diff --git a/OpenSim/Region/Framework/Interfaces/IPresenceModule.cs b/OpenSim/Region/Framework/Interfaces/IPresenceModule.cs index d44c1e1..fb5933c 100644 --- a/OpenSim/Region/Framework/Interfaces/IPresenceModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IPresenceModule.cs @@ -33,7 +33,7 @@ namespace OpenSim.Region.Framework.Interfaces { public string UserID; public UUID RegionID; - + public PresenceInfo(string userID, UUID regionID) { UserID = userID; diff --git a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs index 99bc87d..9370ccd 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs @@ -40,17 +40,17 @@ namespace OpenSim.Region.Framework.Interfaces { void HandleLoadOarConsoleCommand(string module, string[] cmdparams); void HandleSaveOarConsoleCommand(string module, string[] cmdparams); - + /// /// Archive the region to the given path /// - /// + /// /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to /// the EventManager.OnOarFileSaved event. - /// + /// /// void ArchiveRegion(string savePath, Dictionary options); - + /// /// Archive the region to the given path /// @@ -94,35 +94,35 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void DearchiveRegion(string loadPath); - + /// /// Dearchive the given region archive. This replaces the existing scene. /// - /// + /// /// If you want notification of when it has completed then subscribe to the EventManager.OnOarFileLoaded event. - /// + /// /// /// If supplied, this request Id is later returned in the saved event /// /// Dictionary of options. /// void DearchiveRegion(string loadPath, Guid requestId, Dictionary options); - + /// - /// Dearchive a region from a stream. This replaces the existing scene. + /// Dearchive a region from a stream. This replaces the existing scene. /// - /// + /// /// If you want notification of when it has completed then subscribe to the EventManager.OnOarFileLoaded event. - /// + /// /// void DearchiveRegion(Stream loadStream); - + /// /// Dearchive a region from a stream. This replaces the existing scene. /// - /// + /// /// If you want notification of when it has completed then subscribe to the EventManager.OnOarFileLoaded event. - /// + /// /// /// If supplied, this request Id is later returned in the saved event /// diff --git a/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs b/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs index 2089bce..5b8f0f0 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.Framework.Interfaces /// this will be multiple times in one instance, while a nonshared /// module instance will only be called once. /// This method is called after AddRegion has been called in all - /// modules for that scene, providing an opportunity to request + /// modules for that scene, providing an opportunity to request /// another module's interface, or hook an event from another module. /// /// diff --git a/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs index c5b21a8..60586ff 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs @@ -102,9 +102,9 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void SavePrimListToXml2(EntityBase[] entityList, TextWriter stream, Vector3 min, Vector3 max); - + void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName); - + /// /// Deserializes a scene object from its xml2 representation. This does not load the object into the scene. /// diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs index 8536db0..19ba787 100644 --- a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs +++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs @@ -45,7 +45,7 @@ namespace OpenSim.Region.Framework.Interfaces /// Dispose the database /// void Dispose(); - + /// /// Stores all object's details apart from inventory /// @@ -91,7 +91,7 @@ namespace OpenSim.Region.Framework.Interfaces // Legacy version kept for downward compabibility void StoreTerrain(double[,] terrain, UUID regionID); - + /// /// Load terrain from region storage /// @@ -107,7 +107,7 @@ namespace OpenSim.Region.Framework.Interfaces double[,] LoadTerrain(UUID regionID); void StoreLandObject(ILandObject Parcel); - + /// /// /// delete from land where UUID=globalID @@ -116,7 +116,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void RemoveLandObject(UUID globalID); - + List LoadLandObjects(UUID regionUUID); void StoreRegionSettings(RegionSettings rs); diff --git a/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs b/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs index f805863..10f421b 100644 --- a/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs @@ -35,9 +35,9 @@ public interface ISnmpModule void Major(string Message, Scene scene); void ColdStart(int step , Scene scene); void Shutdown(int step , Scene scene); - // - // Node Start/stop events - // + // + // Node Start/stop events + // void LinkUp(Scene scene); void LinkDown(Scene scene); void BootInfo(string data, Scene scene); diff --git a/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs b/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs index 2d33f51..3fc5ce7 100644 --- a/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.Framework.Interfaces /// This call causes all the terrain patches to be sent to the client. /// void PushTerrain(IClientAPI pClient); - + /// /// Load a terrain from a stream. /// @@ -60,7 +60,7 @@ namespace OpenSim.Region.Framework.Interfaces void LoadFromStream(string filename, System.Uri pathToTerrainHeightmap); void LoadFromStream(string filename, Vector3 displacement, float radianRotation, Vector2 rotationDisplacement, Stream stream); - void LoadFromStream(string filename, Vector3 displacement, + void LoadFromStream(string filename, Vector3 displacement, float rotationDegress, Vector2 boundingOrigin, Vector2 boundingSize, Stream stream); /// /// Save a terrain to a stream. diff --git a/OpenSim/Region/Framework/Interfaces/IUrlModule.cs b/OpenSim/Region/Framework/Interfaces/IUrlModule.cs index 2987184..3fc0c44 100644 --- a/OpenSim/Region/Framework/Interfaces/IUrlModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IUrlModule.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Interfaces void ReleaseURL(string url); void HttpResponse(UUID request, int status, string body); void HttpContentType(UUID request, string type); - + string GetHttpHeader(UUID request, string header); int GetFreeUrls(); diff --git a/OpenSim/Region/Framework/Interfaces/IVoiceModule.cs b/OpenSim/Region/Framework/Interfaces/IVoiceModule.cs index 2e555fa..2fe7454 100644 --- a/OpenSim/Region/Framework/Interfaces/IVoiceModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IVoiceModule.cs @@ -40,6 +40,6 @@ namespace OpenSim.Region.Framework.Interfaces /// This is used by osSetParcelSIPAddress /// void setLandSIPAddress(string SIPAddress,UUID GlobalID); - + } } diff --git a/OpenSim/Region/Framework/Interfaces/IWindModule.cs b/OpenSim/Region/Framework/Interfaces/IWindModule.cs index 4a26a71..424df87 100644 --- a/OpenSim/Region/Framework/Interfaces/IWindModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IWindModule.cs @@ -31,7 +31,7 @@ namespace OpenSim.Region.Framework.Interfaces { public interface IWindModule : INonSharedRegionModule { - + /// /// Retrieves the current wind speed at the given Region Coordinates /// diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs index d76a0d7..3da4130 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs @@ -140,7 +140,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// ListenerInfo with filter filled in IWorldCommListenerInfo GetNextMessage(); - + void ListenControl(UUID itemID, int handle, int active); void ListenRemove(UUID itemID, int handle); void DeleteListener(UUID itemID); diff --git a/OpenSim/Region/Framework/Properties/AssemblyInfo.cs b/OpenSim/Region/Framework/Properties/AssemblyInfo.cs index a6965ba..f91dfd3 100644 --- a/OpenSim/Region/Framework/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Framework/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Mono.Addins; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Region.Framework")] @@ -15,8 +15,8 @@ using Mono.Addins; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -27,7 +27,7 @@ using Mono.Addins; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index eb1a970..4d350dd 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -48,16 +48,16 @@ namespace OpenSim.Region.Framework.Scenes.Animation private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation(); private List m_animations = new List(); - public OpenSim.Framework.Animation DefaultAnimation + public OpenSim.Framework.Animation DefaultAnimation { - get { return m_defaultAnimation; } + get { return m_defaultAnimation; } } - - public OpenSim.Framework.Animation ImplicitDefaultAnimation + + public OpenSim.Framework.Animation ImplicitDefaultAnimation { - get { return m_implicitDefaultAnimation; } + get { return m_implicitDefaultAnimation; } } - + public AnimationSet() { ResetDefaultAnimation(); @@ -101,7 +101,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation /// /// /// - /// If true, then the default animation can be entirely removed. + /// If true, then the default animation can be entirely removed. /// If false, then removing the default animation will reset it to the simulator default (currently STAND). /// public bool Remove(UUID animID, bool allowNoDefault) @@ -215,9 +215,9 @@ namespace OpenSim.Region.Framework.Scenes.Animation foreach (OpenSim.Framework.Animation anim in m_animations) theArray[i++] = anim; } - catch + catch { - /* S%^t happens. Ignore. */ + /* S%^t happens. Ignore. */ } return theArray; } diff --git a/OpenSim/Region/Framework/Scenes/Animation/BinBVHAnimation.cs b/OpenSim/Region/Framework/Scenes/Animation/BinBVHAnimation.cs index b3b38b2..def993f 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/BinBVHAnimation.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/BinBVHAnimation.cs @@ -33,8 +33,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation { /// /// Written to decode and encode a binary animation asset. - /// The SecondLife Client reads in a BVH file and converts - /// it to the format described here. This isn't + /// The SecondLife Client reads in a BVH file and converts + /// it to the format described here. This isn't /// public class BinBVHAnimation { @@ -109,7 +109,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation /// Contains an array of joints /// public binBVHJoint[] Joints; - + public byte[] ToBytes() { @@ -136,14 +136,14 @@ namespace OpenSim.Region.Framework.Scenes.Animation Joints[i].WriteBytesToStream(iostream, InPoint, OutPoint); } iostream.Write(BinBVHUtil.ES(Utils.IntToBytes(0))); - + using (MemoryStream ms2 = (MemoryStream)iostream.BaseStream) outputbytes = ms2.ToArray(); } return outputbytes; } - + public BinBVHAnimation() { rotationkeys = 0; @@ -160,7 +160,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation EaseOutTime = 0; HandPose = 1; m_jointCount = 0; - + Joints = new binBVHJoint[1]; Joints[0] = new binBVHJoint(); Joints[0].Name = "mPelvis"; @@ -180,7 +180,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation Joints[0].positionkeys[0].key_element.X = ((float)rnd.NextDouble() * 2 - 1); Joints[0].positionkeys[0].key_element.Y = ((float)rnd.NextDouble() * 2 - 1); Joints[0].positionkeys[0].key_element.Z = ((float)rnd.NextDouble() * 2 - 1); - + } @@ -235,7 +235,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation } } - + /// /// Variable length strings seem to be null terminated in the animation asset.. but.. /// use with caution, home grown. @@ -294,7 +294,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation /// The Joint data serialized into the binBVHJoint structure private binBVHJoint readJoint(byte[] data, ref int i) { - + binBVHJointKey[] positions; binBVHJointKey[] rotations; @@ -312,14 +312,14 @@ namespace OpenSim.Region.Framework.Scenes.Animation pJoint.Name = ReadBytesUntilNull(data, ref i); // Joint name - /* + /* 2 <- Priority Revisited 0 0 0 */ - /* + /* 5 <-- 5 keyframes 0 0 @@ -327,7 +327,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation ... 5 Keyframe data blocks */ - /* + /* 2 <-- 2 keyframes 0 0 @@ -428,8 +428,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation } return m_keys; } - - + + } /// @@ -443,7 +443,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation public string Name; /// - /// Joint Animation Override? Was the same as the Priority in testing.. + /// Joint Animation Override? Was the same as the Priority in testing.. /// public int Priority; @@ -523,7 +523,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation public static class BinBVHUtil { public const float ONE_OVER_U16_MAX = 1.0f / UInt16.MaxValue; - + public static UInt16 FloatToUInt16(float val, float lower, float upper) { UInt16 uival = 0; @@ -536,7 +536,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation { upper -= lower; val = val - lower; - + // start with 500 upper and 200 lower.. subtract 200 from the upper and the value } else //if (lower < 0 && upper > 0) @@ -558,8 +558,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation return uival; } - - + + /// /// Endian Swap /// Swaps endianness if necessary @@ -590,7 +590,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation output[i] = Convert.ToByte(chr[i]); } - + output[i] = Convert.ToByte('\0'); return output; } diff --git a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs index b79dd8f..b8db3a9 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation private static void LoadAnimations(string path) { // Dictionary animations = new Dictionary(); - + using (XmlTextReader reader = new XmlTextReader(path)) { XmlDocument doc = new XmlDocument(); diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 13d4562..6b31555 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -123,7 +123,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation /// /// /// - /// If true, then the default animation can be entirely removed. + /// If true, then the default animation can be entirely removed. /// If false, then removing the default animation will reset it to the simulator default (currently STAND). /// public void RemoveAnimation(UUID animID, bool allowNoDefault) @@ -192,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation /// that are mutually exclusive, e.g. flying and sitting. /// /// 'true' if the animation was updated - /// + /// @@ -488,7 +488,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation m_animTickLand = Environment.TickCount; // TODO: SOFT_LAND support float fallVsq = m_lastFallVelocity * m_lastFallVelocity; - if (fallVsq > 300f) // aprox 20*h + if (fallVsq > 300f) // aprox 20*h return "STANDUP"; else if (fallVsq > 160f) return "SOFT_LAND"; diff --git a/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs b/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs index 4362e28..c874fdb 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs @@ -144,10 +144,10 @@ namespace OpenSim.Region.Framework.Scenes // "[ASYNC INVENTORY SENDER]: Handling request from {0} for {1} on queue", fh.Client.Name, fh.ItemID); InventoryItemBase item = m_scene.InventoryService.GetItem(fh.Client.AgentId, fh.ItemID); - + if (item != null) fh.Client.SendInventoryItemDetails(item.Owner, item); - + // TODO: Possibly log any failure } } diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 11a0146..7509686 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs @@ -44,29 +44,29 @@ namespace OpenSim.Region.Framework.Scenes public UUID folderID; public bool permissionToDelete; } - + /// - /// Asynchronously derez objects. This is used to derez large number of objects to inventory without holding + /// Asynchronously derez objects. This is used to derez large number of objects to inventory without holding /// up the main client thread. /// public class AsyncSceneObjectGroupDeleter { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// Is the deleter currently enabled? /// public bool Enabled; - + private Timer m_inventoryTicker = new Timer(2000); private readonly Queue m_inventoryDeletes = new Queue(); private Scene m_scene; - + public AsyncSceneObjectGroupDeleter(Scene scene) { m_scene = scene; - + m_inventoryTicker.AutoReset = false; m_inventoryTicker.Elapsed += InventoryRunDeleteTimer; } @@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes /// Delete the given object from the scene /// public void DeleteToInventory(DeRezAction action, UUID folderID, - List objectGroups, IClientAPI remoteClient, + List objectGroups, IClientAPI remoteClient, bool permissionToDelete) { if (Enabled) @@ -97,7 +97,7 @@ namespace OpenSim.Region.Framework.Scenes if (Enabled) lock (m_inventoryTicker) m_inventoryTicker.Start(); - + // Visually remove it, even if it isnt really gone yet. This means that if we crash before the object // has gone to inventory, it will reappear in the region again on restart instead of being lost. // This is not ideal since the object will still be available for manipulation when it should be, but it's @@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes g.DeleteGroupFromScene(false); } } - + private void InventoryRunDeleteTimer(object sender, ElapsedEventArgs e) { // m_log.Debug("[ASYNC DELETER]: Starting send to inventory loop"); @@ -116,8 +116,8 @@ namespace OpenSim.Region.Framework.Scenes // We must set appearance parameters in the en_US culture in order to avoid issues where values are saved // in a culture where decimal points are commas and then reloaded in a culture which just treats them as // number seperators. - Culture.SetCurrentCulture(); - + Culture.SetCurrentCulture(); + while (InventoryDeQueueAndDelete()) { //m_log.Debug("[ASYNC DELETER]: Sent item successfully to inventory, continuing..."); @@ -131,7 +131,7 @@ namespace OpenSim.Region.Framework.Scenes public bool InventoryDeQueueAndDelete() { DeleteToInventoryHolder x = null; - + try { lock (m_inventoryDeletes) @@ -144,13 +144,13 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", // left, x.action, x.objectGroups.Count); - + try { IInventoryAccessModule invAccess = m_scene.RequestModuleInterface(); if (invAccess != null) invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient, false); - + if (x.permissionToDelete) { foreach (SceneObjectGroup g in x.objectGroups) @@ -162,7 +162,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.ErrorFormat( "[ASYNC DELETER]: Exception background sending object: {0}{1}", e.Message, e.StackTrace); } - + return true; } } @@ -173,14 +173,14 @@ namespace OpenSim.Region.Framework.Scenes // FIXME: This needs to be fixed. m_log.ErrorFormat( "[ASYNC DELETER]: Queued sending of scene object to agent {0} {1} failed: {2} {3}", - (x != null ? x.remoteClient.Name : "unavailable"), - (x != null ? x.remoteClient.AgentId.ToString() : "unavailable"), - e.Message, + (x != null ? x.remoteClient.Name : "unavailable"), + (x != null ? x.remoteClient.AgentId.ToString() : "unavailable"), + e.Message, e.StackTrace); } // m_log.Debug("[ASYNC DELETER]: No objects left in inventory send queue."); - + return false; } } diff --git a/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs b/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs index af8ccda..8831764 100644 --- a/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs +++ b/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs @@ -37,12 +37,12 @@ namespace OpenSim.Region.Framework.Scenes /// are grouped together. /// public class CoalescedSceneObjects - { + { /// /// The creator of this coalesence, though not necessarily the objects within it. /// public UUID CreatorId { get; set; } - + /// /// The number of objects in this coalesence /// @@ -54,12 +54,12 @@ namespace OpenSim.Region.Framework.Scenes return m_memberObjects.Count; } } - + /// /// Does this coalesence have any member objects? /// public bool HasObjects { get { return Count > 0; } } - + /// /// Get the objects currently in this coalescence /// @@ -70,13 +70,13 @@ namespace OpenSim.Region.Framework.Scenes lock (m_memberObjects) return new List(m_memberObjects); } - } - + } + /// /// Get the scene that contains the objects in this coalescence. If there are no objects then null is returned. /// - public Scene Scene - { + public Scene Scene + { get { if (!HasObjects) @@ -85,24 +85,24 @@ namespace OpenSim.Region.Framework.Scenes return Objects[0].Scene; } } - + /// /// At this point, we need to preserve the order of objects added to the coalescence, since the first /// one will end up matching the item name when rerezzed. /// protected List m_memberObjects = new List(); - - public CoalescedSceneObjects(UUID creatorId) + + public CoalescedSceneObjects(UUID creatorId) { CreatorId = creatorId; } - + public CoalescedSceneObjects(UUID creatorId, params SceneObjectGroup[] objs) : this(creatorId) - { + { foreach (SceneObjectGroup obj in objs) Add(obj); } - + /// /// Add an object to the coalescence. /// @@ -113,7 +113,7 @@ namespace OpenSim.Region.Framework.Scenes lock (m_memberObjects) m_memberObjects.Add(obj); } - + /// /// Removes a scene object from the coalescene /// @@ -124,7 +124,7 @@ namespace OpenSim.Region.Framework.Scenes lock (m_memberObjects) return m_memberObjects.Remove(obj); } - + /// /// Get the total size of the coalescence (the size required to cover all the objects within it) and the /// offsets of each of those objects. @@ -138,16 +138,16 @@ namespace OpenSim.Region.Framework.Scenes float minX, minY, minZ; float maxX, maxY, maxZ; - Vector3[] offsets + Vector3[] offsets = Scene.GetCombinedBoundingBox( Objects, out minX, out maxX, out minY, out maxY, out minZ, out maxZ); - + float sizeX = maxX - minX; float sizeY = maxY - minY; float sizeZ = maxZ - minZ; - + size = new Vector3(sizeX, sizeY, sizeZ); - + return offsets; } } diff --git a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs index 84817a0..e76fef4 100644 --- a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs +++ b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs @@ -113,7 +113,7 @@ namespace OpenSim.Region.Framework.Scenes snd_StonePlastic, snd_MetalPlastic, snd_GlassPlastic, snd_WoodPlastic, snd_FleshPlastic, snd_PlasticPlastic, snd_PlasticRubber, snd_StoneRubber, snd_MetalRubber, snd_GlassRubber, snd_WoodRubber, snd_FleshRubber, snd_PlasticRubber, snd_RubberRubber }; - + public static void PartCollisionSound(SceneObjectPart part, List collidersinfolist) { if (collidersinfolist.Count == 0 || part == null) diff --git a/OpenSim/Region/Framework/Scenes/EntityManager.cs b/OpenSim/Region/Framework/Scenes/EntityManager.cs index 7181313..4654efe 100644 --- a/OpenSim/Region/Framework/Scenes/EntityManager.cs +++ b/OpenSim/Region/Framework/Scenes/EntityManager.cs @@ -38,8 +38,8 @@ namespace OpenSim.Region.Framework.Scenes public class EntityManager { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - private readonly DoubleDictionaryThreadAbortSafe m_entities + + private readonly DoubleDictionaryThreadAbortSafe m_entities = new DoubleDictionaryThreadAbortSafe(); public int Count diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 6ff3049..1e9711d 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Scenes public class EventManager { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public delegate void OnFrameDelegate(); /// @@ -121,7 +121,7 @@ namespace OpenSim.Region.Framework.Scenes public event OnClientConnectCoreDelegate OnClientConnect; public delegate void OnNewClientDelegate(IClientAPI client); - + /// /// Triggered when a new client is added to the scene. /// @@ -163,7 +163,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Triggered in which is used by both /// users and NPCs - /// + /// /// Triggered under per-agent lock. So if you want to perform any long-running operations, please /// do this on a separate thread. /// @@ -223,7 +223,7 @@ namespace OpenSim.Region.Framework.Scenes /// Triggered when the entire simulator is shutdown. /// public event Action OnShutdown; - + public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); public delegate void ScriptResetDelegate(uint localID, UUID itemID); @@ -276,7 +276,7 @@ namespace OpenSim.Region.Framework.Scenes /// public event ObjectGrabDelegate OnObjectGrab; public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); - + /// /// Triggered when an object is being touched/grabbed continuously. /// @@ -503,7 +503,7 @@ namespace OpenSim.Region.Framework.Scenes /// via /// public event UpdateScript OnUpdateScript; - + public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID) { UpdateScript handlerUpdateScript = OnUpdateScript; @@ -523,16 +523,16 @@ namespace OpenSim.Region.Framework.Scenes } } } - } + } /// /// Triggered when some scene object properties change. /// /// - /// ScriptChangedEvent is fired when a scene object property that a script might be interested + /// ScriptChangedEvent is fired when a scene object property that a script might be interested /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event. - /// This is not an indication that the script has changed (see OnUpdateScript for that). - /// This event is sent to a script to tell it that some property changed on + /// This is not an indication that the script has changed (see OnUpdateScript for that). + /// This event is sent to a script to tell it that some property changed on /// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed . /// Triggered by /// in , @@ -561,7 +561,7 @@ namespace OpenSim.Region.Framework.Scenes /// TODO: Should be triggered when a physics object starts moving. /// public event ScriptMovingStartEvent OnScriptMovingStartEvent; - + public delegate void ScriptMovingEndEvent(uint localID); /// @@ -738,7 +738,7 @@ namespace OpenSim.Region.Framework.Scenes /// and /// public event Action OnMakeRootAgent; - + public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted; public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile; @@ -755,7 +755,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate void RequestChangeWaterHeight(float height); public event RequestChangeWaterHeight OnRequestChangeWaterHeight; - + /// /// Fired if any avatar is 'killed' due to its health falling to zero /// @@ -778,7 +778,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); public event EstateToolsSunUpdate OnEstateToolsSunUpdate; - + /// /// Triggered when an object is added to the scene. /// @@ -789,7 +789,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// public event Action OnObjectAddedToScene; - + /// /// When a client sends a derez request for an object inworld /// but before the object is deleted @@ -872,21 +872,21 @@ namespace OpenSim.Region.Framework.Scenes /// 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(UUID agentID, Caps caps); public event DeregisterCapsEvent OnDeregisterCaps; - + /// /// ChatFromWorldEvent is called via Scene when a chat message /// from world comes in. /// public delegate void ChatFromWorldEvent(Object sender, OSChatMessage chat); public event ChatFromWorldEvent OnChatFromWorld; - + /// /// ChatFromClientEvent is triggered via ChatModule (or /// substitutes thereof) when a chat message @@ -894,18 +894,18 @@ namespace OpenSim.Region.Framework.Scenes /// public delegate void ChatFromClientEvent(Object sender, OSChatMessage chat); public event ChatFromClientEvent OnChatFromClient; - + /// /// ChatToClientsEvent is triggered via ChatModule (or - /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a + /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a /// received chat message if they satisfy various conditions (within audible range, etc.) /// public delegate void ChatToClientsEvent( - UUID senderID, HashSet receiverIDs, - string message, ChatTypeEnum type, Vector3 fromPos, string fromName, + UUID senderID, HashSet receiverIDs, + string message, ChatTypeEnum type, Vector3 fromPos, string fromName, ChatSourceType src, ChatAudibleLevel level); public event ChatToClientsEvent OnChatToClients; - + /// /// ChatBroadcastEvent is called via Scene when a broadcast chat message /// from world comes in @@ -923,11 +923,11 @@ namespace OpenSim.Region.Framework.Scenes /// public delegate void OarFileLoaded(Guid guid, List loadedScenes, string message); public event OarFileLoaded OnOarFileLoaded; - + /// /// Called when an oar file has finished saving /// Message is non empty string if there were problems saving the oar file - /// If a guid was supplied on the original call to identify, the request, this is returned. Otherwise + /// If a guid was supplied on the original call to identify, the request, this is returned. Otherwise /// Guid.Empty is returned. /// public delegate void OarFileSaved(Guid guid, string message); @@ -947,14 +947,14 @@ namespace OpenSim.Region.Framework.Scenes /// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical). public delegate void Attach(uint localID, UUID itemID, UUID avatarID); public event Attach OnAttach; - - + + /// /// Called immediately after an object is loaded from storage. /// public event SceneObjectDelegate OnSceneObjectLoaded; public delegate void SceneObjectDelegate(SceneObjectGroup so); - + /// /// Called immediately before an object is saved to storage. /// @@ -967,7 +967,7 @@ namespace OpenSim.Region.Framework.Scenes /// public event SceneObjectPreSaveDelegate OnSceneObjectPreSave; public delegate void SceneObjectPreSaveDelegate(SceneObjectGroup persistingSo, SceneObjectGroup originalSo); - + /// /// Called when a scene object part is cloned within the region. /// @@ -1001,7 +1001,7 @@ namespace OpenSim.Region.Framework.Scenes /// Fired when logins to a region are enabled or disabled. /// /// - /// + /// /// /// Fired public event RegionLoginsStatusChange OnRegionLoginsStatusChange; @@ -1157,7 +1157,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1178,7 +1178,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1199,7 +1199,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1220,7 +1220,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1241,7 +1241,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1262,7 +1262,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1283,7 +1283,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1304,7 +1304,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1324,7 +1324,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1368,7 +1368,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1391,7 +1391,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1412,7 +1412,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1433,7 +1433,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1454,7 +1454,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1495,7 +1495,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1558,7 +1558,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1579,7 +1579,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerObjectAddedToScene failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerObjectAddedToScene failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1625,7 +1625,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1646,7 +1646,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerObjectAddedToPhysicalScene failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerObjectAddedToPhysicalScene failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1667,7 +1667,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerObjectRemovedFromPhysicalScene failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerObjectRemovedFromPhysicalScene failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1688,7 +1688,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1709,7 +1709,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1730,7 +1730,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1751,7 +1751,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1772,7 +1772,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1793,7 +1793,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1814,7 +1814,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1835,7 +1835,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1856,7 +1856,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", e.Message, e.StackTrace); m_log.ErrorFormat(Environment.StackTrace); } @@ -1867,7 +1867,7 @@ namespace OpenSim.Region.Framework.Scenes public bool TriggerGroupMove(UUID groupID, Vector3 delta) { bool result = true; - + SceneGroupMoved handlerSceneGroupMove = OnSceneGroupMove; if (handlerSceneGroupMove != null) { @@ -1881,19 +1881,19 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerGroupMove failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerGroupMove failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } - + return result; } public bool TriggerGroupSpinStart(UUID groupID) { bool result = true; - + SceneGroupSpinStarted handlerSceneGroupSpinStarted = OnSceneGroupSpinStart; if (handlerSceneGroupSpinStarted != null) { @@ -1907,19 +1907,19 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } - + return result; } public bool TriggerGroupSpin(UUID groupID, Quaternion rotation) { bool result = true; - + SceneGroupSpun handlerSceneGroupSpin = OnSceneGroupSpin; if (handlerSceneGroupSpin != null) { @@ -1933,12 +1933,12 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } - + return result; } @@ -1956,7 +1956,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1977,7 +1977,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -1998,7 +1998,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2024,7 +2024,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2045,7 +2045,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2087,7 +2087,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2108,7 +2108,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2127,12 +2127,12 @@ namespace OpenSim.Region.Framework.Scenes // m_log.ErrorFormat("[EVENT MANAGER]: TriggerClientClosed: {0}", d.Target.ToString()); d(ClientID, scene); // m_log.ErrorFormat("[EVENT MANAGER]: TriggerClientClosed done "); - + } catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2153,7 +2153,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2192,7 +2192,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2213,7 +2213,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2234,7 +2234,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2255,7 +2255,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2276,7 +2276,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2297,7 +2297,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2318,7 +2318,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2339,7 +2339,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2360,7 +2360,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2381,7 +2381,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2402,7 +2402,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2471,7 +2471,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2492,7 +2492,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2513,7 +2513,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2534,7 +2534,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2555,16 +2555,16 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } } - + public void TriggerOnChatToClients( - UUID senderID, HashSet receiverIDs, - string message, ChatTypeEnum type, Vector3 fromPos, string fromName, + UUID senderID, HashSet receiverIDs, + string message, ChatTypeEnum type, Vector3 fromPos, string fromName, ChatSourceType src, ChatAudibleLevel level) { ChatToClientsEvent handler = OnChatToClients; @@ -2579,7 +2579,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2600,7 +2600,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2621,7 +2621,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2642,7 +2642,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2663,7 +2663,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2684,7 +2684,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2705,7 +2705,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2726,7 +2726,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2766,7 +2766,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2787,12 +2787,12 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } - + return 6; } @@ -2810,13 +2810,13 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } } - + public void TriggerOarFileSaved(Guid requestId, string message) { OarFileSaved handlerOarFileSaved = OnOarFileSaved; @@ -2831,7 +2831,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2852,7 +2852,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2873,7 +2873,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2894,7 +2894,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2915,7 +2915,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2936,7 +2936,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2957,7 +2957,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2978,7 +2978,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -2999,7 +2999,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -3020,13 +3020,13 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } } - + public void TriggerOnSceneObjectLoaded(SceneObjectGroup so) { SceneObjectDelegate handler = OnSceneObjectLoaded; @@ -3041,13 +3041,13 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectLoaded failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectLoaded failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } } - + public void TriggerOnSceneObjectPreSave(SceneObjectGroup persistingSo, SceneObjectGroup originalSo) { SceneObjectPreSaveDelegate handler = OnSceneObjectPreSave; @@ -3062,13 +3062,13 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPreSave failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPreSave failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } - } - + } + public void TriggerOnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart original, bool userExposed) { SceneObjectPartCopyDelegate handler = OnSceneObjectPartCopy; @@ -3083,7 +3083,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -3104,7 +3104,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerSceneObjectPartUpdated failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerSceneObjectPartUpdated failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -3147,7 +3147,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -3169,7 +3169,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing. {0} {1}", e.Message, e.StackTrace); } } diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index cdd8d2d..e4aa196 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs @@ -140,7 +140,7 @@ namespace OpenSim.Region.Framework.Scenes timer.Start(); }; } - + // Check again, in case the regions were started while we were adding the event handler if (SceneManager.Instance.AllRegionsReady) { @@ -821,7 +821,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectGroup tmp = m_group; m_group = null; - + using (MemoryStream ms = new MemoryStream()) { BinaryFormatter fmt = new BinaryFormatter(); @@ -839,10 +839,10 @@ namespace OpenSim.Region.Framework.Scenes public void StartCrossingCheck() { // timer will be restart by crossingFailure - // or never since crossing worked and this + // or never since crossing worked and this // should be deleted StopTimer(); - + m_isCrossing = true; m_waitingCrossing = true; diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 97009a0..cbf40c8 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs @@ -35,7 +35,7 @@ using OpenSim.Region.PhysicsModules.SharedBase; /* * Steps to add a new prioritization policy: - * + * * - Add a new value to the UpdatePrioritizationSchemes enum. * - Specify this new value in the [InterestManagement] section of your * OpenSim.ini. The name in the config file must match the enum value name @@ -59,7 +59,7 @@ namespace OpenSim.Region.Framework.Scenes public class Prioritizer { private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - + private Scene m_scene; public Prioritizer(Scene scene) @@ -91,7 +91,7 @@ namespace OpenSim.Region.Framework.Scenes return 0; uint priority; - + switch (m_scene.UpdatePrioritizationScheme) { /* @@ -116,7 +116,7 @@ namespace OpenSim.Region.Framework.Scenes priority = GetPriorityByBestAvatarResponsiveness(client, entity); break; } - + return priority; } @@ -145,7 +145,7 @@ namespace OpenSim.Region.Framework.Scenes return ComputeDistancePriority(client,entity,false); } - + private uint GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity) { // And anything attached to this avatar gets top priority as well @@ -172,7 +172,7 @@ namespace OpenSim.Region.Framework.Scenes if (entity is SceneObjectPart) { - // Attachments are high priority, + // Attachments are high priority, if (((SceneObjectPart)entity).ParentGroup.IsAttachment) return 2; @@ -196,7 +196,7 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence presence = m_scene.GetScenePresence(client.AgentId); if (presence == null) { - // this shouldn't happen, it basically means that we are prioritizing + // this shouldn't happen, it basically means that we are prioritizing // updates to send to a client that doesn't have a presence in the scene // seems like there's race condition here... @@ -204,7 +204,7 @@ namespace OpenSim.Region.Framework.Scenes // throw new InvalidOperationException("Prioritization agent not defined"); return PriorityQueue.NumberOfQueues - 1; } - + // Use group position for child prims, since we are putting child prims in // the same queue with the root of the group, the root prim (which goes into // the queue first) should always be sent first, no need to adjust child prim @@ -227,14 +227,14 @@ namespace OpenSim.Region.Framework.Scenes Vector3 presencePos = presence.AbsolutePosition; - // Compute the distance... + // Compute the distance... double distance = Vector3.Distance(presencePos, entityPos); // And convert the distance to a priority queue, this computation gives queues // at 10, 20, 40, 80, 160, 320, 640, and 1280m uint pqueue = PriorityQueue.NumberOfImmediateQueues + 1; // reserve attachments queue uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues; -/* +/* for (int i = 0; i < queues - 1; i++) { if (distance < 30 * Math.Pow(2.0,i)) @@ -246,7 +246,7 @@ namespace OpenSim.Region.Framework.Scenes { float tmp = (float)Math.Log((double)distance) * 1.442695f - 3.321928f; // for a map identical to original: - // now + // now // 1st constant is 1/(log(2)) (natural log) so we get log2(distance) // 2st constant makes it be log2(distance/10) pqueue += (uint)tmp; @@ -265,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes // Plane equation float d = -Vector3.Dot(camPosition, camAtAxis); float p = Vector3.Dot(camAtAxis, entityPos) + d; - if (p < 0.0f) + if (p < 0.0f) pqueue++; } @@ -291,7 +291,7 @@ namespace OpenSim.Region.Framework.Scenes // uint pqueue = minpqueue; uint pqueue = PriorityQueue.NumberOfImmediateQueues; float distance; - + Vector3 presencePos = presence.AbsolutePosition; if(entity is ScenePresence) { @@ -319,10 +319,10 @@ namespace OpenSim.Region.Framework.Scenes { float tmp = (float)Math.Log(distance) * 1.442695f - 3.321928f; // for a map identical to original: - // now + // now // 1st constant is 1/(log(2)) (natural log) so we get log2(distance) // 2st constant makes it be log2(distance/10) - + pqueue += (uint)tmp; if (pqueue > maxqueue) pqueue = maxqueue; diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs index 3b31281..bf58885 100644 --- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs +++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs @@ -55,13 +55,13 @@ namespace OpenSim.Region.Framework.Scenes public string localZone = TimeZone.CurrentTimeZone.StandardName; public TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now); - public RegionStatsHandler(RegionInfo region_info) + public RegionStatsHandler(RegionInfo region_info) : base("GET", "/" + Util.SHA1Hash(region_info.regionSecret), "RegionStats", "Region Statistics") { regionInfo = region_info; osXStatsURI = Util.SHA1Hash(regionInfo.osSecret); } - + protected override byte[] ProcessRequest( string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { @@ -72,7 +72,7 @@ namespace OpenSim.Region.Framework.Scenes { get { return "text/plain"; } } - + private string Report() { OSDMap args = new OSDMap(30); @@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Scenes args["UxTime"] = OSD.FromInteger(Util.ToUnixTime(DateTime.Now)); args["Memory"] = OSD.FromReal(Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)); args["Version"] = OSD.FromString(VersionInfo.Version); - + string strBuffer = ""; strBuffer = OSDParser.SerializeJsonString(args); diff --git a/OpenSim/Region/Framework/Scenes/SOPMaterial.cs b/OpenSim/Region/Framework/Scenes/SOPMaterial.cs index 10ac37c..651c52e 100644 --- a/OpenSim/Region/Framework/Scenes/SOPMaterial.cs +++ b/OpenSim/Region/Framework/Scenes/SOPMaterial.cs @@ -34,7 +34,7 @@ namespace OpenSim.Region.Framework.Scenes { public static class SOPMaterialData { - public enum SopMaterial : int // redundante and not in use for now + public enum SopMaterial : int // redundante and not in use for now { Stone = 0, Metal = 1, diff --git a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs index 897918a..8d11331 100644 --- a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs +++ b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs @@ -571,7 +571,7 @@ namespace OpenSim.Region.Framework.Scenes return errors; } - + public string ToXml2() { using (StringWriter sw = new StringWriter()) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 61ea8ac..e3ccf96 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -164,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat( "[AGENT INVENTORY]: Found folder {0} type {1} for item {2}", f.Name, (AssetType)f.Type, item.Name); - + item.Folder = f.ID; } else @@ -338,7 +338,7 @@ namespace OpenSim.Region.Framework.Scenes // Update item with new asset item.AssetID = asset.FullID; group.UpdateInventoryItem(item); - + part.SendPropertiesToClient(remoteClient); // Trigger rerunning of script (use TriggerRezScript event, see RezScript) @@ -519,7 +519,7 @@ namespace OpenSim.Region.Framework.Scenes // needs to be found. If inventory item flags are updated // the viewer's notion of the item needs to be refreshed. // - // In other situations we cannot send out a bulk update here, since this will cause editing of clothing to start + // In other situations we cannot send out a bulk update here, since this will cause editing of clothing to start // failing frequently. Possibly this is a race with a separate transaction that uploads the asset. if (sendUpdate) remoteClient.SendBulkUpdateInventory(item); @@ -734,7 +734,7 @@ namespace OpenSim.Region.Framework.Scenes itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; itemCopy.BasePermissions = item.BasePermissions; } - + if (itemCopy.Folder == UUID.Zero) { InventoryFolderBase folder = null; @@ -826,7 +826,7 @@ namespace OpenSim.Region.Framework.Scenes } UUID newFolderId = UUID.Random(); - InventoryFolderBase newFolder + InventoryFolderBase newFolder = new InventoryFolderBase( newFolderId, folder.Name, recipientId, folder.Type, recipientParentFolderId, folder.Version); InventoryService.AddFolder(newFolder); @@ -906,7 +906,7 @@ namespace OpenSim.Region.Framework.Scenes item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch(), false); } else - { + { // If item is transfer or permissions are off or calling agent is allowed to copy item owner's inventory item. if (((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0) && (m_permissions.BypassPermissions() @@ -954,7 +954,7 @@ namespace OpenSim.Region.Framework.Scenes moveitems.Add(n); remoteClient.SendInventoryItemCreateUpdate(n, 0); } - + MoveInventoryItem(remoteClient, moveitems); } @@ -1308,9 +1308,9 @@ namespace OpenSim.Region.Framework.Scenes public InventoryItemBase MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId, out string message) { m_log.DebugFormat( - "[PRIM INVENTORY]: Adding item {0} from {1} to folder {2} for {3}", + "[PRIM INVENTORY]: Adding item {0} from {1} to folder {2} for {3}", itemId, part.Name, folderId, remoteClient.Name); - + InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId, out message); if (agentItem == null) return null; @@ -1377,7 +1377,7 @@ namespace OpenSim.Region.Framework.Scenes string message; InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out message); - + if (item == null) remoteClient.SendAgentAlertMessage(message, false); } @@ -1712,7 +1712,7 @@ namespace OpenSim.Region.Framework.Scenes else // Updating existing item with new perms etc { // m_log.DebugFormat( -// "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()", +// "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()", // currentItem.Name, part.Name); // Only look for an uploaded updated asset if we are passed a transaction ID. This is only the @@ -1924,12 +1924,12 @@ namespace OpenSim.Region.Framework.Scenes return null; } - AssetBase asset + AssetBase asset = CreateAsset( - itemBase.Name, - itemBase.Description, + itemBase.Name, + itemBase.Description, (sbyte)itemBase.AssetType, - Encoding.ASCII.GetBytes(scriptText), + Encoding.ASCII.GetBytes(scriptText), agentID); AssetService.Store(asset); @@ -2008,8 +2008,8 @@ namespace OpenSim.Region.Framework.Scenes if ((destPart.GroupID == UUID.Zero) || (destPart.GroupID != srcPart.GroupID) || ((destPart.GroupMask & (uint)PermissionMask.Modify) == 0)) return; - } - else + } + else { if ((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) return; @@ -2102,7 +2102,7 @@ namespace OpenSim.Region.Framework.Scenes List deleteIDs = new List(); List deleteGroups = new List(); List takeGroups = new List(); - + // Start with true for both, then remove the flags if objects // that we can't derez are part of the selection bool permissionToTake = true; @@ -2146,7 +2146,7 @@ namespace OpenSim.Region.Framework.Scenes if (action != DeRezAction.Return) { m_log.WarnFormat( - "[AGENT INVENTORY]: Ignoring attempt to {0} {1} {2} without a client", + "[AGENT INVENTORY]: Ignoring attempt to {0} {1} {2} without a client", action, grp.Name, grp.UUID); return; } @@ -2166,7 +2166,7 @@ namespace OpenSim.Region.Framework.Scenes } if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) permissionToTake = false; - + if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) permissionToDelete = false; } @@ -2471,9 +2471,9 @@ namespace OpenSim.Region.Framework.Scenes bool RezSelected, bool RemoveItem, UUID fromTaskID) { // m_log.DebugFormat( -// "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}", +// "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}", // remoteClient.Name, itemID, fromTaskID); - + if (fromTaskID == UUID.Zero) { IInventoryAccessModule invAccess = RequestModuleInterface(); @@ -2483,37 +2483,37 @@ namespace OpenSim.Region.Framework.Scenes RezSelected, RemoveItem, fromTaskID, false); } else - { + { SceneObjectPart part = GetSceneObjectPart(fromTaskID); if (part == null) { - m_log.ErrorFormat( - "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object", + m_log.ErrorFormat( + "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object", remoteClient.Name, itemID, fromTaskID); - + return; } - + TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID); if (item == null) { - m_log.ErrorFormat( - "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item", + m_log.ErrorFormat( + "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item", remoteClient.Name, itemID, fromTaskID); - + return; - } - + } + byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f); Vector3 pos = GetNewRezLocation( RayStart, RayEnd, RayTargetID, Quaternion.Identity, - BypassRayCast, bRayEndIsIntersection, true, scale, false); - + BypassRayCast, bRayEndIsIntersection, true, scale, false); + RezObject(part, item, pos, null, Vector3.Zero, 0, false); } } - + /// /// Rez an object into the scene from a prim's inventory. /// @@ -2691,7 +2691,7 @@ namespace OpenSim.Region.Framework.Scenes { if (ownerID != UUID.Zero) return; - + if (!Permissions.CanDeedObject(remoteClient.AgentId, groupID)) return; } @@ -2701,8 +2701,8 @@ namespace OpenSim.Region.Framework.Scenes foreach (uint localID in localIDs) { SceneObjectPart part = GetSceneObjectPart(localID); - if (part == null) - continue; + if (part == null) + continue; if (!groups.Contains(part.ParentGroup)) groups.Add(part.ParentGroup); @@ -2717,7 +2717,7 @@ namespace OpenSim.Region.Framework.Scenes sog.ScheduleGroupForFullUpdate(); SceneObjectPart[] partList = sog.Parts; - + foreach (SceneObjectPart child in partList) { child.Inventory.ChangeInventoryOwner(ownerID); @@ -2756,8 +2756,8 @@ namespace OpenSim.Region.Framework.Scenes foreach (uint localID in localIDs) { SceneObjectPart part = GetSceneObjectPart(localID); - if (part == null) - continue; + if (part == null) + continue; part.SendPropertiesToClient(remoteClient); } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 24a2db7..2d62b50 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -86,7 +86,7 @@ namespace OpenSim.Region.Framework.Scenes else EventManager.TriggerOnChatFromWorld(this, args); } - + protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, UUID fromID, bool fromAgent, bool broadcast) { @@ -212,13 +212,13 @@ namespace OpenSim.Region.Framework.Scenes if (groupID != UUID.Zero) { GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, remoteClient.AgentId); - + if (gmd == null) { // m_log.WarnFormat( // "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group", // remoteClient.Name, GroupID, objectLocalID); - + return; } } @@ -243,7 +243,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart part = GetSceneObjectPart(primLocalID); if (part == null) return; - + bool oldgprSelect = part.ParentGroup.IsSelected; // This is wrong, wrong, wrong. Selection should not be @@ -259,14 +259,14 @@ namespace OpenSim.Region.Framework.Scenes // restore targetOmega if (part.AngularVelocity != Vector3.Zero) - part.ScheduleTerseUpdate(); + part.ScheduleTerseUpdate(); } } - public virtual void ProcessMoneyTransferRequest(UUID source, UUID 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, + EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(source, destination, amount, transactiontype, description); EventManager.TriggerMoneyTransfer(this, args); @@ -275,8 +275,8 @@ namespace OpenSim.Region.Framework.Scenes 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, - removeContribution, parcelLocalID, parcelArea, + EventManager.LandBuyArgs args = new EventManager.LandBuyArgs(agentId, groupId, final, groupOwned, + removeContribution, parcelLocalID, parcelArea, parcelPrice, authenticated); // First, allow all validators a stab at it @@ -289,7 +289,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List surfaceArgs) { SceneObjectPart part = GetSceneObjectPart(localID); - + if (part == null) return; @@ -302,7 +302,7 @@ namespace OpenSim.Region.Framework.Scenes // Currently only grab/touch for the single prim // the client handles rez correctly obj.ObjectGrabHandler(localID, offsetPos, remoteClient); - + // If the touched prim handles touches, deliver it if ((part.ScriptEvents & scriptEvents.touch_start) != 0) EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); @@ -310,7 +310,7 @@ namespace OpenSim.Region.Framework.Scenes // Deliver to the root prim if the touched prim doesn't handle touches // or if we're meant to pass on touches anyway. if (((part.ScriptEvents & scriptEvents.touch_start) == 0) || - (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) + (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) { EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); } @@ -337,7 +337,7 @@ namespace OpenSim.Region.Framework.Scenes // get's it's position on the simulator even if it was the same as before // This keeps the moving user's client in sync with the rest of the world. group.SendGroupTerseUpdate(); - + SurfaceTouchEventArgs surfaceArg = null; if (surfaceArgs != null && surfaceArgs.Count > 0) surfaceArg = surfaceArgs[0]; @@ -483,7 +483,7 @@ namespace OpenSim.Region.Framework.Scenes } }); } - + private bool ShouldSendDiscardableEffect(IClientAPI thisClient, ScenePresence other) { return Vector3.Distance(other.CameraPosition, thisClient.SceneAgent.AbsolutePosition) < 10; @@ -603,7 +603,7 @@ namespace OpenSim.Region.Framework.Scenes m_descendentsRequestProcessing = false; } } - + /// /// Handle an inventory folder creation request from the client. /// @@ -657,7 +657,7 @@ namespace OpenSim.Region.Framework.Scenes } } } - + public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID) { InventoryFolderBase folder = InventoryService.GetFolder(remoteClient.AgentId, folderID); diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index b26b789..893b38c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -35,7 +35,7 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.Framework.Scenes -{ +{ #region Delegates public delegate uint GenerateClientFlagsHandler(UUID userID, UUID objectID); public delegate void SetBypassPermissionsHandler(bool value); @@ -98,7 +98,7 @@ namespace OpenSim.Region.Framework.Scenes public class ScenePermissions { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private Scene m_scene; public ScenePermissions(Scene scene) @@ -261,7 +261,7 @@ namespace OpenSim.Region.Framework.Scenes public bool CanDeleteObject(UUID objectID, UUID deleter) { bool result = true; - + DeleteObjectHandler handler = OnDeleteObject; if (handler != null) { @@ -275,14 +275,14 @@ namespace OpenSim.Region.Framework.Scenes } } } - + return result; } public bool CanTransferObject(UUID objectID, UUID recipient) { bool result = true; - + TransferObjectHandler handler = OnTransferObject; if (handler != null) { @@ -296,7 +296,7 @@ namespace OpenSim.Region.Framework.Scenes } } } - + return result; } @@ -306,7 +306,7 @@ namespace OpenSim.Region.Framework.Scenes public bool CanTakeObject(UUID objectID, UUID AvatarTakingUUID) { bool result = true; - + TakeObjectHandler handler = OnTakeObject; if (handler != null) { @@ -320,11 +320,11 @@ namespace OpenSim.Region.Framework.Scenes } } } - + // m_log.DebugFormat( -// "[SCENE PERMISSIONS]: CanTakeObject() fired for object {0}, taker {1}, result {2}", +// "[SCENE PERMISSIONS]: CanTakeObject() fired for object {0}, taker {1}, result {2}", // objectID, AvatarTakingUUID, result); - + return result; } @@ -363,7 +363,7 @@ namespace OpenSim.Region.Framework.Scenes public bool CanTakeCopyObject(UUID objectID, UUID userID) { bool result = true; - + TakeCopyObjectHandler handler = OnTakeCopyObject; if (handler != null) { @@ -377,11 +377,11 @@ namespace OpenSim.Region.Framework.Scenes } } } - + // m_log.DebugFormat( -// "[SCENE PERMISSIONS]: CanTakeCopyObject() fired for object {0}, user {1}, result {2}", +// "[SCENE PERMISSIONS]: CanTakeCopyObject() fired for object {0}, user {1}, result {2}", // objectID, userID, result); - + return result; } @@ -478,7 +478,7 @@ namespace OpenSim.Region.Framework.Scenes public bool CanReturnObjects(ILandObject land, UUID user, List objects) { bool result = true; - + ReturnObjectsHandler handler = OnReturnObjects; if (handler != null) { @@ -492,11 +492,11 @@ namespace OpenSim.Region.Framework.Scenes } } } - + // m_log.DebugFormat( -// "[SCENE PERMISSIONS]: CanReturnObjects() fired for user {0} for {1} objects on {2}, result {3}", +// "[SCENE PERMISSIONS]: CanReturnObjects() fired for user {0} for {1} objects on {2}, result {3}", // user, objects.Count, land.LandData.Name, result); - + return result; } @@ -1004,7 +1004,7 @@ namespace OpenSim.Region.Framework.Scenes } return true; } - + public bool CanTransferObjectInventory(UUID itemID, UUID objectID, UUID userID) { TransferObjectInventoryHandler handler = OnTransferObjectInventory; @@ -1019,7 +1019,7 @@ namespace OpenSim.Region.Framework.Scenes } return true; } - + /// /// Check whether the specified user is allowed to create the given inventory type in their inventory. /// @@ -1039,8 +1039,8 @@ namespace OpenSim.Region.Framework.Scenes } } return true; - } - + } + /// /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. /// @@ -1061,7 +1061,7 @@ namespace OpenSim.Region.Framework.Scenes } return true; } - + /// /// Check whether the specified user is allowed to copy the given inventory item from their own inventory. /// @@ -1082,7 +1082,7 @@ namespace OpenSim.Region.Framework.Scenes } return true; } - + /// /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. /// @@ -1103,7 +1103,7 @@ namespace OpenSim.Region.Framework.Scenes } return true; } - + public bool CanTransferUserInventory(UUID itemID, UUID userID, UUID recipientID) { TransferUserInventoryHandler handler = OnTransferUserInventory; @@ -1118,7 +1118,7 @@ namespace OpenSim.Region.Framework.Scenes } return true; } - + public bool CanTeleport(UUID userID) { TeleportHandler handler = OnTeleport; @@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Framework.Scenes } return true; } - + public bool CanControlPrimMedia(UUID userID, UUID primID, int face) { ControlPrimMediaHandler handler = OnControlPrimMedia; @@ -1147,8 +1147,8 @@ namespace OpenSim.Region.Framework.Scenes } } return true; - } - + } + public bool CanInteractWithPrimMedia(UUID userID, UUID primID, int face) { InteractWithPrimMediaHandler handler = OnInteractWithPrimMedia; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d7a4ca4..352bc05 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes { private const long DEFAULT_MIN_TIME_FOR_PERSISTENCE = 60L; private const long DEFAULT_MAX_TIME_FOR_PERSISTENCE = 600L; - + public delegate void SynchronizeSceneHandler(Scene scene); @@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// Even if false, the scene will still be saved on clean shutdown. - /// FIXME: Currently, setting this to false will mean that objects are not periodically returned from parcels. + /// FIXME: Currently, setting this to false will mean that objects are not periodically returned from parcels. /// This needs to be fixed. /// public bool PeriodicBackup { get; set; } @@ -103,9 +103,9 @@ namespace OpenSim.Region.Framework.Scenes /// If false then physical objects are disabled, though collisions will continue as normal. /// - public bool PhysicsEnabled - { - get + public bool PhysicsEnabled + { + get { return m_physicsEnabled; } @@ -237,7 +237,7 @@ namespace OpenSim.Region.Framework.Scenes /// to compensate for SL bug /// public bool LegacySitOffsets = true; - + /// /// Can avatars cross from and to this region? /// @@ -245,7 +245,7 @@ namespace OpenSim.Region.Framework.Scenes /// Max prims an Physical object will hold /// - /// + /// public int m_linksetPhysCapacity = 0; /// @@ -383,9 +383,9 @@ namespace OpenSim.Region.Framework.Scenes /// /// Frame time /// - public float FrameTime { get; private set; } - public int FrameTimeWarnPercent { get; private set; } - public int FrameTimeCritPercent { get; private set; } + public float FrameTime { get; private set; } + public int FrameTimeWarnPercent { get; private set; } + public int FrameTimeCritPercent { get; private set; } // Normalize the frame related stats to nominal 55fps for viewer and scripts option // see SimStatsReporter.cs @@ -397,7 +397,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Always derived from MinFrameTicks. /// - public float MinMaintenanceTime { get; private set; } + public float MinMaintenanceTime { get; private set; } private int m_update_physics = 1; private int m_update_entitymovement = 1; @@ -529,7 +529,7 @@ namespace OpenSim.Region.Framework.Scenes // private int m_lastUpdate; private bool m_firstHeartbeat = true; - + // private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time; // private bool m_reprioritizationEnabled = true; // private double m_reprioritizationInterval = 5000.0; @@ -868,7 +868,7 @@ namespace OpenSim.Region.Framework.Scenes #region Constructors - public Scene(RegionInfo regInfo, AgentCircuitManager authen, + public Scene(RegionInfo regInfo, AgentCircuitManager authen, ISimulationDataService simDataService, IEstateDataService estateDataService, IConfigSource config, string simulatorVersion) : this(regInfo) @@ -951,7 +951,7 @@ namespace OpenSim.Region.Framework.Scenes RegisterDefaultSceneEvents(); - // XXX: Don't set the public property since we don't want to activate here. This needs to be handled + // XXX: Don't set the public property since we don't want to activate here. This needs to be handled // better in the future. m_scripts_enabled = !RegionInfo.RegionSettings.DisableScripts; @@ -1212,7 +1212,7 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter.OnSendStatsResult += SendSimStatsPackets; StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; - + } public Scene(RegionInfo regInfo) @@ -1549,7 +1549,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// Start the scripts within the scene. - /// + /// public void Start(bool startScripts) { if (IsRunning) @@ -1569,7 +1569,7 @@ namespace OpenSim.Region.Framework.Scenes //int pid = System.Diagnostics.Process.GetCurrentProcess().Id; //System.Diagnostics.Process proc = new System.Diagnostics.Process(); -//proc.EnableRaisingEvents=false; +//proc.EnableRaisingEvents=false; //proc.StartInfo.FileName = "/bin/kill"; //proc.StartInfo.Arguments = "-QUIT " + pid.ToString(); //proc.Start(); @@ -1637,7 +1637,7 @@ namespace OpenSim.Region.Framework.Scenes Update(-1); Watchdog.RemoveThread(); - } + } private void Maintenance() { @@ -1706,7 +1706,7 @@ namespace OpenSim.Region.Framework.Scenes previousMaintenanceTick = m_lastMaintenanceTick; m_lastMaintenanceTick = Util.EnvironmentTickCount(); runtc = Util.EnvironmentTickCountSubtract(m_lastMaintenanceTick, runtc); - runtc = (int)(MinMaintenanceTime * 1000) - runtc; + runtc = (int)(MinMaintenanceTime * 1000) - runtc; if (runtc > 0) m_maintenanceWaitEvent.WaitOne(runtc); @@ -1783,7 +1783,7 @@ namespace OpenSim.Region.Framework.Scenes if (Frame % m_update_entitymovement == 0) m_sceneGraph.UpdateScenePresenceMovement(); - // Get the simulation frame time that the avatar force input + // Get the simulation frame time that the avatar force input // took tmpMS2 = Util.GetTimeStampMS(); agentMS = (float)(tmpMS2 - tmpMS); @@ -1799,7 +1799,7 @@ namespace OpenSim.Region.Framework.Scenes if (SynchronizeScene != null) SynchronizeScene(this); } - + tmpMS2 = Util.GetTimeStampMS(); physicsMS = (float)(tmpMS2 - tmpMS); tmpMS = tmpMS2; @@ -1820,17 +1820,17 @@ namespace OpenSim.Region.Framework.Scenes tmpMS2 = Util.GetTimeStampMS(); agentMS += (float)(tmpMS2 - tmpMS); tmpMS = tmpMS2; - + // Delete temp-on-rez stuff if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps) - { + { m_cleaningTemps = true; Util.FireAndForget(delegate { CleanTempObjects(); m_cleaningTemps = false; }); tmpMS2 = Util.GetTimeStampMS(); tempOnRezMS = (float)(tmpMS2 - tmpMS); // bad.. counts the FireAndForget, not CleanTempObjects tmpMS = tmpMS2; } - + if (Frame % m_update_events == 0) { UpdateEvents(); @@ -1916,7 +1916,7 @@ namespace OpenSim.Region.Framework.Scenes // reuse frameMS as temporary frameMS = (float)tmpMS2; - + // sleep if we can if (tmpMS2 > 0) { @@ -1939,9 +1939,9 @@ namespace OpenSim.Region.Framework.Scenes // script time is not scene frame time, but is displayed per frame float scriptTimeMS = GetAndResetScriptExecutionTime(); StatsReporter.AddFrameStats(TimeDilation, physicsFPS, agentMS, - physicsMS + physicsMS2, otherMS , sleepMS, frameMS, scriptTimeMS); - - + physicsMS + physicsMS2, otherMS , sleepMS, frameMS, scriptTimeMS); + + // if (Frame%m_update_avatars == 0) // UpdateInWorldTime(); @@ -2129,7 +2129,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Tell an agent that their object has been returned. + /// Tell an agent that their object has been returned. /// /// /// The actual return is handled by the caller. @@ -2221,7 +2221,7 @@ namespace OpenSim.Region.Framework.Scenes { if(Bakedmap != null) { - m_log.Warn("[TERRAIN]: terrain not found. Used stored baked terrain."); + m_log.Warn("[TERRAIN]: terrain not found. Used stored baked terrain."); Heightmap = Bakedmap.MakeCopy(); SimulationDataService.StoreTerrain(Heightmap.GetTerrainData(), RegionInfo.RegionID); } @@ -2290,7 +2290,7 @@ namespace OpenSim.Region.Framework.Scenes GridRegion region = new GridRegion(RegionInfo); string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); // m_log.DebugFormat("[SCENE]: RegisterRegionWithGrid. name={0},id={1},loc=<{2},{3}>,size=<{4},{5}>", - // m_regionName, + // m_regionName, // RegionInfo.RegionID, // RegionInfo.RegionLocX, RegionInfo.RegionLocY, // RegionInfo.RegionSizeX, RegionInfo.RegionSizeY); @@ -2369,7 +2369,7 @@ namespace OpenSim.Region.Framework.Scenes return PhysicsScene.SupportsRaycastWorldFiltered(); } - public object RayCastFiltered(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter) + public object RayCastFiltered(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter) { if (PhysicsScene == null) return null; @@ -2463,7 +2463,7 @@ namespace OpenSim.Region.Framework.Scenes if (wpos.Z > pos.Z) pos = wpos; return pos; } - } + } } // else the first we got pos = physresults[0].Normal * scale; @@ -2775,7 +2775,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - toReturn.Add((SceneObjectGroup)e); + toReturn.Add((SceneObjectGroup)e); } } } @@ -2847,7 +2847,7 @@ namespace OpenSim.Region.Framework.Scenes if (removeScripts) group.Clear(); partList = null; - // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); + // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); } /// @@ -3023,7 +3023,7 @@ namespace OpenSim.Region.Framework.Scenes sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); // sceneObject.RootPart.AddFlag(PrimFlags.Phantom); - // Don't sent a full update here because this will cause full updates to be sent twice for + // Don't sent a full update here because this will cause full updates to be sent twice for // attachments on region crossings, resulting in viewer glitches. AddRestoredSceneObject(sceneObject, false, false, false); @@ -3044,7 +3044,7 @@ namespace OpenSim.Region.Framework.Scenes RootPrim.RemFlag(PrimFlags.TemporaryOnRez); - // We must currently not resume scripts at this stage since AttachmentsModule does not have the + // We must currently not resume scripts at this stage since AttachmentsModule does not have the // information that this is due to a teleport/border cross rather than an ordinary attachment. // We currently do this in Scene.MakeRootAgent() instead. if (AttachmentsModule != null) @@ -3141,7 +3141,7 @@ namespace OpenSim.Region.Framework.Scenes vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 || (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0; - + CheckHeartbeat(); sp = GetScenePresence(client.AgentId); @@ -3152,10 +3152,10 @@ namespace OpenSim.Region.Framework.Scenes "[SCENE]: Adding new child scene presence {0} {1} to scene {2} at pos {3}, tpflags: {4}", client.Name, client.AgentId, RegionInfo.RegionName, client.StartPos, ((TPFlags)aCircuit.teleportFlags).ToString()); - + m_clientManager.Add(client); SubscribeToClientEvents(client); - + sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance, type); sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags; @@ -3167,9 +3167,9 @@ namespace OpenSim.Region.Framework.Scenes // We must set this here so that TriggerOnNewClient and TriggerOnClientLogin can determine whether the // client is for a root or child agent. // XXX: This may be better set for a new client before that client is added to the client manager. - // But need to know what happens in the case where a ScenePresence is already present (and if this + // But need to know what happens in the case where a ScenePresence is already present (and if this // actually occurs). - + m_log.WarnFormat( "[SCENE]: Already found {0} scene presence for {1} in {2} when asked to add new scene presence", @@ -3177,9 +3177,9 @@ namespace OpenSim.Region.Framework.Scenes reallyNew = false; } - client.SceneAgent = sp; + client.SceneAgent = sp; - // This is currently also being done earlier in NewUserConnection for real users to see if this + // This is currently also being done earlier in NewUserConnection for real users to see if this // resolves problems where HG agents are occasionally seen by others as "Unknown user" in chat and other // places. However, we still need to do it here for NPCs. CacheUserName(sp, aCircuit); @@ -3610,7 +3610,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Duplicates object specified by localID at position raycasted against RayTargetObject using + /// Duplicates object specified by localID at position raycasted against RayTargetObject using /// RayEnd and RayStart to determine what the angle of the ray is /// /// ID of object to duplicate @@ -3637,7 +3637,7 @@ namespace OpenSim.Region.Framework.Scenes if (target != null && target2 != null) { Vector3 direction = Vector3.Normalize(RayEnd - RayStart); - + pos = target2.AbsolutePosition; //m_log.Info("[OBJECT_REZ]: TargetPos: " + pos.ToString() + ", RayStart: " + RayStart.ToString() + ", RayEnd: " + RayEnd.ToString() + ", Volume: " + Util.GetDistanceTo(RayStart,RayEnd).ToString() + ", mag1: " + Util.GetMagnitude(RayStart).ToString() + ", mag2: " + Util.GetMagnitude(RayEnd).ToString()); @@ -3715,7 +3715,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Remove the given client from the scene. + /// Remove the given client from the scene. /// /// /// Only clientstack code should call this directly. All other code should call IncomingCloseAgent() instead @@ -3726,7 +3726,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Close the neighbour child agents associated with this client. /// - /// + /// private object m_removeClientPrivLock = new Object(); @@ -3734,7 +3734,7 @@ namespace OpenSim.Region.Framework.Scenes { AgentCircuitData acd = m_authenticateHandler.GetAgentCircuitData(agentID); - // Shouldn't be necessary since RemoveClient() is currently only called by IClientAPI.Close() which + // Shouldn't be necessary since RemoveClient() is currently only called by IClientAPI.Close() which // in turn is only called by Scene.IncomingCloseAgent() which checks whether the presence exists or not // However, will keep for now just in case. if (acd == null) @@ -3747,12 +3747,12 @@ namespace OpenSim.Region.Framework.Scenes // TODO: Can we now remove this lock? lock (m_removeClientPrivLock) - { + { bool isChildAgent = false; ScenePresence avatar = GetScenePresence(agentID); - // Shouldn't be necessary since RemoveClient() is currently only called by IClientAPI.Close() which + // Shouldn't be necessary since RemoveClient() is currently only called by IClientAPI.Close() which // in turn is only called by Scene.IncomingCloseAgent() which checks whether the presence exists or not // However, will keep for now just in case. if (avatar == null) @@ -3792,7 +3792,7 @@ namespace OpenSim.Region.Framework.Scenes // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI if (closeChildAgents && CapsModule != null) CapsModule.RemoveCaps(agentID, avatar.ControllingClient.CircuitCode); - + if (closeChildAgents && !isChildAgent) { List regions = avatar.KnownRegionHandles; @@ -3806,7 +3806,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.Debug("[Scene]TriggerClientClosed done"); m_eventManager.TriggerOnRemovePresence(agentID); // m_log.Debug("[Scene]TriggerOnRemovePresence done"); - + if (!isChildAgent) { if (AttachmentsModule != null) @@ -3865,7 +3865,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Removes region from an avatar's known region list. This coincides with child agents. For each child agent, there will be a known region entry. - /// + /// /// /// /// @@ -3914,7 +3914,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Source region (may be null) /// Outputs the reason for the false response on this string - /// True if the region accepts this agent. False if it does not. False will + /// True if the region accepts this agent. False if it does not. False will /// also return a reason. public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, GridRegion source, out string reason) { @@ -3942,9 +3942,9 @@ namespace OpenSim.Region.Framework.Scenes /// Outputs the reason for the false response on this string /// True for normal presence. False for NPC /// or other applications where a full grid/Hypergrid presence may not be required. - /// True if the region accepts this agent. False if it does not. False will + /// True if the region accepts this agent. False if it does not. False will /// also return a reason. - /// + /// private object m_newUserConnLock = new object(); public bool NewUserConnection(AgentCircuitData acd, uint teleportFlags, GridRegion source, out string reason, bool requirePresenceLookup) @@ -4037,7 +4037,7 @@ namespace OpenSim.Region.Framework.Scenes { sp = GetScenePresence(acd.AgentID); - // We need to ensure that we are not already removing the scene presence before we ask it not to be + // We need to ensure that we are not already removing the scene presence before we ask it not to be // closed. if (sp != null && sp.IsChildAgent && (sp.LifecycleState == ScenePresenceState.Running @@ -4051,16 +4051,16 @@ namespace OpenSim.Region.Framework.Scenes // teleport from A -> D, but then -> C before A has asked B to close its old child agent. When C // renews the lease on the child agent at B, we must make sure that the close from A does not succeed. // - // XXX: In the end, this should not be necessary if child agents are closed without delay on + // XXX: In the end, this should not be necessary if child agents are closed without delay on // teleport, since realistically, the close request should always be processed before any other - // region tried to re-establish a child agent. This is much simpler since the logic below is + // region tried to re-establish a child agent. This is much simpler since the logic below is // vulnerable to an issue when a viewer quits a region without sending a proper logout but then // re-establishes the connection on a relogin. This could wrongly set the DoNotCloseAfterTeleport // flag when no teleport had taken place (and hence no close was going to come). // if (!acd.ChildrenCapSeeds.ContainsKey(RegionInfo.RegionHandle)) // { // m_log.DebugFormat( -// "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.", +// "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.", // sp.Name, Name); // // sp.DoNotCloseAfterTeleport = true; @@ -4074,7 +4074,7 @@ namespace OpenSim.Region.Framework.Scenes sp.DoNotCloseAfterTeleport = true; m_log.DebugFormat( - "[SCENE]: Set DoNotCloseAfterTeleport for child scene presence {0} in {1} because this region will attempt end-of-teleport close from a previous close.", + "[SCENE]: Set DoNotCloseAfterTeleport for child scene presence {0} in {1} because this region will attempt end-of-teleport close from a previous close.", sp.Name, Name); } } @@ -4094,7 +4094,7 @@ namespace OpenSim.Region.Framework.Scenes if (sp.LifecycleState == ScenePresenceState.Removing) { m_log.WarnFormat( - "[SCENE]: Agent {0} in {1} was still being removed after {2}s. Aborting NewUserConnection.", + "[SCENE]: Agent {0} in {1} was still being removed after {2}s. Aborting NewUserConnection.", sp.Name, Name, polls * pollInterval / 1000); return false; @@ -4115,7 +4115,7 @@ namespace OpenSim.Region.Framework.Scenes // We have a root agent. Is it in transit? if (!EntityTransferModule.IsInTransit(sp.UUID)) { - // We have a zombie from a crashed session. + // We have a zombie from a crashed session. // Or the same user is trying to be root twice here, won't work. // Kill it. m_log.WarnFormat( @@ -4210,7 +4210,7 @@ namespace OpenSim.Region.Framework.Scenes { m_log.DebugFormat( "[SCENE]: Adjusting known seeds for existing agent {0} in {1}", - acd.AgentID, RegionInfo.RegionName); + acd.AgentID, RegionInfo.RegionName); if (CapsModule != null) { @@ -4253,7 +4253,7 @@ namespace OpenSim.Region.Framework.Scenes // only check access, actual relocations will happen later on ScenePresence MakeRoot // allow child agents creation if(!godlike && teleportFlags != (uint) TPFlags.Default) - { + { bool checkTeleHub; // don't check hubs if via home or via lure @@ -4264,7 +4264,7 @@ namespace OpenSim.Region.Framework.Scenes checkTeleHub = vialogin || (TelehubAllowLandmarks == true ? false : ((teleportFlags & (uint)TPFlags.ViaLandmark) != 0 )) || (teleportFlags & (uint) TPFlags.ViaLocation) != 0; - + if(!CheckLandPositionAccess(acd.AgentID, true, checkTeleHub, acd.startpos, out reason)) { m_authenticateHandler.RemoveCircuit(acd.circuitcode); @@ -4351,7 +4351,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Circuit Data of the Agent we're verifying /// Outputs the reason for the false response on this string - /// True if the user has a session on the grid. False if it does not. False will + /// True if the user has a session on the grid. False if it does not. False will /// also return a reason. public virtual bool VerifyUserPresence(AgentCircuitData agent, out string reason) { @@ -4380,7 +4380,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// The circuit data for the agent /// outputs the reason to this string - /// True if the region accepts this agent. False if it does not. False will + /// True if the region accepts this agent. False if it does not. False will /// also return a reason. protected virtual bool AuthorizeUser(AgentCircuitData agent, bool bypassAccessControl, out string reason) { @@ -4434,7 +4434,7 @@ namespace OpenSim.Region.Framework.Scenes // in access list / owner / manager if (RegionInfo.EstateSettings.HasAccess(agent.AgentID)) return true; - + // finally test groups bool groupAccess = false; @@ -4576,7 +4576,7 @@ Label_GroupsDone: // } /// - /// We've got an update about an agent that sees into this region, + /// We've got an update about an agent that sees into this region, /// send it to ScenePresence for processing It's the full data. /// /// Agent that contains all of the relevant things about an agent. @@ -4604,7 +4604,7 @@ Label_GroupsDone: } // TODO: This check should probably be in QueryAccess(). - ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, + ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, (float)RegionInfo.RegionSizeX * 0.5f, (float)RegionInfo.RegionSizeY * 0.5f); if (nearestParcel == null) { @@ -4616,12 +4616,12 @@ Label_GroupsDone: } // We have to wait until the viewer contacts this region - // after receiving the EnableSimulator HTTP Event Queue message (for the v1 teleport protocol) + // after receiving the EnableSimulator HTTP Event Queue message (for the v1 teleport protocol) // or TeleportFinish (for the v2 teleport protocol). This triggers the viewer to send // a UseCircuitCode packet which in turn calls AddNewAgent which finally creates the ScenePresence. ScenePresence sp = WaitGetScenePresence(cAgentData.AgentID); - if (sp != null) + if (sp != null) { if (!sp.IsChildAgent) { @@ -4632,10 +4632,10 @@ Label_GroupsDone: if (cAgentData.SessionID != sp.ControllingClient.SessionId) { m_log.WarnFormat( - "[SCENE]: Attempt to update agent {0} with invalid session id {1} (possibly from simulator in older version; tell them to update).", + "[SCENE]: Attempt to update agent {0} with invalid session id {1} (possibly from simulator in older version; tell them to update).", sp.UUID, cAgentData.SessionID); - Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}", + Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}", sp.UUID, sp.ControllingClient.SessionId, cAgentData.SessionID)); } @@ -4667,7 +4667,7 @@ Label_GroupsDone: } /// - /// We've got an update about an agent that sees into this region, + /// We've got an update about an agent that sees into this region, /// send it to ScenePresence for processing It's only positional data /// /// AgentPosition that contains agent positional data so we can know what to send @@ -4675,7 +4675,7 @@ Label_GroupsDone: public virtual bool IncomingUpdateChildAgent(AgentPosition cAgentData) { // m_log.DebugFormat( -// "[SCENE PRESENCE]: IncomingChildAgentDataUpdate POSITION for {0} in {1}, position {2}", +// "[SCENE PRESENCE]: IncomingChildAgentDataUpdate POSITION for {0} in {1}, position {2}", // cAgentData.AgentID, Name, cAgentData.Position); ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); @@ -4683,7 +4683,7 @@ Label_GroupsDone: { // if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID) // // Only warn for now -// m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?", +// m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?", // childAgentUpdate.UUID, cAgentData.SessionID); // I can't imagine *yet* why we would get an update if the agent is a root agent.. @@ -4743,7 +4743,7 @@ Label_GroupsDone: if (acd == null) { m_log.DebugFormat( - "[SCENE]: Request to close agent {0} but no such agent in scene {1}. May have been closed previously.", + "[SCENE]: Request to close agent {0} but no such agent in scene {1}. May have been closed previously.", agentID, Name); return false; @@ -4756,7 +4756,7 @@ Label_GroupsDone: else { m_log.WarnFormat( - "[SCENE]: Request to close agent {0} with invalid authorization token {1} in {2}", + "[SCENE]: Request to close agent {0} with invalid authorization token {1} in {2}", agentID, auth_token, Name); } @@ -4850,7 +4850,7 @@ Label_GroupsDone: return true; } m_log.DebugFormat( - "[SCENE]: Called CloseClient() with agent ID {0} but no such presence is in {1}", + "[SCENE]: Called CloseClient() with agent ID {0} but no such presence is in {1}", agentID, Name); return false; @@ -5361,7 +5361,7 @@ Label_GroupsDone: /// Get a scene object group that contains the prim with the given local id /// /// - /// null if no scene object group containing that prim is found + /// null if no scene object group containing that prim is found public SceneObjectGroup GetGroupByPrim(uint localID) { return m_sceneGraph.GetGroupByPrim(localID); @@ -5371,7 +5371,7 @@ Label_GroupsDone: /// Get a scene object group that contains the prim with the given uuid /// /// - /// null if no scene object group containing that prim is found + /// null if no scene object group containing that prim is found public SceneObjectGroup GetGroupByPrim(UUID fullID) { return m_sceneGraph.GetGroupByPrim(fullID); @@ -5484,7 +5484,7 @@ Label_GroupsDone: // 1 = sim is up and accepting http requests. The heartbeat has // stopped and the sim is probably locked up, but a remote // admin restart may succeed - // + // // 2 = Sim is up and the heartbeat is running. The sim is likely // usable for people within // @@ -5533,7 +5533,7 @@ Label_GroupsDone: { int pid = System.Diagnostics.Process.GetCurrentProcess().Id; System.Diagnostics.Process proc = new System.Diagnostics.Process(); -proc.EnableRaisingEvents=false; +proc.EnableRaisingEvents=false; proc.StartInfo.FileName = "/bin/kill"; proc.StartInfo.Arguments = "-QUIT " + pid.ToString(); proc.Start(); @@ -5979,7 +5979,7 @@ Environment.Exit(1); g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ); // m_log.DebugFormat( -// "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}", +// "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}", // g.Name, new Vector3(ominX, ominY, ominZ), new Vector3(omaxX, omaxY, omaxZ)); ominX += vec.X; @@ -6175,11 +6175,11 @@ Environment.Exit(1); reason = "Error authorizing agent: " + e.Message; return false; } - + // last check aditional land access restrictions and relocations // if crossing (viaTeleport false) check only the specified parcel return CheckLandPositionAccess(agentID, viaTeleport, true, position, out reason); - } + } // check access to land. public bool CheckLandPositionAccess(UUID agentID, bool NotCrossing, bool checkTeleHub, Vector3 position, out string reason) @@ -6192,7 +6192,7 @@ Environment.Exit(1); bool isAdmin = Permissions.IsAdministrator(agentID); if(isAdmin) return true; - + // also honor estate managers access rights bool isManager = Permissions.IsEstateManager(agentID); if(isManager) @@ -6204,14 +6204,14 @@ Environment.Exit(1); { SceneObjectGroup telehub; if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && (telehub = GetSceneObjectGroup (RegionInfo.RegionSettings.TelehubObject)) != null && checkTeleHub) - { + { bool banned = true; bool validTelehub = false; List spawnPoints = RegionInfo.RegionSettings.SpawnPoints(); Vector3 spawnPoint; ILandObject land = null; Vector3 telehubPosition = telehub.AbsolutePosition; - + if(spawnPoints.Count == 0) { // will this ever happen? @@ -6225,7 +6225,7 @@ Environment.Exit(1); } } else - { + { Quaternion telehubRotation = telehub.GroupRotation; foreach (SpawnPoint spawn in spawnPoints) { @@ -6293,7 +6293,7 @@ Environment.Exit(1); return true; } - public void StartTimerWatchdog() + public void StartTimerWatchdog() { m_timerWatchdog.Interval = 1000; m_timerWatchdog.Elapsed += TimerWatchdog; @@ -6304,7 +6304,7 @@ Environment.Exit(1); public void TimerWatchdog(object sender, ElapsedEventArgs e) { CheckHeartbeat(); - } + } /// This method deals with movement when an avatar is automatically moving (but this is distinct from the /// autopilot that moves an avatar to a sit target!. @@ -6391,7 +6391,7 @@ Environment.Exit(1); } /// - /// Wrappers to get physics modules retrieve assets. + /// Wrappers to get physics modules retrieve assets. /// /// /// Has to be done this way diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index d406625..e3e54e2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Scenes #region Fields public string Name { get { return RegionInfo.RegionName; } } - + public IConfigSource Config { get { return GetConfig(); } @@ -95,7 +95,7 @@ namespace OpenSim.Region.Framework.Scenes /// The module commanders available from this scene /// protected Dictionary m_moduleCommanders = new Dictionary(); - + /// /// Registered classes that are capable of creating entities. /// @@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes protected uint m_lastAllocatedLocalId = 720000; private readonly Mutex _primAllocateMutex = new Mutex(false); - + protected readonly ClientManager m_clientManager = new ClientManager(); public bool LoginsEnabled @@ -264,7 +264,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual RegionInfo RegionInfo { get; private set; } #region admin stuff - + public abstract void OtherRegionUp(GridRegion otherRegion); public virtual string GetSimulatorVersion() @@ -307,7 +307,7 @@ namespace OpenSim.Region.Framework.Scenes return myID; } - + #region Module Methods /// @@ -366,7 +366,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_moduleCommanders.ContainsKey(name)) return m_moduleCommanders[name]; } - + return null; } @@ -416,7 +416,7 @@ namespace OpenSim.Region.Framework.Scenes public void RegisterModuleInterface(M mod) { // m_log.DebugFormat("[SCENE BASE]: Registering interface {0}", typeof(M)); - + List l = null; if (!ModuleInterfaces.TryGetValue(typeof(M), out l)) { @@ -527,9 +527,9 @@ namespace OpenSim.Region.Framework.Scenes return new T[] {}; } } - + #endregion - + /// /// Call this from a region module to add a command to the OpenSim console. /// diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 3eefd3c..6304778 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -115,7 +115,7 @@ namespace OpenSim.Region.Framework.Scenes OpenSim.Framework.RegionFlags? regionFlags = n.RegionFlags; // m_log.DebugFormat( - // "{0}: Region flags for {1} as seen by {2} are {3}", + // "{0}: Region flags for {1} as seen by {2} are {3}", // LogHeader, n.RegionName, m_scene.Name, regionFlags != null ? regionFlags.ToString() : "not present"); // Robust services before 2015-01-14 do not return the regionFlags information. In this case, we could @@ -175,7 +175,7 @@ namespace OpenSim.Region.Framework.Scenes public void SendChildAgentDataUpdate(AgentPosition cAgentData, ScenePresence presence) { // m_log.DebugFormat( - // "[SCENE COMMUNICATION SERVICE]: Sending child agent position updates for {0} in {1}", + // "[SCENE COMMUNICATION SERVICE]: Sending child agent position updates for {0} in {1}", // presence.Name, m_scene.Name); // This assumes that we know what our neighbors are. @@ -248,7 +248,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Closes a child agents in a collection of regions. Does so asynchronously + /// Closes a child agents in a collection of regions. Does so asynchronously /// so that the caller doesn't wait. /// /// diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 579874a..2f65ce2 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -87,21 +87,21 @@ namespace OpenSim.Region.Framework.Scenes protected int m_scriptLPS = 0; protected internal PhysicsScene _PhyScene; - + /// /// Index the SceneObjectGroup for each part by the root part's UUID. /// protected internal Dictionary SceneObjectGroupsByFullID = new Dictionary(); - + /// /// Index the SceneObjectGroup for each part by that part's UUID. /// protected internal Dictionary SceneObjectGroupsByFullPartID = new Dictionary(); - + /// /// Index the SceneObjectGroup for each part by that part's local ID. /// - protected internal Dictionary SceneObjectGroupsByLocalPartID = new Dictionary(); + protected internal Dictionary SceneObjectGroupsByLocalPartID = new Dictionary(); /// /// Lock to prevent object group update, linking, delinking and duplication operations from running concurrently. @@ -121,11 +121,11 @@ namespace OpenSim.Region.Framework.Scenes public PhysicsScene PhysicsScene { - get + get { if (_PhyScene == null) _PhyScene = m_parentScene.RequestModuleInterface(); - return _PhyScene; + return _PhyScene; } set { @@ -215,7 +215,7 @@ namespace OpenSim.Region.Framework.Scenes // the joint in the Scene does not exist in the PhysicsScene. // // To solve this, we have an event in the PhysicsScene that is fired when a joint - // has changed position (because one of its associated PhysicsActors has changed + // has changed position (because one of its associated PhysicsActors has changed // position). // // Therefore, JointMoved and JointDeactivated events will be fired as a result of the following Simulate(). @@ -244,7 +244,7 @@ namespace OpenSim.Region.Framework.Scenes // coarse locations are sent as BYTE, so limited to the 255m max of normal regions // try to work around that scale down X and Y acording to region size, so reducing the resolution - // + // // viewers need to scale up float scaleX = (float)m_parentScene.RegionInfo.RegionSizeX / (float)Constants.RegionSize; if (scaleX == 0) @@ -259,7 +259,7 @@ namespace OpenSim.Region.Framework.Scenes for (int i = 0; i < Math.Min(presences.Count, maxLocations); ++i) { ScenePresence sp = presences[i]; - + // If this presence is a child agent, we don't want its coarse locations if (sp.IsChildAgent) continue; @@ -346,7 +346,7 @@ namespace OpenSim.Region.Framework.Scenes return ret; } - + /// /// Add a newly created object to the scene. This will both update the scene, and send information about the /// new object to all clients interested in the scene. @@ -372,11 +372,11 @@ namespace OpenSim.Region.Framework.Scenes return ret; } - + /// /// Add a newly created object to the scene. /// - /// + /// /// This method does not send updates to the client - callers need to handle this themselves. /// Caller should also trigger EventManager.TriggerObjectAddedToScene /// @@ -630,7 +630,7 @@ namespace OpenSim.Region.Framework.Scenes { List updates; - // Some updates add more updates to the updateList. + // Some updates add more updates to the updateList. // Get the current list of updates and clear the list before iterating lock (m_updateList) { @@ -762,7 +762,7 @@ namespace OpenSim.Region.Framework.Scenes { Dictionary newmap = new Dictionary(m_scenePresenceMap); List newlist = new List(m_scenePresenceArray); - + // Remove the presence reference from the dictionary if (newmap.ContainsKey(agentID)) { @@ -874,7 +874,7 @@ namespace OpenSim.Region.Framework.Scenes #endregion #region Get Methods - + /// /// Get the controlling client for the given avatar, if there is one. /// @@ -1190,7 +1190,7 @@ namespace OpenSim.Region.Framework.Scenes return null; return group.GetPart(localID); } - + /// /// Get a prim by name from the scene (will return the first /// found, if there are more than one prim with the same name) @@ -1209,7 +1209,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectPart p in ((SceneObjectGroup)entity).Parts) { // m_log.DebugFormat("[SCENE GRAPH]: Part {0} has name {1}", p.UUID, p.Name); - + if (p.Name == name) { sop = p; @@ -1308,7 +1308,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Performs action on all scene presences. This can ultimately run the actions in parallel but /// any delegates passed in will need to implement their own locking on data they reference and - /// modify outside of the scope of the delegate. + /// modify outside of the scope of the delegate. /// /// public void ForEachScenePresence(Action action) @@ -1343,7 +1343,7 @@ namespace OpenSim.Region.Framework.Scenes } } } - + #endregion #region Client Event handlers @@ -1574,7 +1574,7 @@ namespace OpenSim.Region.Framework.Scenes public void UpdatePrimGroupPosition(uint localId, Vector3 pos, UUID updatingAgentId) { SceneObjectGroup group = GetGroupByPrim(localId); - + if (group != null) { if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) @@ -1589,7 +1589,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - if (m_parentScene.Permissions.CanMoveObject(group.UUID, updatingAgentId) + if (m_parentScene.Permissions.CanMoveObject(group.UUID, updatingAgentId) && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos)) { group.UpdateGroupPosition(pos); @@ -1611,7 +1611,7 @@ namespace OpenSim.Region.Framework.Scenes protected internal void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); - + if (group != null) { if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId)) @@ -1730,8 +1730,8 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); if (part != null) { - part.ClickAction = Convert.ToByte(clickAction); - group.HasGroupChanged = true; + part.ClickAction = Convert.ToByte(clickAction); + group.HasGroupChanged = true; } } } @@ -1966,7 +1966,7 @@ namespace OpenSim.Region.Framework.Scenes // However, editing linked parts and unlinking may be different // SceneObjectGroup group = root.ParentGroup; - + List newSet = new List(group.Parts); newSet.Remove(root); @@ -1978,7 +1978,7 @@ namespace OpenSim.Region.Framework.Scenes group.DelinkFromGroup(p, false); SceneObjectPart newRoot = newSet[0]; - + // If there is more than one prim remaining, we // need to re-link // @@ -1996,7 +1996,7 @@ namespace OpenSim.Region.Framework.Scenes { newRoot.TriggerScriptChangedEvent(Changed.LINK); newRoot.ParentGroup.HasGroupChanged = true; - newRoot.ParentGroup.ScheduleGroupForFullUpdate(); + newRoot.ParentGroup.ScheduleGroupForFullUpdate(); } } @@ -2089,7 +2089,7 @@ namespace OpenSim.Region.Framework.Scenes public SceneObjectGroup DuplicateObject(uint originalPrimID, 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}", +// "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", // originalPrimID, offset, AgentID); SceneObjectGroup original = GetGroupByPrim(originalPrimID); @@ -2194,6 +2194,6 @@ namespace OpenSim.Region.Framework.Scenes #endregion - + } } diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index c5c083a..1e418df 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -91,12 +91,12 @@ namespace OpenSim.Region.Framework.Scenes private static SceneManager m_instance = null; public static SceneManager Instance - { + { get { if (m_instance == null) m_instance = new SceneManager(); return m_instance; - } + } } private readonly DoubleDictionary m_localScenes = new DoubleDictionary(); @@ -340,7 +340,7 @@ namespace OpenSim.Region.Framework.Scenes public bool TrySetCurrentScene(string regionName) { - if ((String.Compare(regionName, "root") == 0) + if ((String.Compare(regionName, "root") == 0) || (String.Compare(regionName, "..") == 0) || (String.Compare(regionName, "/") == 0)) { @@ -398,7 +398,7 @@ namespace OpenSim.Region.Framework.Scenes return true; } } - + scene = null; return false; } @@ -415,7 +415,7 @@ namespace OpenSim.Region.Framework.Scenes return true; } } - + scene = null; return false; } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 98617d1..9f98554 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -114,9 +114,9 @@ namespace OpenSim.Region.Framework.Scenes public bool AddInventoryItem(UUID agentID, uint localID, InventoryItemBase item, UUID copyItemID) { // m_log.DebugFormat( -// "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}", +// "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}", // item.Name, remoteClient.Name, localID); - + UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID; SceneObjectPart part = GetPart(localID); @@ -147,8 +147,8 @@ namespace OpenSim.Region.Framework.Scenes // We're adding this to a prim we don't own. Force // owner change taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; - } - else + } + else { taskItem.BasePermissions = item.BasePermissions; taskItem.CurrentPermissions = item.CurrentPermissions; @@ -156,13 +156,13 @@ namespace OpenSim.Region.Framework.Scenes taskItem.GroupPermissions = item.GroupPermissions; taskItem.NextPermissions = item.NextPermissions; } - + taskItem.Flags = item.Flags; // m_log.DebugFormat( -// "[PRIM INVENTORY]: Flags are 0x{0:X} for item {1} added to part {2} by {3}", -// taskItem.Flags, taskItem.Name, localID, remoteClient.Name); - +// "[PRIM INVENTORY]: Flags are 0x{0:X} for item {1} added to part {2} by {3}", +// taskItem.Flags, taskItem.Name, localID, remoteClient.Name); + // TODO: These are pending addition of those fields to TaskInventoryItem // taskItem.SalePrice = item.SalePrice; // taskItem.SaleType = item.SaleType; @@ -328,13 +328,13 @@ namespace OpenSim.Region.Framework.Scenes xmldoc.AppendChild(xmlnode); XmlElement rootElement = xmldoc.CreateElement("", "ScriptData", String.Empty); - + xmldoc.AppendChild(rootElement); - + XmlElement wrapper = xmldoc.CreateElement("", "ScriptStates", String.Empty); - + rootElement.AppendChild(wrapper); foreach (KeyValuePair state in states) @@ -362,7 +362,7 @@ namespace OpenSim.Region.Framework.Scenes return; IScriptModule scriptModule = null; - + foreach (IScriptModule sm in s.RequestModuleInterfaces()) { if (sm.ScriptEngineName == s.DefaultScriptEngine) @@ -401,7 +401,7 @@ namespace OpenSim.Region.Framework.Scenes return; XmlElement dataE = (XmlElement)dataL[0]; - + foreach (XmlNode n in dataE.ChildNodes) { XmlElement stateE = (XmlElement)n; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e42b675..8fdb0f1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + using System; using System.ComponentModel; using System.Collections.Generic; @@ -46,7 +46,7 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.Framework.Scenes { - + [Flags] public enum scriptEvents { @@ -148,7 +148,7 @@ namespace OpenSim.Region.Framework.Scenes { if (value) { - + if (Backup) { m_scene.SceneGraph.FireChangeBackup(this); @@ -188,7 +188,7 @@ namespace OpenSim.Region.Framework.Scenes } } m_hasGroupChanged = value; - + // m_log.DebugFormat( // "[SCENE OBJECT GROUP]: HasGroupChanged set to {0} for {1} {2}", m_hasGroupChanged, Name, LocalId); } @@ -197,7 +197,7 @@ namespace OpenSim.Region.Framework.Scenes } private bool m_groupContainsForeignPrims = false; - + /// /// Whether the group contains prims that came from a different group. This happens when /// linking or delinking groups. The implication is that until the group is persisted, @@ -232,7 +232,7 @@ namespace OpenSim.Region.Framework.Scenes m_maxPersistTime = m_scene.m_persistAfter; m_minPersistTime = m_scene.m_dontPersistBefore; } - + long currentTime = DateTime.UtcNow.Ticks; if (timeLastChanged == 0) timeLastChanged = currentTime; @@ -419,7 +419,7 @@ namespace OpenSim.Region.Framework.Scenes // { // get { return m_rotation; } // set { -// m_rotation = value; +// m_rotation = value; // } // } @@ -435,27 +435,27 @@ namespace OpenSim.Region.Framework.Scenes Vector3 minScale = new Vector3(Constants.MaximumRegionSize, Constants.MaximumRegionSize, Constants.MaximumRegionSize); Vector3 maxScale = Vector3.Zero; Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f); - + SceneObjectPart[] parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) { SceneObjectPart part = parts[i]; 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.Y + partoffset.Y : minScale.Y; minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z; - + maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X; maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y; maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z; } - + finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X; finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y; finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z; - + return finalScale; } } @@ -520,7 +520,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// This is necessary in some cases, particularly when a scene object has just crossed into a region and doesn't /// have the IsAttachment property yet checked. - /// + /// /// FIXME: However, this should be fixed so that this property /// propertly reflects the underlying status. /// @@ -530,7 +530,7 @@ namespace OpenSim.Region.Framework.Scenes return (IsAttachment || (m_rootPart.Shape.PCode == (byte)PCodeEnum.Primitive && m_rootPart.Shape.State != 0)); } - + private struct avtocrossInfo { public ScenePresence av; @@ -627,7 +627,7 @@ namespace OpenSim.Region.Framework.Scenes OpenSim.Services.Interfaces.GridRegion destination = null; if (sog.RootPart.DIE_AT_EDGE) - { + { try { sogScene.DeleteSceneObject(sog, false); @@ -648,7 +648,7 @@ namespace OpenSim.Region.Framework.Scenes localIDs.Add(sog.RootPart.LocalId); sogScene.AddReturn(sog.OwnerID, sog.Name, sog.AbsolutePosition, "Returned at region cross"); - sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero); + sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero); } catch (Exception) { @@ -754,7 +754,7 @@ namespace OpenSim.Region.Framework.Scenes // avatar cross failed we need do dedicated standUp // part of it was done at CrossAgentToNewRegionAsync // so for now just remove the sog controls - // this may need extra care + // this may need extra care av.UnRegisterSeatControls(sog.UUID); } @@ -869,7 +869,7 @@ namespace OpenSim.Region.Framework.Scenes public override UUID UUID { get { return m_rootPart.UUID; } - set + set { lock (m_parts.SyncRoot) { @@ -931,7 +931,7 @@ namespace OpenSim.Region.Framework.Scenes { get { return true; } } - + public bool IsSelected { get { return m_isSelected; } @@ -944,7 +944,7 @@ namespace OpenSim.Region.Framework.Scenes // but ode engines should only really need to know about root part // so they can put entire object simulation on hold and not colliding // keep as was for now - + PhysicsActor pa = m_rootPart.PhysActor; if (pa != null) { @@ -1107,7 +1107,7 @@ namespace OpenSim.Region.Framework.Scenes /// public SceneObjectGroup() { - + } /// @@ -1152,7 +1152,7 @@ namespace OpenSim.Region.Framework.Scenes if (itemid != UUID.Zero) m_savedScriptState[itemid] = node.InnerXml; } - } + } } } @@ -1211,11 +1211,11 @@ namespace OpenSim.Region.Framework.Scenes if (!Backup) m_scene.EventManager.OnBackup += ProcessBackup; - + Backup = true; } } - + /// /// Attach this object to a scene. It will also now appear to agents. /// @@ -1378,7 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes backBottomRight.Y = orig.Y + (part.Scale.Y / 2); backBottomRight.Z = orig.Z - (part.Scale.Z / 2); - + //m_log.InfoFormat("pre corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z); //m_log.InfoFormat("pre corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z); @@ -1675,7 +1675,7 @@ namespace OpenSim.Region.Framework.Scenes } int nparts = parts.Length; - + for (int i = 0; i < nparts; i++) { @@ -1692,7 +1692,7 @@ namespace OpenSim.Region.Framework.Scenes { linksetResCost = 0; linksetPhysCost = 0; - partCost = 0; + partCost = 0; partPhysCost = 0; for (int i = 0; i < nparts; i++) @@ -1838,7 +1838,7 @@ namespace OpenSim.Region.Framework.Scenes else { m_log.WarnFormat( - "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present", + "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present", UUID, avatar.ControllingClient.AgentId, Scene.RegionInfo.RegionName); } } @@ -1925,7 +1925,7 @@ namespace OpenSim.Region.Framework.Scenes { return Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); } - + /// /// Set a part to act as the root part for this scene object /// @@ -1940,7 +1940,7 @@ namespace OpenSim.Region.Framework.Scenes if (!IsAttachment) part.ParentID = 0; part.LinkNum = 0; - + m_parts.Add(m_rootPart.UUID, m_rootPart); } @@ -1991,19 +1991,19 @@ namespace OpenSim.Region.Framework.Scenes // justincc: I don't believe this hack is needed any longer, especially since the physics // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false // this method was preventing proper reload of scene objects. - + // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects // at region startup - - // teravus: After this was removed from the linking algorithm, Linked prims no longer collided + + // teravus: After this was removed from the linking algorithm, Linked prims no longer collided // properly when non-physical if they havn't been moved. This breaks ALL builds. // see: http://opensimulator.org/mantis/view.php?id=3108 - - // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the - // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and - // unmoved prims! As soon as you move a Prim/group, it will collide properly because Absolute + + // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the + // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and + // unmoved prims! As soon as you move a Prim/group, it will collide properly because Absolute // Position has been set! - + public void ResetChildPrimPhysicsPositions() { // Setting this SOG's absolute position also loops through and sets the positions @@ -2219,9 +2219,9 @@ namespace OpenSim.Region.Framework.Scenes if (m_rootPart.PhysActor != null) m_rootPart.PhysActor.Building = false; - } - else - { + } + else + { // Apply physics to the root prim m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, false); } @@ -2309,7 +2309,7 @@ namespace OpenSim.Region.Framework.Scenes DetachFromBackup(); m_log.DebugFormat( - "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn", + "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn", RootPart.UUID); m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn"); m_scene.DeRezObjects(null, new List() { RootPart.LocalId }, UUID.Zero, @@ -2364,9 +2364,9 @@ namespace OpenSim.Region.Framework.Scenes datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); - backup_group.ForEachPart(delegate(SceneObjectPart part) - { - part.Inventory.ProcessInventoryBackup(datastore); + backup_group.ForEachPart(delegate(SceneObjectPart part) + { + part.Inventory.ProcessInventoryBackup(datastore); if(part.KeyframeMotion != null) { @@ -2389,7 +2389,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}", + "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}", Name, UUID, m_scene.RegionInfo.RegionName, e.Message, e.StackTrace); } } @@ -2427,22 +2427,22 @@ namespace OpenSim.Region.Framework.Scenes { m_dupeInProgress = true; SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); - + dupe.m_parts = new MapAndArray(); // a copy isnt backedup dupe.Backup = false; dupe.InvalidBoundsRadius(); - + // a copy is not in transit hopefully dupe.inTransit = false; - - // new group as no sitting avatars + + // new group as no sitting avatars dupe.m_sittingAvatars = new List(); dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; - + if (userExposed) dupe.m_rootPart.TrimPermissions(); @@ -2587,7 +2587,7 @@ namespace OpenSim.Region.Framework.Scenes if (pa != null) { - // false to be applied as a impulse + // false to be applied as a impulse pa.AddForce(impulse, false); m_scene.PhysicsScene.AddPhysicsActorTaint(pa); } @@ -2723,7 +2723,7 @@ namespace OpenSim.Region.Framework.Scenes if(IsAttachment) { ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); - if (avatar != null) + if (avatar != null) pa = avatar.PhysicsActor; } else @@ -2813,7 +2813,7 @@ namespace OpenSim.Region.Framework.Scenes public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, UUID AgentID, uint RequestFlags) { remoteClient.SendObjectPropertiesFamilyData(RootPart, RequestFlags); - + // remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.OwnerID, RootPart.GroupID, RootPart.BaseMask, // RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask, // RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category, @@ -2844,7 +2844,7 @@ namespace OpenSim.Region.Framework.Scenes // return; // If we somehow got here to updating the SOG and its root part is not scheduled for update, - // check to see if the physical position or rotation warrant an update. + // check to see if the physical position or rotation warrant an update. if (m_rootPart.UpdateFlag == UpdateRequired.NONE) { // rootpart SendScheduledUpdates will check if a update is needed @@ -2885,7 +2885,7 @@ namespace OpenSim.Region.Framework.Scenes { // if (IsAttachment) // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId); - + checkAtTargets(); RootPart.ScheduleFullUpdate(); @@ -2919,11 +2919,11 @@ namespace OpenSim.Region.Framework.Scenes /// Immediately send a full update for this scene object. /// public void SendGroupFullUpdate() - { + { if (IsDeleted) return; -// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID); +// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID); if (IsAttachment) { @@ -2964,7 +2964,7 @@ namespace OpenSim.Region.Framework.Scenes { if (m_scene == null) // Need to check here as it's null during object creation return; - + m_scene.SceneGraph.AddToUpdateList(this); } @@ -3139,7 +3139,7 @@ namespace OpenSim.Region.Framework.Scenes Vector3 oldGroupPosition = linkPart.GroupPosition; Quaternion oldRootRotation = linkPart.RotationOffset; - // A linked SOP remembers its location and rotation relative to the root of a group. + // A linked SOP remembers its location and rotation relative to the root of a group. // Convert the root of the group being linked to be relative to the // root of the group being linked to. // Note: Some of the assignments have complex side effects. @@ -3247,7 +3247,7 @@ namespace OpenSim.Region.Framework.Scenes objectGroup.IsDeleted = true; objectGroup.m_parts.Clear(); - + // Can't do this yet since backup still makes use of the root part without any synchronization // objectGroup.m_rootPart = null; @@ -3258,8 +3258,8 @@ namespace OpenSim.Region.Framework.Scenes AttachToBackup(); - // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the - // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and + // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the + // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and // unmoved prims! ResetChildPrimPhysicsPositions(); @@ -3453,7 +3453,7 @@ namespace OpenSim.Region.Framework.Scenes lock (m_parts.SyncRoot) if(!m_parts.Remove(linkPart.UUID)) continue; - + linkPart.ClearUndoState(); Vector3 worldPos = linkPart.GetWorldPosition(); @@ -3580,7 +3580,7 @@ namespace OpenSim.Region.Framework.Scenes part.setOffsetPosition(newPos - AbsolutePosition); // (radams1 20120711: I don't know why part.OffsetPosition is set multiple times. - // It would have the affect of setting the physics engine position multiple + // It would have the affect of setting the physics engine position multiple // times. In theory, that is not necessary but I don't have a good linkset // test to know that cleaning up this code wouldn't break things.) @@ -3685,29 +3685,29 @@ namespace OpenSim.Region.Framework.Scenes /// public void SpinMovement(Quaternion newOrientation, IClientAPI remoteClient) { - // The incoming newOrientation, sent by the client, "seems" to be the - // desired target orientation. This needs further verification; in particular, + // The incoming newOrientation, sent by the client, "seems" to be the + // desired target orientation. This needs further verification; in particular, // one would expect that the initial incoming newOrientation should be - // fairly close to the original prim's physical orientation, + // fairly close to the original prim's physical orientation, // m_rootPart.PhysActor.Orientation. This however does not seem to be the // case (might just be an issue with different quaternions representing the // same rotation, or it might be a coordinate system issue). // // Since it's not clear what the relationship is between the PhysActor.Orientation // and the incoming orientations sent by the client, we take an alternative approach - // of calculating the delta rotation between the orientations being sent by the + // of calculating the delta rotation between the orientations being sent by the // client. (Since a spin is invoked by ctrl+shift+drag in the client, we expect // a steady stream of several new orientations coming in from the client.) // This ensures that the delta rotations are being calculated from self-consistent // pairs of old/new rotations. Given the delta rotation, we apply a torque around // the delta rotation axis, scaled by the object mass times an arbitrary scaling // factor (to ensure the resulting torque is not "too strong" or "too weak"). - // + // // Ideally we need to calculate (probably iteratively) the exact torque or series - // of torques needed to arrive exactly at the destination orientation. However, since + // of torques needed to arrive exactly at the destination orientation. However, since // it is not yet clear how to map the destination orientation (provided by the viewer) - // into PhysActor orientations (needed by the physics engine), we omit this step. - // This means that the resulting torque will at least be in the correct direction, + // into PhysActor orientations (needed by the physics engine), we omit this step. + // This means that the resulting torque will at least be in the correct direction, // but it will result in over-shoot or under-shoot of the target orientation. // For the end user, this means that ctrl+shift+drag can be used for relative, // but not absolute, adjustments of orientation for physical prims. @@ -3750,7 +3750,7 @@ namespace OpenSim.Region.Framework.Scenes if(rotationAngle > 0) spinforce = spinforce * pa.Mass * 0.1f; // 0.1 is an arbitrary torque scaling factor else - spinforce = spinforce * pa.Mass * -0.1f; // 0.1 is an arbitrary torque scaling + spinforce = spinforce * pa.Mass * -0.1f; // 0.1 is an arbitrary torque scaling pa.AddAngularForce(spinforce,true); m_scene.PhysicsScene.AddPhysicsActorTaint(pa); } @@ -3870,8 +3870,8 @@ namespace OpenSim.Region.Framework.Scenes if (selectionPart != null) { SceneObjectPart[] parts = m_parts.GetArray(); - - if (Scene != null && UsePhysics) + + if (Scene != null && UsePhysics) { int maxprims = m_scene.m_linksetPhysCapacity; bool checkShape = (maxprims > 0 && @@ -3975,7 +3975,7 @@ namespace OpenSim.Region.Framework.Scenes RootPart.OwnerMask = (RootPart.OwnerMask & lockBit) | ((newOwnerMask | foldedPerms) & lockMask); // m_log.DebugFormat( -// "[SCENE OBJECT GROUP]: RootPart.OwnerMask now {0} for {1} in {2}", +// "[SCENE OBJECT GROUP]: RootPart.OwnerMask now {0} for {1} in {2}", // (OpenMetaverse.PermissionMask)RootPart.OwnerMask, Name, Scene.Name); RootPart.ScheduleFullUpdate(); @@ -4273,7 +4273,7 @@ namespace OpenSim.Region.Framework.Scenes { if (Scene == null || IsDeleted || inTransit) return 1.0f; - + float maxsize = Scene.m_maxNonphys; PhysicsActor pa = m_rootPart.PhysActor; // assuming physics is more restrictive @@ -4282,7 +4282,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart[] parts = m_parts.GetArray(); float larger = float.MinValue; - + for(int i = 0; i < parts.Length; i++) { SceneObjectPart obPart = parts[i]; @@ -4310,7 +4310,7 @@ namespace OpenSim.Region.Framework.Scenes { if (Scene == null || IsDeleted || inTransit) return 1.0f; - + float minsize = Scene.m_minNonphys; PhysicsActor pa = m_rootPart.PhysActor; // assuming physics is more restrictive @@ -4319,7 +4319,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart[] parts = m_parts.GetArray(); float smaller = float.MaxValue; - + for(int i = 0; i < parts.Length; i++) { SceneObjectPart obPart = parts[i]; @@ -4388,7 +4388,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - /// + /// public void UpdateSinglePosition(Vector3 pos, uint localID) { @@ -4443,7 +4443,7 @@ namespace OpenSim.Region.Framework.Scenes } AbsolutePosition = newPos; - + if (IsAttachment) m_rootPart.AttachedPos = newPos; @@ -4469,7 +4469,7 @@ namespace OpenSim.Region.Framework.Scenes public void UpdateGroupRotationR(Quaternion rot) { m_rootPart.UpdateRotation(rot); - + /* this is done by rootpart RotationOffset set called by UpdateRotation PhysicsActor actor = m_rootPart.PhysActor; if (actor != null) @@ -4747,7 +4747,7 @@ namespace OpenSim.Region.Framework.Scenes if (setX || setY || setZ) { bool lockaxis = (rotate10 == 0); // zero means axis locked - + byte locks = RootPart.RotationAxisLocks; if (setX) @@ -4757,7 +4757,7 @@ namespace OpenSim.Region.Framework.Scenes else locks &= (byte)SceneObjectGroup.axisSelect.NOT_STATUS_ROTATE_X; } - + if (setY) { if(lockaxis) @@ -4791,7 +4791,7 @@ namespace OpenSim.Region.Framework.Scenes if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) return (rotAxislocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) == 0 ? 1:0; - return 0; + return 0; } public int registerRotTargetWaypoint(Quaternion target, float tolerance) @@ -4837,7 +4837,7 @@ namespace OpenSim.Region.Framework.Scenes m_scene.AddGroupTarget(this); return (int)handle; } - + public void unregisterTargetWaypoint(int handle) { lock (m_targets) @@ -4879,14 +4879,14 @@ namespace OpenSim.Region.Framework.Scenes } } } - + if (atTargets.Count > 0) { SceneObjectPart[] parts = m_parts.GetArray(); uint[] localids = new uint[parts.Length]; for (int i = 0; i < parts.Length; i++) localids[i] = parts[i].LocalId; - + for (int ctr = 0; ctr < localids.Length; ctr++) { foreach (uint target in atTargets.Keys) @@ -4896,10 +4896,10 @@ namespace OpenSim.Region.Framework.Scenes localids[ctr], att.handle, att.targetPos, m_rootPart.GroupPosition); } } - + return; } - + if (m_scriptListens_notAtTarget && !at_target) { //trigger not_at_target @@ -4907,7 +4907,7 @@ namespace OpenSim.Region.Framework.Scenes uint[] localids = new uint[parts.Length]; for (int i = 0; i < parts.Length; i++) localids[i] = parts[i].LocalId; - + for (int ctr = 0; ctr < localids.Length; ctr++) { m_scene.EventManager.TriggerNotAtTargetEvent(localids[ctr]); @@ -4994,7 +4994,7 @@ namespace OpenSim.Region.Framework.Scenes // http://wiki.secondlife.com/wiki/llGetGeometricCenter // ignoring tortured prims details since sl also seems to ignore // so no real use in doing it on physics - + Vector3 gc = Vector3.Zero; SceneObjectPart[] parts = m_parts.GetArray(); @@ -5034,7 +5034,7 @@ namespace OpenSim.Region.Framework.Scenes Vector3 tmp = pa.CenterOfMass; return tmp; } - + Vector3 Ptot = Vector3.Zero; float totmass = 0f; float m; @@ -5072,7 +5072,7 @@ namespace OpenSim.Region.Framework.Scenes } HasGroupChanged = true; - + // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled // for the same object with very different properties. The caller must schedule the update. //ScheduleGroupForFullUpdate(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b95b5be..b97cceb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -134,7 +134,7 @@ namespace OpenSim.Region.Framework.Scenes ); private const scriptEvents PhyscicsVolumeDtcSubsEvents = ( scriptEvents.collision_start | scriptEvents.collision_end - ); + ); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -148,8 +148,8 @@ namespace OpenSim.Region.Framework.Scenes /// /// Dynamic objects that can be created and deleted as required. /// - public DOMap DynObjs - { + public DOMap DynObjs + { get { if (m_dynObjs == null) @@ -163,16 +163,16 @@ namespace OpenSim.Region.Framework.Scenes m_dynObjs = value; } } - + /// /// Is this a root part? /// /// /// This will return true even if the whole object is attached to an avatar. /// - public bool IsRoot + public bool IsRoot { - get { return Object.ReferenceEquals(ParentGroup.RootPart, this); } + get { return Object.ReferenceEquals(ParentGroup.RootPart, this); } } /// @@ -192,11 +192,11 @@ namespace OpenSim.Region.Framework.Scenes #region Fields public bool AllowedDrop; - + public bool DIE_AT_EDGE; - + public bool RETURN_AT_EDGE; - + public bool BlockGrab { get; set; } public bool StatusSandbox; @@ -221,7 +221,7 @@ namespace OpenSim.Region.Framework.Scenes // Note: This isn't persisted in the database right now, as the fields for that aren't just there yet. // 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) - + public UUID Sound; public byte SoundFlags; @@ -254,7 +254,7 @@ namespace OpenSim.Region.Framework.Scenes [XmlIgnore] public int STATUS_ROTATE_X; // this should not be used - + [XmlIgnore] public int STATUS_ROTATE_Y; // this should not be used @@ -262,13 +262,13 @@ namespace OpenSim.Region.Framework.Scenes public int STATUS_ROTATE_Z; // this should not be used private Dictionary m_CollisionFilter = new Dictionary(); - + /// /// The UUID of the user inventory item from which this object was rezzed if this is a root part. /// If UUID.Zero then either this is not a root part or there is no connection with a user inventory item. /// private UUID m_fromUserInventoryItemID; - + public UUID FromUserInventoryItemID { get { return m_fromUserInventoryItemID; } @@ -289,7 +289,7 @@ namespace OpenSim.Region.Framework.Scenes public bool VolumeDetectActive { - get + get { return (Flags & (PrimFlags)primFlagVolumeDetect) != 0; } @@ -313,7 +313,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// This part's inventory - /// + /// public IEntityInventory Inventory { get { return m_inventory; } @@ -321,20 +321,20 @@ namespace OpenSim.Region.Framework.Scenes protected SceneObjectPartInventory m_inventory; public bool Undoing; - + public bool IgnoreUndoUpdate = false; - + public PrimFlags LocalFlags; - + private float m_damage = -1.0f; private byte[] m_TextureAnimation; private byte m_clickAction; private Color m_color = Color.Black; private readonly List m_lastColliders = new List(); private int m_linkNum; - + private int m_scriptAccessPin; - + private readonly Dictionary m_scriptEvents = new Dictionary(); private string m_sitName = String.Empty; private Quaternion m_sitTargetOrientation = Quaternion.Identity; @@ -403,7 +403,7 @@ namespace OpenSim.Region.Framework.Scenes private UUID m_collisionSound; private float m_collisionSoundVolume; - private int LastColSoundSentTime; + private int LastColSoundSentTime; private SOPVehicle m_vehicleParams = null; @@ -454,7 +454,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// public SceneObjectPart( - UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, + UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset, Vector3 offsetPosition) : this() { m_name = "Object"; @@ -505,7 +505,7 @@ namespace OpenSim.Region.Framework.Scenes private bool m_createSelected = false; private UUID _creatorID; - public UUID CreatorID + public UUID CreatorID { get { return _creatorID; } set { _creatorID = value; } @@ -515,7 +515,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Data about the creator in the form home_url;name /// - public string CreatorData + public string CreatorData { get { return m_creatorData; } set { m_creatorData = value; } @@ -565,7 +565,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// A relic from when we we thought that prims contained folder objects. In + /// A relic from when we we thought that prims contained folder objects. In /// reality, prim == folder /// 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. @@ -611,10 +611,10 @@ namespace OpenSim.Region.Framework.Scenes public UUID UUID { get { return m_uuid; } - set - { - m_uuid = value; - + set + { + m_uuid = value; + // This is necessary so that TaskInventoryItem parent ids correctly reference the new uuid of this part if (Inventory != null) Inventory.ResetObjectID(); @@ -634,8 +634,8 @@ namespace OpenSim.Region.Framework.Scenes public virtual string Name { get { return m_name; } - set - { + set + { m_name = value; PhysicsActor pa = PhysActor; @@ -678,11 +678,11 @@ namespace OpenSim.Region.Framework.Scenes m_isSelected = value; if (ParentGroup != null) ParentGroup.PartSelectChanged(value); - + } } - - + + public Dictionary CollisionFilter { get { return m_CollisionFilter; } @@ -704,14 +704,14 @@ namespace OpenSim.Region.Framework.Scenes set { m_APIDTarget = value; } } - + protected float APIDDamp { get { return m_APIDDamp; } set { m_APIDDamp = value; } } - + protected float APIDStrength { get { return m_APIDStrength; } @@ -769,21 +769,21 @@ namespace OpenSim.Region.Framework.Scenes set { m_particleSystem = value; } } - + public DateTime Expires { get { return m_expires; } set { m_expires = value; } } - + public DateTime Rezzed { get { return m_rezzed; } set { m_rezzed = value; } } - + public float Damage { get { return m_damage; } @@ -798,7 +798,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// The position of the entire group that this prim belongs to. /// - /// + /// public Vector3 GroupPosition { @@ -837,7 +837,7 @@ namespace OpenSim.Region.Framework.Scenes // Root prim actually goes at Position if (ParentID == 0) { - actor.Position = value; + actor.Position = value; } else { @@ -955,7 +955,7 @@ namespace OpenSim.Region.Framework.Scenes return m_rotationOffset; } - + set { // StoreUndoState(); @@ -1066,24 +1066,24 @@ namespace OpenSim.Region.Framework.Scenes if ((actor != null) && actor.IsPhysical && ParentGroup.RootPart == this && VehicleType == (int)Vehicle.TYPE_NONE) { actor.RotationalVelocity = m_angularVelocity; - } + } } } /// public Vector3 Acceleration { - get - { + get + { PhysicsActor actor = PhysActor; if (actor != null) - { - m_acceleration = actor.Acceleration; - } - return m_acceleration; - } - - set + { + m_acceleration = actor.Acceleration; + } + return m_acceleration; + } + + set { if (Util.IsNanOrInfinity(value)) m_acceleration = Vector3.Zero; @@ -1217,23 +1217,23 @@ namespace OpenSim.Region.Framework.Scenes else b = sz; } - - return a * b; + + return a * b; } public UpdateRequired UpdateFlag { get; set; } - + /// /// Used for media on a prim. /// /// Do not change this value directly - always do it through an IMoapModule. - public string MediaUrl - { + public string MediaUrl + { get { - return m_mediaUrl; + return m_mediaUrl; } - + set { m_mediaUrl = value; @@ -1246,10 +1246,10 @@ namespace OpenSim.Region.Framework.Scenes public bool CreateSelected { get { return m_createSelected; } - set - { + set + { // m_log.DebugFormat("[SOP]: Setting CreateSelected to {0} for {1} {2}", value, Name, UUID); - m_createSelected = value; + m_createSelected = value; } } @@ -1423,7 +1423,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Property flags. See OpenMetaverse.PrimFlags + /// Property flags. See OpenMetaverse.PrimFlags /// /// /// Example properties are PrimFlags.Phantom and PrimFlags.DieAtEdge @@ -1431,18 +1431,18 @@ namespace OpenSim.Region.Framework.Scenes public PrimFlags Flags { get { return _flags; } - set - { + set + { // m_log.DebugFormat("[SOP]: Setting flags for {0} {1} to {2}", UUID, Name, value); - _flags = value; + _flags = value; } } - + [XmlIgnore] public bool IsOccupied // KF If an av is sittingon this prim { - get { return m_occupied; } - set { m_occupied = value; } + get { return m_occupied; } + set { m_occupied = value; } } /// @@ -1474,7 +1474,7 @@ namespace OpenSim.Region.Framework.Scenes } private UUID _parentUUID = UUID.Zero; - + public UUID ParentUUID { get @@ -1487,7 +1487,7 @@ namespace OpenSim.Region.Framework.Scenes set { _parentUUID = value; } } - + public string SitAnimation { get { return m_sitAnimation; } @@ -1519,7 +1519,7 @@ namespace OpenSim.Region.Framework.Scenes { get { return m_collisionSound; } set - { + { m_collisionSound = value; if (value == invalidCollisionSoundUUID) @@ -1589,7 +1589,7 @@ namespace OpenSim.Region.Framework.Scenes { if (ParentGroup.RootPart == this) return m_torque; - + return ParentGroup.RootPart.Torque; } @@ -1733,7 +1733,7 @@ namespace OpenSim.Region.Framework.Scenes set { byte oldv = m_physicsShapeType; - + if (value >= 0 && value <= (byte)PhysShapeType.convex) { if (value == (byte)PhysShapeType.none && ParentGroup != null && ParentGroup.RootPart == this) @@ -1966,7 +1966,7 @@ namespace OpenSim.Region.Framework.Scenes Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); - + } m_TextureAnimation = data; } @@ -2063,7 +2063,7 @@ namespace OpenSim.Region.Framework.Scenes root.AngularVelocity = pAngVel; } - + /// /// hook to the physics scene to apply angular impulse @@ -2095,7 +2095,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Vector force /// true for the local frame, false for the global frame - + // this is actualy Set Torque.. keeping naming so not to edit lslapi also public void SetAngularImpulse(Vector3 torquei, bool localGlobalTF) { @@ -2116,7 +2116,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// - public void ApplyPhysics(uint _ObjectFlags, bool _VolumeDetectActive, bool building) + public void ApplyPhysics(uint _ObjectFlags, bool _VolumeDetectActive, bool building) { VolumeDetectActive = _VolumeDetectActive; @@ -2177,7 +2177,7 @@ namespace OpenSim.Region.Framework.Scenes /// public SceneObjectPart Copy(uint plocalID, UUID AgentID, UUID GroupID, int linkNum, bool userExposed) { - // FIXME: This is dangerous since it's easy to forget to reset some references when necessary and end up + // FIXME: This is dangerous since it's easy to forget to reset some references when necessary and end up // with bugs that only occur in some circumstances (e.g. crossing between regions on the same simulator // but not between regions on different simulators). Really, all copying should be done explicitly. SceneObjectPart dupe = (SceneObjectPart)MemberwiseClone(); @@ -2242,20 +2242,20 @@ namespace OpenSim.Region.Framework.Scenes dupe.PayPrice = (int[])PayPrice.Clone(); dupe.DynAttrs.CopyFrom(DynAttrs); - + if (userExposed) { bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0); dupe.DoPhysicsPropertyUpdate(UsePhysics, true); } - + if (dupe.PhysActor != null) dupe.PhysActor.LocalID = plocalID; ParentGroup.Scene.EventManager.TriggerOnSceneObjectPartCopy(dupe, this, userExposed); // m_log.DebugFormat("[SCENE OBJECT PART]: Clone of {0} {1} finished", Name, UUID); - + return dupe; } @@ -2428,7 +2428,7 @@ namespace OpenSim.Region.Framework.Scenes pa.link(parentPa); } } - } + } } bool phan = ((Flags & PrimFlags.Phantom) != 0); @@ -2528,7 +2528,7 @@ namespace OpenSim.Region.Framework.Scenes public uint GetEffectiveObjectFlags() { - // Commenting this section of code out since it doesn't actually do anything, as enums are handled by + // Commenting this section of code out since it doesn't actually do anything, as enums are handled by // value rather than reference // PrimFlags f = _flags; // if (m_parentGroup == null || m_parentGroup.RootPart == this) @@ -2820,7 +2820,7 @@ namespace OpenSim.Region.Framework.Scenes ColliderArgs LandCollidingMessage = new ColliderArgs(); List colliding = new List(); - + colliding.Add(CreateDetObjectForGround()); LandCollidingMessage.Colliders = colliding; @@ -2969,9 +2969,9 @@ namespace OpenSim.Region.Framework.Scenes // Note: This is only being called on the root prim at this time. m_log.ErrorFormat( - "[SCENE OBJECT PART]: Physical object {0}, localID {1} went out of bounds at {2} in {3}. Stopping at {4} and making non-physical.", + "[SCENE OBJECT PART]: Physical object {0}, localID {1} went out of bounds at {2} in {3}. Stopping at {4} and making non-physical.", Name, LocalId, pos, ParentGroup.Scene.Name, AbsolutePosition); - + RemFlag(PrimFlags.Physics); DoPhysicsPropertyUpdate(false, true); } @@ -3026,7 +3026,7 @@ namespace OpenSim.Region.Framework.Scenes //m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); //ScheduleFullUpdate(); } - + public void RemoveScriptEvents(UUID scriptid) { lock (m_scriptEvents) @@ -3089,7 +3089,7 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); } - + public void RotLookAt(Quaternion target, float strength, float damping) { if(ParentGroup.IsDeleted) @@ -3115,7 +3115,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.WarnFormat("[SceneObjectPart] Invalid rotation strength {0}",APIDStrength); return; } - + APIDActive = true; // Necessary to get the lookat deltas applied @@ -3357,7 +3357,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter // sl Does send them // if (ParentGroup.IsSelected && ParentGroup.IsAttachment) // return; - + if (ParentGroup.IsDeleted) return; @@ -3487,7 +3487,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter public void SetBuoyancy(float fvalue) { Buoyancy = fvalue; -/* +/* if (PhysActor != null) { PhysActor.Buoyancy = fvalue; @@ -3547,7 +3547,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter public void SetVehicleType(int type) { m_vehicleParams = null; - + if (type == (int)Vehicle.TYPE_NONE) { if (_parentID ==0 && PhysActor != null) @@ -3754,7 +3754,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter { if (Shape.SculptEntry) return PrimType.SCULPT; - + if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) { if (Shape.PathCurve == (byte)Extrusion.Straight) @@ -3782,12 +3782,12 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter else if (Shape.PathCurve == (byte)Extrusion.Curve1) return PrimType.RING; } - + return PrimType.BOX; } - + /// - /// Tell us if this object has cut, hollow, dimple, and other factors affecting the number of faces + /// Tell us if this object has cut, hollow, dimple, and other factors affecting the number of faces /// /// /// @@ -3812,7 +3812,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter hasDimple = (shape.ProfileBegin > 0) || (shape.ProfileEnd > 0); // taken from llSetPrimitiveParms hasProfileCut = hasDimple; // is it the same thing? } - + public void SetGroup(UUID groupID, IClientAPI client) { // Scene.AddNewPrims() calls with client == null so can't use this. @@ -3859,7 +3859,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter public void SetScriptEvents(UUID scriptid, int events) { // m_log.DebugFormat( -// "[SCENE OBJECT PART]: Set script events for script with id {0} on {1}/{2} to {3} in {4}", +// "[SCENE OBJECT PART]: Set script events for script with id {0} on {1}/{2} to {3} in {4}", // scriptid, Name, ParentGroup.Name, events, ParentGroup.Scene.Name); // scriptEvents oldparts; @@ -3896,7 +3896,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter ScheduleFullUpdate(); } } - + /// /// Set the text displayed for this part. /// @@ -4491,7 +4491,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter public bool IsHingeJoint() { // For now, we use the NINJA naming scheme for identifying joints. - // In the future, we can support other joint specification schemes such as a + // In the future, we can support other joint specification schemes such as a // custom checkbox in the viewer GUI. if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) { @@ -4507,7 +4507,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter public bool IsBallJoint() { // For now, we use the NINJA naming scheme for identifying joints. - // In the future, we can support other joint specification schemes such as a + // In the future, we can support other joint specification schemes such as a // custom checkbox in the viewer GUI. if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) { @@ -4523,7 +4523,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter public bool IsJoint() { // For now, we use the NINJA naming scheme for identifying joints. - // In the future, we can support other joint specification schemes such as a + // In the future, we can support other joint specification schemes such as a // custom checkbox in the viewer GUI. if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) { @@ -4616,8 +4616,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter Stop(); } - - else + + else { if (ParentGroup.Scene.CollidablePrims) { @@ -4649,7 +4649,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter UpdatePhysicsSubscribedEvents(); } - } + } // and last in case we have a new actor and not building @@ -4658,7 +4658,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); } - + // m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags); } @@ -4671,10 +4671,10 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter /// tells physics to delay full construction of object /// applies velocities, force and torque private void AddToPhysics(bool isPhysical, bool isPhantom, bool building, bool applyDynamics) - { + { PhysicsActor pa; - Vector3 velocity = Velocity; + Vector3 velocity = Velocity; Vector3 rotationalVelocity = AngularVelocity;; try @@ -4695,7 +4695,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom. e={1}", m_uuid, e); pa = null; } - + if (pa != null) { pa.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info @@ -4709,7 +4709,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter if(LocalId == ParentGroup.RootPart.LocalId) { - pa.LockAngularMotion(RotationAxisLocks); + pa.LockAngularMotion(RotationAxisLocks); } if (VolumeDetectActive) // change if not the default only @@ -4722,7 +4722,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter AddFlag(PrimFlags.CameraDecoupled); else RemFlag(PrimFlags.CameraDecoupled); - } + } else RemFlag(PrimFlags.CameraDecoupled); // we are going to tell rest of code about physics so better have this here @@ -4752,8 +4752,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter } } - if (applyDynamics && LocalId == ParentGroup.RootPart.LocalId) - // do independent of isphysical so parameters get setted (at least some) + if (applyDynamics && LocalId == ParentGroup.RootPart.LocalId) + // do independent of isphysical so parameters get setted (at least some) { Velocity = velocity; AngularVelocity = rotationalVelocity; @@ -4941,8 +4941,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter Primitive.TextureEntryFace fallbackNewFace = newTex.DefaultTexture; Primitive.TextureEntryFace fallbackOldFace = oldTex.DefaultTexture; - - // On Incoming packets, sometimes newText.DefaultTexture is null. The assumption is that all + + // On Incoming packets, sometimes newText.DefaultTexture is null. The assumption is that all // other prim-sides are set, but apparently that's not always the case. Lets assume packet/data corruption at this point. if (fallbackNewFace == null) { @@ -4958,7 +4958,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter // Materials capable viewers can send a ObjectImage packet // when nothing in TE has changed. MaterialID should be updated // by the RenderMaterials CAP handler, so updating it here may cause a - // race condtion. Therefore, if no non-materials TE fields have changed, + // race condtion. Therefore, if no non-materials TE fields have changed, // we should ignore any changes and not update Shape.TextureEntry bool otherFieldsChanged = false; @@ -5140,7 +5140,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter { return m_forceMouselook; } - + public override string ToString() { return String.Format("{0} {1} (parent {2}))", Name, UUID, ParentGroup); @@ -5157,7 +5157,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter && (ParentGroup.RootPart != this || ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint)) return; - + // Causes this thread to dig into the Client Thread Data. // Remember your locking here! remoteClient.SendEntityUpdate( @@ -5165,9 +5165,9 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); - ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); + ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); } - + public void AddScriptLPS(int count) { ParentGroup.AddScriptLPS(count); @@ -5233,7 +5233,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter { PermissionsUtil.LogPermissions(Name, message, BaseMask, OwnerMask, NextOwnerMask); } - + public void ApplyNextOwnerPermissions() { // Export needs to be preserved in the base and everyone diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 5b64aac..a50f162 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Scenes private object m_inventoryFileLock = new object(); private Dictionary m_scriptErrors = new Dictionary(); - + /// /// The part to which the inventory belongs. /// @@ -76,7 +76,7 @@ namespace OpenSim.Region.Framework.Scenes /// Tracks whether inventory has changed since the last persistent backup /// internal bool HasInventoryChanged; - + /// /// Inventory serial number /// @@ -91,8 +91,8 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal TaskInventoryDictionary Items { - get { - return m_items; + get { + return m_items; } set { @@ -110,7 +110,7 @@ namespace OpenSim.Region.Framework.Scenes return m_items.Count; } } - + /// /// Constructor /// @@ -393,7 +393,7 @@ namespace OpenSim.Region.Framework.Scenes StoreScriptError(item.ItemID, msg); m_log.ErrorFormat( "[PRIM INVENTORY]: Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", - item.Name, item.ItemID, m_part.AbsolutePosition, + item.Name, item.ItemID, m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); return false; @@ -410,7 +410,7 @@ namespace OpenSim.Region.Framework.Scenes m_items[item.ItemID].PermsGranter = UUID.Zero; m_items.LockItemsForWrite(false); - + string script = Utils.BytesToString(asset.Data); m_part.ParentGroup.Scene.EventManager.TriggerRezScript( m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); @@ -428,7 +428,7 @@ namespace OpenSim.Region.Framework.Scenes private UUID RestoreSavedScriptState(UUID loadedID, UUID oldID, UUID newID) { // m_log.DebugFormat( -// "[PRIM INVENTORY]: Restoring scripted state for item {0}, oldID {1}, loadedID {2}", +// "[PRIM INVENTORY]: Restoring scripted state for item {0}, oldID {1}, loadedID {2}", // newID, oldID, loadedID); IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces(); @@ -477,7 +477,7 @@ namespace OpenSim.Region.Framework.Scenes m_part.ParentGroup.m_savedScriptState[stateID] = newDoc.OuterXml; } - + foreach (IScriptModule e in engines) { if (e != null) @@ -544,7 +544,7 @@ namespace OpenSim.Region.Framework.Scenes { ArrayList errors; - // Indicate to CreateScriptInstanceInternal() we want it to + // Indicate to CreateScriptInstanceInternal() we want it to // post any compilation/loading error messages lock (m_scriptErrors) { @@ -641,7 +641,7 @@ namespace OpenSim.Region.Framework.Scenes { if (!sceneObjectBeingDeleted) m_part.RemoveScriptEvents(itemId); - + m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemId); m_part.ParentGroup.AddActiveScriptCount(-1); } @@ -650,7 +650,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.WarnFormat( "[PRIM INVENTORY]: " + "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", - itemId, m_part.Name, m_part.UUID, + itemId, m_part.Name, m_part.UUID, m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } } @@ -679,7 +679,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.WarnFormat( "[PRIM INVENTORY]: " + "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", - itemId, m_part.Name, m_part.UUID, + itemId, m_part.Name, m_part.UUID, m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } } @@ -802,11 +802,11 @@ namespace OpenSim.Region.Framework.Scenes m_items.LockItemsForWrite(true); m_items.Add(item.ItemID, item); m_items.LockItemsForWrite(false); - if (allowedDrop) + if (allowedDrop) m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP); else m_part.TriggerScriptChangedEvent(Changed.INVENTORY); - + m_inventorySerial++; //m_inventorySerial += 2; HasInventoryChanged = true; @@ -887,7 +887,7 @@ namespace OpenSim.Region.Framework.Scenes if (null == rezAsset) { m_log.WarnFormat( - "[PRIM INVENTORY]: Could not find asset {0} for inventory item {1} in {2}", + "[PRIM INVENTORY]: Could not find asset {0} for inventory item {1} in {2}", item.AssetID, item.Name, m_part.Name); objlist = null; veclist = null; @@ -895,7 +895,7 @@ namespace OpenSim.Region.Framework.Scenes offsetHeight = 0; return false; } - + bool single = m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight); for (int i = 0; i < objlist.Count; i++) @@ -985,7 +985,7 @@ namespace OpenSim.Region.Framework.Scenes return true; } - + /// /// Update an existing inventory item. /// @@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_items.ContainsKey(item.ItemID)) { // m_log.DebugFormat("[PRIM INVENTORY]: Updating item {0} in {1}", item.Name, m_part.Name); - + item.ParentID = m_part.UUID; item.ParentPartID = m_part.UUID; @@ -1025,7 +1025,7 @@ namespace OpenSim.Region.Framework.Scenes m_inventorySerial++; if (fireScriptEvents) m_part.TriggerScriptChangedEvent(Changed.INVENTORY); - + if (considerChanged) { HasInventoryChanged = true; @@ -1039,7 +1039,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.ErrorFormat( "[PRIM INVENTORY]: " + "Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", - item.ItemID, m_part.Name, m_part.UUID, + item.ItemID, m_part.Name, m_part.UUID, m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } m_items.LockItemsForWrite(false); @@ -1084,7 +1084,7 @@ namespace OpenSim.Region.Framework.Scenes } } m_items.LockItemsForRead(false); - + if (scriptcount <= 0) { @@ -1381,7 +1381,7 @@ namespace OpenSim.Region.Framework.Scenes item.CurrentPermissions = perms; item.BasePermissions = perms; } - + m_inventorySerial++; HasInventoryChanged = true; } @@ -1485,7 +1485,7 @@ namespace OpenSim.Region.Framework.Scenes return ret; } - + public Dictionary GetScriptStates() { return GetScriptStates(false); @@ -1493,13 +1493,13 @@ namespace OpenSim.Region.Framework.Scenes public Dictionary GetScriptStates(bool oldIDs) { - Dictionary ret = new Dictionary(); - + Dictionary ret = new Dictionary(); + if (m_part.ParentGroup.Scene == null) // Group not in a scene return ret; - + IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces(); - + if (engines.Length == 0) // No engine at all return ret; @@ -1535,7 +1535,7 @@ namespace OpenSim.Region.Framework.Scenes } return ret; } - + public void ResumeScripts() { IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c1b1a63..29e139b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -108,8 +108,8 @@ namespace OpenSim.Region.Framework.Scenes /// The current state of this presence. Governs only the existence lifecycle. See ScenePresenceStateMachine /// for more details. /// - public ScenePresenceState LifecycleState - { + public ScenePresenceState LifecycleState + { get { return m_stateMachine.GetState(); @@ -126,7 +126,7 @@ namespace OpenSim.Region.Framework.Scenes /// the viewer fires these in quick succession. /// /// - /// TODO: The child -> agent transition should be folded into LifecycleState and the CompleteMovement + /// TODO: The child -> agent transition should be folded into LifecycleState and the CompleteMovement /// regulation done there. /// private object m_completeMovementLock = new object(); @@ -134,7 +134,7 @@ namespace OpenSim.Region.Framework.Scenes // private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes(); private static readonly Array DIR_CONTROL_FLAGS = Enum.GetValues(typeof(Dir_ControlFlags)); private static readonly Vector3 HEAD_ADJUSTMENT = new Vector3(0f, 0f, 0.3f); - + /// /// Experimentally determined "fudge factor" to make sit-target positions /// the same as in SecondLife. Fudge factor was tested for 36 different @@ -241,7 +241,7 @@ namespace OpenSim.Region.Framework.Scenes return m_currentParcelHide; } } - + /// /// The animator for this avatar /// @@ -356,7 +356,7 @@ namespace OpenSim.Region.Framework.Scenes protected bool m_reprioritizationBusy; protected Vector3 m_reprioritizationLastPosition; protected float m_reprioritizationLastDrawDistance; - + private Quaternion m_headrotation = Quaternion.Identity; //PauPaw:Proper PID Controler for autopilot************ @@ -377,7 +377,7 @@ namespace OpenSim.Region.Framework.Scenes //private bool m_collisionEventFlag = false; private object m_collisionEventLock = new Object(); - + private int m_movementAnimationUpdateCounter = 0; public Vector3 PrevSitOffset { get; set; } @@ -424,7 +424,7 @@ namespace OpenSim.Region.Framework.Scenes DIR_CONTROL_FLAG_UP_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_POS, DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG } - + /// /// Position at which a significant movement was made /// @@ -528,7 +528,7 @@ namespace OpenSim.Region.Framework.Scenes m_rootRegionHandle = value; // position rounded to lower multiple of 256m m_rootRegionPosition.X = (float)((m_rootRegionHandle >> 32) & 0xffffff00); - m_rootRegionPosition.Y = (float)(m_rootRegionHandle & 0xffffff00); + m_rootRegionPosition.Y = (float)(m_rootRegionHandle & 0xffffff00); } } @@ -562,7 +562,7 @@ namespace OpenSim.Region.Framework.Scenes return a; } } - #endregion + #endregion public string Firstname { get; private set; } public string Lastname { get; private set; } @@ -603,7 +603,7 @@ namespace OpenSim.Region.Framework.Scenes public bool AllowMovement { get; set; } private bool m_setAlwaysRun; - + public bool SetAlwaysRun { get @@ -689,7 +689,7 @@ namespace OpenSim.Region.Framework.Scenes return rootPart.AbsolutePosition + (m_pos * rootPart.GetWorldRotation()); } } - + return m_pos; } set @@ -777,7 +777,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[SCENE PRESENCE]: In {0} set velocity of {1} to {2}", -// Scene.RegionInfo.RegionName, Name, m_velocity); +// Scene.RegionInfo.RegionName, Name, m_velocity); } } @@ -821,9 +821,9 @@ namespace OpenSim.Region.Framework.Scenes /// public Quaternion Rotation { - get - { - return m_bodyRot; + get + { + return m_bodyRot; } set @@ -963,10 +963,10 @@ namespace OpenSim.Region.Framework.Scenes } DropOldNeighbours(old); - + if (Scene.CapsModule != null) Scene.CapsModule.SetChildrenSeed(UUID, seeds); -*/ +*/ KnownRegions = seeds; //m_log.Debug(" ++++++++++AFTER+++++++++++++ "); //DumpKnownRegions(); @@ -991,13 +991,13 @@ namespace OpenSim.Region.Framework.Scenes /// /// This signals whether the presence is in transit between neighbouring regions. /// - /// + /// /// It is not set when the presence is teleporting or logging in/out directly to a region. /// public bool IsInTransit { get { return m_inTransit; } - set { + set { if(value) { if (Flying) @@ -1051,14 +1051,14 @@ namespace OpenSim.Region.Framework.Scenes { get { return Util.GetViewerName(m_scene.AuthenticateHandler.GetAgentCircuitData(ControllingClient.CircuitCode)); } } - + #endregion #region Constructor(s) public ScenePresence( IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) - { + { m_scene = world; AttachmentsSyncLock = new Object(); AllowMovement = true; @@ -1092,16 +1092,16 @@ namespace OpenSim.Region.Framework.Scenes // Grouptitle = gm.GetGroupTitle(m_uuid); m_scriptEngines = m_scene.RequestModuleInterfaces(); - + AbsolutePosition = posLastMove = posLastSignificantMove = CameraPosition = m_reprioritizationLastPosition = ControllingClient.StartPos; m_reprioritizationLastDrawDistance = DrawDistance; // disable updates workjobs for now - childUpdatesBusy = true; + childUpdatesBusy = true; m_reprioritizationBusy = true; - + AdjustKnownSeeds(); RegisterToClientEvents(); @@ -1189,7 +1189,7 @@ namespace OpenSim.Region.Framework.Scenes // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); } - + public void RemoveClientEvents() { ControllingClient.OnCompleteMovementToRegion -= CompleteMovement; @@ -1237,7 +1237,7 @@ namespace OpenSim.Region.Framework.Scenes /// This method is on the critical path for transferring an avatar from one region to another. Delay here /// delays that crossing. /// - + // constants for physics position search const float PhysSearchHeight = 600f; const float PhysMinSkipGap = 50f; @@ -1280,7 +1280,7 @@ namespace OpenSim.Region.Framework.Scenes // if not actually on the target invalidate it if(gotCrossUpdate && (crossingFlags & 0x04) == 0) part.SitTargetAvatar = UUID.Zero; - + ParentID = part.LocalId; ParentPart = part; m_pos = PrevSitOffset; @@ -1380,7 +1380,7 @@ namespace OpenSim.Region.Framework.Scenes int physcount = PhysNumberCollisions; float dist = physTestHeight - groundHeight + localAVHalfHeight; - + Vector3 direction = new Vector3(0f, 0f, -1f); Vector3 RayStart = pos; RayStart.Z = physTestHeight; @@ -1426,7 +1426,7 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition = pos; // m_log.DebugFormat( -// "Set pos {0}, vel {1} in {1} to {2} from input position of {3} on MakeRootAgent", +// "Set pos {0}, vel {1} in {1} to {2} from input position of {3} on MakeRootAgent", // Name, Scene.Name, AbsolutePosition, pos); // if (m_teleportFlags == TeleportFlags.Default) @@ -1453,8 +1453,8 @@ namespace OpenSim.Region.Framework.Scenes Flying = false; } } - - + + m_log.DebugFormat("[MakeRootAgent] position and physical: {0}ms", Util.EnvironmentTickCountSubtract(ts)); m_scene.SwapRootAgentCount(false); @@ -1519,7 +1519,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[SCENE PRESENCE]: Forcing viewers to update the avatar name for " + Name); UseFakeGroupTitle = true; - + Util.FireAndForget(o => { @@ -1587,7 +1587,7 @@ namespace OpenSim.Region.Framework.Scenes else Animator.ResetAnimations(); - + // m_log.DebugFormat( // "[SCENE PRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", // Name, UUID, m_scene.RegionInfo.RegionName); @@ -1595,7 +1595,7 @@ namespace OpenSim.Region.Framework.Scenes // Don't zero out the velocity since this can cause problems when an avatar is making a region crossing, // depending on the exact timing. This shouldn't matter anyway since child agent positions are not updated. //Velocity = new Vector3(0, 0, 0); - + IsChildAgent = true; m_scene.SwapRootAgentCount(true); RemoveFromPhysicalScene(); @@ -1656,7 +1656,7 @@ namespace OpenSim.Region.Framework.Scenes bool isFlying = Flying; Vector3 vel = Velocity; RemoveFromPhysicalScene(); - + AbsolutePosition = pos; AddToPhysicalScene(isFlying); if (PhysicsActor != null) @@ -1709,7 +1709,7 @@ namespace OpenSim.Region.Framework.Scenes if (IsInTransit) return; - Vector3 pos = AbsolutePosition; + Vector3 pos = AbsolutePosition; if (Appearance.AvatarHeight != 127.0f) pos += new Vector3(0f, 0f, (Appearance.AvatarHeight / 6f)); else @@ -1737,7 +1737,7 @@ namespace OpenSim.Region.Framework.Scenes /// Postive or negative roll amount in radians private void ApplyFlyingRoll(float amount, bool PressingUp, bool PressingDown) { - + float rollAmount = Util.Clamp(m_AngularVelocity.Z + amount, -FLY_ROLL_MAX_RADIANS, FLY_ROLL_MAX_RADIANS); m_AngularVelocity.Z = rollAmount; @@ -1789,7 +1789,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_AngularVelocity.Z > 0) { - + float leftOverToMin = m_AngularVelocity.Z - rollMinRadians; if (amount > leftOverToMin) return -leftOverToMin; @@ -1799,7 +1799,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - + float leftOverToMin = -m_AngularVelocity.Z - rollMinRadians; if (amount > leftOverToMin) return leftOverToMin; @@ -1807,7 +1807,7 @@ namespace OpenSim.Region.Framework.Scenes return amount; } } - + // neighbouring regions we have enabled a child agent in @@ -1943,15 +1943,15 @@ namespace OpenSim.Region.Framework.Scenes private bool WaitForUpdateAgent(IClientAPI client) { // Before the source region executes UpdateAgent - // (which triggers Scene.IncomingUpdateChildAgent(AgentData cAgentData) here in the destination, + // (which triggers Scene.IncomingUpdateChildAgent(AgentData cAgentData) here in the destination, // m_originRegionID is UUID.Zero; after, it's non-Zero. The CompleteMovement sequence initiated from the // viewer (in turn triggered by the source region sending it a TeleportFinish event) waits until it's non-zero // m_updateAgentReceivedAfterTransferEvent.WaitOne(10000); - int count = 50; - UUID originID = UUID.Zero; + int count = 50; + UUID originID = UUID.Zero; lock (m_originRegionIDAccessLock) - originID = m_originRegionID; + originID = m_originRegionID; while (originID.Equals(UUID.Zero) && count-- > 0) @@ -2014,7 +2014,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.InfoFormat( "[SCENE PRESENCE]: Completing movement of {0} into region {1} in position {2}", client.Name, Scene.Name, AbsolutePosition); - + m_inTransit = true; try @@ -2110,7 +2110,7 @@ namespace OpenSim.Region.Framework.Scenes // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); // } - + m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); @@ -2138,7 +2138,7 @@ namespace OpenSim.Region.Framework.Scenes m_currentParcelHide = false; m_currentParcelUUID = UUID.Zero; - // send initial land overlay and parcel + // send initial land overlay and parcel ILandChannel landch = m_scene.LandChannel; if (landch != null) landch.sendClientInitialLandInfo(client); @@ -2193,7 +2193,7 @@ namespace OpenSim.Region.Framework.Scenes // send look and animations to others // if not cached we send greys - // uncomented if will wait till avatar does baking + // uncomented if will wait till avatar does baking //if (cachedbaked) { foreach (ScenePresence p in allpresences) @@ -2292,7 +2292,7 @@ namespace OpenSim.Region.Framework.Scenes { IFriendsModule friendsModule = m_scene.RequestModuleInterface(); if (friendsModule != null) - { + { if(gotCrossUpdate) friendsModule.IsNowRoot(this); else @@ -2331,7 +2331,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - /// + /// private void checkCameraCollision() { @@ -2486,7 +2486,7 @@ namespace OpenSim.Region.Framework.Scenes // The Agent's Draw distance setting // When we get to the point of re-computing neighbors everytime this - // changes, then start using the agent's drawdistance rather than the + // changes, then start using the agent's drawdistance rather than the // region's draw distance. DrawDistance = agentData.Far; @@ -2495,7 +2495,7 @@ namespace OpenSim.Region.Framework.Scenes // FIXME: This does not work as intended because the viewer only sends the lbutton down when the button // is first pressed, not whilst it is held down. If this is required in the future then need to look - // for an AGENT_CONTROL_LBUTTON_UP event and make sure to handle cases where an initial DOWN is not + // for an AGENT_CONTROL_LBUTTON_UP event and make sure to handle cases where an initial DOWN is not // received (e.g. on holding LMB down on the avatar in a viewer). m_leftButtonDown = (flags & AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0; @@ -2549,7 +2549,7 @@ namespace OpenSim.Region.Framework.Scenes if (AllowMovement && !SitGround) { -// m_log.DebugFormat("[SCENE PRESENCE]: Initial body rotation {0} for {1}", agentData.BodyRotation, Name); +// m_log.DebugFormat("[SCENE PRESENCE]: Initial body rotation {0} for {1}", agentData.BodyRotation, Name); bool update_rotation = false; if (agentData.BodyRotation != Rotation) { @@ -2617,7 +2617,7 @@ namespace OpenSim.Region.Framework.Scenes } if (((MovementFlag & (uint)DCF) == 0)) - { + { //m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with {1}", Name, DCF); MovementFlag |= (uint)DCF; update_movementflag = true; @@ -2715,11 +2715,11 @@ namespace OpenSim.Region.Framework.Scenes if (m_AngularVelocity.Z != 0) m_AngularVelocity.Z += CalculateFlyingRollResetToZero(FLY_ROLL_RESET_RADIANS_PER_UPDATE); } - + /* if (Flying && IsColliding && controlland) { - // nesting this check because LengthSquared() is expensive and we don't + // nesting this check because LengthSquared() is expensive and we don't // want to do it every step when flying. if ((Velocity.LengthSquared() <= LAND_VELOCITYMAG_MAX)) StopFlying(); @@ -2730,7 +2730,7 @@ namespace OpenSim.Region.Framework.Scenes else if (IsColliding && agent_control_v3.Z < 0f) agent_control_v3.Z = 0; // else if(AgentControlStopActive %% Velocity.Z <0.01f) - + // m_log.DebugFormat("[SCENE PRESENCE]: MovementFlag {0} for {1}", MovementFlag, Name); @@ -2738,9 +2738,9 @@ namespace OpenSim.Region.Framework.Scenes // which occurs later in the main scene loop // We also need to update if the user rotates their avatar whilst it is slow walking/running (if they // held down AGENT_CONTROL_STOP whilst normal walking/running). However, we do not want to update - // if the user rotated whilst holding down AGENT_CONTROL_STOP when already still (which locks the + // if the user rotated whilst holding down AGENT_CONTROL_STOP when already still (which locks the // avatar location in place). - if (update_movementflag + if (update_movementflag || (update_rotation && DCFlagKeyPressed && (!AgentControlStopActive || MovementFlag != 0))) { @@ -2810,9 +2810,9 @@ namespace OpenSim.Region.Framework.Scenes // The Agent's Draw distance setting // When we get to the point of re-computing neighbors everytime this - // changes, then start using the agent's drawdistance rather than the + // changes, then start using the agent's drawdistance rather than the // region's draw distance. - + DrawDistance = agentData.Far; @@ -2839,7 +2839,7 @@ namespace OpenSim.Region.Framework.Scenes TriggerScenePresenceUpdated(); } - + /// /// Calculate an update to move the presence to the set target. /// @@ -2853,7 +2853,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); bool updated = false; - + Vector3 LocalVectorToTarget3D = MoveToPositionTarget - AbsolutePosition; // m_log.DebugFormat( @@ -3030,11 +3030,11 @@ namespace OpenSim.Region.Framework.Scenes || pos.Y < 0 || pos.Y >= regionSize.Y || pos.Z < 0) return; - + float terrainHeight; Scene targetScene = m_scene; terrainHeight = m_scene.GetGroundHeight(pos.X, pos.Y); - + // dont try to land underground terrainHeight += Appearance.AvatarHeight * 0.5f + 0.2f; @@ -3044,7 +3044,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", // Name, pos, terrainHeight, m_scene.RegionInfo.RegionName); - + if (noFly) Flying = false; else if (pos.Z > terrainHeight || Flying) @@ -3068,7 +3068,7 @@ namespace OpenSim.Region.Framework.Scenes Rotation = Quaternion.CreateFromEulers(angle); // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation); - + Vector3 control = Vector3.Zero; if(HandleMoveToTargetUpdate(1f, ref control)) AddNewMovement(control); @@ -3162,7 +3162,7 @@ namespace OpenSim.Region.Framework.Scenes m_pos = standPos; } - // We need to wait until we have calculated proper stand positions before sitting up the physical + // We need to wait until we have calculated proper stand positions before sitting up the physical // avatar to avoid race conditions. if (PhysicsActor == null) AddToPhysicalScene(false); @@ -3178,7 +3178,7 @@ namespace OpenSim.Region.Framework.Scenes // reset to default sitAnimation sitAnimation = "SIT"; - + // Animator.TrySetMovementAnimation("STAND"); Animator.SetMovementAnimations("STAND"); @@ -3244,7 +3244,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - if (PhysicsSit(part,offset)) // physics engine + if (PhysicsSit(part,offset)) // physics engine return; Vector3 pos = part.AbsolutePosition + offset; @@ -3275,7 +3275,7 @@ namespace OpenSim.Region.Framework.Scenes cameraAtOffset = part.GetCameraAtOffset(); cameraEyeOffset = part.GetCameraEyeOffset(); - + forceMouselook = part.GetForceMouselook(); if (!part.IsRoot) @@ -3398,7 +3398,7 @@ namespace OpenSim.Region.Framework.Scenes if (part == null) return; - Vector3 targetPos = part.GetWorldPosition() + offset * part.GetWorldRotation(); + Vector3 targetPos = part.GetWorldPosition() + offset * part.GetWorldRotation(); if(!CanEnterLandPosition(targetPos)) { ControllingClient.SendAlertMessage(" Sit position on restricted land, try another spot"); @@ -3530,7 +3530,7 @@ namespace OpenSim.Region.Framework.Scenes else { m = r.X * r.X + r.Y * r.Y + r.Z * r.Z + r.W * r.W; - + if (Math.Abs(1.0 - m) > 0.000001) { if(m != 0) @@ -3554,7 +3554,7 @@ namespace OpenSim.Region.Framework.Scenes x = 2 * (r.X * r.Z + r.Y * r.W); y = 2 * (-r.X * r.W + r.Y * r.Z); z = -r.X * r.X - r.Y * r.Y + r.Z * r.Z + r.W * r.W; - Vector3 up = new Vector3((float)x, (float)y, (float)z); + Vector3 up = new Vector3((float)x, (float)y, (float)z); sitOffset = up * Appearance.AvatarHeight * 0.02638f; newPos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT; } @@ -3670,7 +3670,7 @@ namespace OpenSim.Region.Framework.Scenes public void AddNewMovement(Vector3 vec, float thisAddSpeedModifier = 1, bool breaking = false) { // m_log.DebugFormat( - // "[SCENE PRESENCE]: Adding new movement {0} with rotation {1}, thisAddSpeedModifier {2} for {3}", + // "[SCENE PRESENCE]: Adding new movement {0} with rotation {1}, thisAddSpeedModifier {2} for {3}", // vec, Rotation, thisAddSpeedModifier, Name); // rotate from avatar coord space to world @@ -3792,11 +3792,11 @@ namespace OpenSim.Region.Framework.Scenes Math.Abs(dpos.X) > POSITION_LARGETOLERANCE || Math.Abs(dpos.Y) > POSITION_LARGETOLERANCE || Math.Abs(dpos.Z) > POSITION_LARGETOLERANCE || - + ( (Math.Abs(dpos.X) > POSITION_SMALLTOLERANCE || Math.Abs(dpos.Y) > POSITION_SMALLTOLERANCE || Math.Abs(dpos.Z) > POSITION_SMALLTOLERANCE) - && vel.LengthSquared() < LOWVELOCITYSQ + && vel.LengthSquared() < LOWVELOCITYSQ )) { */ @@ -3833,7 +3833,7 @@ namespace OpenSim.Region.Framework.Scenes } // this is diferente from SendTerseUpdateToClient - // this sends bypassing entities updates + // this sends bypassing entities updates public void SendAgentTerseUpdate(ISceneEntity p) { ControllingClient.SendAgentTerseUpdate(p); @@ -3982,7 +3982,7 @@ namespace OpenSim.Region.Framework.Scenes p.SendAppearanceToAgentNF(this); p.SendAnimPackToAgentNF(this); - p.SendAttachmentsToAgentNF(this); + p.SendAttachmentsToAgentNF(this); count++; }); @@ -3991,7 +3991,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Send this agent's avatar data to all other root and child agents in the scene - /// This agent must be root. This avatar will receive its own update. + /// This agent must be root. This avatar will receive its own update. /// public void SendAvatarDataToAllAgents() { @@ -4222,7 +4222,7 @@ namespace OpenSim.Region.Framework.Scenes posLastMove = pos; m_scene.EventManager.TriggerOnClientMovement(this); } - + diff = pos - posLastSignificantMove; if (diff.LengthSquared() > SIGNIFICANT_MOVEMENT) { @@ -4235,18 +4235,18 @@ namespace OpenSim.Region.Framework.Scenes if(childUpdatesBusy) return; - + //possible KnownRegionHandles always contains current region and this check is not needed int minhandles = 0; if(KnownRegionHandles.Contains(RegionHandle)) minhandles++; - if(KnownRegionHandles.Count > minhandles) - { + if(KnownRegionHandles.Count > minhandles) + { int tdiff = Util.EnvironmentTickCountSubtract(lastChildUpdatesTime); if(tdiff > CHILDUPDATES_TIME) { - diff = pos - m_lastChildAgentUpdatePosition; + diff = pos - m_lastChildAgentUpdatePosition; if (diff.LengthSquared() > CHILDUPDATES_MOVEMENT) { childUpdatesBusy = true; @@ -4268,7 +4268,7 @@ namespace OpenSim.Region.Framework.Scenes Util.FireAndForget( o => { - m_scene.SendOutChildAgentUpdates(agentpos, this); + m_scene.SendOutChildAgentUpdates(agentpos, this); lastChildUpdatesTime = Util.EnvironmentTickCount(); childUpdatesBusy = false; }, null, "ScenePresence.SendOutChildAgentUpdates"); @@ -4309,7 +4309,7 @@ namespace OpenSim.Region.Framework.Scenes pos2.Z += vel.Z * timeStep; // m_log.DebugFormat( -// "[SCENE PRESENCE]: Testing border check for projected position {0} of {1} in {2}", +// "[SCENE PRESENCE]: Testing border check for projected position {0} of {1} in {2}", // pos2, Name, Scene.Name); if (Scene.PositionIsInCurrentRegion(pos2)) @@ -4399,7 +4399,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName); // Put the child agent back at the center - AbsolutePosition + AbsolutePosition = new Vector3(((float)m_scene.RegionInfo.RegionSizeX * 0.5f), ((float)m_scene.RegionInfo.RegionSizeY * 0.5f), 70); Animator.ResetAnimations(); @@ -4511,7 +4511,7 @@ namespace OpenSim.Region.Framework.Scenes public void GrantGodlikePowers(UUID token, bool godStatus) { int oldgodlevel = GodLevel; - + if (godStatus && !isNPC && m_scene.Permissions.IsGod(UUID)) { GodLevel = 200; @@ -4519,7 +4519,7 @@ namespace OpenSim.Region.Framework.Scenes GodLevel = UserLevel; } else - GodLevel = 0; + GodLevel = 0; ControllingClient.SendAdminResponse(token, (uint)GodLevel); if(oldgodlevel != GodLevel) @@ -4535,7 +4535,7 @@ namespace OpenSim.Region.Framework.Scenes return; CopyFrom(cAgentData); - + } private static Vector3 marker = new Vector3(-1f, -1f, -1f); @@ -4621,7 +4621,7 @@ namespace OpenSim.Region.Framework.Scenes cAgent.Far = DrawDistance; - // Throttles + // Throttles cAgent.Throttles = ControllingClient.GetThrottlesPacked(1); cAgent.HeadRotation = m_headrotation; @@ -4630,7 +4630,7 @@ namespace OpenSim.Region.Framework.Scenes if (GodLevel > 200 && m_scene.Permissions.IsGod(cAgent.AgentID)) cAgent.GodLevel = (byte)GodLevel; - else + else cAgent.GodLevel = (byte) 0; cAgent.AlwaysRun = SetAlwaysRun; @@ -4640,7 +4640,7 @@ namespace OpenSim.Region.Framework.Scenes cAgent.ParentPart = ParentUUID; cAgent.SitOffset = PrevSitOffset; - + lock (scriptedcontrols) { ControllerData[] controls = new ControllerData[scriptedcontrols.Count]; @@ -4675,7 +4675,7 @@ namespace OpenSim.Region.Framework.Scenes cAgent.CrossingFlags |= 1; } else - cAgent.CrossingFlags = 0; + cAgent.CrossingFlags = 0; if(isCrossUpdate) { @@ -4708,7 +4708,7 @@ namespace OpenSim.Region.Framework.Scenes PrevSitOffset = cAgent.SitOffset; // When we get to the point of re-computing neighbors everytime this - // changes, then start using the agent's drawdistance rather than the + // changes, then start using the agent's drawdistance rather than the // region's draw distance. DrawDistance = cAgent.Far; //DrawDistance = Scene.DefaultDrawDistance; @@ -4727,7 +4727,7 @@ namespace OpenSim.Region.Framework.Scenes m_headrotation = cAgent.HeadRotation; Rotation = cAgent.BodyRotation; - m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; + m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; if (cAgent.GodLevel >200 && m_scene.Permissions.IsGod(cAgent.AgentID)) GodLevel = cAgent.GodLevel; @@ -4738,14 +4738,14 @@ namespace OpenSim.Region.Framework.Scenes Appearance = new AvatarAppearance(cAgent.Appearance); /* - bool isFlying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); + bool isFlying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); if (PhysicsActor != null) { RemoveFromPhysicalScene(); AddToPhysicalScene(isFlying); } -*/ +*/ try { lock (scriptedcontrols) @@ -4800,7 +4800,7 @@ namespace OpenSim.Region.Framework.Scenes ControllingClient.ActiveGroupId = cAgent.ActiveGroupID; ControllingClient.ActiveGroupName = cAgent.ActiveGroupName; Grouptitle = cAgent.ActiveGroupTitle; - ControllingClient.ActiveGroupPowers = + ControllingClient.ActiveGroupPowers = ControllingClient.GetGroupPowers(cAgent.ActiveGroupID); } else @@ -4871,7 +4871,7 @@ namespace OpenSim.Region.Framework.Scenes // m_forceToApplyValid = false; PhysicsScene scene = m_scene.PhysicsScene; - Vector3 pVec = AbsolutePosition; + Vector3 pVec = AbsolutePosition; PhysicsActor = scene.AddAvatar( LocalId, Firstname + "." + Lastname, pVec, @@ -5007,7 +5007,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - + } } @@ -5040,13 +5040,13 @@ namespace OpenSim.Region.Framework.Scenes { // Clear known regions KnownRegions = new Dictionary(); - + // I don't get it but mono crashes when you try to dispose of this timer, // unsetting the elapsed callback should be enough to allow for cleanup however. - // m_reprioritizationTimer.Dispose(); + // m_reprioritizationTimer.Dispose(); RemoveFromPhysicalScene(); - + m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd; RemoveClientEvents(); @@ -5106,7 +5106,7 @@ namespace OpenSim.Region.Framework.Scenes } } } - + return attachments; } @@ -5269,7 +5269,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectGroup sog in m_attachments) { SendAttachmentFullUpdateToAgentNF(sog, p); - } + } } } @@ -5689,14 +5689,14 @@ namespace OpenSim.Region.Framework.Scenes return; if(objectID == m_scene.RegionInfo.RegionID) // for all objects { - + } else { SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); if(part != null) { - + } } } @@ -5759,7 +5759,7 @@ namespace OpenSim.Region.Framework.Scenes return; ScriptControlled allflags = ScriptControlled.CONTROL_ZERO; - + if (MouseDown) { allflags = LastCommands & (ScriptControlled.CONTROL_ML_LBUTTON | ScriptControlled.CONTROL_LBUTTON); @@ -5769,35 +5769,35 @@ namespace OpenSim.Region.Framework.Scenes MouseDown = true; } } - + if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_DOWN) != 0) { allflags |= ScriptControlled.CONTROL_ML_LBUTTON; MouseDown = true; } - + if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0) { allflags |= ScriptControlled.CONTROL_LBUTTON; MouseDown = true; } - + // find all activated controls, whether the scripts are interested in them or not if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0) { allflags |= ScriptControlled.CONTROL_FWD; } - + if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) != 0) { allflags |= ScriptControlled.CONTROL_BACK; } - + if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_POS) != 0) { allflags |= ScriptControlled.CONTROL_UP; } - + if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0) { allflags |= ScriptControlled.CONTROL_DOWN; @@ -5807,17 +5807,17 @@ namespace OpenSim.Region.Framework.Scenes { allflags |= ScriptControlled.CONTROL_LEFT; } - + if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) != 0) { allflags |= ScriptControlled.CONTROL_RIGHT; } - + if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0) { allflags |= ScriptControlled.CONTROL_ROT_RIGHT; } - + if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0) { allflags |= ScriptControlled.CONTROL_ROT_LEFT; @@ -5830,7 +5830,7 @@ namespace OpenSim.Region.Framework.Scenes { UUID scriptUUID = kvp.Key; ScriptControllers scriptControlData = kvp.Value; - + ScriptControlled localHeld = allflags & scriptControlData.eventControls; // the flags interesting for us ScriptControlled localLast = LastCommands & scriptControlData.eventControls; // the activated controls in the last cycle ScriptControlled localChange = localHeld ^ localLast; // the changed bits @@ -5842,7 +5842,7 @@ namespace OpenSim.Region.Framework.Scenes } } } - + LastCommands = allflags; } } @@ -5885,7 +5885,7 @@ namespace OpenSim.Region.Framework.Scenes } // returns true it local teleport allowed and sets the destiny position into pos - + private bool CheckLocalTPLandingPoint(ref Vector3 pos) { // Never constrain lures @@ -5930,7 +5930,7 @@ namespace OpenSim.Region.Framework.Scenes spawnPos = spawnPoints[0].GetLocation(hubPos, hubRot); spawnDistSQ = Vector3.DistanceSquared(spawnPos, pos); - float testDistSQ; + float testDistSQ; Vector3 testSpawnPos; for(int i = 1; i< spawnPoints.Length; i++) { @@ -5960,7 +5960,7 @@ namespace OpenSim.Region.Framework.Scenes ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); - if (land.LandData.LandingType != (byte)LandingType.LandingPoint + if (land.LandData.LandingType != (byte)LandingType.LandingPoint || land.LandData.OwnerID == m_uuid) return true; @@ -5978,7 +5978,7 @@ namespace OpenSim.Region.Framework.Scenes return true; } - const TeleportFlags TeleHubTPFlags = TeleportFlags.ViaLogin + const TeleportFlags TeleHubTPFlags = TeleportFlags.ViaLogin | TeleportFlags.ViaHGLogin | TeleportFlags.ViaLocation; private bool CheckAndAdjustTelehub(SceneObjectGroup telehub, ref Vector3 pos, ref bool positionChanged) @@ -6011,7 +6011,7 @@ namespace OpenSim.Region.Framework.Scenes bool selected = false; bool validhub = false; Vector3 spawnPosition; - + Quaternion teleHubRotation = telehub.GroupRotation; switch(m_scene.SpawnPointRouting) @@ -6033,14 +6033,14 @@ namespace OpenSim.Region.Framework.Scenes if(tries <= 0) goto case "sequence"; - + pos = spawnPosition; return true; case "sequence": tries = spawnPoints.Length; - selected = false; - validhub = false; + selected = false; + validhub = false; do { index = m_scene.SpawnPoint(); @@ -6092,7 +6092,7 @@ namespace OpenSim.Region.Framework.Scenes closest = i; } - if(!validhub) + if(!validhub) return false; if(closest < 0) @@ -6437,28 +6437,28 @@ namespace OpenSim.Region.Framework.Scenes } private void TeleportFlagsDebug() { - + // Some temporary debugging help to show all the TeleportFlags we have... bool HG = false; if((m_teleportFlags & TeleportFlags.ViaHGLogin) == TeleportFlags.ViaHGLogin) HG = true; - + m_log.InfoFormat("[SCENE PRESENCE]: TELEPORT ******************"); - + uint i = 0u; for (int x = 0; x <= 30 ; x++, i = 1u << x) { i = 1u << x; - + if((m_teleportFlags & (TeleportFlags)i) == (TeleportFlags)i) if (HG == false) m_log.InfoFormat("[SCENE PRESENCE]: Teleport Flags include {0}", ((TeleportFlags) i).ToString()); else m_log.InfoFormat("[SCENE PRESENCE]: HG Teleport Flags include {0}", ((TeleportFlags)i).ToString()); } - + m_log.InfoFormat("[SCENE PRESENCE]: TELEPORT ******************"); - + } private void parcelGodCheck(UUID currentParcelID, bool isGod) @@ -6509,7 +6509,7 @@ namespace OpenSim.Region.Framework.Scenes // those on not on parcel see me if (currentParcelID != p.currentParcelUUID) - { + { viewsToSendto.Add(p); // they see me } } @@ -6584,7 +6584,7 @@ namespace OpenSim.Region.Framework.Scenes } } allpresences.Clear(); - } // now on a private parcel end + } // now on a private parcel end else { diff --git a/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs b/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs index cae7fe5..e7b09ea 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Framework.Scenes /// Running => PreRemove, Removing /// PreRemove => Running, Removing /// Removing => Removed - /// + /// /// All other methods should only see the scene presence in running state - this is the normal operational state /// Removed state occurs when the presence has been removed. This is the end state with no exit. /// @@ -89,13 +89,13 @@ namespace OpenSim.Region.Framework.Scenes else if (newState == ScenePresenceState.PreRemove && m_state == ScenePresenceState.Running) transitionOkay = true; else if (newState == ScenePresenceState.Removing) - { + { if (m_state == ScenePresenceState.Running || m_state == ScenePresenceState.PreRemove) transitionOkay = true; } else if (newState == ScenePresenceState.Removed && m_state == ScenePresenceState.Removing) transitionOkay = true; - } + } if (!transitionOkay) { diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index 998789d..7f7977e 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs @@ -68,54 +68,54 @@ namespace OpenSim.Region.Framework.Scenes.Serialization /// /// public static string ToXml(CoalescedSceneObjects coa, bool doScriptStates) - { + { using (StringWriter sw = new StringWriter()) { using (XmlTextWriter writer = new XmlTextWriter(sw)) - { + { Vector3 size; - + List coaObjects = coa.Objects; - + // m_log.DebugFormat( -// "[COALESCED SCENE OBJECTS SERIALIZER]: Writing {0} objects for coalesced object", +// "[COALESCED SCENE OBJECTS SERIALIZER]: Writing {0} objects for coalesced object", // coaObjects.Count); - + // This is weak - we're relying on the set of coalesced objects still being identical Vector3[] offsets = coa.GetSizeAndOffsets(out size); writer.WriteStartElement("CoalescedObject"); - + writer.WriteAttributeString("x", size.X.ToString()); writer.WriteAttributeString("y", size.Y.ToString()); - writer.WriteAttributeString("z", size.Z.ToString()); - + writer.WriteAttributeString("z", size.Z.ToString()); + // Embed the offsets into the group XML for (int i = 0; i < coaObjects.Count; i++) { SceneObjectGroup obj = coaObjects[i]; - + // m_log.DebugFormat( -// "[COALESCED SCENE OBJECTS SERIALIZER]: Writing offset for object {0}, {1}", -// i, obj.Name); - +// "[COALESCED SCENE OBJECTS SERIALIZER]: Writing offset for object {0}, {1}", +// i, obj.Name); + writer.WriteStartElement("SceneObjectGroup"); writer.WriteAttributeString("offsetx", offsets[i].X.ToString()); writer.WriteAttributeString("offsety", offsets[i].Y.ToString()); writer.WriteAttributeString("offsetz", offsets[i].Z.ToString()); - + SceneObjectSerializer.ToOriginalXmlFormat(obj, writer, doScriptStates); - + writer.WriteEndElement(); // SceneObjectGroup - } - + } + writer.WriteEndElement(); // CoalescedObject } string output = sw.ToString(); - + // Console.WriteLine(output); - + return output; } } @@ -123,14 +123,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization public static bool TryFromXml(string xml, out CoalescedSceneObjects coa) { // m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml); - + coa = null; - + try { // Quickly check if this is a coalesced object, without fully parsing the XML using (StringReader sr = new StringReader(xml)) - { + { using (XmlTextReader reader = new XmlTextReader(sr)) { reader.MoveToContent(); // skip possible xml declaration @@ -138,9 +138,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (reader.Name != "CoalescedObject") { // m_log.DebugFormat( - // "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false", + // "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false", // reader.Name); - + return false; } } @@ -151,12 +151,12 @@ namespace OpenSim.Region.Framework.Scenes.Serialization XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); if (e == null) return false; - + coa = new CoalescedSceneObjects(UUID.Zero); XmlNodeList groups = e.SelectNodes("SceneObjectGroup"); int i = 0; - + foreach (XmlNode n in groups) { SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml); @@ -166,10 +166,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization } else { - // XXX: Possibly we should fail outright here rather than continuing if a particular component of the + // XXX: Possibly we should fail outright here rather than continuing if a particular component of the // coalesced object fails to load. m_log.WarnFormat( - "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", + "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", i); } @@ -181,8 +181,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization m_log.Error("[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed ", e); Util.LogFailedXML("[COALESCED SCENE OBJECTS SERIALIZER]:", xml); return false; - } - + } + return true; } } diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 0b7379b..b8d210c 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -107,7 +107,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization part.LinkNum = linkNum; part.TrimPermissions(); } - } + } while (reader.ReadToNextSibling("Part")); } @@ -156,7 +156,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization { ToOriginalXmlFormat(sceneObject, writer, doScriptStates, false); } - + public static string ToOriginalXmlFormat(SceneObjectGroup sceneObject, string scriptedState) { using (StringWriter sw = new StringWriter()) @@ -190,7 +190,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (!noRootElement) writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty); - + writer.WriteStartElement(String.Empty, "RootPart", String.Empty); ToXmlFormat(sceneObject.RootPart, writer); writer.WriteEndElement(); @@ -212,23 +212,23 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (doScriptStates) sceneObject.SaveScriptedState(writer); - + if (!noRootElement) writer.WriteEndElement(); // SceneObjectGroup // m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0}, {1}ms", sceneObject.Name, System.Environment.TickCount - time); - } + } protected static void ToXmlFormat(SceneObjectPart part, XmlTextWriter writer) { SOPToXml2(writer, part, new Dictionary()); } - + public static SceneObjectGroup FromXml2Format(string xmlData) { //m_log.DebugFormat("[SOG]: Starting deserialization of SOG"); //int time = System.Environment.TickCount; - + try { XmlDocument doc = new XmlDocument(); @@ -780,7 +780,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization obj.VehicleParams = vehicle; } } - + private static void ProcessShape(SceneObjectPart obj, XmlReader reader) { List errorNodeNames; @@ -1235,7 +1235,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization { shp.HollowShape = Util.ReadEnum(reader, "HollowShape"); } - + private static void ProcessShpSculptTexture(PrimitiveBaseShape shp, XmlReader reader) { shp.SculptTexture = Util.ReadUUID(reader, "SculptTexture"); @@ -1367,13 +1367,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (sog.RootPart.KeyframeMotion != null) { - Byte[] data = sog.RootPart.KeyframeMotion.Serialize(); + Byte[] data = sog.RootPart.KeyframeMotion.Serialize(); writer.WriteStartElement(String.Empty, "KeyframeMotion", String.Empty); writer.WriteBase64(data, 0, data.Length); writer.WriteEndElement(); } - + writer.WriteEndElement(); } @@ -1438,7 +1438,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization WriteShape(writer, sop.Shape, options); WriteVector(writer, "Scale", sop.Scale); - WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation); + WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation); WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition); WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL); WriteQuaternion(writer, "SitTargetOrientationLL", sop.SitTargetOrientationLL); @@ -1472,7 +1472,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (sop.MediaUrl != null) writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); WriteVector(writer, "AttachedPos", sop.AttachedPos); - + if (sop.DynAttrs.CountNamespaces > 0) { writer.WriteStartElement("DynAttrs"); @@ -1520,7 +1520,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("SoundRadius", sop.SoundRadius.ToString().ToLower()); } writer.WriteElementString("SoundQueueing", sop.SoundQueueing.ToString().ToLower()); - + writer.WriteEndElement(); } diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index c8f525e..bc440fc 100755 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -113,12 +113,12 @@ namespace OpenSim.Region.Framework.Scenes SimSpareMs = 32, SimSleepMs = 33, SimIoPumpTime = 34, - SimPCTSscriptsRun = 35, - SimRegionIdle = 36, // dataserver only - SimRegionIdlePossible = 37, // dataserver only - SimAIStepTimeMS = 38, - SimSkippedSillouet_PS = 39, - SimSkippedCharsPerC = 40, + SimPCTSscriptsRun = 35, + SimRegionIdle = 36, // dataserver only + SimRegionIdlePossible = 37, // dataserver only + SimAIStepTimeMS = 38, + SimSkippedSillouet_PS = 39, + SimSkippedCharsPerC = 40, // extra stats IDs irrelevant, just far from viewer defined ones SimExtraCountStart = 1000, @@ -129,7 +129,7 @@ namespace OpenSim.Region.Framework.Scenes TotalGeoPrim = 1003, TotalMesh = 1004, ThreadCount = 1005, - + SimExtraCountEnd = 1006 } @@ -199,7 +199,7 @@ namespace OpenSim.Region.Framework.Scenes /// private float m_statisticsFPSfactor = 5.0f; private float m_targetFrameTime = 0.1f; - // saved last reported value so there is something available for llGetRegionFPS + // saved last reported value so there is something available for llGetRegionFPS private float lastReportedSimFPS; private float[] lastReportedSimStats = new float[m_statisticExtraArraySize + m_statisticViewerArraySize]; private float m_pfps; @@ -336,7 +336,7 @@ namespace OpenSim.Region.Framework.Scenes { if (!m_scene.Active) return; - + // dont do it if if still been done if(Monitor.TryEnter(m_statsLock)) @@ -367,8 +367,8 @@ namespace OpenSim.Region.Framework.Scenes // factor to consider updates integration time float updateTimeFactor = 1.0f / updateElapsed; - - // scene frame stats + + // scene frame stats float reportedFPS; float physfps; float timeDilation; @@ -393,7 +393,7 @@ namespace OpenSim.Region.Framework.Scenes sleeptime = m_sleeptimeMS; scriptTimeMS = m_scriptTimeMS; totalFrameTime = m_frameMS; - // still not inv + // still not inv invFrameElapsed = (float)((m_FrameStatsTS - m_prevFrameStatsTS) / 1000.0); ResetFrameStats(); @@ -424,10 +424,10 @@ namespace OpenSim.Region.Framework.Scenes } // some engines track frame time with error related to the simulation step size - if(physfps > reportedFPS) + if(physfps > reportedFPS) physfps = reportedFPS; - // save the reported value so there is something available for llGetRegionFPS + // save the reported value so there is something available for llGetRegionFPS lastReportedSimFPS = reportedFPS; // scale frame stats @@ -461,13 +461,13 @@ namespace OpenSim.Region.Framework.Scenes // FIXME: Checking for stat sanity is a complex approach. What we really need to do is fix the code // so that stat numbers are always consistent. - CheckStatSanity(); - + CheckStatSanity(); + for (int i = 0; i < m_statisticViewerArraySize; i++) { sb[i] = new SimStatsPacket.StatBlock(); } - + sb[0].StatID = (uint) Stats.TimeDilation; sb[0].StatValue = (Single.IsNaN(timeDilation)) ? 0.0f : (float)Math.Round(timeDilation,3); @@ -546,13 +546,13 @@ namespace OpenSim.Region.Framework.Scenes sb[24].StatID = (uint)Stats.ResidentSizeKb; sb[24].StatValue = 0; - + sb[25].StatID = (uint)Stats.PendingLocalUploads; sb[25].StatValue = 0; - + sb[26].StatID = (uint)Stats.PhysicsPinnedTasks; sb[26].StatValue = 0; - + sb[27].StatID = (uint)Stats.PhysicsLodTasks; sb[27].StatValue = 0; @@ -623,7 +623,7 @@ namespace OpenSim.Region.Framework.Scenes sbex[5].StatValue = m_inUseThreads; lastReportedSimStats[43] = m_inUseThreads; - SimStats simStats + SimStats simStats = new SimStats( ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, rb, sb, sbex, m_scene.RegionInfo.originRegionID); @@ -643,7 +643,7 @@ namespace OpenSim.Region.Framework.Scenes m_lastReportedExtraSimStats[SlowFramesStat.ShortName] = (float)SlowFramesStat.Value; Dictionary physicsStats = m_scene.PhysicsScene.GetStats(); - + if (physicsStats != null) { foreach (KeyValuePair tuple in physicsStats) @@ -717,7 +717,7 @@ namespace OpenSim.Region.Framework.Scenes m_FrameStatsTS = Util.GetTimeStampMS(); } - } + } private void ResetFrameStats() { diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index 1aa1194..89d78cf 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs @@ -158,7 +158,7 @@ namespace OpenSim.Region.Framework.Scenes { if (Double.IsNaN(value) || Double.IsInfinity(value)) return; - + m_terrainData[x, y] = (float)value; } } @@ -486,7 +486,7 @@ namespace OpenSim.Region.Framework.Scenes int index = 0; m_terrainData = new HeightmapTerrainData(Height, Width, (int)Constants.RegionHeight); - + for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) diff --git a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs index fd65735..9d1f815 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs @@ -400,7 +400,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP block[k++] = (terrData[x, y] - sub) * premult; } } - + wbits = (prequant >> 1); dct16x16(block, iout, ref wbits); @@ -490,22 +490,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region DCT /* DCT (Discrete Cosine Transform) - adaptation from + adaptation from General Purpose 2D,3D FFT (Fast Fourier Transform) Package by Takuya OOURA (email: ooura@kurims.kyoto-u.ac.jp) -------- 16x16 DCT (Discrete Cosine Transform) / Inverse of DCT -------- [definition] Normalized 16x16 IDCT - C[k1 + k2] = (1/8) * sum_j1=0^15 sum_j2=0^15 - tmp[j1 + j2] * s[j1] * s[j2] * - cos(pi*j1*(k1+1/2)/16) * + C[k1 + k2] = (1/8) * sum_j1=0^15 sum_j2=0^15 + tmp[j1 + j2] * s[j1] * s[j2] * + cos(pi*j1*(k1+1/2)/16) * cos(pi*j2*(k2+1/2)/16), 0<=k1<16, 0<=k2<16 (s[0] = 1/sqrt(2), s[j] = 1, j > 0) Normalized 16x16 DCT - C[k1 + k2] = (1/8) * s[k1] * s[k2] * sum_j1=0^15 sum_j2=0^15 - tmp[j1 + j2] * - cos(pi*(j1+1/2)*k1/16) * + C[k1 + k2] = (1/8) * s[k1] * s[k2] * sum_j1=0^15 sum_j2=0^15 + tmp[j1 + j2] * + cos(pi*(j1+1/2)*k1/16) * cos(pi*(j2+1/2)*k2/16), 0<=k1<16, 0<=k2<16 (s[0] = 1/sqrt(2), s[j] = 1, j > 0) */ diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs index da18941..fa698a9 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void T010_AddObjects() { TestHelpers.InMethod(); - + random = new Random(); SceneObjectGroup found; EntityManager entman = new EntityManager(); @@ -62,7 +62,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests UUID obj2 = sog.UUID; uint li2 = sog.LocalId; entman.Add(sog); - + found = (SceneObjectGroup)entman[obj1]; Assert.That(found.UUID ,Is.EqualTo(obj1)); found = (SceneObjectGroup)entman[li1]; @@ -85,15 +85,15 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void T011_ThreadAddRemoveTest() { TestHelpers.InMethod(); - - // This test adds and removes with mutiple threads, attempting to break the + + // This test adds and removes with mutiple threads, attempting to break the // uuid and localid dictionary coherence. EntityManager entman = new EntityManager(); SceneObjectGroup sog = NewSOG(); for (int j=0; j<20; j++) { List trdlist = new List(); - + for (int i=0; i<4; i++) { // Adds scene object @@ -101,14 +101,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests Thread start = new Thread(new ThreadStart(test.TestAddSceneObject)); start.Start(); trdlist.Add(start); - + // Removes it test = new NewTestThreads(entman,sog); start = new Thread(new ThreadStart(test.TestRemoveSceneObject)); start.Start(); trdlist.Add(start); } - foreach (Thread thread in trdlist) + foreach (Thread thread in trdlist) { thread.Join(); } @@ -133,14 +133,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectGroup sog = new SceneObjectGroup(sop); scene.AddNewSceneObject(sog, false); - + return sog; } - + private static string RandomName() { StringBuilder name = new StringBuilder(); - int size = random.Next(40,80); + int size = random.Next(40,80); char ch ; for (int i=0; i /// Test deleting an object from a scene. /// @@ -205,10 +205,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(retrievedPart, Is.Null); } - + /// /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not - /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by + /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by /// OpenSim. /// [Test] @@ -218,24 +218,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); string childPartName = "childPart"; UUID childPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); - + SceneObjectPart rootPart - = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = rootPartName, UUID = rootPartUuid }; SceneObjectPart linkPart - = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = childPartName, UUID = childPartUuid }; SceneObjectGroup sog = new SceneObjectGroup(rootPart); sog.AddPart(linkPart); - + Assert.That(sog.UUID, Is.EqualTo(rootPartUuid)); Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid)); Assert.That(sog.Parts.Length, Is.EqualTo(2)); - + UUID newRootPartUuid = new UUID("00000000-0000-0000-0000-000000000002"); sog.UUID = newRootPartUuid; - + Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid)); Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); Assert.That(sog.Parts.Length, Is.EqualTo(2)); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs index dc3b717..c27bc1a 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs @@ -87,7 +87,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; + sogd.Enabled = false; SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", ua.PrincipalID); uint soLocalId = so.LocalId; @@ -119,11 +119,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Check that object is still there. SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); - Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(retrievedPart2, Is.Not.Null); Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); // Check that we have a copy in inventory - InventoryItemBase item + InventoryItemBase item = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Lost And Found/so1"); Assert.That(item, Is.Not.Null); } @@ -145,7 +145,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; + sogd.Enabled = false; SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", ua.PrincipalID); uint soLocalId = so.LocalId; @@ -168,11 +168,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Check that object is still there. SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); - Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(retrievedPart2, Is.Not.Null); Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); // Check that we do not have a copy in inventory - InventoryItemBase item + InventoryItemBase item = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Lost And Found/so1"); Assert.That(item, Is.Null); } @@ -194,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; + sogd.Enabled = false; SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", TestHelpers.ParseTail(0x2)); uint soLocalId = so.LocalId; @@ -219,11 +219,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Check that object is still there. SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); - Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(retrievedPart2, Is.Not.Null); Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); // Check that we have a copy in inventory - InventoryItemBase item + InventoryItemBase item = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); Assert.That(item, Is.Not.Null); } @@ -245,7 +245,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; + sogd.Enabled = false; SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", TestHelpers.ParseTail(0x2)); uint soLocalId = so.LocalId; @@ -272,11 +272,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests sogd.InventoryDeQueueAndDelete(); // Check that object is still there. SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); - Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(retrievedPart2, Is.Not.Null); Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); // Check that we have a copy in inventory - InventoryItemBase item + InventoryItemBase item = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); Assert.That(item, Is.Null); } @@ -303,11 +303,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests sogd.InventoryDeQueueAndDelete(); // Check that object is still there. SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); - Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(retrievedPart2, Is.Not.Null); Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); // Check that we have a copy in inventory - InventoryItemBase item + InventoryItemBase item = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); Assert.That(item, Is.Null); } @@ -334,11 +334,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests sogd.InventoryDeQueueAndDelete(); // Check that object is still there. SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); - Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(retrievedPart2, Is.Not.Null); Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); // Check that we have a copy in inventory - InventoryItemBase item + InventoryItemBase item = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); Assert.That(item, Is.Null); } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs index 4a98746..e1e973c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs @@ -98,7 +98,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // crossing is async Thread.Sleep(500); - + Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id)); Assert.NotNull(sceneB.GetSceneObjectGroup(so1Id)); } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index f0debd0..b84ecac 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -77,19 +77,19 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestDeRezSceneObject() { TestHelpers.InMethod(); - + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); - + TestScene scene = new SceneHelpers().SetupScene(); IConfigSource configSource = new IniConfigSource(); IConfig config = configSource.AddConfig("Startup"); config.Set("serverside_object_permissions", true); SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; - + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; + sogd.Enabled = false; SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", userId); uint soLocalId = so.LocalId; @@ -104,9 +104,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); sogd.InventoryDeQueueAndDelete(); - + // SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); - Assert.That(retrievedPart, Is.Null); + Assert.That(retrievedPart, Is.Null); } /// @@ -154,48 +154,48 @@ namespace OpenSim.Region.Framework.Scenes.Tests sceneA.DeleteSceneObject(so, false); } - + /// /// Test deleting an object from a scene where the deleter is not the owner /// /// - /// This test assumes that the deleter is not a god. + /// This test assumes that the deleter is not a god. /// [Test] public void TestDeRezSceneObjectNotOwner() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); - + TestScene scene = new SceneHelpers().SetupScene(); IConfigSource configSource = new IniConfigSource(); IConfig config = configSource.AddConfig("Startup"); config.Set("serverside_object_permissions", true); - SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); + SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; - + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; - + sogd.Enabled = false; + SceneObjectPart part = new SceneObjectPart(objectOwnerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); part.Name = "obj1"; scene.AddNewSceneObject(new SceneObjectGroup(part), false); List localIds = new List(); - localIds.Add(part.LocalId); + localIds.Add(part.LocalId); scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); sogd.InventoryDeQueueAndDelete(); - + // Object should still be in the scene. SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); - } - + } + /// /// Test deleting an object asynchronously to user inventory. /// @@ -211,7 +211,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests TestScene scene = new SceneHelpers().SetupScene(); IConfigSource configSource = new IniConfigSource(); - IConfig config = configSource.AddConfig("Modules"); + IConfig config = configSource.AddConfig("Modules"); config.Set("InventoryAccessModule", "BasicInventoryAccessModule"); SceneHelpers.SetupSceneModules( scene, configSource, new object[] { new BasicInventoryAccessModule() }); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 1718734..41f61ac 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs @@ -66,8 +66,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestLinkDelink2SceneObjects() { TestHelpers.InMethod(); - - bool debugtest = false; + + bool debugtest = false; Scene scene = new SceneHelpers().SetupScene(); SceneObjectGroup grp1 = SceneHelpers.AddSceneObject(scene); @@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // <180,0,0> grp2.UpdateGroupRotationR(Quaternion.CreateFromEulers(180 * Utils.DEG_TO_RAD, 0, 0)); - + // Required for linking grp1.RootPart.ClearUpdateSchedule(); grp2.RootPart.ClearUpdateSchedule(); @@ -111,7 +111,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests } // root part should have no offset position or rotation - Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, + Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, "root part should have no offset position or rotation"); // offset position should be root part position - part2.absolute position. @@ -125,13 +125,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests // There's a euler anomoly at 180, 0, 0 so expect 180 to turn into -180. part1.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); Vector3 rotEuler1 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); - + if (debugtest) m_log.Debug(rotEuler1); part2.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); Vector3 rotEuler2 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); - + if (debugtest) m_log.Debug(rotEuler2); @@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestLinkDelink2groups4SceneObjects() { TestHelpers.InMethod(); - + bool debugtest = false; Scene scene = new SceneHelpers().SetupScene(); @@ -194,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Link grp4 to grp3. grp3.LinkToGroup(grp4); - + // At this point we should have 4 parts total in two groups. Assert.That(grp1.Parts.Length == 2, "Group1 children count should be 2"); Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); @@ -202,7 +202,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(grp3.Parts.Length == 2, "Group3 children count should be 2"); Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); Assert.That(grp4.Parts.Length, Is.EqualTo(0), "Group 4 still contained parts after delink."); - + if (debugtest) { m_log.Debug("--------After Link-------"); @@ -273,13 +273,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(part2.AbsolutePosition == Vector3.Zero, "Badness 1"); Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20), "Badness 2"); Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); - Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) - && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) - && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) + Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) + && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) + && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) && (part4.RotationOffset.W - compareQuaternion.W < 0.00003), "Badness 3"); } - + /// /// Test that a new scene object which is already linked is correctly persisted to the persistence layer. /// @@ -288,37 +288,37 @@ namespace OpenSim.Region.Framework.Scenes.Tests { TestHelpers.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - + TestScene scene = new SceneHelpers().SetupScene(); - + string rootPartName = "rootpart"; UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); string linkPartName = "linkpart"; UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); SceneObjectPart rootPart - = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = rootPartName, UUID = rootPartUuid }; SceneObjectPart linkPart - = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = linkPartName, UUID = linkPartUuid }; SceneObjectGroup sog = new SceneObjectGroup(rootPart); sog.AddPart(linkPart); scene.AddNewSceneObject(sog, true); - + // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked // scene backup thread. scene.Backup(true); - + List storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); - + Assert.That(storedObjects.Count, Is.EqualTo(1)); Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(2)); Assert.That(storedObjects[0].ContainsPart(rootPartUuid)); Assert.That(storedObjects[0].ContainsPart(linkPartUuid)); } - + /// /// Test that a delink of a previously linked object is correctly persisted to the database /// @@ -327,20 +327,20 @@ namespace OpenSim.Region.Framework.Scenes.Tests { TestHelpers.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - + TestScene scene = new SceneHelpers().SetupScene(); - + string rootPartName = "rootpart"; UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); string linkPartName = "linkpart"; UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); SceneObjectPart rootPart - = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = rootPartName, UUID = rootPartUuid }; - + SceneObjectPart linkPart - = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = linkPartName, UUID = linkPartUuid }; SceneObjectGroup linkGroup = new SceneObjectGroup(linkPart); scene.AddNewSceneObject(linkGroup, true); @@ -359,7 +359,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); Assert.IsFalse(groupToDelete.GroupContainsForeignPrims); -/* backup is async +/* backup is async scene.DeleteSceneObject(groupToDelete, false); List storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index ec58a5a..c2c7822 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs @@ -137,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Vector3 childPosition = new Vector3(rootPartPosition + rotatedChildOffsetPosition); SceneObjectPart childPart = so.Parts[1]; - + Assert.That(childPart.AbsolutePosition, Is.EqualTo(childPosition)); Assert.That(childPart.GroupPosition, Is.EqualTo(rootPartPosition)); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs index e98e631..8d88083 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs @@ -71,7 +71,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests m_so1.ScriptSetTemporaryStatus(false); Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.None)); - Assert.That(m_so1.Backup, Is.True); + Assert.That(m_so1.Backup, Is.True); } [Test] @@ -91,7 +91,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests m_so1.ScriptSetPhantomStatus(false); - Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); } [Test] @@ -112,7 +112,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests m_so1.ScriptSetVolumeDetect(false); - Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); } [Test] @@ -152,9 +152,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests m_so1.ScriptSetVolumeDetect(false); - Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics)); + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics)); } - + [Test] public void TestSetPhysicsLinkset() { diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs index a92e364..4ec69cd 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs @@ -53,30 +53,30 @@ namespace OpenSim.Region.Framework.Scenes.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); - + TestScene scene = new SceneHelpers().SetupScene(); IConfigSource configSource = new IniConfigSource(); - + IConfig startupConfig = configSource.AddConfig("Startup"); startupConfig.Set("serverside_object_permissions", true); - - IConfig groupsConfig = configSource.AddConfig("Groups"); + + IConfig groupsConfig = configSource.AddConfig("Groups"); groupsConfig.Set("Enabled", true); - groupsConfig.Set("Module", "GroupsModule"); - groupsConfig.Set("DebugEnabled", true); - + groupsConfig.Set("Module", "GroupsModule"); + groupsConfig.Set("DebugEnabled", true); + SceneHelpers.SetupSceneModules( - scene, configSource, new object[] - { new DefaultPermissionsModule(), - new GroupsModule(), + scene, configSource, new object[] + { new DefaultPermissionsModule(), + new GroupsModule(), new MockGroupsServicesConnector() }); - - IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; - - IGroupsModule groupsModule = scene.RequestModuleInterface(); - + + IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; + + IGroupsModule groupsModule = scene.RequestModuleInterface(); + groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true); } } diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index ada407f..0f386bc 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs @@ -142,7 +142,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Check rest of exepcted parameters. Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null); Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1)); - + Assert.That(sp.IsChildAgent, Is.False); Assert.That(sp.UUID, Is.EqualTo(spUuid)); @@ -262,9 +262,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + // UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); - + TestScene myScene1 = new SceneHelpers().SetupScene("Neighbour y", UUID.Random(), 1000, 1000); TestScene myScene2 = new SceneHelpers().SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); @@ -279,7 +279,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests EventQueueGetModule eqgm2 = new EventQueueGetModule(); SceneHelpers.SetupSceneModules(myScene2, configSource, etm, eqgm2); - + // SceneHelpers.AddScenePresence(myScene1, agent1Id); // ScenePresence childPresence = myScene2.GetScenePresence(agent1); // diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index b8f7458..86500c7 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs @@ -465,7 +465,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests teleportLookAt, (uint)TeleportFlags.ViaLocation); - // FIXME: Not setting up InformClientOfNeighbour on the TestClient means that it does not initiate + // FIXME: Not setting up InformClientOfNeighbour on the TestClient means that it does not initiate // communication with the destination region. But this is a very non-obvious way of doing it - really we // should be forced to expicitly set this up. @@ -627,8 +627,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Both these operations will occur on different threads and will wait for each other. // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1 // test protocol, where we are trying to avoid unpredictable async operations in regression tests. - tc.OnTestClientSendRegionTeleport - += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) + tc.OnTestClientSendRegionTeleport + += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null); sceneA.RequestTeleportLocation( diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTelehubTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTelehubTests.cs index 584a03c..dbb6a37 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTelehubTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTelehubTests.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Must still be possible to successfully log in UUID loggingInUserId = TestHelpers.ParseTail(0x2); - UserAccount ua + UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, "Test", "User", loggingInUserId, "password"); SceneHelpers.AddScenePresence(scene, ua); @@ -107,7 +107,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Must still be possible to successfully log in UUID loggingInUserId = TestHelpers.ParseTail(0x2); - UserAccount ua + UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, "Test", "User", loggingInUserId, "password"); SceneHelpers.AddScenePresence(scene, ua); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index 517faf1..6c0af8f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests uint sizeX = 512; uint sizeY = 512; - Scene scene + Scene scene = new SceneHelpers().SetupScene("scene", regionUuid, 1000, 1000, sizeX, sizeY, new IniConfigSource()); Assert.AreEqual(sizeX, scene.RegionInfo.RegionSizeX); @@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Scene scene = new SceneHelpers().SetupScene(); scene.Update(1); - + Assert.That(scene.Frame, Is.EqualTo(1)); } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs index eeda84f..c74c83f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs @@ -105,7 +105,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // rmcp.LoadModulesFromAddins = false; //// reg.RegisterInterface(rmcp); // rmcp.Initialise(sim); -// rmcp.PostInitialise(); +// rmcp.PostInitialise(); // TypeExtensionNode node = new TypeExtensionNode(); // node. // rmcp.AddNode(node, configSource.Configs["Modules"], new Dictionary>()); @@ -120,9 +120,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests int expectedEventCount = 6; Assert.AreEqual( - expectedEventCount, - co.Count, - "Expected {0} events but only got {1} ({2})", + expectedEventCount, + co.Count, + "Expected {0} events but only got {1} ({2})", expectedEventCount, co.Count, string.Join(",", co)); Assert.AreEqual("Initialise", co[0]); Assert.AreEqual("PostInitialise", co[1]); @@ -137,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests { // FIXME: Should really use MethodInfo public List CallOrder = new List(); - + public string Name { get { return "TestSharedRegion"; } } public Type ReplaceableInterface { get { return null; } } @@ -186,13 +186,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void Initialise() {} - public void Initialise(OpenSimBase sim) + public void Initialise(OpenSimBase sim) { m_openSim = sim; } /// - /// Called when the application loading is completed + /// Called when the application loading is completed /// public void PostInitialise() { @@ -228,8 +228,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests } scene.RegionModules.Clear(); - } - + } + public void AddNode(ISharedRegionModule module) { m_sharedInstances.Add(module); diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 33a630c..8273e32 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + Scene scene = new SceneHelpers().SetupScene(); UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); @@ -78,7 +78,7 @@ namespace OpenSim.Region.Framework.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + Scene scene = new SceneHelpers().SetupScene(); UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); @@ -121,7 +121,7 @@ namespace OpenSim.Region.Framework.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + Scene scene = new SceneHelpers().SetupScene(); UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); @@ -130,18 +130,18 @@ namespace OpenSim.Region.Framework.Tests = TaskInventoryHelpers.AddNotecard( scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); - InventoryFolderBase folder + InventoryFolderBase folder = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; - + // Perform test string message; scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID, out message); - + InventoryItemBase ncUserItem = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Objects/ncItem"); Assert.That(ncUserItem, Is.Not.Null, "Objects/ncItem was not found"); } - + /// /// Test MoveTaskInventoryItem from a part inventory to a user inventory where the item has no parent folder assigned. /// @@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + Scene scene = new SceneHelpers().SetupScene(); UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); @@ -162,11 +162,11 @@ namespace OpenSim.Region.Framework.Tests TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard( scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); - + // Perform test string message; scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID, out message); - + InventoryItemBase ncUserItem = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Notecards/ncItem"); Assert.That(ncUserItem, Is.Not.Null, "Notecards/ncItem was not found"); diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs index 142ad84..58e157c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs @@ -113,7 +113,7 @@ namespace OpenSim.Region.Framework.Tests { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); - + Scene scene = new SceneHelpers().SetupScene(); UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 937c414..4ceebc1 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests { protected IAssetService m_assetService; protected UuidGatherer m_uuidGatherer; - + [SetUp] public void Init() { @@ -55,9 +55,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestCorruptAsset() { TestHelpers.InMethod(); - + UUID corruptAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); - AssetBase corruptAsset + AssetBase corruptAsset = AssetHelpers.CreateAsset(corruptAssetUuid, AssetType.Notecard, "CORRUPT ASSET", UUID.Zero); m_assetService.Store(corruptAsset); @@ -67,7 +67,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests // We count the uuid as gathered even if the asset itself is corrupt. Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(1)); } - + /// /// Test requests made for non-existent assets while we're gathering /// @@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestMissingAsset() { TestHelpers.InMethod(); - + UUID missingAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); m_uuidGatherer.AddForInspection(missingAssetUuid); @@ -89,23 +89,23 @@ namespace OpenSim.Region.Framework.Scenes.Tests { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); - + UUID ownerId = TestHelpers.ParseTail(0x10); UUID embeddedId = TestHelpers.ParseTail(0x20); UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); UUID missingEmbeddedId = TestHelpers.ParseTail(0x22); UUID ncAssetId = TestHelpers.ParseTail(0x30); - AssetBase ncAsset + AssetBase ncAsset = AssetHelpers.CreateNotecardAsset( ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId)); m_assetService.Store(ncAsset); - AssetBase embeddedAsset + AssetBase embeddedAsset = AssetHelpers.CreateNotecardAsset(embeddedId, string.Format("{0} We'll meet again.", secondLevelEmbeddedId)); m_assetService.Store(embeddedAsset); - AssetBase secondLevelEmbeddedAsset + AssetBase secondLevelEmbeddedAsset = AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId, "Don't know where, don't know when."); m_assetService.Store(secondLevelEmbeddedAsset); diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs index 7bbf1bd..8fff38f 100644 --- a/OpenSim/Region/Framework/Scenes/UndoState.cs +++ b/OpenSim/Region/Framework/Scenes/UndoState.cs @@ -46,7 +46,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// bit field with what is changed - /// + /// public UndoState(SceneObjectPart part, ObjectChangeType change) { data = new ObjectChangeData(); @@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes } } /// - /// check if undo or redo is too old + /// check if undo or redo is too old /// public bool checkExpire() @@ -97,8 +97,8 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// true what fiels and related data are equal, False otherwise. - /// - public bool Compare(SceneObjectPart part, ObjectChangeType change) + /// + public bool Compare(SceneObjectPart part, ObjectChangeType change) { if (data.change != change) // if diferent targets, then they are diferent return false; @@ -130,7 +130,7 @@ namespace OpenSim.Region.Framework.Scenes /// executes the undo or redo to a part or its group /// /// - /// + /// public void PlayState(SceneObjectPart part) { @@ -140,7 +140,7 @@ namespace OpenSim.Region.Framework.Scenes if (grp != null) { - grp.doChangeObject(part, data); + grp.doChangeObject(part, data); } part.Undoing = false; } diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 37b91d3..93406cb 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Asset service. /// - public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary()) {} + public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary()) {} /// /// Initializes a new instance of the class. @@ -101,7 +101,7 @@ namespace OpenSim.Region.Framework.Scenes /// Asset service. /// /// - /// Gathered UUIDs will be collected in this dictinaory. + /// Gathered UUIDs will be collected in this dictinaory. /// It can be pre-populated if you want to stop the gatherer from analyzing assets that have already been fetched and inspected. /// public UuidGatherer(IAssetService assetService, IDictionary collector) @@ -128,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes m_assetUuidsToInspect.Enqueue(uuid); return true; } - + /// /// Gather all the asset uuids associated with a given object. /// @@ -194,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception) { m_log.WarnFormat( - "[UUID GATHERER]: Could not check particle system for part {0} {1} in object {2} {3} since it is corrupt. Continuing.", + "[UUID GATHERER]: Could not check particle system for part {0} {1} in object {2} {3} since it is corrupt. Continuing.", part.Name, part.UUID, sceneObject.Name, sceneObject.UUID); } } @@ -205,7 +205,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (TaskInventoryItem tii in taskDictionary.Values) { // m_log.DebugFormat( - // "[ARCHIVER]: Analysing item {0} asset type {1} in {2} {3}", + // "[ARCHIVER]: Analysing item {0} asset type {1} in {2} {3}", // tii.Name, tii.Type, part.Name, part.UUID); if (!GatheredUuids.ContainsKey(tii.AssetID)) @@ -214,19 +214,19 @@ namespace OpenSim.Region.Framework.Scenes // FIXME: We need to make gathering modular but we cannot yet, since gatherers are not guaranteed // to be called with scene objects that are in a scene (e.g. in the case of hg asset mapping and - // inventory transfer. There needs to be a way for a module to register a method without assuming a + // inventory transfer. There needs to be a way for a module to register a method without assuming a // Scene.EventManager is present. // part.ParentGroup.Scene.EventManager.TriggerGatherUuids(part, assetUuids); // still needed to retrieve textures used as materials for any parts containing legacy materials stored in DynAttrs - RecordMaterialsUuids(part); + RecordMaterialsUuids(part); } catch (Exception e) { m_log.ErrorFormat("[UUID GATHERER]: Failed to get part - {0}", e); m_log.DebugFormat( - "[UUID GATHERER]: Texture entry length for prim was {0} (min is 46)", + "[UUID GATHERER]: Texture entry length for prim was {0} (min is 46)", part.Shape.TextureEntry.Length); } } @@ -283,7 +283,7 @@ namespace OpenSim.Region.Framework.Scenes return; try - { + { AssetBase assetBase = GetAsset(assetUuid); if (null != assetBase) @@ -322,14 +322,14 @@ namespace OpenSim.Region.Framework.Scenes m_log.ErrorFormat("[UUID GATHERER]: Failed to gather uuids for asset id {0}", assetUuid); throw; } - } + } private void AddForInspection(UUID assetUuid, sbyte assetType) { // Here, we want to collect uuids which require further asset fetches but mark the others as gathered try - { - if ((sbyte)AssetType.Bodypart == assetType + { + if ((sbyte)AssetType.Bodypart == assetType || (sbyte)AssetType.Clothing == assetType || (sbyte)AssetType.Gesture == assetType || (sbyte)AssetType.Notecard == assetType @@ -347,7 +347,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception) { m_log.ErrorFormat( - "[UUID GATHERER]: Failed to gather uuids for asset id {0}, type {1}", + "[UUID GATHERER]: Failed to gather uuids for asset id {0}, type {1}", assetUuid, assetType); throw; } @@ -511,7 +511,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// private void RecordGestureAssetUuids(AssetBase gestureAsset) - { + { using (MemoryStream ms = new MemoryStream(gestureAsset.Data)) using (StreamReader sr = new StreamReader(ms)) { -- cgit v1.1