From 6ef9d4da901a346c232458317cca6268da888e2e Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 18 Aug 2008 00:39:10 +0000 Subject: Formatting cleanup. --- OpenSim/Region/Application/Application.cs | 2 +- OpenSim/Region/Application/IApplicationPlugin.cs | 2 +- OpenSim/Region/Application/OpenSim.cs | 92 +- OpenSim/Region/Application/OpenSimBase.cs | 50 +- .../Region/ClientStack/LindenUDP/LLClientView.cs | 66 +- .../ClientStack/LindenUDP/LLPacketHandler.cs | 14 +- .../Region/ClientStack/LindenUDP/LLUDPServer.cs | 18 +- .../Region/ClientStack/RegionApplicationBase.cs | 2 +- .../Communications/Local/LocalBackEndServices.cs | 4 +- .../Region/Communications/OGS1/OGS1GridServices.cs | 10 +- .../Region/Communications/OGS1/OGS1UserServices.cs | 10 +- .../Region/Environment/Interfaces/ICommander.cs | 2 - .../Environment/Interfaces/IRegionDataStore.cs | 4 +- .../Environment/Interfaces/ITerrainChannel.cs | 2 +- OpenSim/Region/Environment/ModuleLoader.cs | 2 +- .../TextureDownload/UserTextureDownloadService.cs | 8 +- .../Modules/Avatar/Friends/FriendsModule.cs | 6 +- .../Modules/Avatar/Groups/GroupsModule.cs | 10 +- .../DynamicTexture/DynamicTextureModule.cs | 8 +- .../Modules/Scripting/EMailModules/EmailModule.cs | 52 +- .../Modules/World/Archiver/ArchiveConstants.cs | 22 +- .../Modules/World/Archiver/ArchiveReadRequest.cs | 86 +- .../World/Archiver/ArchiveWriteRequestExecution.cs | 38 +- .../Archiver/ArchiveWriteRequestPreparation.cs | 54 +- .../Modules/World/Archiver/AssetsArchiver.cs | 42 +- .../Modules/World/Archiver/AssetsDearchiver.cs | 46 +- .../Modules/World/Archiver/AssetsRequest.cs | 10 +- .../Modules/World/Archiver/TarArchiveReader.cs | 12 +- .../Modules/World/Archiver/TarArchiveWriter.cs | 6 +- .../Modules/World/Estate/EstateManagementModule.cs | 18 +- .../Modules/World/Land/LandManagementModule.cs | 85 +- .../Environment/Modules/World/Land/LandObject.cs | 4 +- .../Environment/Modules/World/NPC/NPCAvatar.cs | 8 +- .../Modules/World/Permissions/PermissionsModule.cs | 2 +- .../Modules/World/Serialiser/SceneXmlLoader.cs | 14 +- .../Environment/Modules/World/Sun/SunModule.cs | 10 +- .../Modules/World/Terrain/FileLoaders/BMP.cs | 6 +- .../Modules/World/Terrain/FileLoaders/GIF.cs | 6 +- .../Terrain/FileLoaders/GenericSystemDrawing.cs | 12 +- .../Modules/World/Terrain/FileLoaders/JPEG.cs | 10 +- .../Modules/World/Terrain/FileLoaders/LLRAW.cs | 20 +- .../Modules/World/Terrain/FileLoaders/PNG.cs | 6 +- .../Modules/World/Terrain/FileLoaders/RAW32.cs | 14 +- .../Modules/World/Terrain/FileLoaders/TIFF.cs | 6 +- .../Modules/World/Terrain/FileLoaders/Terragen.cs | 10 +- .../Modules/World/Terrain/ITerrainModule.cs | 6 +- .../Modules/World/Terrain/TerrainModule.cs | 16 +- .../Modules/World/WorldMap/MapImageModule.cs | 12 +- .../Modules/World/WorldMap/WorldMapModule.cs | 35 +- OpenSim/Region/Environment/Scenes/EntityBase.cs | 4 +- OpenSim/Region/Environment/Scenes/EventManager.cs | 32 +- OpenSim/Region/Environment/Scenes/InnerScene.cs | 42 +- .../Region/Environment/Scenes/Scene.Inventory.cs | 73 +- OpenSim/Region/Environment/Scenes/Scene.cs | 82 +- .../Scenes/SceneCommunicationService.cs | 8 +- .../Environment/Scenes/SceneExternalChecks.cs | 1571 ++++++++++---------- .../Scenes/SceneObjectGroup.Inventory.cs | 8 +- .../Region/Environment/Scenes/SceneObjectGroup.cs | 78 +- .../Scenes/SceneObjectPart.Inventory.cs | 24 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 98 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 26 +- .../Region/Environment/Scenes/SimStatsReporter.cs | 2 +- OpenSim/Region/Environment/Scenes/UndoState.cs | 8 +- .../Region/Examples/SimpleModule/ComplexObject.cs | 2 - .../Examples/SimpleModule/CpuCounterObject.cs | 2 +- .../BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 2 +- OpenSim/Region/Physics/Manager/IMesher.cs | 1 - OpenSim/Region/Physics/Manager/PhysicsActor.cs | 2 - OpenSim/Region/Physics/Meshing/Extruder.cs | 26 +- OpenSim/Region/Physics/Meshing/HelperTypes.cs | 2 +- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 12 +- OpenSim/Region/Physics/Meshing/SculptMesh.cs | 12 +- OpenSim/Region/Physics/OdePlugin/ODETestClass.cs | 6 +- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 164 +- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 204 +-- OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 24 +- .../AsyncCommandPlugins/Dataserver.cs | 2 +- .../Common/ScriptEngineBase/EventQueueManager.cs | 8 +- .../ScriptEngineBase/EventQueueThreadClass.cs | 2 +- .../ScriptEngine/Common/ScriptServerInterfaces.cs | 2 +- .../DotNetEngine/Compiler/LSL/Compiler.cs | 2 - .../DotNetEngine/Compiler/LSL/YP2CSConverter.cs | 2 +- .../Compiler/YieldProlog/IndexedAnswers.cs | 2 +- .../Compiler/YieldProlog/PrologException.cs | 28 +- .../DotNetEngine/Compiler/YieldProlog/YP.cs | 74 +- .../ScriptEngine/DotNetEngine/ScriptManager.cs | 12 +- .../ScriptEngine/RemoteServer/EventManager.cs | 4 +- .../Shared/Api/Implementation/LSL_Api.cs | 226 +-- .../Api/Implementation/Plugins/Dataserver.cs | 2 +- .../Api/Implementation/Plugins/XmlRequest.cs | 2 +- .../ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | 2 +- .../Api/Runtime/YieldProlog/IndexedAnswers.cs | 2 +- .../Api/Runtime/YieldProlog/PrologException.cs | 28 +- .../Shared/Api/Runtime/YieldProlog/YP.cs | 74 +- .../Region/ScriptEngine/Shared/AssemblyResolver.cs | 4 +- .../ScriptEngine/Shared/CodeTools/Compiler.cs | 2 - .../Shared/CodeTools/LSL2CSConverter.cs | 6 +- .../Shared/CodeTools/YP2CSConverter.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 22 +- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 6 +- 100 files changed, 1983 insertions(+), 2028 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 4df6415..59ac161 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -95,7 +95,7 @@ namespace OpenSim } private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself - + /// /// Global exception handler -- all unhandlet exceptions end up here :) /// diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs index 2e3122f..4fd93e8 100644 --- a/OpenSim/Region/Application/IApplicationPlugin.cs +++ b/OpenSim/Region/Application/IApplicationPlugin.cs @@ -33,7 +33,7 @@ namespace OpenSim { void Initialise(OpenSimBase openSim); } - + public class ApplicationPluginInitialiser : PluginInitialiserBase { private OpenSimBase server; diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4664b0b..cc2d993 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -90,8 +90,8 @@ namespace OpenSim m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid")); m_console = new ConsoleBase("Region", this); - MainConsole.Instance = m_console; - + MainConsole.Instance = m_console; + base.Startup(); //Run Startup Commands @@ -116,9 +116,9 @@ namespace OpenSim PrintFileToConsole("startuplogo.txt"); RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed"); RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving"); - + // For now, start at the 'root' level by default - ChangeSelectedRegion(new string[] {"root"}); + ChangeSelectedRegion(new string[] {"root"}); } private void RunAutoTimerScript(object sender, EventArgs e) @@ -135,7 +135,7 @@ namespace OpenSim { for (int i = 0; i < cmdparams.Length; i++) { - m_log.Info("[EchoTest]: "+cmdparams[i]+""); + m_log.Info("[EchoTest]: "+cmdparams[i]+""); } } @@ -214,7 +214,7 @@ namespace OpenSim { base.RunCmd(command, cmdparams); RunPluginCommands(command , cmdparams); - + switch (command) { case "clear-assets": @@ -255,7 +255,7 @@ namespace OpenSim m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False"); m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); m_console.Notice("export-map [filename] - save image of world map"); - m_console.Notice("force-update - force an update of prims in the scene"); + m_console.Notice("force-update - force an update of prims in the scene"); m_console.Notice("restart - disconnects all clients and restarts the sims in the instance."); m_console.Notice("remove-region [name] - remove a region"); m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)"); @@ -273,14 +273,14 @@ namespace OpenSim m_console.Notice("config set section field value - set a config value"); m_console.Notice("config get section field - get a config value"); m_console.Notice("config save - save OpenSim.ini"); - m_console.Notice("terrain help - show help for terrain commands."); + m_console.Notice("terrain help - show help for terrain commands."); ShowPluginCommandsHelp(CombineParams(cmdparams, 0), m_console); - + if (m_sandbox) { m_console.Notice(""); m_console.Notice("create user - adds a new user."); - } + } break; @@ -314,11 +314,11 @@ namespace OpenSim case "load-oar": LoadOar(cmdparams); break; - + case "save-oar": SaveOar(cmdparams); break; - + case "save-inv": SaveInv(cmdparams); break; @@ -343,13 +343,13 @@ namespace OpenSim break; case "create": - Create(cmdparams); + Create(cmdparams); break; case "create-region": CreateRegion(new RegionInfo(cmdparams[0], "Regions/" + cmdparams[1],false), true); break; - + case "remove-region": string regName = CombineParams(cmdparams, 0); @@ -441,7 +441,7 @@ namespace OpenSim } } break; - + case "modules": if (cmdparams.Length > 0) { @@ -488,7 +488,7 @@ namespace OpenSim m_commsManager.AddInventoryService(cmdparams[0]); } break; - + default: string[] tmpPluginArgs = new string[cmdparams.Length + 1]; cmdparams.CopyTo(tmpPluginArgs, 1); @@ -498,7 +498,7 @@ namespace OpenSim break; } } - + /// /// Change the currently selected region. The selected region is that operated upon by single region commands. /// @@ -515,13 +515,13 @@ namespace OpenSim else { m_console.Error("Usage: change-region "); - } + } - string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); + string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); m_console.Notice(String.Format("Currently selected region is {0}", regionName)); - m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); + m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); } - + /// /// Execute switch for some of the create commands /// @@ -530,7 +530,7 @@ namespace OpenSim { if (args.Length == 0) return; - + switch (args[0]) { case "user": @@ -547,7 +547,7 @@ namespace OpenSim { if (args.Length == 0) return; - + switch (args[0]) { case "packet": @@ -566,7 +566,7 @@ namespace OpenSim } break; - + case "scene": if (args.Length == 4) { @@ -580,11 +580,11 @@ namespace OpenSim bool collisionsOn = !Convert.ToBoolean(args[2]); bool physicsOn = !Convert.ToBoolean(args[3]); m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); - + m_console.Notice( - "CONSOLE", + "CONSOLE", String.Format( - "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", + "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", !scriptingOn, !collisionsOn, !physicsOn)); } } @@ -592,9 +592,9 @@ namespace OpenSim { m_console.Error("debug scene (where inside <> is true/false)"); } - - break; - + + break; + default: m_console.Error("Unknown debug"); break; @@ -666,7 +666,7 @@ namespace OpenSim break; } } - + /// /// Create a new user /// @@ -697,7 +697,7 @@ namespace OpenSim if ( cmdparams.Length < 6 ) regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); - else regY = Convert.ToUInt32(cmdparams[5]); + else regY = Convert.ToUInt32(cmdparams[5]); if (null == m_commsManager.UserService.GetUserProfile(firstName, lastName)) { @@ -706,9 +706,9 @@ namespace OpenSim else { m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); - } + } } - + protected void SaveXml(string[] cmdparams) { m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); @@ -721,8 +721,8 @@ namespace OpenSim { m_sceneManager.SaveCurrentSceneToXml(DEFAULT_PRIM_BACKUP_FILENAME); } - } - + } + protected void LoadXml(string[] cmdparams) { m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); @@ -758,8 +758,8 @@ namespace OpenSim { m_sceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset); } - } - + } + protected void SaveXml2(string[] cmdparams) { if (cmdparams.Length > 0) @@ -771,7 +771,7 @@ namespace OpenSim m_sceneManager.SaveCurrentSceneToXml2(DEFAULT_PRIM_BACKUP_FILENAME); } } - + protected void LoadXml2(string[] cmdparams) { if (cmdparams.Length > 0) @@ -782,8 +782,8 @@ namespace OpenSim { m_sceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME); } - } - + } + /// /// Load a whole region from an opensim archive. /// @@ -800,9 +800,9 @@ namespace OpenSim else { m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); - } + } } - + /// /// Save a region to a file, including all the assets needed to restore it. /// @@ -819,8 +819,8 @@ namespace OpenSim else { m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); - } - } + } + } private static string CombineParams(string[] commandParams, int pos) { @@ -835,7 +835,7 @@ namespace OpenSim /// /// Runs the best matching plugin command - /// + /// /// returns true if a match was found, false otherwise. /// public bool RunPluginCommands(string cmd, string[] withParams) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0ac8cd7..983773a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -70,7 +70,7 @@ namespace OpenSim /// The file used to load and save an opensim archive if no filename has been specified /// protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz"; - + /// /// The file to load and save inventory if no filename has been specified /// @@ -161,7 +161,7 @@ namespace OpenSim m_config = new OpenSimConfigSource(); m_config.Source = new IniConfigSource(); // IConfigSource icong; - + //check for .INI file (either default or name passed in command line) if (File.Exists(Application.iniFilePath)) { @@ -338,7 +338,7 @@ namespace OpenSim protected void LoadPlugins() { - PluginLoader loader = + PluginLoader loader = new PluginLoader (new ApplicationPluginInitialiser (this)); loader.Load ("/OpenSim/Startup"); @@ -351,7 +351,7 @@ namespace OpenSim public override void Startup() { base.Startup(); - + m_stats = StatsManager.StartCollectingSimExtraStats(); // StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false) @@ -586,7 +586,7 @@ namespace OpenSim public void handleRestartRegion(RegionInfo whichRegion) { m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager"); - + // Shutting down the client server bool foundClientServer = false; int clientServerElement = 0; @@ -660,7 +660,7 @@ namespace OpenSim } #endregion - + /// /// Save inventory to a file. /// @@ -668,49 +668,49 @@ namespace OpenSim protected void SaveInv(string[] cmdparams) { m_log.Error("[CONSOLE]: This command has not yet been implemented!"); - + if (cmdparams.Length < 3) { m_log.Error("[CONSOLE]: usage is save-inv []"); return; } - - string firstName = cmdparams[0]; + + string firstName = cmdparams[0]; string lastName = cmdparams[1]; string invPath = cmdparams[2]; //string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME); - + UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(firstName, lastName); if (null == userProfile) { m_log.ErrorFormat("[CONSOLE]: Failed to find user {0} {1}", firstName, lastName); return; - } - + } + CachedUserInfo userInfo = m_commsManager.UserProfileCacheService.GetUserDetails(userProfile.ID); if (null == userInfo) { m_log.ErrorFormat("[CONSOLE]: Failed to find user info for {0} {1} {2}", firstName, lastName, userProfile.ID); return; - } - + } + InventoryFolderImpl inventoryFolder = null; InventoryItemBase inventoryItem = null; - + if (userInfo.HasReceivedInventory) { // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl // itself (possibly at a small loss in efficiency). - string[] components + string[] components = invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); invPath = String.Empty; foreach (string c in components) { invPath += c + InventoryFolderImpl.PATH_DELIMITER; - } - + } + invPath = invPath.Remove(invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); - + // Annoyingly Split actually returns the original string if the input string consists only of delimiters // Therefore if we still start with a / after the split, then we need the root folder if (invPath.StartsWith(InventoryFolderImpl.PATH_DELIMITER)) @@ -718,10 +718,10 @@ namespace OpenSim inventoryFolder = userInfo.RootFolder; } else - { - inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); + { + inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); } - + // The path may point to an item instead if (inventoryFolder == null) { @@ -733,7 +733,7 @@ namespace OpenSim m_log.ErrorFormat("[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}", firstName, lastName, userProfile.ID); return; } - + if (null != inventoryFolder) { m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath); @@ -746,8 +746,8 @@ namespace OpenSim { m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); return; - } - } + } + } /// /// Performs any last-minute sanity checking and shuts down the region server diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b14b3db..3c24fb6 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private RegionHandleRequest handlerRegionHandleRequest = null; // OnRegionHandleRequest private ParcelInfoRequest handlerParcelInfoRequest = null; // OnParcelInfoRequest - + private ScriptAnswer handlerScriptAnswer = null; private RequestPayPrice handlerRequestPayPrice = null; private ObjectDeselect handlerObjectDetach = null; @@ -366,7 +366,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP) - { + { m_moneyBalance = 1000; m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion()); @@ -378,7 +378,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_networkServer = packServer; // m_inventoryCache = inventoryCache; - m_authenticateSessionsHandler = authenSessions; + m_authenticateSessionsHandler = authenSessions; m_agentId = agentId; m_sessionId = sessionId; @@ -404,8 +404,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_clientThread.IsBackground = true; m_clientThread.Start(); ThreadTracker.Add(m_clientThread); - - m_log.Info("[CLIENT]: Started up new thread to handle client UDP session"); + + m_log.Info("[CLIENT]: Started up new thread to handle client UDP session"); } public void SetDebug(int newDebug) @@ -457,9 +457,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void Close(bool shutdownCircuit) { m_log.DebugFormat( - "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", + "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", shutdownCircuit, m_scene.RegionInfo.RegionName); - + m_PacketHandler.Flush(); // raise an event on the packet server to Shutdown the circuit @@ -639,7 +639,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP # endregion protected int m_terrainCheckerCount = 0; - + /// /// Event handler for check client timer /// Checks to ensure that the client is still connected. If the client has failed to respond to many pings @@ -652,15 +652,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_PacketHandler.PacketsReceived == m_PacketHandler.PacketsReceivedReported) { m_probesWithNoIngressPackets++; - if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) + if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) { if (OnConnectionClosed != null) { m_log.WarnFormat( - "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", + "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", Name, AgentId); - + OnConnectionClosed(this); } } @@ -694,7 +694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_clientPingTimer = new Timer(5000); m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); m_clientPingTimer.Enabled = true; - + m_scene.AddNewClient(this, true); } @@ -764,7 +764,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLQueItem item = new LLQueItem(); item.Packet = packet; - + m_PacketHandler.ProcessOutPacket(item); // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to @@ -1091,7 +1091,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int y = 0; y < 16; y++) { // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception - // see http://opensimulator.org/mantis/view.php?id=1662 + // see http://opensimulator.org/mantis/view.php?id=1662 //for (int x = 0; x < 16; x += 4) //{ // SendLayerPacket(map, y, x); @@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// Sends a set of four patches (x, x+1, ..., x+3) to the client /// - /// heightmap + /// heightmap /// X coordinate for patches 0..12 /// Y coordinate for patches 0..15 // private void SendLayerPacket(float[] map, int y, int x) @@ -1147,7 +1147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP LayerDataPacket layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); layerpack.Header.Zerocoded = true; - + OutPacket(layerpack, ThrottleOutPacketType.Land); } catch (Exception e) @@ -1157,7 +1157,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } /// - /// Tell the client that the given neighbour region is ready to receive a child agent. + /// Tell the client that the given neighbour region is ready to receive a child agent. /// /// /// @@ -3405,7 +3405,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } /// - /// + /// /// /// /// @@ -3682,7 +3682,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// returns a byte array of the client set throttles Gets multiplied by the multiplier - /// + /// /// /// non 1 multiplier for subdividing the throttles between individual regions /// @@ -3691,7 +3691,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier); } /// - /// sets the throttles from values supplied by the client + /// sets the throttles from values supplied by the client /// /// public void SetChildAgentThrottle(byte[] throttles) @@ -5291,24 +5291,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.RegionHandleRequest: RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; - + handlerRegionHandleRequest = OnRegionHandleRequest; if (handlerRegionHandleRequest != null) { handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); } break; - + case PacketType.ParcelInfoRequest: ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack; - + handlerParcelInfoRequest = OnParcelInfoRequest; if (handlerParcelInfoRequest != null) { handlerParcelInfoRequest(this, pirPack.Data.ParcelID); } break; - + case PacketType.ParcelAccessListRequest: ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; @@ -6277,10 +6277,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion - - + + #region Camera - + public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary parameters) { SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties); @@ -6292,7 +6292,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP SetFollowCamPropertiesPacket.CameraPropertyBlock block = new SetFollowCamPropertiesPacket.CameraPropertyBlock(); block.Type = pair.Key; block.Value = pair.Value; - + camPropBlock[idx++] = block; } packet.CameraProperty = camPropBlock; @@ -6314,7 +6314,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP reply.ReplyBlock.RegionHandle = handle; OutPacket(reply, ThrottleOutPacketType.Land); } - + public void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) { ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); @@ -6325,16 +6325,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP reply.Data.Desc = Helpers.StringToField(land.Description); reply.Data.ActualArea = land.Area; reply.Data.BillableArea = land.Area; // TODO: what is this? - + // Bit 0: Mature, bit 7: on sale, other bits: no idea reply.Data.Flags = (byte)( ((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + ((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); - + LLVector3 pos = land.UserLocation; if (pos.Equals(LLVector3.Zero)) { - pos = (land.AABBMax + land.AABBMin) * 0.5f; + pos = (land.AABBMax + land.AABBMin) * 0.5f; } reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; @@ -6344,7 +6344,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP reply.Data.Dwell = 0; // TODO: not implemented yet reply.Data.SalePrice = land.SalePrice; reply.Data.AuctionID = (int)land.AuctionID; - + OutPacket(reply, ThrottleOutPacketType.Land); } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 8fe9a7b..8023f58 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // Call the load balancer's hook. If this is not active here // we defer to the sim server this client is actually connected - // to. Packet drop notifies will not be triggered in this + // to. Packet drop notifies will not be triggered in this // configuration! // if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) @@ -282,7 +282,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } } - + private void QueuePacket( Packet packet, ThrottleOutPacketType throttlePacketType, Object id) @@ -303,7 +303,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { int now = System.Environment.TickCount; int lastAck = m_LastAck; - + // Unless we have received at least one ack, don't bother resending // anything. There may not be a client there, don't clog up the // pipes. @@ -558,7 +558,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP PruneDupeTracker(); - // Check for duplicate packets.. packets that the client is + // Check for duplicate packets.. packets that the client is // resending because it didn't receive our ack // lock (m_DupeTracker) @@ -677,7 +677,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_Sequence = info.sequence; } - + public void AddImportantPacket(PacketType type) { if (m_ImportantPackets.Contains(type)) @@ -693,7 +693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_ImportantPackets.Remove(type); } - + private void DropResend(Object id) { foreach (AckData data in new List(m_NeedAck.Values)) @@ -736,7 +736,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (packet.Header.Reliable) { m_UnackedBytes += packet.ToBytes().Length; - m_NeedAck[packet.Header.Sequence] = new AckData(packet, + m_NeedAck[packet.Header.Sequence] = new AckData(packet, item.Identifier); } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 5903661..7c21df2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -213,7 +213,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } BeginReceive(); - + if (packet != null) { try @@ -297,11 +297,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); - // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. + // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. // so therefore.. we've got to tell the server to BeginReceiveFrom again. - // This will happen over and over until we've gone through all packets + // This will happen over and over until we've gone through all packets // sent to and from this particular user. - // Stupid I know.. + // Stupid I know.. // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. } catch (SocketException e) @@ -329,7 +329,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { if (!(packet is UseCircuitCodePacket)) return; - + UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; lock (clientCircuits) { @@ -424,13 +424,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP public virtual void RemoveClientCircuit(uint circuitcode) { EndPoint sendto = null; - if (clientCircuits_reverse.Contains(circuitcode)) + if (clientCircuits_reverse.Contains(circuitcode)) { sendto = (EndPoint)clientCircuits_reverse[circuitcode]; clientCircuits_reverse.Remove(circuitcode); - - lock (clientCircuits) + + lock (clientCircuits) { if (sendto != null) { @@ -442,7 +442,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP "[UDPSERVER]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode); } } - lock (proxyCircuits) + lock (proxyCircuits) { proxyCircuits.Remove(circuitcode); } diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 7a552a6..91f7472 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.ClientStack public override void Startup() { base.Startup(); - + m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString); m_clientStackManager = CreateClientStackManager(); diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 8149bcc..7501967 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -496,13 +496,13 @@ namespace OpenSim.Region.Communications.Local { m_log.DebugFormat("[INTERREGION STANDALONE] requests land data in {0}, at {1}, {2}", regionHandle, x, y); - + if (m_regionListeners.ContainsKey(regionHandle)) { LandData land = m_regionListeners[regionHandle].TriggerGetLandData(x, y); return land; } - + m_log.Debug("[INTERREGION STANDALONE] didn't find land data locally."); return null; } diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 9a4c166..7baaa16 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -139,7 +139,7 @@ namespace OpenSim.Region.Communications.OGS1 try { XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); - + // The timeout should always be significantly larger than the timeout for the grid server to request // the initial status of the region before confirming registration. GridResp = GridReq.Send(serversInfo.GridURL, 90000); @@ -630,7 +630,7 @@ namespace OpenSim.Region.Communications.OGS1 } XmlRpcResponse resp = new XmlRpcResponse(); - + if (banned) { m_log.InfoFormat("[OGS1 GRID SERVICES]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); @@ -645,7 +645,7 @@ namespace OpenSim.Region.Communications.OGS1 m_log.Debug("[CONNECTION DEBUGGING]: Triggering welcome for " + agentData.AgentID.ToString() + " into " + regionHandle.ToString()); m_localBackend.TriggerExpectUser(regionHandle, agentData); m_log.Info("[OGS1 GRID SERVICES]: Welcoming new user..."); - Hashtable respdata = new Hashtable(); + Hashtable respdata = new Hashtable(); respdata["success"] = "TRUE"; resp.Value = respdata; @@ -1638,10 +1638,10 @@ namespace OpenSim.Region.Communications.OGS1 hash["region_handle"] = regionHandle.ToString(); hash["x"] = x.ToString(); hash["y"] = y.ToString(); - + IList paramList = new ArrayList(); paramList.Add(hash); - + // this might be cached, as we probably requested it just a moment ago... RegionInfo info = RequestNeighbourInfo(regionHandle); diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 06a28d0..1d86646 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -252,7 +252,7 @@ namespace OpenSim.Region.Communications.OGS1 IList parameters = new ArrayList(); parameters.Add(param); XmlRpcRequest req = new XmlRpcRequest("logout_of_simulator", parameters); - + try { req.Send(m_parent.NetworkServersInfo.UserURL, 3000); @@ -262,7 +262,7 @@ namespace OpenSim.Region.Communications.OGS1 m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff"); } } - + public UserProfileData GetUserProfile(string firstName, string lastName) { return GetUserProfile(firstName + " " + lastName); @@ -711,7 +711,7 @@ namespace OpenSim.Region.Communications.OGS1 public AvatarAppearance GetUserAppearance(LLUUID user) { AvatarAppearance appearance = null; - + try { Hashtable param = new Hashtable(); @@ -722,14 +722,14 @@ namespace OpenSim.Region.Communications.OGS1 XmlRpcRequest req = new XmlRpcRequest("get_avatar_appearance", parameters); XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000); Hashtable respData = (Hashtable) resp.Value; - + return ConvertXMLRPCDataToAvatarAppearance(respData); } catch (WebException e) { m_log.ErrorFormat("[OGS1 USER SERVICES]: Network problems when trying to fetch appearance for avatar {0}, {1}", user, e.Message); } - + return appearance; } diff --git a/OpenSim/Region/Environment/Interfaces/ICommander.cs b/OpenSim/Region/Environment/Interfaces/ICommander.cs index f2260c3..c4102af 100644 --- a/OpenSim/Region/Environment/Interfaces/ICommander.cs +++ b/OpenSim/Region/Environment/Interfaces/ICommander.cs @@ -27,8 +27,6 @@ namespace OpenSim.Region.Environment.Interfaces { - - public interface ICommander { void ProcessConsoleCommand(string function, string[] args); diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs index ad5983c..4e716a2 100644 --- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); - + /// /// Entirely removes the object, including inventory /// @@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// void RemoveObject(LLUUID uuid, LLUUID regionUUID); - + /// /// Store a prim's inventory /// diff --git a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs index aa34c45..4bcb14b 100644 --- a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs @@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// float[] GetFloatsSerialised(); - + double[,] GetDoubles(); bool Tainted(int x, int y); ITerrainChannel MakeCopy(); diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index 3f8b9ff..09f2dda 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs @@ -320,7 +320,7 @@ namespace OpenSim.Region.Environment public void UnloadModule(IRegionModule rm) { rm.Close(); - + m_loadedModules.Remove(rm); } } diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index 10ef766..e6ee75f 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// True if the service has been closed, probably because a user with texture requests still queued /// logged out. @@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload public void TextureCallback(LLUUID textureID, AssetBase texture) { //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); - + // There may still be texture requests pending for a logged out client if (closed) return; @@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload internal void Close() { closed = true; - + lock (m_textureSenders) { foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) @@ -257,7 +257,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload m_textureSenders.Clear(); } - + // XXX: It might be possible to also remove pending texture requests from the asset cache queues, // though this might also be more trouble than it's worth. } diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index c5a4a96..4a98622 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs @@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends client.OnTerminateFriendship += OnTerminateFriendship; doFriendListUpdateOnline(client.AgentId); - + } private void doFriendListUpdateOnline(LLUUID AgentId) @@ -386,7 +386,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends { m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); - + List updateme = new List(); lock (StoredFriendListUpdates) { @@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); - + //LLUUID[] Agents = new LLUUID[1]; //Agents[0] = msg.toAgentID; diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index a83730e..eaa5013 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; lock (m_groupUUIDGroup) { - + GroupData OpenSimulatorGroup = new GroupData(); OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; OpenSimulatorGroup.GroupID = opensimulatorGroupID; @@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups } } - + lock (m_groupmap) { if (!m_groupmap.ContainsKey(client.AgentId)) @@ -159,8 +159,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups updateGroups[0] = OpenSimulatorGroup; client.SendGroupMembership(updateGroups); - - } private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) @@ -275,6 +273,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups GC.Collect(); } } - - -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs index a3452ab..15ce584 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture SceneObjectPart part = scene.GetSceneObjectPart(PrimID); byte[] assetData; AssetBase oldAsset = null; - + if (BlendWithOldTexture) { LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; @@ -228,7 +228,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture assetData = new byte[data.Length]; Array.Copy(data, assetData, data.Length); } - + // Create a new asset for user AssetBase asset = new AssetBase(); asset.FullID = LLUUID.Random(); @@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture // mostly keep the values from before LLObject.TextureEntry tmptex = part.Shape.Textures; - + // remove the old asset from the cache LLUUID oldID = tmptex.DefaultTexture.TextureID; scene.AssetCache.ExpireAsset(oldID); @@ -298,4 +298,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index 1162c25..bcf3e76 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs @@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { m_Config = config; IConfig SMTPConfig; - + //FIXME: RegionName is correct?? //m_RegionName = scene.RegionInfo.RegionName; IConfig startupConfig = m_Config.Configs["Startup"]; m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); - + //Load SMTP SERVER config try { @@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules m_Enabled = false; return; } - + if (!SMTPConfig.GetBoolean("enabled", false)) { m_log.InfoFormat("[SMTP] module disabled in configuration"); m_Enabled = false; return; } - + m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); - SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); + SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); @@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); } } - + m_log.Info("[EMAIL] Activated DefaultEmailModule"); } } @@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { get { return true; } } - + /// - /// + /// /// /// private void DelayInSeconds(int seconds) @@ -156,11 +156,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); DateTime EndDelay = DateTime.Now.Add(DiffDelay); while (DateTime.Now < EndDelay) - { + { ;//Do nothing!! } } - + private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) { lock (m_Scenes) @@ -187,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { ObjectAbsolutePosition = part.AbsolutePosition.ToString(); ObjectName = part.Name; - ObjectRegionName = m_ObjectRegionName; + ObjectRegionName = m_ObjectRegionName; return; } ObjectAbsolutePosition = part.AbsolutePosition.ToString(); @@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules ObjectRegionName = m_ObjectRegionName; return; } - + /// /// SendMail function utilized by llEMail /// @@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules public void SendEmail(LLUUID objectID, string address, string subject, string body) { //Check if address is empty - if (address == string.Empty) + if (address == string.Empty) return; - + //FIXED:Check the email is correct form in REGEX - string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" - + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" - + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" - + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" + + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" + + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" + + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + @"[a-zA-Z]{2,}))$"; Regex EMailreStrict = new Regex(EMailpatternStrict); bool isEMailStrictMatch = EMailreStrict.IsMatch(address); @@ -226,9 +226,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules if ((subject.Length + body.Length) > 1024) { m_log.Error("[EMAIL] subject + body > 1024 Byte"); - return; + return; } - + try { string LastObjectName = string.Empty; @@ -242,21 +242,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules //From emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); //To - Only One - emailMessage.AddToAddress(new EmailAddress(address)); + emailMessage.AddToAddress(new EmailAddress(address)); //Subject emailMessage.Subject = subject; //TEXT Body resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + - LastObjectPosition+"\r\n\r\n\r\n" + body); + LastObjectPosition+"\r\n\r\n\r\n" + body); //HTML Body - emailMessage.HtmlPart = new HtmlAttachment("

" + + emailMessage.HtmlPart = new HtmlAttachment("

" + "
Object-Name: " + LastObjectName + "
Region: " + LastObjectRegionName + "
Local-Position: " + LastObjectPosition + "


" +body+"\r\n

"); - + //Set SMTP SERVER config SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); //Authentication @@ -272,9 +272,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules return; } } - + /// - /// + /// /// /// /// diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index a5688ef..a76ff0d 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs @@ -39,33 +39,33 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// The location of the archive control file ///
public static readonly string CONTROL_FILE_PATH = "archive.xml"; - + /// /// Path for the assets held in an archive /// public static readonly string ASSETS_PATH = "assets/"; - + /// /// Path for the assets metadata file /// //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; - + /// /// Path for the prims file /// public static readonly string OBJECTS_PATH = "objects/"; - + /// /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. /// public static readonly string TERRAINS_PATH = "terrains/"; - + /// /// Extensions used for asset types in the archive /// public static readonly IDictionary ASSET_TYPE_TO_EXTENSION = new Dictionary(); public static readonly IDictionary EXTENSION_TO_ASSET_TYPE = new Dictionary(); - + static ArchiveConstants() { ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; @@ -79,11 +79,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; - ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; + ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this // disable warning: we know Script is obsolete, but need to support it -// anyhow +// anyhow #pragma warning disable 0612 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this #pragma warning restore 0612 @@ -93,8 +93,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; - ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this - + ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this + EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; @@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; // disable warning: we know Script is obsolete, but need to support it -// anyhow +// anyhow #pragma warning disable 0612 EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; #pragma warning restore 0612 diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 1340f8b..87106fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver private Scene m_scene; private string m_loadPath; - + /// /// Used to cache lookups for valid uuids. /// @@ -68,15 +68,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver } private void DearchiveRegion() - { - TarArchiveReader archive + { + TarArchiveReader archive = new TarArchiveReader( - new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); + new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); List serialisedSceneObjects = new List(); string filePath = "ERROR"; - + int successfulAssetRestores = 0; int failedAssetRestores = 0; @@ -111,30 +111,30 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.Debug("[ARCHIVER]: Reached end of archive"); archive.Close(); - + m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); - + if (failedAssetRestores > 0) m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); - m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); + m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); m_scene.DeleteAllSceneObjects(); - + // Reload serialized prims m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); IRegionSerialiser serialiser = m_scene.RequestModuleInterface(); - ICollection sceneObjects = new List(); + ICollection sceneObjects = new List(); foreach (string serialisedSceneObject in serialisedSceneObjects) - { + { SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); - + // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned // on the same region server and multiple examples a single object archive to be imported // to the same scene (when this is possible). sceneObject.ResetIDs(); - + // Try to retain the original creator/owner/lastowner if their uuid is present on this grid // otherwise, use the master avatar uuid instead LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; @@ -144,41 +144,41 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { if (!resolveUserUuid(part.CreatorID)) part.CreatorID = masterAvatarId; - + if (!resolveUserUuid(part.OwnerID)) part.OwnerID = masterAvatarId; - + if (!resolveUserUuid(part.LastOwnerID)) - part.LastOwnerID = masterAvatarId; - + part.LastOwnerID = masterAvatarId; + // And zap any troublesome sit target information part.SitTargetOrientation = new Quaternion(0,0,0,1); part.SitTargetPosition = new Vector3(0,0,0); - } - + } + if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) - { + { sceneObjects.Add(sceneObject); } - } - + } + m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); - + int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; - + if (ignoredObjects > 0) m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); - + m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); - + m_log.Debug("[ARCHIVER]: Starting scripts"); - + foreach (SceneObjectGroup sceneObject in sceneObjects) { sceneObject.CreateScriptInstances(0, true); - } + } } - + /// /// Look up the given user id to check whether it's one that is valid for this grid. /// @@ -194,13 +194,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver else m_validUserUuids.Add(uuid, false); } - + if (m_validUserUuids[uuid]) return true; else - return false; + return false; } - + /// /// Load an asset /// @@ -212,20 +212,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // Right now we're nastily obtaining the lluuid from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); string extension = filename.Substring(filename.LastIndexOf("_")); - string uuid = filename.Remove(filename.Length - extension.Length); - + string uuid = filename.Remove(filename.Length - extension.Length); + if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) { sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; - + //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); - + AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); asset.Type = assetType; asset.Data = data; - + m_scene.AssetCache.AddAsset(asset); - + return true; } else @@ -233,11 +233,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_log.ErrorFormat( "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", assetPath, extension); - + return false; } } - + /// /// Load terrain data /// @@ -249,13 +249,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver private bool LoadTerrain(string terrainPath, byte[] data) { ITerrainModule terrainModule = m_scene.RequestModuleInterface(); - + MemoryStream ms = new MemoryStream(data); terrainModule.LoadFromStream(terrainPath, ms); ms.Close(); - + m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); - + return true; } } diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 0341a70..26d4797 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -61,8 +61,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public ArchiveWriteRequestExecution( List sceneObjects, - ITerrainModule terrainModule, - IRegionSerialiser serialiser, + ITerrainModule terrainModule, + IRegionSerialiser serialiser, string sceneName, string savePath) { @@ -79,37 +79,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); } - + m_log.InfoFormat( "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); TarArchiveWriter archive = new TarArchiveWriter(); - + // Write out control file archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); - + // Write out terrain string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new MemoryStream(); m_terrainModule.SaveToStream(terrainPath, ms); - archive.AddFile(terrainPath, ms.ToArray()); + archive.AddFile(terrainPath, ms.ToArray()); ms.Close(); - + // Write out scene object metadata foreach (SceneObjectGroup sceneObject in m_sceneObjects) { //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); - + LLVector3 position = sceneObject.AbsolutePosition; - + string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); - string filename + string filename = string.Format( "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", - ArchiveConstants.OBJECTS_PATH, sceneObject.Name, - Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), + ArchiveConstants.OBJECTS_PATH, sceneObject.Name, + Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), sceneObject.UUID); - + archive.AddFile(filename, serializedObject); } @@ -120,8 +120,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); - } - + } + /// /// Create the control file for this archive /// @@ -136,13 +136,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver xtw.WriteAttributeString("major_version", "0"); xtw.WriteAttributeString("minor_version", "1"); xtw.WriteEndElement(); - + xtw.Flush(); xtw.Close(); - + String s = sw.ToString(); sw.Close(); - + return s; } } diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index 327808a..20e15ab 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -52,14 +52,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver protected Scene m_scene; protected string m_savePath; - + /// /// Used for identifying uuids embedded in scripts /// - protected static readonly Regex m_uuidRegex + protected static readonly Regex m_uuidRegex = new Regex( - "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", - RegexOptions.Compiled); + "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", + RegexOptions.Compiled); /// /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate @@ -93,9 +93,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver Monitor.Pulse(this); } } - + /// - /// Get an asset synchronously, potentially using an asynchronous callback. If the + /// Get an asset synchronously, potentially using an asynchronous callback. If the /// asynchronous callback is used, we will wait for it to complete. /// /// @@ -118,11 +118,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver Monitor.Wait(this); m_waitingForObjectAsset = false; } - } - + } + return m_requestedObjectAsset; } - + /// /// Record the asset uuids embedded within the given script. /// @@ -138,16 +138,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); MatchCollection uuidMatches = m_uuidRegex.Matches(script); //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); - + foreach (Match uuidMatch in uuidMatches) { LLUUID uuid = new LLUUID(uuidMatch.Value); //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); assetUuids[uuid] = 1; } - } + } } - + /// /// Record the uuids referenced by the given wearable asset /// @@ -159,25 +159,25 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); wearableAsset.Decode(); - + //m_log.DebugFormat( // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); - + foreach (LLUUID uuid in wearableAsset.Textures.Values) { //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); assetUuids[uuid] = 1; } } - + /// /// Get all the asset uuids associated with a given object. This includes both those directly associated with /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained /// within this object). /// /// - /// - protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary assetUuids) + /// + protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary assetUuids) { AssetBase objectAsset = GetAsset(sceneObjectUuid); @@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver string xml = Helpers.FieldToUTF8String(objectAsset.Data); SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); GetSceneObjectAssetUuids(sog, assetUuids); - } + } } /// @@ -209,10 +209,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver try { LLObject.TextureEntry textureEntry = part.Shape.Textures; - + // Get the prim's default texture. This will be used for faces which don't have their own texture assetUuids[textureEntry.DefaultTexture.TextureID] = 1; - + // XXX: Not a great way to iterate through face textures, but there's no // other method available to tell how many faces there actually are //int i = 0; @@ -224,15 +224,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver assetUuids[texture.TextureID] = 1; } } - + foreach (TaskInventoryItem tii in part.TaskInventory.Values) { //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); - + if (!assetUuids.ContainsKey(tii.AssetID)) { assetUuids[tii.AssetID] = 1; - + if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) { GetWearableAssetUuids(tii.AssetID, assetUuids); @@ -275,20 +275,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver if (entity is SceneObjectGroup) sceneObjects.Add((SceneObjectGroup)entity); } - + foreach (SceneObjectGroup sceneObject in sceneObjects) { GetSceneObjectAssetUuids(sceneObject, assetUuids); } m_log.DebugFormat( - "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", + "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", sceneObjects.Count, assetUuids.Count); // Asynchronously request all the assets required to perform this archive operation - ArchiveWriteRequestExecution awre + ArchiveWriteRequestExecution awre = new ArchiveWriteRequestExecution( - sceneObjects, + sceneObjects, m_scene.RequestModuleInterface(), m_scene.RequestModuleInterface(), m_scene.RegionInfo.RegionName, diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 2704224..708bed3 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs @@ -41,17 +41,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public class AssetsArchiver { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// Archive assets /// protected IDictionary m_assets; - + public AssetsArchiver(IDictionary assets) { m_assets = assets; } - + /// /// Archive the assets given to this archiver to the given archive. /// @@ -70,44 +70,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { StringWriter sw = new StringWriter(); XmlTextWriter xtw = new XmlTextWriter(sw); - + xtw.Formatting = Formatting.Indented; xtw.WriteStartDocument(); - + xtw.WriteStartElement("assets"); - + foreach (LLUUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; - + if (asset != null) { xtw.WriteStartElement("asset"); - + string extension = string.Empty; - + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) { extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; - } - + } + xtw.WriteElementString("filename", uuid.ToString() + extension); - + xtw.WriteElementString("name", asset.Name); xtw.WriteElementString("description", asset.Description); xtw.WriteElementString("asset-type", asset.Type.ToString()); - + xtw.WriteEndElement(); } } - + xtw.WriteEndElement(); - + xtw.WriteEndDocument(); - + archive.AddFile("assets.xml", sw.ToString()); } - + /// /// Write asset data files to the given archive /// @@ -116,18 +116,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar //archive.AddDir("assets"); - + foreach (LLUUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; - + string extension = string.Empty; - + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) { extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; } - + archive.AddFile( ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, asset.Data); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs index 284a39e..17abb24 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs @@ -43,9 +43,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public class AssetsDearchiver { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); - + /// /// Store for asset data we received before we get the metadata /// @@ -55,17 +55,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// Asset metadata. Is null if asset metadata isn't yet available. /// protected Dictionary m_metadata; - + /// /// Cache to which dearchived assets will be added /// protected AssetCache m_cache; - + public AssetsDearchiver(AssetCache cache) { m_cache = cache; } - + /// /// Add asset data to the dearchiver /// @@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ResolveAssetData(assetFilename, data); } } - + /// /// Add asset metadata xml /// @@ -90,39 +90,39 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public void AddAssetMetadata(string xml) { m_metadata = new Dictionary(); - + StringReader sr = new StringReader(xml); XmlTextReader reader = new XmlTextReader(sr); - + reader.ReadStartElement("assets"); reader.Read(); - + while (reader.Name.Equals("asset")) { reader.Read(); - + AssetMetadata metadata = new AssetMetadata(); - + string filename = reader.ReadElementString("filename"); m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); - + metadata.Name = reader.ReadElementString("name"); metadata.Description = reader.ReadElementString("description"); metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); - + m_metadata[filename] = metadata; - + // Read asset end tag reader.ReadEndElement(); - + reader.Read(); } - + m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); - + ResolvePendingAssetData(); } - + /// /// Resolve asset data that we collected before receiving the metadata /// @@ -133,7 +133,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); } } - + /// /// Resolve a new piece of asset data against stored metadata /// @@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { // Right now we're nastily obtaining the lluuid from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); - + if (m_metadata.ContainsKey(filename)) { AssetMetadata metadata = m_metadata[filename]; - + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) { string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; @@ -166,11 +166,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver else { m_log.ErrorFormat( - "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", + "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", assetPath); } } - + /// /// Metadata for an asset /// diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs index 6ffbcbb..2164f7e 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs @@ -43,12 +43,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver class AssetsRequest { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// uuids to request /// protected ICollection m_uuids; - + /// /// Callback used when all the assets requested have been received. /// @@ -58,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// Assets retrieved in this request /// protected Dictionary m_assets = new Dictionary(); - + /// /// Maintain a list of assets that could not be found. This will be passed back to the requester. /// @@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_assetCache = assetCache; m_repliesRequired = uuids.Count; } - + protected internal void Execute() { // We can stop here if there are no assets to fetch @@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_assets[assetID] = asset; else m_notFoundAssetUuids.Add(assetID); - + //m_log.DebugFormat( // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs index 585d1d4..4e000cc 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs @@ -69,9 +69,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public byte[] ReadEntry(out string filePath) { filePath = String.Empty; - + TarHeader header = ReadHeader(); - + if (null == header) return null; @@ -98,14 +98,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ///
/// A tar header struct. null if we have reached the end of the archive. protected TarHeader ReadHeader() - { + { byte[] header = m_br.ReadBytes(512); - + // If we've reached the end of the archive we'll be in null block territory, which means - // the next byte will be 0 + // the next byte will be 0 if (header[0] == 0) return null; - + TarHeader tarHeader = new TarHeader(); tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs index f70a93d..83b9250 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs @@ -54,10 +54,10 @@ namespace OpenSim.Region.Environment // Directories are signalled by a final / if (!dirName.EndsWith("/")) dirName += "/"; - + AddFile(dirName, new byte[0]); } - + /// /// Add a file to the tar archive /// @@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment if (data.Length % 512 != 0) { int paddingRequired = 512 - (data.Length % 512); - + //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); byte[] padding = new byte[paddingRequired]; diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 1e622be..28347d0 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) { EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; - + bool alreadyInList = false; for (int i = 0; i < banlistcheck.Length; i++) @@ -407,8 +407,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; args.simName = m_scene.RegionInfo.RegionName; - - + remote_client.SendRegionInfoToEstateMenu(args); } @@ -416,6 +415,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate { remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); } + private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) { Dictionary SceneData = new Dictionary(); @@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate continue; } } - + SceneReport.Add(lsri); } } @@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate } } remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); - + if (uuidNameLookupList.Count > 0) LookupUUID(uuidNameLookupList); } @@ -502,7 +502,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate private void LookupUUIDsAsync(List uuidLst) { LLUUID[] uuidarr = new LLUUID[0]; - + lock (uuidLst) { uuidarr = uuidLst.ToArray(); @@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate if (EstateManagers[i] == remoteClient.AgentId) estatemanager = true; } - + args.isEstateManager = estatemanager; args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; @@ -729,11 +729,11 @@ namespace OpenSim.Region.Environment.Modules.World.Estate client.OnLandStatRequest += HandleLandStatRequest; sendRegionHandshake(client); } - + public uint GetRegionFlags() { Simulator.RegionFlags flags = Simulator.RegionFlags.None; - + // Fully implemented // if (m_scene.RegionInfo.RegionSettings.AllowDamage) diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 9b1b9b5..00994fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -47,14 +47,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private static readonly string remoteParcelRequestPath = "0009/"; - + private LandChannel landChannel; private Scene m_scene; - - private readonly int[,] landIDList = new int[64, 64]; private readonly Dictionary landList = new Dictionary(); @@ -115,8 +113,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - - public void PostInitialise() { } @@ -153,8 +149,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - - public bool AllowedForcefulBans { get { return m_allowedForcefulBans; } @@ -185,11 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land public List ParcelsNearPoint(LLVector3 position) { List parcelsNear = new List(); - int x; - for (x = -4; x <= 4; x += 4) + for (int x = -4; x <= 4; x += 4) { - int y; - for (y = -4; y <= 4; y += 4) + for (int y = -4; y <= 4; y += 4) { ILandObject check = GetLandObject(position.X + x, position.Y + y); if (check != null) @@ -286,7 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); - if (over != null) { if (force) @@ -387,6 +378,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land Console.WriteLine("INVALID LOCAL LAND ID"); } } + /// /// Creates a basic Parcel object without an owner (a zeroed key) /// @@ -406,13 +398,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land new_land.landData.LocalID = lastLandLocalID; landList.Add(lastLandLocalID, new_land.Copy()); - bool[,] landBitmap = new_land.getLandBitmap(); - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landBitmap[x, y]) { @@ -431,11 +420,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land /// Land.localID of the peice of land to remove. public void removeLandObject(int local_id) { - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landIDList[x, y] == local_id) { @@ -451,12 +438,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land private void performFinalLandJoin(ILandObject master, ILandObject slave) { - int x; bool[,] landBitmapSlave = slave.getLandBitmap(); - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landBitmapSlave[x, y]) { @@ -519,6 +504,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } return landList[landIDList[x / 4, y / 4]]; } + #endregion #region Parcel Modification @@ -601,7 +587,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land ResetAllLandPrimCounts(); lock (m_scene.Entities) { - foreach (EntityBase obj in m_scene.Entities.Values) + foreach (EntityBase obj in m_scene.Entities.Values) { if (obj != null) { @@ -647,11 +633,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land { int totalX = end_x - start_x; int totalY = end_y - start_y; - int y; - for (y = 0; y < totalY; y++) + for (int y = 0; y < totalY; y++) { - int x; - for (x = 0; x < totalX; x++) + for (int x = 0; x < totalX; x++) { ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); if (tempLandObject == null) return; @@ -690,9 +674,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject result = AddLandObject(newLand); UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); result.sendLandUpdateToAvatarsOverMe(); - - - return; } /// @@ -730,7 +711,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject masterLandObject = selectedLandObjects[0]; selectedLandObjects.RemoveAt(0); - if (selectedLandObjects.Count < 1) { return; @@ -753,12 +733,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land performFinalLandJoin(masterLandObject, slaveLandObject); } - SetPrimsTainted(); masterLandObject.sendLandUpdateToAvatarsOverMe(); - - return; } #endregion @@ -777,17 +754,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land int byteArrayCount = 0; int sequenceID = 0; - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { byte tempByte = 0; //This represents the byte for the current 4x4 ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); - if (currentParcelBlock != null) { if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) @@ -813,7 +787,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); } - //Now for border control ILandObject westParcel = null; @@ -864,14 +837,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land { //Get the land objects within the bounds List temp = new List(); - int x; - int i; int inc_x = end_x - start_x; int inc_y = end_y - start_y; - for (x = 0; x < inc_x; x++) + for (int x = 0; x < inc_x; x++) { - int y; - for (y = 0; y < inc_y; y++) + for (int y = 0; y < inc_y; y++) { ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); @@ -892,12 +862,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land requestResult = LandChannel.LAND_RESULT_MULTIPLE; } - for (i = 0; i < temp.Count; i++) + for (int i = 0; i < temp.Count; i++) { temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); } - SendParcelOverlay(remote_client); } @@ -921,7 +890,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) { - landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); } @@ -954,7 +922,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land landList[local_id].sendLandUpdateToClient(remote_client); } } - } public void handleParcelReclaim(int local_id, IClientAPI remote_client) @@ -972,7 +939,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land landList[local_id].sendLandUpdateToClient(remote_client); } } - } #endregion @@ -1076,7 +1042,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land { selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); } - } public void NoLandDataFromStorage() @@ -1093,11 +1058,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land obj.setParcelObjectMaxOverride(overrideDel); } } + public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) { } #region CAPS handler + private void OnRegisterCaps(LLUUID agentID, Caps caps) { string capsBase = "/CAPS/" + caps.CapsObjectPath; @@ -1109,7 +1076,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return RemoteParcelRequest(request, path, param, agentID, caps); })); } - + // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x @@ -1171,11 +1138,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land { m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); } - + LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); response.parcel_id = parcelID; m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); - + return LLSDHelpers.SerialiseLLSDReply(response); } @@ -1191,7 +1158,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land uint x, y; Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); - + LandData landData; if (regionHandle == m_scene.RegionInfo.RegionHandle) landData = this.GetLandObject(x, y).landData; diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 305e236..6388a1c 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return newLand; } - + static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; @@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } #endregion - + #region Packet Request Handling public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 7b05027..09f12b2 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event RegionHandleRequest OnRegionHandleRequest; public event ParcelInfoRequest OnParcelInfoRequest; - + #pragma warning restore 67 #endregion @@ -368,7 +368,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { get { return 0; } } - + public ulong GetGroupPowers(LLUUID groupID) { return 0; @@ -820,13 +820,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) - { + { } public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop) - { + { } public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary parameters) diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 6107f48..071e3af 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); - + if (m_bypassPermissions) m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); else diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs index 0df19d9..22c9b29 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes public class SceneXmlLoader { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) { XmlDocument doc = new XmlDocument(); @@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes doc.Load(reader); reader.Close(); rootNode = doc.FirstChild; - + // This is to deal with neighbouring regions that are still surrounding the group xml with the // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or // when some other changes forces all regions to upgrade). @@ -127,13 +127,13 @@ namespace OpenSim.Region.Environment.Scenes // There is only ever one prim. This oddity should be removeable post 0.5.9 return new SceneObjectGroup(aPrimNode.OuterXml); } - + return null; } else { return new SceneObjectGroup(rootNode.OuterXml); - } + } } /// @@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Scenes reader.Close(); XmlNode rootNode = doc.FirstChild; - ICollection sceneObjects = new List(); + ICollection sceneObjects = new List(); foreach (XmlNode aPrimNode in rootNode.ChildNodes) { SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); @@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Scenes { SceneObjectGroup obj = new SceneObjectGroup(xmlData); - if (scene.AddRestoredSceneObject(obj, true, false)) + if (scene.AddRestoredSceneObject(obj, true, false)) return obj; else return null; @@ -254,7 +254,7 @@ namespace OpenSim.Region.Environment.Scenes if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) continue; } - + stream.WriteLine(g.ToXmlString2()); primCount++; } diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 5682de3..9690433 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules private LLVector3 Position = new LLVector3(0,0,0); private LLVector3 Velocity = new LLVector3(0,0,0); private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); - + private long LindenHourOffset = 0; private bool sunFixed = false; @@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment.Modules private float GetLindenEstateHourFromCurrentTime() { float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); - + float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; return hour; @@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules float hour = (24 * (ticksleftover / SecondsPerSunCycle)); float offsethours = 0; - + if (LindenHour - 6 > hour) { offsethours = hour + ((LindenHour-6) - hour); @@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules offsethours = hour - (hour - (LindenHour - 6)); } //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); - + LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); @@ -422,7 +422,7 @@ namespace OpenSim.Region.Environment.Modules } } } - + public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) { if (m_scene.RegionInfo.RegionHandle == regionHandle) diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs index 34bbf78..48da96d 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Bmp); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Png); - } + } /// /// The human readable version of the file format(s) this loader handles @@ -73,4 +73,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return "BMP"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs index 0cd9000..accffd2 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Gif); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Gif); - } + } public override string ToString() { return "GIF"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 4d213e0..983ad29 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs @@ -58,19 +58,19 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders /// A terrain channel generated from the image. public virtual ITerrainChannel LoadFile(string filename) { - return LoadBitmap(new Bitmap(filename)); + return LoadBitmap(new Bitmap(filename)); } public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) { throw new NotImplementedException(); } - + public virtual ITerrainChannel LoadStream(Stream stream) { return LoadBitmap(new Bitmap(stream)); } - + protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) { ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); @@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - return retval; + return retval; } /// @@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Png); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Png); - } + } #endregion diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs index 9886b81..35576c7 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders { throw new NotImplementedException(); } - + public ITerrainChannel LoadStream(Stream stream) { throw new NotImplementedException(); - } + } public void SaveFile(string filename, ITerrainChannel map) { @@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Jpeg); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateBitmapFromMap(map); colours.Save(stream, ImageFormat.Jpeg); - } + } #endregion @@ -109,4 +109,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return bmp; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs index 21fba2b..5f13d01 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders FileInfo file = new FileInfo(filename); FileStream s = file.Open(FileMode.Open, FileAccess.Read); ITerrainChannel retval = LoadStream(s); - + s.Close(); return retval; @@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders // i.e. eat X upto where we start while (currFileXOffset < offsetX) { - bs.ReadBytes(sectionWidth * 13); + bs.ReadBytes(sectionWidth * 13); currFileXOffset++; } @@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return retval; } - + public ITerrainChannel LoadStream(Stream s) - { + { TerrainChannel retval = new TerrainChannel(); - + BinaryReader bs = new BinaryReader(s); int y; for (y = 0; y < retval.Height; y++) @@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - bs.Close(); - + bs.Close(); + return retval; } @@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders s.Close(); } - + public void SaveStream(Stream s, ITerrainChannel map) { BinaryWriter binStream = new BinaryWriter(s); @@ -224,9 +224,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - binStream.Close(); + binStream.Close(); } - + public string FileExtension { get { return ".raw"; } diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs index cf95486..19e181e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Png); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Png); - } + } public override string ToString() { return "PNG"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs index bb8b0f7..758821a 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs @@ -112,11 +112,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return retval; } - + public ITerrainChannel LoadStream(Stream s) { TerrainChannel retval = new TerrainChannel(); - + BinaryReader bs = new BinaryReader(s); int y; for (y = 0; y < retval.Height; y++) @@ -129,10 +129,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } bs.Close(); - + return retval; } - + public void SaveFile(string filename, ITerrainChannel map) { FileInfo file = new FileInfo(filename); @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders s.Close(); } - + public void SaveStream(Stream s, ITerrainChannel map) { BinaryWriter bs = new BinaryWriter(s); @@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - bs.Close(); + bs.Close(); } #endregion @@ -166,4 +166,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return "RAW32"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs index 3f98f40..95b43b0 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Tiff); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Tiff); - } + } public override string ToString() { return "TIFF"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs index 5dc2aa5..2bf029e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return retval; } - + public ITerrainChannel LoadStream(Stream s) { TerrainChannel retval = new TerrainChannel(); - + BinaryReader bs = new BinaryReader(s); bool eof = false; @@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } bs.Close(); - + return retval; } @@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders { throw new NotImplementedException(); } - + public void SaveStream(Stream stream, ITerrainChannel map) { throw new NotImplementedException(); @@ -138,4 +138,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return "Terragen"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs index e255515..beeff03 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs @@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain { void LoadFromFile(string filename); void SaveToFile(string filename); - + /// /// Load a terrain from a stream. /// @@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain /// /// void LoadFromStream(string filename, Stream stream); - + /// /// Save a terrain to a stream. /// @@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain /// /// void SaveToStream(string filename, Stream stream); - + void InstallPlugin(string name, ITerrainEffect plug); } } diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index 8fbc62e..4a62446 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs @@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); } } - + /// /// Loads a terrain file from a stream and installs it in the scene. /// @@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); } - } + } #region Plugin Loading Methods @@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain m_tainted = false; m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); m_scene.SaveTerrain(); - + // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. //m_scene.CreateTerrainTexture(true); } @@ -517,11 +517,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain // fixup and height deltas that don't respect them if (respectEstateSettings && LimitChannelChanges(x, y)) { - // this has been vetoed, so update + // this has been vetoed, so update // what we are going to send to the client serialised = m_channel.GetFloatsSerialised(); } - + SendToClients(serialised, x, y); shouldTaint = true; } @@ -580,9 +580,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain private void SendToClients(float[] serialised, int x, int y) { m_scene.ForEachClient( - delegate(IClientAPI controller) + delegate(IClientAPI controller) { controller.SendLayerData( - x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); + x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); } ); } @@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain { // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. // for now check a point in the centre of the region - + if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) { InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs index a331d37..9b8dc75 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs @@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap { int tc = System.Environment.TickCount; m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); - + double[,] hm = whichScene.Heightmap.GetDoubles(); bool ShadowDebugContinue = true; //Color prim = Color.FromArgb(120, 120, 120); @@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //X // . // - // Shade the terrain for shadows + // Shade the terrain for shadows if ((x - 1 > 0) && (y - 1 > 0)) { hfvalue = (float)hm[x, y]; @@ -268,7 +268,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap else if (hfdiff < -0.3f) { // We have to desaturate and blacken the land at the same time - // we use floats, colors use bytes, so shrink are space down to + // we use floats, colors use bytes, so shrink are space down to // 0-255 @@ -368,8 +368,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap return mapbmp; } - - + + private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) { int tc = 0; @@ -570,4 +570,4 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 2a7af87..2430822 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs @@ -54,13 +54,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly string m_mapLayerPath = "0001/"; - - //private IConfig m_config; + + //private IConfig m_config; private Scene m_scene; private List cachedMapBlocks = new List(); private int cachedTime = 0; private byte[] myMapImageJPEG; - + //private int CacheRegionsDistance = 256; #region IRegionModule Members @@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } public void PostInitialise() { - + } public void Close() @@ -102,10 +102,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } #endregion - - - - public void OnRegisterCaps(LLUUID agentID, Caps caps) { @@ -117,9 +113,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return MapLayerRequest(request, path, param, - agentID, caps); + agentID, caps); })); - } /// @@ -138,12 +133,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //{ //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", //request, path, param,agentID.ToString()); - + // this is here because CAPS map requests work even beyond the 10,000 limit. ScenePresence avatarPresence = null; m_scene.TryGetAvatar(agentID, out avatarPresence); - + if (avatarPresence != null) { bool lookup = false; @@ -168,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); - + lock (cachedMapBlocks) cachedMapBlocks = mapBlocks; @@ -262,18 +257,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap MemoryStream imgstream = new MemoryStream(); Bitmap mapTexture = new Bitmap(1,1); System.Drawing.Image image = (System.Drawing.Image)mapTexture; - - + try { // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data - imgstream = new MemoryStream(); - + // non-async because we know we have the asset immediately. AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); - + // Decode image to System.Drawing.Image image = OpenJPEG.DecodeToImage(mapasset.Data); @@ -293,7 +286,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap myEncoderParameter = new EncoderParameter(myEncoder, 95L); myEncoderParameters.Param[0] = myEncoderParameter; - + // Save bitmap to stream mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); @@ -332,16 +325,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // From msdn private static ImageCodecInfo GetEncoderInfo(String mimeType) { - int j; ImageCodecInfo[] encoders; encoders = ImageCodecInfo.GetImageEncoders(); - for (j = 0; j < encoders.Length; ++j) + for (int j = 0; j < encoders.Length; ++j) { if (encoders[j].MimeType == mimeType) return encoders[j]; } return null; } - } } diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index bc3e06c..40caabc 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_name; } set { m_name = value; } } - + /// /// Signals whether this group was in a scene but has since been deleted from it. /// @@ -71,7 +71,7 @@ namespace OpenSim.Region.Environment.Scenes { get { return m_isDeleted; } } - protected bool m_isDeleted; + protected bool m_isDeleted; protected LLVector3 m_pos; diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index 2b1adee..1dd2273 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs @@ -131,13 +131,10 @@ namespace OpenSim.Region.Environment.Scenes public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; - public delegate void SignificantClientMovement(IClientAPI remote_client); public event SignificantClientMovement OnSignificantClientMovement; - - public delegate void NewGridInstantMessage(GridInstantMessage message); public event NewGridInstantMessage OnGridInstantMessageToIMModule; @@ -163,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes public event ScriptAtTargetEvent OnScriptAtTargetEvent; public delegate void ScriptNotAtTargetEvent(uint localID); - + public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; public delegate void ScriptColliding(uint localID, ColliderArgs colliders); @@ -172,8 +169,6 @@ namespace OpenSim.Region.Environment.Scenes public event ScriptColliding OnScriptColliding; public event ScriptColliding OnScriptCollidingEnd; - - public delegate void OnMakeChildAgentDelegate(ScenePresence presence); public event OnMakeChildAgentDelegate OnMakeChildAgent; @@ -289,7 +284,6 @@ namespace OpenSim.Region.Environment.Scenes public int transactionID = 0; public int amountDebited = 0; - public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, bool pauthenticated) @@ -306,8 +300,6 @@ namespace OpenSim.Region.Environment.Scenes } } - - public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); public delegate void LandBuy(Object sender, LandBuyArgs e); @@ -377,7 +369,6 @@ namespace OpenSim.Region.Environment.Scenes private ScriptColliding handlerColliding = null; private ScriptColliding handlerCollidingEnd = null; - private SunLindenHour handlerSunGetLindenHour = null; public void TriggerOnScriptChangedEvent(uint localID, uint change) @@ -491,7 +482,6 @@ namespace OpenSim.Region.Environment.Scenes if (handlerObjectBeingRemovedFromScene != null) { handlerObjectBeingRemovedFromScene(obj); - } } @@ -641,7 +631,6 @@ namespace OpenSim.Region.Environment.Scenes { handlerGridInstantMessageToFriends(message); } - } } @@ -698,7 +687,8 @@ namespace OpenSim.Region.Environment.Scenes handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); } } - public void TriggerLandBuy (Object sender, LandBuyArgs e) + + public void TriggerLandBuy(Object sender, LandBuyArgs e) { handlerLandBuy = OnLandBuy; if (handlerLandBuy != null) @@ -706,6 +696,7 @@ namespace OpenSim.Region.Environment.Scenes handlerLandBuy(sender, e); } } + public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) { handlerValidateLandBuy = OnValidateLandBuy; @@ -741,6 +732,7 @@ namespace OpenSim.Region.Environment.Scenes handlerRequestChangeWaterHeight(height); } } + public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) { handlerAvatarKill = OnAvatarKilled; @@ -756,7 +748,6 @@ namespace OpenSim.Region.Environment.Scenes if (handlerSignificantClientMovement != null) { handlerSignificantClientMovement(client); - } } @@ -787,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerNoticeNoLandDataFromStorage() { handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; @@ -818,26 +808,24 @@ namespace OpenSim.Region.Environment.Scenes } } - - public void TriggerRequestParcelPrimCountUpdate() { handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; if (handlerRequestParcelPrimCountUpdate != null) { handlerRequestParcelPrimCountUpdate(); - } } + public void TriggerParcelPrimCountTainted() { handlerParcelPrimCountTainted = OnParcelPrimCountTainted; if (handlerParcelPrimCountTainted != null) { handlerParcelPrimCountTainted(); - } } + // this lets us keep track of nasty script events like timer, etc. public void TriggerTimerEvent(uint objLocalID, double Interval) { @@ -845,9 +833,7 @@ namespace OpenSim.Region.Environment.Scenes if (handlerScriptTimerEvent != null) { handlerScriptTimerEvent(objLocalID, Interval); - } - } public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) @@ -875,19 +861,19 @@ namespace OpenSim.Region.Environment.Scenes if (handlerCollidingStart != null) handlerCollidingStart(localId, colliders); } + public void TriggerScriptColliding(uint localId, ColliderArgs colliders) { - handlerColliding = OnScriptColliding; if (handlerColliding != null) handlerColliding(localId, colliders); } + public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) { handlerCollidingEnd = OnScriptCollidingEnd; if (handlerCollidingEnd != null) handlerCollidingEnd(localId, colliders); } - } } diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 3021891..6695dbf 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -96,7 +96,7 @@ namespace OpenSim.Region.Environment.Scenes // Then we've got to remove the previous // event handler - if (_PhyScene != null) + if (_PhyScene != null) _PhyScene.OnPhysicsCrash -= physicsBasedCrash; _PhyScene = value; @@ -194,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was added, false if an object with the same uuid was already in the scene - /// + /// protected internal bool AddRestoredSceneObject( SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) { @@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes { part.LocalId = m_parentScene.PrimIDAllocate(); } - + sceneObject.UpdateParentIDs(); if (!alreadyPersisted) @@ -213,10 +213,10 @@ namespace OpenSim.Region.Environment.Scenes sceneObject.ForceInventoryPersistence(); sceneObject.HasGroupChanged = true; } - + return AddSceneObject(sceneObject, attachToBackup); } - + /// /// 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. @@ -228,12 +228,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was added, false if an object with the same uuid was already in the scene - /// + /// protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) - { + { // Ensure that we persist this new scene object sceneObject.HasGroupChanged = true; - + return AddSceneObject(sceneObject, attachToBackup); } @@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes { sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim); sceneObject.ScheduleGroupForFullUpdate(); - + lock (Entities) { if (!Entities.ContainsKey(sceneObject.UUID)) @@ -261,8 +261,8 @@ namespace OpenSim.Region.Environment.Scenes Entities.Add(sceneObject.UUID, sceneObject); m_numPrim += sceneObject.Children.Count; - if (attachToBackup) - sceneObject.AttachToBackup(); + if (attachToBackup) + sceneObject.AttachToBackup(); return true; } @@ -342,7 +342,7 @@ namespace OpenSim.Region.Environment.Scenes "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e); } } - + m_updateList.Clear(); } } @@ -555,7 +555,7 @@ namespace OpenSim.Region.Environment.Scenes protected internal void AddScenePresence(ScenePresence presence) { bool child = presence.IsChildAgent; - + if (child) { m_numChildAgents++; @@ -598,7 +598,7 @@ namespace OpenSim.Region.Environment.Scenes { if (!ScenePresences.Remove(agentID)) { - m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); + m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); } // else // { @@ -774,7 +774,7 @@ namespace OpenSim.Region.Environment.Scenes /// 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 private SceneObjectGroup GetGroupByPrim(LLUUID fullID) { List EntityList = GetEntities(); @@ -823,7 +823,7 @@ namespace OpenSim.Region.Environment.Scenes protected internal SceneObjectPart GetSceneObjectPart(uint localID) { SceneObjectGroup group = GetGroupByPrim(localID); - + if (group != null) return group.GetChildPart(localID); else @@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Scenes /// Get a part contained in this scene. /// /// - /// null if the part was not found + /// null if the part was not found protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) { SceneObjectGroup group = GetGroupByPrim(fullID); @@ -1089,7 +1089,7 @@ namespace OpenSim.Region.Environment.Scenes group.SendGroupTerseUpdate(); return; } - + if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) { group.UpdateSinglePosition(pos, localID); @@ -1119,7 +1119,7 @@ namespace OpenSim.Region.Environment.Scenes if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) { group.SendGroupTerseUpdate(); - + return; } if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) @@ -1397,14 +1397,14 @@ namespace OpenSim.Region.Environment.Scenes if (sendEvents) parenPrim.TriggerScriptChangedEvent(Changed.LINK); } - else + else { // The link set has prims remaining. This path is taken // when a subset of a link set's prims are selected // and the root prim is part of that selection // List parts = new List(parenPrim.Children.Values); - + List unlink_ids = new List(); foreach (SceneObjectPart unlink_part in parts) unlink_ids.Add(unlink_part.LocalId); diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index fe66dd5..0148d76 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -242,9 +242,9 @@ namespace OpenSim.Region.Environment.Scenes // Retrieve item TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); - + if (null == item) - { + { m_log.ErrorFormat( "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " + " but the item does not exist in this inventory", @@ -338,7 +338,6 @@ namespace OpenSim.Region.Environment.Scenes item.CreationDate = Util.UnixTimeSinceEpoch(); else item.CreationDate = itemUpd.CreationDate; - // TODO: Check if folder changed and move item //item.NextPermissions = itemUpd.Folder; @@ -577,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes asset.Type = assetType; asset.FullID = LLUUID.Random(); asset.Data = (data == null) ? new byte[1] : data; - + return asset; } @@ -958,7 +957,7 @@ namespace OpenSim.Region.Environment.Scenes agentItem.Folder = folderId; AddInventoryItem(remoteClient, agentItem); } - + /// /// ClientMoveTaskInventoryItem /// @@ -981,13 +980,13 @@ namespace OpenSim.Region.Environment.Scenes } TaskInventoryItem taskItem = part.GetInventoryItem(itemId); - + if (null == taskItem) { m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" + " because the inventory item could not be found", itemId, primLocalId); - + return; } @@ -997,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes MoveTaskInventoryItem(remoteClient, folderId, part, itemId); } - + /// /// MoveTaskInventoryItem /// @@ -1029,7 +1028,7 @@ namespace OpenSim.Region.Environment.Scenes AddInventoryItem(avatarId, agentItem); } } - + /// /// Copy a task (prim) inventory item to another task (prim) /// @@ -1049,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes return; } - + SceneObjectPart destPart = GetSceneObjectPart(destId); if (destPart == null) @@ -1060,7 +1059,7 @@ namespace OpenSim.Region.Environment.Scenes destId); return; } - + if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) { // object cannot copy items to an object owned by a different owner @@ -1076,7 +1075,7 @@ namespace OpenSim.Region.Environment.Scenes } TaskInventoryItem destTaskItem = new TaskInventoryItem(); - + destTaskItem.ItemID = LLUUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; destTaskItem.AssetID = srcTaskItem.AssetID; @@ -1091,7 +1090,7 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; destTaskItem.NextPermissions = srcTaskItem.NextPermissions; destTaskItem.Flags = srcTaskItem.Flags; - + if (destPart.OwnerID != part.OwnerID) { if (ExternalChecks.ExternalChecksPropagatePermissions()) @@ -1112,20 +1111,20 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.Name = srcTaskItem.Name; destTaskItem.InvType = srcTaskItem.InvType; destTaskItem.Type = srcTaskItem.Type; - + destPart.AddInventoryItem(destTaskItem); if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) part.RemoveInventoryItem(itemId); ScenePresence avatar; - + if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) { destPart.GetProperties(avatar.ControllingClient); } } - + public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List items) { CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); @@ -1139,7 +1138,7 @@ namespace OpenSim.Region.Environment.Scenes } LLUUID newFolderID = LLUUID.Random(); - + profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); foreach (LLUUID itemID in items) @@ -1346,7 +1345,7 @@ namespace OpenSim.Region.Environment.Scenes part.AddInventoryItem(taskItem); part.GetProperties(remoteClient); - + part.CreateScriptInstance(taskItem, 0, false); } } @@ -1370,7 +1369,7 @@ namespace OpenSim.Region.Environment.Scenes return; } - + SceneObjectPart destPart = GetSceneObjectPart(destId); if (destPart == null) @@ -1381,7 +1380,7 @@ namespace OpenSim.Region.Environment.Scenes destId); return; } - + // Must own the object, and have modify rights if (srcPart.OwnerID != destPart.OwnerID) return; @@ -1395,14 +1394,14 @@ namespace OpenSim.Region.Environment.Scenes "[PRIM INVENTORY]: " + "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); - // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - + // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - // "Object: Task Object trying to illegally load script onto task Other_Object!" // How do we shout from in here? return; } - + TaskInventoryItem destTaskItem = new TaskInventoryItem(); - + destTaskItem.ItemID = LLUUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; destTaskItem.AssetID = srcTaskItem.AssetID; @@ -1417,7 +1416,7 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; destTaskItem.NextPermissions = srcTaskItem.NextPermissions; destTaskItem.Flags = srcTaskItem.Flags; - + if (destPart.OwnerID != srcPart.OwnerID) { if (ExternalChecks.ExternalChecksPropagatePermissions()) @@ -1438,22 +1437,22 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.Name = srcTaskItem.Name; destTaskItem.InvType = srcTaskItem.InvType; destTaskItem.Type = srcTaskItem.Type; - + destPart.AddInventoryItemExclusive(destTaskItem); if (running > 0) { destPart.CreateScriptInstance(destTaskItem, 0, false); } - + ScenePresence avatar; - + if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) { destPart.GetProperties(avatar.ControllingClient); } } - + /// /// Called when an object is removed from the environment into inventory. /// @@ -1566,7 +1565,7 @@ namespace OpenSim.Region.Environment.Scenes private bool InventoryDeQueueAndDelete() { DeleteToInventoryHolder x = null; - + try { lock (m_inventoryDeletes) @@ -1580,13 +1579,13 @@ namespace OpenSim.Region.Environment.Scenes return true; } } - } + } catch(Exception e) { // We can't put the object group details in here since the root part may have disappeared (which is where these sit). // FIXME: This needs to be fixed. m_log.ErrorFormat( - "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", + "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); } @@ -1745,7 +1744,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + AssetBase asset = CreateAsset( objectGroup.GetPartName(objectGroup.LocalId), objectGroup.GetPartDescription(objectGroup.LocalId), @@ -1792,7 +1791,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) { SceneObjectGroup objectGroup = grp; @@ -2057,7 +2056,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// public virtual SceneObjectGroup RezObject( - SceneObjectPart sourcePart, TaskInventoryItem item, + SceneObjectPart sourcePart, TaskInventoryItem item, LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) { // Rez object @@ -2142,10 +2141,10 @@ namespace OpenSim.Region.Environment.Scenes return rootPart.ParentGroup; } } - + return null; } - + public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) { string message = ""; @@ -2218,7 +2217,7 @@ namespace OpenSim.Region.Environment.Scenes item.AssetType = asset.Type; item.InvType = (int)InventoryType.Object; item.Folder = folderID; - + if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) { uint perms = returnobjects[i].GetEffectivePermissions(); diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e8a8a78..474f062 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -74,11 +74,11 @@ namespace OpenSim.Region.Environment.Scenes public InnerScene m_innerScene; /// - /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is + /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is /// dispenced. - /// + /// private uint m_lastAllocatedLocalId = 720000; - + private readonly Mutex _primAllocateMutex = new Mutex(false); private int m_timePhase = 24; @@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Scenes public override void Close() { m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); - + // Kick all ROOT agents with the message, 'The simulator is going down' ForEachScenePresence(delegate(ScenePresence avatar) { @@ -765,7 +765,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_frame % m_update_backup == 0) { UpdateStorageBackup(); - + } if (m_frame % m_update_terrain == 0) @@ -1112,7 +1112,7 @@ namespace OpenSim.Region.Environment.Scenes //X // . // - // Shade the terrain for shadows + // Shade the terrain for shadows if ((x - 1 > 0) && (y - 1 > 0)) { hfvalue = (float)hm[x, y]; @@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Environment.Scenes else if (hfdiff < -0.3f) { // We have to desaturate and blacken the land at the same time - // we use floats, colors use bytes, so shrink are space down to + // we use floats, colors use bytes, so shrink are space down to // 0-255 @@ -1429,13 +1429,13 @@ namespace OpenSim.Region.Environment.Scenes public void LazySaveGeneratedMaptile(byte[] data, bool temporary) { // Overwrites the local Asset cache with new maptile data - // Assets are single write, this causes the asset server to ignore this update, + // Assets are single write, this causes the asset server to ignore this update, // but the local asset cache does not // this is on purpose! The net result of this is the region always has the most up to date - // map tile while protecting the (grid) asset database from bloat caused by a new asset each + // map tile while protecting the (grid) asset database from bloat caused by a new asset each // time a mapimage is generated! - + LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; int lastMapRefresh = 0; @@ -1711,7 +1711,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was added, false if an object with the same uuid was already in the scene - /// + /// public bool AddRestoredSceneObject( SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) { @@ -1739,15 +1739,15 @@ namespace OpenSim.Region.Environment.Scenes lock (Entities) { ICollection entities = new List(Entities.Values); - + foreach (EntityBase e in entities) { if (e is SceneObjectGroup) DeleteSceneObject((SceneObjectGroup)e); } - } + } } - + /// /// Delete the given object from the scene. /// @@ -1791,8 +1791,8 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) { - m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); - + m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); + m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); } @@ -1805,29 +1805,29 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromXml2(string fileName) { - m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); - + m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); + m_serialiser.LoadPrimsFromXml2(this, fileName); } public void LoadPrimsFromXml2(TextReader reader, bool startScripts) { - m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); - + m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); + m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); } public void SavePrimsToXml2(string fileName) { m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); - + m_serialiser.SavePrimsToXml2(this, fileName); } public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) { m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); - + m_serialiser.SavePrimsToXml2(this, stream, min, max); } @@ -1835,7 +1835,7 @@ namespace OpenSim.Region.Environment.Scenes { m_log.InfoFormat( "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); - + List entityList = GetEntities(); List primList = new List(); @@ -1860,7 +1860,7 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromArchive(string filePath) { m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); - + m_archiver.DearchiveRegion(filePath); } @@ -1871,7 +1871,7 @@ namespace OpenSim.Region.Environment.Scenes public void SavePrimsToArchive(string filePath) { m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); - + m_archiver.ArchiveRegion(filePath); } @@ -1986,7 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); if (XMLMethod == 0) { - SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); + SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); AddRestoredSceneObject(sceneObject, true, false); SceneObjectPart RootPrim = GetSceneObjectPart(primID); @@ -1999,7 +1999,7 @@ namespace OpenSim.Region.Environment.Scenes { DeleteSceneObject(grp); } - + m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); return false; @@ -2075,7 +2075,7 @@ namespace OpenSim.Region.Environment.Scenes else { m_log.DebugFormat( - "[SCENE]: Adding new {0} agent {1} {2} in {3}", + "[SCENE]: Adding new {0} agent {1} {2} in {3}", (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); @@ -2156,7 +2156,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnScriptReset += ProcessScriptReset; client.OnGetScriptRunning += GetScriptRunning; client.OnSetScriptRunning += SetScriptRunning; - + client.OnRegionHandleRequest += RegionHandleRequest; client.OnUnackedTerrain += TerrainUnAcked; @@ -2310,7 +2310,7 @@ namespace OpenSim.Region.Environment.Scenes public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) { appearance = null; // VS needs this line, mono doesn't - + try { if (m_AvatarFactory == null || @@ -2323,10 +2323,10 @@ namespace OpenSim.Region.Environment.Scenes catch (Exception e) { m_log.ErrorFormat( - "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", + "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", client.Name, client.AgentId, e); appearance = new AvatarAppearance(); - } + } } /// @@ -2341,13 +2341,13 @@ namespace OpenSim.Region.Environment.Scenes { childagentYN = avatar.IsChildAgent; } - + try { m_log.DebugFormat( - "[SCENE]: Removing {0} agent {1} from region {2}", + "[SCENE]: Removing {0} agent {1} from region {2}", (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); - + if (avatar.IsChildAgent) { m_innerScene.removeUserCount(false); @@ -2378,7 +2378,7 @@ namespace OpenSim.Region.Environment.Scenes // We don't know which count to remove it from // Avatar is already disposed :/ } - + m_eventManager.TriggerOnRemovePresence(agentID); Broadcast(delegate(IClientAPI client) { @@ -2717,7 +2717,7 @@ namespace OpenSim.Region.Environment.Scenes { m_innerScene.removeUserCount(true); } - + // Tell a single agent to disconnect from the region. presence.ControllingClient.SendShutdownConnectionNotice(); @@ -3827,9 +3827,9 @@ namespace OpenSim.Region.Environment.Scenes { //should be doing this by parcel, but as its only for testing // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 - // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist + // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist // in the context of `<>c__CompilerGenerated17' - // MW said it was okay to comment the body of this method out for now since the code is experimental + // MW said it was okay to comment the body of this method out for now since the code is experimental // and will be replaced anyway // ForEachClient(delegate(IClientAPI client) // { @@ -3840,7 +3840,7 @@ namespace OpenSim.Region.Environment.Scenes // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); // }); } - + public void RegionHandleRequest(IClientAPI client, LLUUID regionID) { RegionInfo info; @@ -3860,4 +3860,4 @@ namespace OpenSim.Region.Environment.Scenes client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); } } -} +} diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 35a7434..adad7d3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; public event LogOffUser OnLogOffUser; public event GetLandData OnGetLandData; - + private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; @@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; private LogOffUser handlerLogOffUser = null; - private GetLandData handlerGetLandData = null; // OnGetLandData + private GetLandData handlerGetLandData = null; // OnGetLandData public KillObjectDelegate KillObject; public string _debugRegionName = String.Empty; @@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Scenes } return null; } - + #endregion #region Inform Client of Neighbours @@ -582,7 +582,7 @@ namespace OpenSim.Region.Environment.Scenes LLVector3 lookAt, uint flags) { bool destRegionUp = false; - + if (regionHandle == m_regionInfo.RegionHandle) { // Teleport within the same region diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 0b2cc9e..a0e0a37 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -45,534 +45,553 @@ namespace OpenSim.Region.Environment.Scenes #region Object Permission Checks - public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); - private List GenerateClientFlagsCheckFunctions = new List(); + public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); + private List GenerateClientFlagsCheckFunctions = new List(); - public void addGenerateClientFlags(GenerateClientFlags delegateFunc) - { - if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) - GenerateClientFlagsCheckFunctions.Add(delegateFunc); - } - public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) - { - if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) - GenerateClientFlagsCheckFunctions.Remove(delegateFunc); - } + public void addGenerateClientFlags(GenerateClientFlags delegateFunc) + { + if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) + GenerateClientFlagsCheckFunctions.Add(delegateFunc); + } - public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) - { - SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); - - if (part == null) - return 0; - - uint perms=part.GetEffectiveObjectFlags() | - (uint)LLObject.ObjectFlags.ObjectModify | - (uint)LLObject.ObjectFlags.ObjectCopy | - (uint)LLObject.ObjectFlags.ObjectMove | - (uint)LLObject.ObjectFlags.ObjectTransfer | - (uint)LLObject.ObjectFlags.ObjectYouOwner | - (uint)LLObject.ObjectFlags.ObjectAnyOwner | - (uint)LLObject.ObjectFlags.ObjectOwnerModify | - (uint)LLObject.ObjectFlags.ObjectYouOfficer; - - foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) - { - perms &= check(userID, objectID); - } - return perms; - } + public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) + { + if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) + GenerateClientFlagsCheckFunctions.Remove(delegateFunc); + } - public delegate void SetBypassPermissions(bool value); - private List SetBypassPermissionsCheckFunctions = new List(); + public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) + { + SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); - public void addSetBypassPermissions(SetBypassPermissions delegateFunc) - { - if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) - SetBypassPermissionsCheckFunctions.Add(delegateFunc); - } - public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) - { - if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) - SetBypassPermissionsCheckFunctions.Remove(delegateFunc); - } + if (part == null) + return 0; + + uint perms=part.GetEffectiveObjectFlags() | + (uint)LLObject.ObjectFlags.ObjectModify | + (uint)LLObject.ObjectFlags.ObjectCopy | + (uint)LLObject.ObjectFlags.ObjectMove | + (uint)LLObject.ObjectFlags.ObjectTransfer | + (uint)LLObject.ObjectFlags.ObjectYouOwner | + (uint)LLObject.ObjectFlags.ObjectAnyOwner | + (uint)LLObject.ObjectFlags.ObjectOwnerModify | + (uint)LLObject.ObjectFlags.ObjectYouOfficer; - public void ExternalChecksSetBypassPermissions(bool value) + foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) { - foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) - { - check(value); - } + perms &= check(userID, objectID); } + return perms; + } - public delegate bool BypassPermissions(); - private List BypassPermissionsCheckFunctions = new List(); + public delegate void SetBypassPermissions(bool value); + private List SetBypassPermissionsCheckFunctions = new List(); - public void addBypassPermissions(BypassPermissions delegateFunc) - { - if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) - BypassPermissionsCheckFunctions.Add(delegateFunc); - } - public void removeBypassPermissions(BypassPermissions delegateFunc) + public void addSetBypassPermissions(SetBypassPermissions delegateFunc) + { + if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) + SetBypassPermissionsCheckFunctions.Add(delegateFunc); + } + + public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) + { + if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) + SetBypassPermissionsCheckFunctions.Remove(delegateFunc); + } + + public void ExternalChecksSetBypassPermissions(bool value) + { + foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) { - if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) - BypassPermissionsCheckFunctions.Remove(delegateFunc); + check(value); } + } - public bool ExternalChecksBypassPermissions() + public delegate bool BypassPermissions(); + private List BypassPermissionsCheckFunctions = new List(); + + public void addBypassPermissions(BypassPermissions delegateFunc) + { + if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) + BypassPermissionsCheckFunctions.Add(delegateFunc); + } + + public void removeBypassPermissions(BypassPermissions delegateFunc) + { + if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) + BypassPermissionsCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksBypassPermissions() + { + foreach (BypassPermissions check in BypassPermissionsCheckFunctions) { - foreach (BypassPermissions check in BypassPermissionsCheckFunctions) + if (check() == false) { - if (check() == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool PropagatePermissions(); - private List PropagatePermissionsCheckFunctions = new List(); + public delegate bool PropagatePermissions(); + private List PropagatePermissionsCheckFunctions = new List(); - public void addPropagatePermissions(PropagatePermissions delegateFunc) - { - if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) - PropagatePermissionsCheckFunctions.Add(delegateFunc); - } - public void removePropagatePermissions(PropagatePermissions delegateFunc) - { - if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) - PropagatePermissionsCheckFunctions.Remove(delegateFunc); - } + public void addPropagatePermissions(PropagatePermissions delegateFunc) + { + if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) + PropagatePermissionsCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksPropagatePermissions() + public void removePropagatePermissions(PropagatePermissions delegateFunc) + { + if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) + PropagatePermissionsCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksPropagatePermissions() + { + foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) { - foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) + if (check() == false) { - if (check() == false) - { - return false; - } + return false; } - return true; } + return true; + } - #region REZ OBJECT - public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); - private List CanRezObjectCheckFunctions = new List(); + #region REZ OBJECT + public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); + private List CanRezObjectCheckFunctions = new List(); - public void addCheckRezObject(CanRezObject delegateFunc) - { - if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) - CanRezObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckRezObject(CanRezObject delegateFunc) - { - if (CanRezObjectCheckFunctions.Contains(delegateFunc)) - CanRezObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckRezObject(CanRezObject delegateFunc) + { + if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) + CanRezObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckRezObject(CanRezObject delegateFunc) + { + if (CanRezObjectCheckFunctions.Contains(delegateFunc)) + CanRezObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) + public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) + { + foreach (CanRezObject check in CanRezObjectCheckFunctions) { - foreach (CanRezObject check in CanRezObjectCheckFunctions) + if (check(objectCount, owner,objectPosition, m_scene) == false) { - if (check(objectCount, owner,objectPosition, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region DELETE OBJECT - public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); - private List CanDeleteObjectCheckFunctions = new List(); + #region DELETE OBJECT + public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); + private List CanDeleteObjectCheckFunctions = new List(); - public void addCheckDeleteObject(CanDeleteObject delegateFunc) - { - if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) - CanDeleteObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckDeleteObject(CanDeleteObject delegateFunc) - { - if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) - CanDeleteObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckDeleteObject(CanDeleteObject delegateFunc) + { + if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) + CanDeleteObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) + public void removeCheckDeleteObject(CanDeleteObject delegateFunc) + { + if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) + CanDeleteObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) + { + foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) { - foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) + if (check(objectID,deleter,m_scene) == false) { - if (check(objectID,deleter,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region TAKE OBJECT - public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); - private List CanTakeObjectCheckFunctions = new List(); + #region TAKE OBJECT + public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); + private List CanTakeObjectCheckFunctions = new List(); - public void addCheckTakeObject(CanTakeObject delegateFunc) - { - if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) - CanTakeObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckTakeObject(CanTakeObject delegateFunc) - { - if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) - CanTakeObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckTakeObject(CanTakeObject delegateFunc) + { + if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) + CanTakeObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckTakeObject(CanTakeObject delegateFunc) + { + if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) + CanTakeObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) + public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) + { + foreach (CanTakeObject check in CanTakeObjectCheckFunctions) { - foreach (CanTakeObject check in CanTakeObjectCheckFunctions) + if (check(objectID, AvatarTakingUUID, m_scene) == false) { - if (check(objectID, AvatarTakingUUID, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region TAKE COPY OBJECT - public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); - private List CanTakeCopyObjectCheckFunctions = new List(); + #region TAKE COPY OBJECT + public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); + private List CanTakeCopyObjectCheckFunctions = new List(); - public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) - { - if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) - CanTakeCopyObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) - { - if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) - CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) + { + if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) + CanTakeCopyObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) + public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) + { + if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) + CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) + { + foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) { - foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) + if (check(objectID,userID,m_scene) == false) { - if (check(objectID,userID,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region DUPLICATE OBJECT - public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); - private List CanDuplicateObjectCheckFunctions = new List(); + #region DUPLICATE OBJECT + public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); + private List CanDuplicateObjectCheckFunctions = new List(); - public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) - { - if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) - CanDuplicateObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) - { - if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) - CanDuplicateObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) + { + if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) + CanDuplicateObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) + public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) + { + if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) + CanDuplicateObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) + { + foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) { - foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) + if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) { - if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region EDIT OBJECT - public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); - private List CanEditObjectCheckFunctions = new List(); + #region EDIT OBJECT + public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); + private List CanEditObjectCheckFunctions = new List(); - public void addCheckEditObject(CanEditObject delegateFunc) - { - if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) - CanEditObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditObject(CanEditObject delegateFunc) - { - if (CanEditObjectCheckFunctions.Contains(delegateFunc)) - CanEditObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckEditObject(CanEditObject delegateFunc) + { + if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) + CanEditObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckEditObject(CanEditObject delegateFunc) + { + if (CanEditObjectCheckFunctions.Contains(delegateFunc)) + CanEditObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) + public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) + { + foreach (CanEditObject check in CanEditObjectCheckFunctions) { - foreach (CanEditObject check in CanEditObjectCheckFunctions) + if (check(objectID, editorID, m_scene) == false) { - if (check(objectID, editorID, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region MOVE OBJECT - public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); - private List CanMoveObjectCheckFunctions = new List(); + #region MOVE OBJECT + public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); + private List CanMoveObjectCheckFunctions = new List(); - public void addCheckMoveObject(CanMoveObject delegateFunc) - { - if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) - CanMoveObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckMoveObject(CanMoveObject delegateFunc) - { - if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) - CanMoveObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckMoveObject(CanMoveObject delegateFunc) + { + if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) + CanMoveObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) + public void removeCheckMoveObject(CanMoveObject delegateFunc) + { + if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) + CanMoveObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) + { + foreach (CanMoveObject check in CanMoveObjectCheckFunctions) { - foreach (CanMoveObject check in CanMoveObjectCheckFunctions) + if (check(objectID,moverID,m_scene) == false) { - if (check(objectID,moverID,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region OBJECT ENTRY - public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); - private List CanObjectEntryCheckFunctions = new List(); + #region OBJECT ENTRY + public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); + private List CanObjectEntryCheckFunctions = new List(); - public void addCheckObjectEntry(CanObjectEntry delegateFunc) - { - if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) - CanObjectEntryCheckFunctions.Add(delegateFunc); - } - public void removeCheckObjectEntry(CanObjectEntry delegateFunc) - { - if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) - CanObjectEntryCheckFunctions.Remove(delegateFunc); - } + public void addCheckObjectEntry(CanObjectEntry delegateFunc) + { + if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) + CanObjectEntryCheckFunctions.Add(delegateFunc); + } + + public void removeCheckObjectEntry(CanObjectEntry delegateFunc) + { + if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) + CanObjectEntryCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) + public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) + { + foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) { - foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) + if (check(objectID, newPoint, m_scene) == false) { - if (check(objectID, newPoint, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region RETURN OBJECT - public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); - private List CanReturnObjectCheckFunctions = new List(); + #region RETURN OBJECT + public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); + private List CanReturnObjectCheckFunctions = new List(); - public void addCheckReturnObject(CanReturnObject delegateFunc) - { - if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) - CanReturnObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckReturnObject(CanReturnObject delegateFunc) - { - if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) - CanReturnObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckReturnObject(CanReturnObject delegateFunc) + { + if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) + CanReturnObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckReturnObject(CanReturnObject delegateFunc) + { + if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) + CanReturnObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) + public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) + { + foreach (CanReturnObject check in CanReturnObjectCheckFunctions) { - foreach (CanReturnObject check in CanReturnObjectCheckFunctions) + if (check(objectID,returnerID,m_scene) == false) { - if (check(objectID,returnerID,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region INSTANT MESSAGE - public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); - private List CanInstantMessageCheckFunctions = new List(); + #region INSTANT MESSAGE + public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); + private List CanInstantMessageCheckFunctions = new List(); - public void addCheckInstantMessage(CanInstantMessage delegateFunc) - { - if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) - CanInstantMessageCheckFunctions.Add(delegateFunc); - } - public void removeCheckInstantMessage(CanInstantMessage delegateFunc) - { - if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) - CanInstantMessageCheckFunctions.Remove(delegateFunc); - } + public void addCheckInstantMessage(CanInstantMessage delegateFunc) + { + if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) + CanInstantMessageCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) + public void removeCheckInstantMessage(CanInstantMessage delegateFunc) + { + if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) + CanInstantMessageCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) + { + foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) { - foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) + if (check(user, target, m_scene) == false) { - if (check(user, target, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } + + #endregion - #endregion + #region INVENTORY TRANSFER + public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); + private List CanInventoryTransferCheckFunctions = new List(); - #region INVENTORY TRANSFER - public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); - private List CanInventoryTransferCheckFunctions = new List(); + public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) + { + if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) + CanInventoryTransferCheckFunctions.Add(delegateFunc); + } - public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) - { - if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) - CanInventoryTransferCheckFunctions.Add(delegateFunc); - } - public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) + public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) { if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) CanInventoryTransferCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) + public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) + { + foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) { - foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) + if (check(user, target, m_scene) == false) { - if (check(user, target, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region VIEW SCRIPT - public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanViewScriptCheckFunctions = new List(); + #region VIEW SCRIPT + public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanViewScriptCheckFunctions = new List(); - public void addCheckViewScript(CanViewScript delegateFunc) - { - if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) - CanViewScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckViewScript(CanViewScript delegateFunc) - { - if (CanViewScriptCheckFunctions.Contains(delegateFunc)) - CanViewScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckViewScript(CanViewScript delegateFunc) + { + if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) + CanViewScriptCheckFunctions.Add(delegateFunc); + } + + public void removeCheckViewScript(CanViewScript delegateFunc) + { + if (CanViewScriptCheckFunctions.Contains(delegateFunc)) + CanViewScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) + public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanViewScript check in CanViewScriptCheckFunctions) { - foreach (CanViewScript check in CanViewScriptCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanViewNotecardCheckFunctions = new List(); + public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanViewNotecardCheckFunctions = new List(); - public void addCheckViewNotecard(CanViewNotecard delegateFunc) - { - if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) - CanViewNotecardCheckFunctions.Add(delegateFunc); - } - public void removeCheckViewNotecard(CanViewNotecard delegateFunc) - { - if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) - CanViewNotecardCheckFunctions.Remove(delegateFunc); - } + public void addCheckViewNotecard(CanViewNotecard delegateFunc) + { + if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) + CanViewNotecardCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckViewNotecard(CanViewNotecard delegateFunc) + { + if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) + CanViewNotecardCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) { - foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region EDIT SCRIPT - public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanEditScriptCheckFunctions = new List(); + #region EDIT SCRIPT + public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanEditScriptCheckFunctions = new List(); - public void addCheckEditScript(CanEditScript delegateFunc) - { - if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) - CanEditScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditScript(CanEditScript delegateFunc) - { - if (CanEditScriptCheckFunctions.Contains(delegateFunc)) - CanEditScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckEditScript(CanEditScript delegateFunc) + { + if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) + CanEditScriptCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckEditScript(CanEditScript delegateFunc) + { + if (CanEditScriptCheckFunctions.Contains(delegateFunc)) + CanEditScriptCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanEditScript check in CanEditScriptCheckFunctions) { - foreach (CanEditScript check in CanEditScriptCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); - private List CanEditNotecardCheckFunctions = new List(); + public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); + private List CanEditNotecardCheckFunctions = new List(); - public void addCheckEditNotecard(CanEditNotecard delegateFunc) - { - if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) - CanEditNotecardCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditNotecard(CanEditNotecard delegateFunc) - { - if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) - CanEditNotecardCheckFunctions.Remove(delegateFunc); - } + public void addCheckEditNotecard(CanEditNotecard delegateFunc) + { + if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) + CanEditNotecardCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckEditNotecard(CanEditNotecard delegateFunc) + { + if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) + CanEditNotecardCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) { foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) { @@ -584,388 +603,402 @@ namespace OpenSim.Region.Environment.Scenes return true; } - #endregion + #endregion - #region RUN SCRIPT (When Script Placed in Object) - public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanRunScriptCheckFunctions = new List(); + #region RUN SCRIPT (When Script Placed in Object) + public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanRunScriptCheckFunctions = new List(); - public void addCheckRunScript(CanRunScript delegateFunc) - { - if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) - CanRunScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckRunScript(CanRunScript delegateFunc) - { - if (CanRunScriptCheckFunctions.Contains(delegateFunc)) - CanRunScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckRunScript(CanRunScript delegateFunc) + { + if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) + CanRunScriptCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckRunScript(CanRunScript delegateFunc) + { + if (CanRunScriptCheckFunctions.Contains(delegateFunc)) + CanRunScriptCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanRunScript check in CanRunScriptCheckFunctions) { - foreach (CanRunScript check in CanRunScriptCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region START SCRIPT (When Script run box is Checked after placed in object) - public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); - private List CanStartScriptCheckFunctions = new List(); + #region START SCRIPT (When Script run box is Checked after placed in object) + public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); + private List CanStartScriptCheckFunctions = new List(); - public void addCheckStartScript(CanStartScript delegateFunc) - { - if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) - CanStartScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckStartScript(CanStartScript delegateFunc) - { - if (CanStartScriptCheckFunctions.Contains(delegateFunc)) - CanStartScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckStartScript(CanStartScript delegateFunc) + { + if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) + CanStartScriptCheckFunctions.Add(delegateFunc); + } + + public void removeCheckStartScript(CanStartScript delegateFunc) + { + if (CanStartScriptCheckFunctions.Contains(delegateFunc)) + CanStartScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) + { + foreach (CanStartScript check in CanStartScriptCheckFunctions) { - foreach (CanStartScript check in CanStartScriptCheckFunctions) + if (check(script, user, m_scene) == false) { - if (check(script, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } #endregion - #region STOP SCRIPT (When Script run box is unchecked after placed in object) - public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); - private List CanStopScriptCheckFunctions = new List(); + #region STOP SCRIPT (When Script run box is unchecked after placed in object) + public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); + private List CanStopScriptCheckFunctions = new List(); + + public void addCheckStopScript(CanStopScript delegateFunc) + { + if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) + CanStopScriptCheckFunctions.Add(delegateFunc); + } - public void addCheckStopScript(CanStopScript delegateFunc) - { - if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) - CanStopScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckStopScript(CanStopScript delegateFunc) - { - if (CanStopScriptCheckFunctions.Contains(delegateFunc)) - CanStopScriptCheckFunctions.Remove(delegateFunc); - } + public void removeCheckStopScript(CanStopScript delegateFunc) + { + if (CanStopScriptCheckFunctions.Contains(delegateFunc)) + CanStopScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) + { + foreach (CanStopScript check in CanStopScriptCheckFunctions) { - foreach (CanStopScript check in CanStopScriptCheckFunctions) + if (check(script, user, m_scene) == false) { - if (check(script, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region RESET SCRIPT - public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); - private List CanResetScriptCheckFunctions = new List(); + #region RESET SCRIPT + public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); + private List CanResetScriptCheckFunctions = new List(); - public void addCheckResetScript(CanResetScript delegateFunc) - { - if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) - CanResetScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckResetScript(CanResetScript delegateFunc) - { - if (CanResetScriptCheckFunctions.Contains(delegateFunc)) - CanResetScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckResetScript(CanResetScript delegateFunc) + { + if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) + CanResetScriptCheckFunctions.Add(delegateFunc); + } + + public void removeCheckResetScript(CanResetScript delegateFunc) + { + if (CanResetScriptCheckFunctions.Contains(delegateFunc)) + CanResetScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) + { + foreach (CanResetScript check in CanResetScriptCheckFunctions) { - foreach (CanResetScript check in CanResetScriptCheckFunctions) + if (check(script, user, m_scene) == false) { - if (check(script, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region TERRAFORM LAND - public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); - private List CanTerraformLandCheckFunctions = new List(); + #region TERRAFORM LAND + public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); + private List CanTerraformLandCheckFunctions = new List(); - public void addCheckTerraformLand(CanTerraformLand delegateFunc) - { - if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) - CanTerraformLandCheckFunctions.Add(delegateFunc); - } - public void removeCheckTerraformLand(CanTerraformLand delegateFunc) - { - if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) - CanTerraformLandCheckFunctions.Remove(delegateFunc); - } + public void addCheckTerraformLand(CanTerraformLand delegateFunc) + { + if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) + CanTerraformLandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckTerraformLand(CanTerraformLand delegateFunc) + { + if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) + CanTerraformLandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) + public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) + { + foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) { - foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) + if (check(user, pos, m_scene) == false) { - if (check(user, pos, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region RUN CONSOLE COMMAND - public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); - private List CanRunConsoleCommandCheckFunctions = new List(); + #region RUN CONSOLE COMMAND + public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); + private List CanRunConsoleCommandCheckFunctions = new List(); - public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) - { - if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) - CanRunConsoleCommandCheckFunctions.Add(delegateFunc); - } - public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) - { - if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) - CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); - } + public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) + { + if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) + CanRunConsoleCommandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) + { + if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) + CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanRunConsoleCommand(LLUUID user) + public bool ExternalChecksCanRunConsoleCommand(LLUUID user) + { + foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) { - foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) + if (check(user, m_scene) == false) { - if (check(user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region CAN ISSUE ESTATE COMMAND - public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); - private List CanIssueEstateCommandCheckFunctions = new List(); + #region CAN ISSUE ESTATE COMMAND + public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); + private List CanIssueEstateCommandCheckFunctions = new List(); - public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) - { - if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) - CanIssueEstateCommandCheckFunctions.Add(delegateFunc); - } - public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) - { - if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) - CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); - } + public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) + { + if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) + CanIssueEstateCommandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) + { + if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) + CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) + public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) + { + foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) { - foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) + if (check(user, m_scene, ownerCommand) == false) { - if (check(user, m_scene, ownerCommand) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region CAN BE GODLIKE - public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); - private List CanBeGodLikeCheckFunctions = new List(); + #region CAN BE GODLIKE + public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); + private List CanBeGodLikeCheckFunctions = new List(); - public void addCheckBeGodLike(CanBeGodLike delegateFunc) - { - if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) - CanBeGodLikeCheckFunctions.Add(delegateFunc); - } - public void removeCheckBeGodLike(CanBeGodLike delegateFunc) - { - if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) - CanBeGodLikeCheckFunctions.Remove(delegateFunc); - } + public void addCheckBeGodLike(CanBeGodLike delegateFunc) + { + if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) + CanBeGodLikeCheckFunctions.Add(delegateFunc); + } + + public void removeCheckBeGodLike(CanBeGodLike delegateFunc) + { + if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) + CanBeGodLikeCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanBeGodLike(LLUUID user) + public bool ExternalChecksCanBeGodLike(LLUUID user) + { + foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) { - foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) + if (check(user, m_scene) == false) { - if (check(user, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region EDIT PARCEL - public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanEditParcelCheckFunctions = new List(); + #region EDIT PARCEL + public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanEditParcelCheckFunctions = new List(); - public void addCheckEditParcel(CanEditParcel delegateFunc) - { - if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) - CanEditParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditParcel(CanEditParcel delegateFunc) - { - if (CanEditParcelCheckFunctions.Contains(delegateFunc)) - CanEditParcelCheckFunctions.Remove(delegateFunc); - } + public void addCheckEditParcel(CanEditParcel delegateFunc) + { + if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) + CanEditParcelCheckFunctions.Add(delegateFunc); + } + + public void removeCheckEditParcel(CanEditParcel delegateFunc) + { + if (CanEditParcelCheckFunctions.Contains(delegateFunc)) + CanEditParcelCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) + { + foreach (CanEditParcel check in CanEditParcelCheckFunctions) { - foreach (CanEditParcel check in CanEditParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region SELL PARCEL - public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanSellParcelCheckFunctions = new List(); + #region SELL PARCEL + public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanSellParcelCheckFunctions = new List(); - public void addCheckSellParcel(CanSellParcel delegateFunc) - { - if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) - CanSellParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckSellParcel(CanSellParcel delegateFunc) - { - if (CanSellParcelCheckFunctions.Contains(delegateFunc)) - CanSellParcelCheckFunctions.Remove(delegateFunc); - } + public void addCheckSellParcel(CanSellParcel delegateFunc) + { + if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) + CanSellParcelCheckFunctions.Add(delegateFunc); + } + + public void removeCheckSellParcel(CanSellParcel delegateFunc) + { + if (CanSellParcelCheckFunctions.Contains(delegateFunc)) + CanSellParcelCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) + { + foreach (CanSellParcel check in CanSellParcelCheckFunctions) { - foreach (CanSellParcel check in CanSellParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region ABANDON PARCEL - public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanAbandonParcelCheckFunctions = new List(); + #region ABANDON PARCEL + public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanAbandonParcelCheckFunctions = new List(); - public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) - { - if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) - CanAbandonParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) - { - if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) - CanAbandonParcelCheckFunctions.Remove(delegateFunc); - } + public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) + { + if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) + CanAbandonParcelCheckFunctions.Add(delegateFunc); + } + + public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) + { + if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) + CanAbandonParcelCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) + { + foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) { - foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanReclaimParcelCheckFunctions = new List(); + public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanReclaimParcelCheckFunctions = new List(); - public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) - { - if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) - CanReclaimParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) - { - if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) - CanReclaimParcelCheckFunctions.Remove(delegateFunc); - } + public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) + { + if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) + CanReclaimParcelCheckFunctions.Add(delegateFunc); + } + + public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) + { + if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) + CanReclaimParcelCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) + { + foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) { - foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); - private List CanBuyLandCheckFunctions = new List(); + return true; + } + public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); + private List CanBuyLandCheckFunctions = new List(); - public void addCheckCanBuyLand(CanBuyLand delegateFunc) - { - if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) - CanBuyLandCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanBuyLand(CanBuyLand delegateFunc) - { - if (CanBuyLandCheckFunctions.Contains(delegateFunc)) - CanBuyLandCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanBuyLand(CanBuyLand delegateFunc) + { + if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) + CanBuyLandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanBuyLand(CanBuyLand delegateFunc) + { + if (CanBuyLandCheckFunctions.Contains(delegateFunc)) + CanBuyLandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) + { + foreach (CanBuyLand check in CanBuyLandCheckFunctions) { - foreach (CanBuyLand check in CanBuyLandCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); - private List CanLinkObjectCheckFunctions = new List(); + public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); + private List CanLinkObjectCheckFunctions = new List(); - public void addCheckCanLinkObject(CanLinkObject delegateFunc) - { - if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) - CanLinkObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanLinkObject(CanLinkObject delegateFunc) - { - if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) - CanLinkObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanLinkObject(CanLinkObject delegateFunc) + { + if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) + CanLinkObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanLinkObject(CanLinkObject delegateFunc) + { + if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) + CanLinkObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) + public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) { foreach (CanLinkObject check in CanLinkObjectCheckFunctions) { @@ -977,137 +1010,141 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); - private List CanDelinkObjectCheckFunctions = new List(); + public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); + private List CanDelinkObjectCheckFunctions = new List(); - public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) - { - if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) - CanDelinkObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) - { - if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) - CanDelinkObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) + { + if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) + CanDelinkObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) + { + if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) + CanDelinkObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) + public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) + { + foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) { - foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) + if (check(user, objectID) == false) { - if (check(user, objectID) == false) - { - return false; - } + return false; } - return true; } + return true; + } #endregion - public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); - private List CanCreateInventoryCheckFunctions = new List(); + public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); + private List CanCreateInventoryCheckFunctions = new List(); - public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) - { - if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) - CanCreateInventoryCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) - { - if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) - CanCreateInventoryCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) + { + if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) + CanCreateInventoryCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) + { + if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) + CanCreateInventoryCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) + { + foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) { - foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) + if (check(invType, objectID, userID) == false) { - if (check(invType, objectID, userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); - private List CanCopyInventoryCheckFunctions = new List(); + public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); + private List CanCopyInventoryCheckFunctions = new List(); - public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) - { - if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) - CanCopyInventoryCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) - { - if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) - CanCopyInventoryCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) + { + if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) + CanCopyInventoryCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) + { + if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) + CanCopyInventoryCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + { + foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) { - foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) + if (check(itemID, objectID, userID) == false) { - if (check(itemID, objectID, userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); - private List CanDeleteInventoryCheckFunctions = new List(); + public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); + private List CanDeleteInventoryCheckFunctions = new List(); - public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) - { - if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) - CanDeleteInventoryCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) - { - if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) - CanDeleteInventoryCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) + { + if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) + CanDeleteInventoryCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) + { + if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) + CanDeleteInventoryCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + { + foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) { - foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) + if (check(itemID, objectID, userID) == false) { - if (check(itemID, objectID, userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanTeleport(LLUUID userID); - private List CanTeleportCheckFunctions = new List(); + public delegate bool CanTeleport(LLUUID userID); + private List CanTeleportCheckFunctions = new List(); - public void addCheckCanTeleport(CanTeleport delegateFunc) - { - if (!CanTeleportCheckFunctions.Contains(delegateFunc)) - CanTeleportCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanTeleport(CanTeleport delegateFunc) - { - if (CanTeleportCheckFunctions.Contains(delegateFunc)) - CanTeleportCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanTeleport(CanTeleport delegateFunc) + { + if (!CanTeleportCheckFunctions.Contains(delegateFunc)) + CanTeleportCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanTeleport(CanTeleport delegateFunc) + { + if (CanTeleportCheckFunctions.Contains(delegateFunc)) + CanTeleportCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanTeleport(LLUUID userID) + public bool ExternalChecksCanTeleport(LLUUID userID) + { + foreach (CanTeleport check in CanTeleportCheckFunctions) { - foreach (CanTeleport check in CanTeleportCheckFunctions) + if (check(userID) == false) { - if (check(userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } } } - diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index cc4891f..032d673 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs @@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Scenes private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// - /// Force all task inventories of prims in the scene object to persist + /// Force all task inventories of prims in the scene object to persist /// public void ForceInventoryPersistence() { @@ -49,9 +49,9 @@ namespace OpenSim.Region.Environment.Scenes { part.ForceInventoryPersistence(); } - } + } } - + /// /// Start the scripts contained in all the prims in this group. /// @@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Scenes // taskItem.SalePrice = item.SalePrice; // taskItem.SaleType = item.SaleType; taskItem.CreationDate = (uint)item.CreationDate; - + part.AddInventoryItem(taskItem); return true; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2a1b8c5..9c3d6a7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes /// since the group's last persistent backup /// public bool HasGroupChanged = false; - + public float scriptScore = 0f; private LLVector3 lastPhysGroupPos; @@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes private bool m_scriptListens_notAtTarget = false; #region Properties - + /// /// The name of an object grouping is always the same as its root part /// @@ -123,7 +123,7 @@ namespace OpenSim.Region.Environment.Scenes { get { return RootPart.Name; } set { RootPart.Name = value; } - } + } /// /// Added because the Parcel code seems to use it @@ -445,13 +445,13 @@ namespace OpenSim.Region.Environment.Scenes } more = !reader.EOF; } - + reader.Close(); sr.Close(); UpdateParentIDs(); } - + /// /// /// @@ -468,14 +468,14 @@ namespace OpenSim.Region.Environment.Scenes newPart.LinkNum = 0; m_parts.Add(newPart.UUID, newPart); SetPartAsRoot(newPart); - + // one of these is a proxy. if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) AttachToBackup(); //ApplyPhysics(scene.m_physicalPrim); } - + /// /// /// @@ -754,7 +754,7 @@ namespace OpenSim.Region.Environment.Scenes m_rootPart.ScheduleFullUpdate(); m_rootPart.ClearUndoState(); } - + public void DetachToInventoryPrep() { ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); @@ -873,11 +873,11 @@ namespace OpenSim.Region.Environment.Scenes return m_scene.MaxUndoCount; return 5; } - - // justincc: I don't believe this hack is needed any longer, especially since the physics + + // 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 + // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects // at region startup public void ResetChildPrimPhysicsPositions() { @@ -926,20 +926,20 @@ namespace OpenSim.Region.Environment.Scenes /// public void DeleteGroup() { - // We need to keep track of this state in case this group is still queued for backup. + // We need to keep track of this state in case this group is still queued for backup. // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race // conditions where a user deletes an entity while it is being stored. Really, the update - // code needs a redesign. + // code needs a redesign. m_isDeleted = true; - - DetachFromBackup(this); + + DetachFromBackup(this); lock (m_parts) { foreach (SceneObjectPart part in m_parts.Values) { part.RemoveScriptInstances(); - + List avatars = Scene.GetScenePresences(); for (int i = 0; i < avatars.Count; i++) { @@ -951,12 +951,12 @@ namespace OpenSim.Region.Environment.Scenes avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); } } - + m_rootPart = null; - m_parts.Clear(); + m_parts.Clear(); } } - + public void FakeDeleteGroup() { foreach (SceneObjectPart part in m_parts.Values) @@ -1034,7 +1034,7 @@ namespace OpenSim.Region.Environment.Scenes lock (m_targets) m_targets.Clear(); } - + ScheduleGroupForFullUpdate(); } @@ -1067,7 +1067,7 @@ namespace OpenSim.Region.Environment.Scenes { part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); } - + // Hack to get the physics scene geometries in the right spot ResetChildPrimPhysicsPositions(); } @@ -1102,14 +1102,14 @@ namespace OpenSim.Region.Environment.Scenes /// /// public void ProcessBackup(IRegionDataStore datastore) - { + { if (HasGroupChanged) { // don't backup while it's selected or you're asking for changes mid stream. if ((!IsSelected) && (RootPart != null)) { m_log.InfoFormat( - "[SCENE]: Storing object {0}, {1} in {2}", + "[SCENE]: Storing object {0}, {1} in {2}", Name, UUID, m_scene.RegionInfo.RegionName); SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); @@ -1236,7 +1236,7 @@ namespace OpenSim.Region.Environment.Scenes dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); } - + // Now we've made a copy that replaces this one, we need to // switch the owner to the person who did the copying // Second Life copies an object and duplicates the first one in it's place @@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Environment.Scenes dupe.UpdateParentIDs(); dupe.HasGroupChanged = true; dupe.AttachToBackup(); - + ScheduleGroupForFullUpdate(); } @@ -1673,7 +1673,7 @@ namespace OpenSim.Region.Environment.Scenes { return true; } - + return false; } @@ -1695,7 +1695,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + return false; } @@ -2042,7 +2042,7 @@ namespace OpenSim.Region.Environment.Scenes public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) { SceneObjectPart selectionPart = GetChildPart(localID); - + if (selectionPart != null) { lock (m_parts) @@ -2164,7 +2164,7 @@ namespace OpenSim.Region.Environment.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); } //if (part.UUID != m_rootPart.UUID) - + HasGroupChanged = true; ScheduleGroupForFullUpdate(); @@ -2332,10 +2332,10 @@ namespace OpenSim.Region.Environment.Scenes } AbsolutePosition = pos; - + HasGroupChanged = true; } - + //we need to do a terse update even if the move wasn't allowed // so that the position is reset in the client (the object snaps back) ScheduleGroupForTerseUpdate(); @@ -2349,7 +2349,7 @@ namespace OpenSim.Region.Environment.Scenes public void UpdateSinglePosition(LLVector3 pos, uint localID) { SceneObjectPart part = GetChildPart(localID); - + if (part != null) { if (part.UUID == m_rootPart.UUID) @@ -2360,7 +2360,7 @@ namespace OpenSim.Region.Environment.Scenes { part.UpdateOffSet(pos); } - + HasGroupChanged = true; } } @@ -2398,7 +2398,7 @@ namespace OpenSim.Region.Environment.Scenes } AbsolutePosition = newPos; - + HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2426,7 +2426,7 @@ namespace OpenSim.Region.Environment.Scenes m_rootPart.RotationOffset.Z); m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } - + HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2447,7 +2447,7 @@ namespace OpenSim.Region.Environment.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } AbsolutePosition = pos; - + HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2684,7 +2684,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + /// /// Set the user group to which this scene object belongs. /// @@ -2698,10 +2698,10 @@ namespace OpenSim.Region.Environment.Scenes { part.SetGroup(GroupID, client); } - + HasGroupChanged = true; } - + ScheduleGroupForFullUpdate(); } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 480c030..0ac20e2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Scenes private string m_inventoryFileName = String.Empty; private int m_inventoryFileNameSerial = 0; - + /// /// Serial count for inventory file , used to tell if inventory has changed /// no need for this to be part of Database backup @@ -53,13 +53,13 @@ namespace OpenSim.Region.Environment.Scenes /// /// Holds in memory prim inventory /// - protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); + protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); /// /// Tracks whether inventory has changed since the last persistent backup /// protected bool HasInventoryChanged; - + /// /// Force the task inventory of this prim to persist at the next update sweep /// @@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Scenes { if (i.InvType == (int)InventoryType.LSL) RemoveScriptInstance(i.ItemID); - + RemoveInventoryItem(i.ItemID); break; } @@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes AddInventoryItem(item.Name, item); } - + /// /// Add an item to this prim's inventory. /// @@ -329,7 +329,7 @@ namespace OpenSim.Region.Environment.Scenes { item.ParentID = UUID; item.ParentPartID = UUID; - + lock (m_taskInventory) { m_taskInventory.Add(item.ItemID, item); @@ -339,7 +339,7 @@ namespace OpenSim.Region.Environment.Scenes m_inventorySerial++; //m_inventorySerial += 2; HasInventoryChanged = true; - ParentGroup.HasGroupChanged = true; + ParentGroup.HasGroupChanged = true; } /// @@ -369,10 +369,10 @@ namespace OpenSim.Region.Environment.Scenes /// /// null if the item does not exist public TaskInventoryItem GetInventoryItem(LLUUID itemId) - { + { TaskInventoryItem item; m_taskInventory.TryGetValue(itemId, out item); - + return item; } @@ -450,12 +450,12 @@ namespace OpenSim.Region.Environment.Scenes } } - + if (scriptcount <= 0) { RemFlag(LLObject.ObjectFlags.Scripted); } - + ScheduleFullUpdate(); return type; @@ -603,7 +603,7 @@ namespace OpenSim.Region.Environment.Scenes public void ProcessInventoryBackup(IRegionDataStore datastore) { if (HasInventoryChanged) - { + { lock (TaskInventory) { datastore.StorePrimInventory(UUID, TaskInventory.Values); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 1432912..517114f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes public uint AttachmentPoint = (byte)0; [XmlIgnore] public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); - + [XmlIgnore] public bool Undoing = false; @@ -196,11 +196,11 @@ namespace OpenSim.Region.Environment.Scenes protected LLVector3 m_velocity; // TODO: Those have to be changed into persistent properties at some later point, - // or sit-camera on vehicles will break on sim-crossing. + // or sit-camera on vehicles will break on sim-crossing. private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); private bool m_forceMouselook = false; - + #endregion Fields #region Constructors @@ -352,13 +352,13 @@ namespace OpenSim.Region.Environment.Scenes private uint _everyoneMask = (uint)PermissionMask.None; private uint _nextOwnerMask = (uint)PermissionMask.All; private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; - + public LLUUID CreatorID { - get + get { return _creatorID; } - set + set { _creatorID = value; } @@ -390,26 +390,26 @@ namespace OpenSim.Region.Environment.Scenes { get { return (uint)_flags; } set { _flags = (LLObject.ObjectFlags)value; } - } - + } + public LLUUID UUID { get { return m_uuid; } set { m_uuid = value; } } - + public uint LocalId { get { return m_localId; } set { m_localId = value; } } - + public virtual string Name { get { return m_name; } set { m_name = value; } } - + public byte Material { get { return (byte) m_material; } @@ -607,13 +607,13 @@ namespace OpenSim.Region.Environment.Scenes /// public LLVector3 AngularVelocity { - get - { + get + { if ((PhysActor != null) && PhysActor.IsPhysical) { m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); } - return m_angularVelocity; + return m_angularVelocity; } set { m_angularVelocity = value; } } @@ -631,7 +631,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_description; } set { m_description = value; } } - + public Color Color { get { return m_color; } @@ -702,7 +702,7 @@ namespace OpenSim.Region.Environment.Scenes // set of attributes on shape change. For instance, // changing the lighting on a shape shouldn't cause // this. - if (m_shape != null) + if (m_shape != null) shape_changed = true; m_shape = value; @@ -740,7 +740,7 @@ namespace OpenSim.Region.Environment.Scenes } #endregion - + //--------------- @@ -771,7 +771,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_parentGroup; } } - + public scriptEvents ScriptEvents { @@ -802,8 +802,8 @@ namespace OpenSim.Region.Environment.Scenes public LLQuaternion SitTargetOrientationLL { - get - { + get + { return new LLQuaternion( m_sitTargetOrientation.x, m_sitTargetOrientation.y, @@ -830,97 +830,97 @@ namespace OpenSim.Region.Environment.Scenes } } - public uint ParentID + public uint ParentID { get { return _parentID; } set { _parentID = value; } } - public int CreationDate + public int CreationDate { get { return _creationDate; } set { _creationDate = value; } } - public uint Category + public uint Category { get { return _category; } set { _category = value; } } - public int SalePrice + public int SalePrice { get { return _salePrice; } set { _salePrice = value; } } - public byte ObjectSaleType + public byte ObjectSaleType { get { return _objectSaleType; } set { _objectSaleType = value; } } - public int OwnershipCost + public int OwnershipCost { get { return _ownershipCost; } set { _ownershipCost = value; } } - public LLUUID GroupID + public LLUUID GroupID { get { return _groupID; } set { _groupID = value; } } - public LLUUID OwnerID + public LLUUID OwnerID { get { return _ownerID; } set { _ownerID = value; } } - public LLUUID LastOwnerID + public LLUUID LastOwnerID { get { return _lastOwnerID; } set { _lastOwnerID = value; } } - public uint BaseMask + public uint BaseMask { get { return _baseMask; } set { _baseMask = value; } } - public uint OwnerMask + public uint OwnerMask { get { return _ownerMask; } set { _ownerMask = value; } } - public uint GroupMask + public uint GroupMask { get { return _groupMask; } set { _groupMask = value; } } - public uint EveryoneMask + public uint EveryoneMask { get { return _everyoneMask; } set { _everyoneMask = value; } } - public uint NextOwnerMask + public uint NextOwnerMask { get { return _nextOwnerMask; } set { _nextOwnerMask = value; } } - public libsecondlife.LLObject.ObjectFlags Flags + public libsecondlife.LLObject.ObjectFlags Flags { get { return _flags; } set { _flags = value; } } - public LLUUID SitTargetAvatar + public LLUUID SitTargetAvatar { get { return m_sitTargetAvatar; } set { m_sitTargetAvatar = value; } @@ -929,8 +929,8 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public virtual LLUUID RegionID { - get - { + get + { if (ParentGroup != null && ParentGroup.Scene != null) return ParentGroup.Scene.RegionInfo.RegionID; else @@ -943,9 +943,9 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public LLUUID ParentUUID { - get + get { - if (ParentGroup != null) + if (ParentGroup != null) { _parentUUID = ParentGroup.UUID; } @@ -953,7 +953,7 @@ namespace OpenSim.Region.Environment.Scenes } set { _parentUUID = value; } } - + #endregion Public Properties with only Get #region Private Methods @@ -2460,7 +2460,7 @@ namespace OpenSim.Region.Environment.Scenes return; } } - + if (m_parentGroup.GetSceneMaxUndo() > 0) @@ -2914,7 +2914,7 @@ namespace OpenSim.Region.Environment.Scenes ScaleOffset = Math.Abs(ScaleOffset); Vector3 offset = returnresult.normal * ScaleOffset; returnresult.ipoint = AXpos + offset; - + ///pos = (intersectionpoint + offset); } else @@ -3354,27 +3354,27 @@ namespace OpenSim.Region.Environment.Scenes public void SetCameraAtOffset(LLVector3 v) { m_cameraAtOffset = v; } - + public void SetCameraEyeOffset(LLVector3 v) { m_cameraEyeOffset = v; } - + public void SetForceMouselook(bool force) { m_forceMouselook = force; } - + public LLVector3 GetCameraAtOffset() { return m_cameraAtOffset; } - + public LLVector3 GetCameraEyeOffset() { return m_cameraEyeOffset; } - + public bool GetForceMouselook() { return m_forceMouselook; } - + #endregion Public Methods } } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index cad2496..5669af6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Environment.Scenes RemoveFromPhysicalScene(); } } - + cameraAtOffset = part.GetCameraAtOffset(); cameraEyeOffset = part.GetCameraEyeOffset(); forceMouselook = part.GetForceMouselook(); @@ -1347,7 +1347,7 @@ namespace OpenSim.Region.Environment.Scenes RemoveAnimation(animID); } - + public LLUUID[] GetAnimationArray() { LLUUID[] animIDs; @@ -1696,7 +1696,7 @@ namespace OpenSim.Region.Environment.Scenes /// - /// Do everything required once a client completes its movement into a region + /// Do everything required once a client completes its movement into a region /// public void SendInitialData() { @@ -1898,7 +1898,7 @@ namespace OpenSim.Region.Environment.Scenes { if (IsChildAgent) return; - + LLVector3 pos2 = AbsolutePosition; LLVector3 vel = Velocity; @@ -1968,9 +1968,9 @@ namespace OpenSim.Region.Environment.Scenes // This means we need to remove the current caps handler here and possibly compensate later, // in case both scenes are being hosted on the same region server. Messy m_scene.RemoveCapsHandler(UUID); - newpos = newpos + (vel); + newpos = newpos + (vel); - CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); + CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); if (userInfo != null) { userInfo.DropInventory(); @@ -1978,11 +1978,11 @@ namespace OpenSim.Region.Environment.Scenes else { m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); - } - + } + bool crossingSuccessful = m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, - m_physicsActor.Flying); + m_physicsActor.Flying); if (crossingSuccessful) { AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); @@ -1998,8 +1998,8 @@ namespace OpenSim.Region.Environment.Scenes m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, capsPath); MakeChildAgent(); - CrossAttachmentsIntoNewRegion(neighbourHandle); - + CrossAttachmentsIntoNewRegion(neighbourHandle); + m_scene.SendKillObject(m_localId); m_scene.NotifyMyCoarseLocationChange(); // the user may change thier profile information in other region, @@ -2010,7 +2010,7 @@ namespace OpenSim.Region.Environment.Scenes else { // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing - m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); + m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); m_scene.AddCapsHandler(UUID); } } @@ -2825,7 +2825,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + LastCommands = allflags; } diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index f46aba4..0e551cb 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Scenes m_report.Interval = statsUpdatesEveryMS; m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); m_report.Enabled = true; - + if (StatsManager.SimExtraStats != null) OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; } diff --git a/OpenSim/Region/Environment/Scenes/UndoState.cs b/OpenSim/Region/Environment/Scenes/UndoState.cs index 5d1f6a0..fdbfa8c 100644 --- a/OpenSim/Region/Environment/Scenes/UndoState.cs +++ b/OpenSim/Region/Environment/Scenes/UndoState.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Scenes Rotation = rot; Scale = scale; } - + public UndoState(SceneObjectPart part) { if (part != null) @@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes { Position = part.AbsolutePosition; Rotation = part.RotationOffset; - + } else { @@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Scenes if (part != null) { part.Undoing = true; - + if (part.ParentID == 0) { part.ParentGroup.AbsolutePosition = Position; @@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Scenes part.ScheduleTerseUpdate(); } part.Undoing = false; - + } } diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index d83bba6..16636e0 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs @@ -49,7 +49,6 @@ namespace OpenSim.Region.Examples.SimpleModule public RotatingWheel() { - } public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, @@ -78,7 +77,6 @@ namespace OpenSim.Region.Examples.SimpleModule public ComplexObject() { - } public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) diff --git a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs index 6a18091..e7d5db8 100644 --- a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs @@ -59,7 +59,7 @@ namespace OpenSim.Region.Examples.SimpleModule { float cpu = m_counter.NextValue()/40f; LLVector3 size = new LLVector3(cpu, cpu, cpu); - + RootPart.Resize(size); base.UpdateMovement(); diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 213f1d4..3bf0956 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin public BasicScene() { } - + public override void Initialise(IMesher meshmerizer, IConfigSource config) { // Does nothing right now diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs index 48e4ba6..0042c40 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/Physics/Manager/IMesher.cs @@ -48,6 +48,5 @@ namespace OpenSim.Region.Physics.Manager int[] getIndexListAsIntLocked(); float[] getVertexListAsFloatLocked(); void releasePinned(); - } } diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index beca4da..d4af271 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -209,10 +209,8 @@ namespace OpenSim.Region.Physics.Manager public override bool Stopped { get{ return false; } - } - public override PhysicsVector Position { get { return PhysicsVector.Zero; } diff --git a/OpenSim/Region/Physics/Meshing/Extruder.cs b/OpenSim/Region/Physics/Meshing/Extruder.cs index b14deeb..0c94669 100644 --- a/OpenSim/Region/Physics/Meshing/Extruder.cs +++ b/OpenSim/Region/Physics/Meshing/Extruder.cs @@ -286,7 +286,7 @@ namespace OpenSim.Region.Physics.Meshing // It's not quite clear what pushY (Y top shear) does, but subtracting it from the start and end // angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used // to calculate the sine for generating the path radius appears to approximate it's effects there - // too, but there are some subtle differences in the radius which are noticeable as the prim size + // too, but there are some subtle differences in the radius which are noticeable as the prim size // increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on // the meshes generated with this technique appear nearly identical in shape to the same prims when // displayed by the viewer. @@ -369,28 +369,26 @@ namespace OpenSim.Region.Physics.Meshing float yOffset; float zOffset; - xOffset = 0.5f * (skewStart + totalSkew * (float)percentOfPath); xOffset += (float) System.Math.Sin(angle) * pushX * 0.45f; yOffset = (float)(System.Math.Cos(angle) * (0.5f - yPathScale)) * radiusScale; zOffset = (float)(System.Math.Sin(angle + pushY * 0.9f) * (0.5f - yPathScale)) * radiusScale; - - // next apply twist rotation to the profile layer - if (twistTotal != 0.0f || twistBot != 0.0f) + // next apply twist rotation to the profile layer + if (twistTotal != 0.0f || twistBot != 0.0f) + { + Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); + foreach (Vertex v in newLayer.vertices) { - Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); - foreach (Vertex v in newLayer.vertices) + if (v != null) { - if (v != null) - { - vTemp = v * profileRot; - v.X = vTemp.X; - v.Y = vTemp.Y; - v.Z = vTemp.Z; - } + vTemp = v * profileRot; + v.X = vTemp.X; + v.Y = vTemp.Y; + v.Z = vTemp.Z; } } + } // now orient the rotation of the profile layer relative to it's position on the path // adding pushY to the angle used to generate the quat appears to approximate the viewer diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/Meshing/HelperTypes.cs index 816b6bb..2cb8d04 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/Physics/Meshing/HelperTypes.cs @@ -118,7 +118,7 @@ public class Vertex : PhysicsVector, IComparable { return new Vertex(Y * v.Z - Z * v.Y, Z * v.X - X * v.Z, X * v.Y - Y * v.X); } - + // disable warning: mono compiler moans about overloading // operators hiding base operator but should not according to C# // language spec diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index f041aec..a038dc2 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -941,7 +941,7 @@ namespace OpenSim.Region.Physics.Meshing extr.twistBot = (float)primShape.PathTwistBegin * (float)Math.PI * 0.01f; extr.pathBegin = primShape.PathBegin; extr.pathEnd = primShape.PathEnd; - + //System.Console.WriteLine("[MESH]: twistTop = " + twistTop.ToString() + "|" + extr.twistTop.ToString() + ", twistMid = " + twistMid.ToString() + "|" + extr.twistMid.ToString() + ", twistbot = " + twistBot.ToString() + "|" + extr.twistBot.ToString()); //Mesh result = extr.Extrude(m); Mesh result = extr.ExtrudeLinearPath(m); @@ -1340,7 +1340,7 @@ namespace OpenSim.Region.Physics.Meshing } /// - /// Creates a mesh for prim types torus, ring, tube, and sphere + /// Creates a mesh for prim types torus, ring, tube, and sphere /// /// /// @@ -1655,7 +1655,7 @@ namespace OpenSim.Region.Physics.Meshing // Vertex vTemp = new Vertex(0.0f, 0.0f, 0.0f); - + float skew = primShape.PathSkew * 0.01f; float pathScaleX = (float)(200 - primShape.PathScaleX) * 0.01f; float pathScaleY = (float)(200 - primShape.PathScaleY) * 0.01f; @@ -1700,7 +1700,7 @@ namespace OpenSim.Region.Physics.Meshing //System.Console.WriteLine("primShape.PathTaperX: " + primShape.PathTaperX.ToString()); //System.Console.WriteLine("primShape.PathTaperY: " + primShape.PathTaperY.ToString()); - + //System.Console.WriteLine("primShape.PathRadiusOffset: " + primShape.PathRadiusOffset.ToString()); #endif @@ -1875,7 +1875,7 @@ namespace OpenSim.Region.Physics.Meshing if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0) { - + SculptMesh smesh = CreateSculptMesh(primName, primShape, size, lod); mesh = (Mesh)smesh; CalcNormals(mesh); @@ -1967,7 +1967,7 @@ namespace OpenSim.Region.Physics.Meshing float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; float pathBegin = (float)primShape.PathBegin * 2.0e-5f; float pathEnd = 1.0f - (float)primShape.PathEnd * 2.0e-5f; - + float profileBegin = (float)primShape.ProfileBegin * 2.0e-5f; float profileEnd = 1.0f - (float)primShape.ProfileEnd * 2.0e-5f; diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index 95a244d..1c3153a 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs @@ -52,7 +52,7 @@ namespace OpenSim.Region.Physics.Meshing { if (_lod == 2f || _lod == 4f || _lod == 8f || _lod == 16f || _lod == 32f || _lod == 64f) lod = (int)_lod; - + try { idata = OpenJPEG.DecodeToImage(jpegData); @@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Meshing } } - + } private Vertex ColorToVertex(Color input) { @@ -225,7 +225,7 @@ namespace OpenSim.Region.Physics.Meshing // Create a vertex position from the RGB channels in the current pixel // int ypos = y * bLOD.Width; - + if (y == 0) { v1 = northpole; @@ -291,7 +291,7 @@ namespace OpenSim.Region.Physics.Meshing Add(tri2); } } - + } //Vertex vt31 = sVertices[(y * x_max + x)]; //Vertex vt32 = sVertices[(y * x_max + 0)]; @@ -311,7 +311,7 @@ namespace OpenSim.Region.Physics.Meshing //Add(tri3); // } //} - + //Vertex vt41 = sVertices[(y * x_max + x)]; //Vertex vt42 = sVertices[((y + 1) * x_max + 0)]; //Vertex vt43 = sVertices[((y + 1) * x_max + x)]; @@ -329,7 +329,7 @@ namespace OpenSim.Region.Physics.Meshing //Add(tri4); //} //} - + } } } diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs index bc2ad69..074170a 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Physics.OdePlugin private OdePlugin cbt; private PhysicsScene ps; private IMeshingPlugin imp; - + [SetUp] public void Initialize() { @@ -96,11 +96,11 @@ namespace OpenSim.Region.Physics.OdePlugin Assert.That(!oprim.m_taintadd); Console.WriteLine("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); - + // Make sure we're above the ground //Assert.That(prim.Position.Z > 20f); //Console.WriteLine("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); - + // Make sure we've got a Body Assert.That(oprim.Body != (IntPtr)0); //Console.WriteLine( diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 3f8aa26..f285911 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -252,7 +252,6 @@ namespace OpenSim.Region.Physics.OdePlugin public int physics_logging_interval = 0; public bool physics_logging_append_existing_logfile = false; - /// /// Initiailizes the scene /// Sets many properties that ODE requires to be stable @@ -352,14 +351,13 @@ namespace OpenSim.Region.Physics.OdePlugin geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", 10.000006836f); bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", 20); - + bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", 35f); bodyPIDG = physicsconfig.GetFloat("body_pid_gain", 25f); meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", true); meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); - if (Environment.OSVersion.Platform == PlatformID.Unix) { @@ -367,7 +365,6 @@ namespace OpenSim.Region.Physics.OdePlugin avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", 1400.0f); avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_linux", 2000000f); bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_linux", 2f); - } else { @@ -547,7 +544,6 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (AccessViolationException) { - m_log.Warn("[PHYSICS]: Unable to collide test an object"); return; } @@ -603,7 +599,6 @@ namespace OpenSim.Region.Physics.OdePlugin p2.CollidingGround = true; break; } - // we don't want prim or avatar to explode @@ -850,87 +845,87 @@ namespace OpenSim.Region.Physics.OdePlugin case ActorTypes.Agent: cc2 = (OdeCharacter)p2; - // obj1LocalID = cc2.m_localID; - switch ((ActorTypes)p1.PhysicsActorType) - { - case ActorTypes.Agent: - cc1 = (OdeCharacter)p1; - obj2LocalID = cc1.m_localID; - cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); - //ctype = (int)CollisionCategories.Character; - - //if (cc1.CollidingObj) - //cStartStop = (int)StatusIndicators.Generic; - //else - //cStartStop = (int)StatusIndicators.Start; - - //returncollisions = true; - break; - case ActorTypes.Prim: - cp1 = (OdePrim)p1; - obj2LocalID = cp1.m_localID; - cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); - //ctype = (int)CollisionCategories.Geom; - - //if (cp1.CollidingObj) - //cStartStop = (int)StatusIndicators.Generic; - //else - //cStartStop = (int)StatusIndicators.Start; - - //returncollisions = true; - break; - - case ActorTypes.Ground: - case ActorTypes.Unknown: - obj2LocalID = 0; - //ctype = (int)CollisionCategories.Land; - //returncollisions = true; - break; - } + // obj1LocalID = cc2.m_localID; + switch ((ActorTypes)p1.PhysicsActorType) + { + case ActorTypes.Agent: + cc1 = (OdeCharacter)p1; + obj2LocalID = cc1.m_localID; + cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); + //ctype = (int)CollisionCategories.Character; + + //if (cc1.CollidingObj) + //cStartStop = (int)StatusIndicators.Generic; + //else + //cStartStop = (int)StatusIndicators.Start; + + //returncollisions = true; + break; + case ActorTypes.Prim: + cp1 = (OdePrim)p1; + obj2LocalID = cp1.m_localID; + cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); + //ctype = (int)CollisionCategories.Geom; + + //if (cp1.CollidingObj) + //cStartStop = (int)StatusIndicators.Generic; + //else + //cStartStop = (int)StatusIndicators.Start; + + //returncollisions = true; + break; + + case ActorTypes.Ground: + case ActorTypes.Unknown: + obj2LocalID = 0; + //ctype = (int)CollisionCategories.Land; + //returncollisions = true; + break; + } cc2.AddCollisionEvent(obj2LocalID, collisiondepth); break; case ActorTypes.Prim: cp2 = (OdePrim)p2; - // obj1LocalID = cp2.m_localID; - switch ((ActorTypes)p1.PhysicsActorType) - { - case ActorTypes.Agent: - cc1 = (OdeCharacter)p1; - obj2LocalID = cc1.m_localID; - cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); - //ctype = (int)CollisionCategories.Character; - - //if (cc1.CollidingObj) - //cStartStop = (int)StatusIndicators.Generic; - //else - //cStartStop = (int)StatusIndicators.Start; - //returncollisions = true; - - break; - case ActorTypes.Prim: - cp1 = (OdePrim)p1; - obj2LocalID = cp1.m_localID; - cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); - //ctype = (int)CollisionCategories.Geom; - - //if (cp1.CollidingObj) - //cStartStop = (int)StatusIndicators.Generic; - //else - //cStartStop = (int)StatusIndicators.Start; - - //returncollisions = true; - break; - - case ActorTypes.Ground: - case ActorTypes.Unknown: - obj2LocalID = 0; - //ctype = (int)CollisionCategories.Land; - - //returncollisions = true; - break; - } + // obj1LocalID = cp2.m_localID; + switch ((ActorTypes)p1.PhysicsActorType) + { + case ActorTypes.Agent: + cc1 = (OdeCharacter)p1; + obj2LocalID = cc1.m_localID; + cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); + //ctype = (int)CollisionCategories.Character; + + //if (cc1.CollidingObj) + //cStartStop = (int)StatusIndicators.Generic; + //else + //cStartStop = (int)StatusIndicators.Start; + //returncollisions = true; + + break; + case ActorTypes.Prim: + cp1 = (OdePrim)p1; + obj2LocalID = cp1.m_localID; + cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); + //ctype = (int)CollisionCategories.Geom; + + //if (cp1.CollidingObj) + //cStartStop = (int)StatusIndicators.Generic; + //else + //cStartStop = (int)StatusIndicators.Start; + + //returncollisions = true; + break; + + case ActorTypes.Ground: + case ActorTypes.Unknown: + obj2LocalID = 0; + //ctype = (int)CollisionCategories.Land; + + //returncollisions = true; + break; + } cp2.AddCollisionEvent(obj2LocalID, collisiondepth); break; @@ -1015,7 +1010,6 @@ namespace OpenSim.Region.Physics.OdePlugin /// private void collision_optimized(float timeStep) { - foreach (OdeCharacter chr in _characters) { // Reset the collision values to false @@ -1579,7 +1573,7 @@ namespace OpenSim.Region.Physics.OdePlugin // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) // return true; - + // return false; @@ -1625,7 +1619,6 @@ namespace OpenSim.Region.Physics.OdePlugin //m_log.Info(timeStep.ToString()); step_time += timeStep; - // If We're loaded down by something else, // or debugging with the Visual Studio project on pause // skip a few frames to catch up gracefully. @@ -1739,7 +1732,6 @@ namespace OpenSim.Region.Physics.OdePlugin } d.WorldQuickStep(world, ODE_STEPSIZE); - d.JointGroupEmpty(contactgroup); //ode.dunlock(world); } @@ -2075,7 +2067,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (resultarr2[y, x] <= 0) { returnarr[i] = 0.0000001f; - + } else returnarr[i] = resultarr2[y, x]; diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 25c0d9a..9195063 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -361,23 +361,23 @@ namespace OpenSim.Region.ScriptEngine.Common a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. */ - + /* How we arrived at this llEuler2Rot - * + * * Experiment in SL to determine conventions: * llEuler2Rot()=<1,0,0,0> * llEuler2Rot(<0,PI,0>)=<0,1,0,0> * llEuler2Rot(<0,0,PI>)=<0,0,1,0> - * + * * Important facts about Quaternions * - multiplication is non-commutative (a*b != b*a) * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication - * + * * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): * Qx = c1+i*s1 * Qy = c2+j*s2; * Qz = c3+k*s3; - * + * * Rotations applied in order (from above) Z, Y, X * Q = (Qz * Qy) * Qx * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) @@ -389,23 +389,23 @@ namespace OpenSim.Region.ScriptEngine.Common * y=j*(c1*s2*c3-s1*c2*s3) * z=k*(s1*s2*c3+c1*c2*s3) * s= c1*c2*c3-s1*s2*s3 - * + * * This implementation agrees with the functions found here: * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions * And with the results in SL. - * + * * It's also possible to calculate llEuler2Rot by direct multiplication of * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function - * from the wiki). - * Apparently in some cases this is better from a numerical precision perspective? - */ + * from the wiki). + * Apparently in some cases this is better from a numerical precision perspective? + */ public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) { m_host.AddScriptLPS(1); double x,y,z,s; - + double c1 = Math.Cos(v.x/2.0); double c2 = Math.Cos(v.y/2.0); double c3 = Math.Cos(v.z/2.0); @@ -417,7 +417,7 @@ namespace OpenSim.Region.ScriptEngine.Common y = c1*s2*c3-s1*c2*s3; z = s1*s2*c3+c1*c2*s3; s = c1*c2*c3-s1*s2*s3; - + return new LSL_Types.Quaternion(x, y, z, s); } @@ -427,7 +427,7 @@ namespace OpenSim.Region.ScriptEngine.Common double x,y,z,s; int f=0; // Important Note: q1= is equal to q2=<-x,-y,-z,-s> - // Computing quaternion x,y,z,s values + // Computing quaternion x,y,z,s values x = ((fwd.x - left.y - up.z + 1) / 4); x *= x; x = Math.Sqrt(Math.Sqrt(x)); @@ -441,7 +441,7 @@ namespace OpenSim.Region.ScriptEngine.Common s *= s; s = Math.Sqrt(Math.Sqrt(s)); - // Set f for signs detection + // Set f for signs detection if (fwd.y+left.x >= 0){f+=1;} if (fwd.z+up.x >= 0){f+=2;} if (left.z-up.y >= 0){f+=4;} @@ -510,7 +510,7 @@ namespace OpenSim.Region.ScriptEngine.Common x = 2 * (r.x * r.y - r.z * r.s); y = -r.x * r.x + r.y * r.y - r.z * r.z + r.s * r.s; z = 2 * (r.x * r.s + r.y * r.z); - return (new LSL_Types.Vector3(x, y, z)); + return (new LSL_Types.Vector3(x, y, z)); } public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) @@ -536,7 +536,7 @@ namespace OpenSim.Region.ScriptEngine.Common z = -r.x * r.x - r.y * r.y + r.z * r.z + r.s * r.s; return (new LSL_Types.Vector3(x, y, z)); } - + public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) { //A and B should both be normalized @@ -1215,7 +1215,7 @@ namespace OpenSim.Region.ScriptEngine.Common /// /// Set flexi parameters of a part. - /// + /// /// FIXME: Much of this code should probably be within the part itself. /// /// @@ -1226,7 +1226,7 @@ namespace OpenSim.Region.ScriptEngine.Common /// /// /// - private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, + private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, float wind, float tension, LSL_Types.Vector3 Force) { if (part == null) @@ -1239,7 +1239,7 @@ namespace OpenSim.Region.ScriptEngine.Common { needs_fakedelete = true; } - part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do + part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do // work once the prim is already flexi part.Shape.FlexiSoftness = softness; part.Shape.FlexiGravity = gravity; @@ -1265,7 +1265,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (needs_fakedelete) { if (part.ParentGroup != null) - { + { part.ParentGroup.FakeDeleteGroup(); } } @@ -1276,7 +1276,7 @@ namespace OpenSim.Region.ScriptEngine.Common /// /// Set a light point on a part - /// + /// /// FIXME: Much of this code should probably be in SceneObjectGroup /// /// @@ -1781,7 +1781,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.SoundGain = volume; m_host.SoundFlags = 1; // looping m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? - + m_host.ScheduleFullUpdate(); m_host.SendFullUpdateToAllClients(); } @@ -2908,13 +2908,13 @@ namespace OpenSim.Region.ScriptEngine.Common bool found = false; LLUUID destId = LLUUID.Zero; LLUUID objId = LLUUID.Zero; - + if (!LLUUID.TryParse(destination, out destId)) { llSay(0, "Could not parse key " + destination); return; } - + // move the first object found with this inventory name foreach (KeyValuePair inv in m_host.TaskInventory) { @@ -2931,7 +2931,7 @@ namespace OpenSim.Region.ScriptEngine.Common llSay(0, String.Format("Could not find object '{0}'", inventory)); throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); } - + // check if destination is an avatar if (World.GetScenePresence(destId) != null) { @@ -2993,7 +2993,7 @@ namespace OpenSim.Region.ScriptEngine.Common { LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( m_localID, m_itemID, item.AssetID.ToString()); - + LLVector3 region = new LLVector3( World.RegionInfo.RegionLocX * Constants.RegionSize, World.RegionInfo.RegionLocY * Constants.RegionSize, @@ -4155,13 +4155,13 @@ namespace OpenSim.Region.ScriptEngine.Common if (LLUUID.TryParse(id,out key)) { ScenePresence presence = World.GetScenePresence(key); - + if (presence != null) { return presence.ControllingClient.Name; //return presence.Name; } - + if (World.GetSceneObjectPart(key) != null) { return World.GetSceneObjectPart(key).Name; @@ -4516,7 +4516,7 @@ namespace OpenSim.Region.ScriptEngine.Common private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() { Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); - + // TODO find out about the other defaults and add them here ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); @@ -4530,7 +4530,7 @@ namespace OpenSim.Region.ScriptEngine.Common ps.PartMaxAge = 10.0f; return ps; } - + public void llParticleSystem(LSL_Types.list rules) { m_host.AddScriptLPS(1); @@ -4725,7 +4725,7 @@ namespace OpenSim.Region.ScriptEngine.Common itemList.Add(itemID); } } - + if (itemList.Count == 0) return; @@ -4973,7 +4973,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetRemoteScriptAccessPin(int pin) { m_host.AddScriptLPS(1); - + m_host.ScriptAccessPin = pin; } @@ -4983,19 +4983,19 @@ namespace OpenSim.Region.ScriptEngine.Common bool found = false; LLUUID destId = LLUUID.Zero; LLUUID srcId = LLUUID.Zero; - + if (!LLUUID.TryParse(target, out destId)) { llSay(0, "Could not parse key " + target); return; } - + // target must be a different prim than the one containing the script if (m_host.UUID == destId) { return; } - + // copy the first script found with this inventory name foreach (KeyValuePair inv in m_host.TaskInventory) { @@ -5010,13 +5010,13 @@ namespace OpenSim.Region.ScriptEngine.Common } } } - + if (!found) { llSay(0, "Could not find script " + name); return; } - + // the rest of the permission checks are done in RezScript, so check the pin there as well World.RezScript(srcId, m_host, destId, pin, running, start_param); // this will cause the delay even if the script pin or permissions were wrong - seems ok @@ -5066,11 +5066,11 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); return Util.Md5Hash(src + ":" + nonce.ToString()); } - + private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); - + if (holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT && holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_CIRCLE && holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_SQUARE && @@ -5128,23 +5128,23 @@ namespace OpenSim.Region.ScriptEngine.Common } shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); shapeBlock.PathTwist = (sbyte)(200 * twist.y); - + shapeBlock.ObjectLocalID = m_host.LocalId; - + // retain pathcurve - shapeBlock.PathCurve = m_host.Shape.PathCurve; - + shapeBlock.PathCurve = m_host.Shape.PathCurve; + return shapeBlock; } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; - + if (taper_b.x < 0f) { taper_b.x = 0f; @@ -5181,25 +5181,25 @@ namespace OpenSim.Region.ScriptEngine.Common } shapeBlock.PathShearX = (byte)(100 * topshear.x); shapeBlock.PathShearY = (byte)(100 * topshear.y); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + // profile/path swapped for a sphere shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + shapeBlock.ProfileCurve += fudge; - + shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 100; - + if (dimple.x < 0f) { dimple.x = 0f; @@ -5222,22 +5222,22 @@ namespace OpenSim.Region.ScriptEngine.Common } shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; // profile/path swapped for a torrus, tube, ring shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + if (holesize.x < 0.05f) { holesize.x = 0.05f; @@ -5342,15 +5342,15 @@ namespace OpenSim.Region.ScriptEngine.Common skew = 0.95f; } shapeBlock.PathSkew = (sbyte)(100 * skew); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(string map, int type) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); LLUUID sculptId; - + if (!LLUUID.TryParse(map, out sculptId)) { llSay(0, "Could not parse key " + map); @@ -5360,7 +5360,7 @@ namespace OpenSim.Region.ScriptEngine.Common shapeBlock.ObjectLocalID = m_host.LocalId; shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 150; - + if (type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_CYLINDER && type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_PLANE && type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE && @@ -5369,7 +5369,7 @@ namespace OpenSim.Region.ScriptEngine.Common // default type = (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE; } - + // retain pathcurve shapeBlock.PathCurve = m_host.Shape.PathCurve; @@ -5422,7 +5422,7 @@ namespace OpenSim.Region.ScriptEngine.Common v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); SetScale(part, v); - + break; case (int)BuiltIn_Commands_BaseClass.PRIM_ROTATION: if (remain < 1) @@ -5432,13 +5432,13 @@ namespace OpenSim.Region.ScriptEngine.Common SetRot(part, q); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE: if (remain < 3) return; - + code = Convert.ToInt32(rules.Data[idx++]); - + remain = rules.Length - idx; float hollow; LSL_Types.Vector3 twist; @@ -5449,9 +5449,9 @@ namespace OpenSim.Region.ScriptEngine.Common float skew; LSL_Types.Vector3 holesize; LSL_Types.Vector3 profilecut; - + switch (code) - { + { case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX: if (remain < 6) return; @@ -5465,7 +5465,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: if (remain < 6) return; @@ -5480,12 +5480,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM: if (remain < 6) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5507,12 +5507,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TORUS: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5526,12 +5526,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TUBE: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5545,12 +5545,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_RING: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5564,7 +5564,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SCULPT: if (remain < 2) return; @@ -5575,7 +5575,7 @@ namespace OpenSim.Region.ScriptEngine.Common SetPrimitiveShapeParams(map, face); break; } - + break; case (int)BuiltIn_Commands_BaseClass.PRIM_TEXTURE: @@ -5630,7 +5630,7 @@ namespace OpenSim.Region.ScriptEngine.Common float intensity = (float)Convert.ToDouble(rules.Data[idx++]); float radius = (float)Convert.ToDouble(rules.Data[idx++]); float falloff = (float)Convert.ToDouble(rules.Data[idx++]); - + SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); break; @@ -5701,7 +5701,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.list llGetAnimationList( string id ) { m_host.AddScriptLPS(1); - + LSL_Types.list l = new LSL_Types.list(); ScenePresence av = World.GetScenePresence(id); if (av == null) @@ -6560,7 +6560,7 @@ namespace OpenSim.Region.ScriptEngine.Common IConfigSource config = new IniConfigSource(Application.iniFilePath); if (config.Configs["LL-Functions"] == null) config.AddConfig("LL-Functions"); - + if (config.Configs["LL-Functions"].GetBoolean("AllowGodFunctions", false)) { if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) @@ -6829,7 +6829,7 @@ namespace OpenSim.Region.ScriptEngine.Common //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) m_host.AddScriptLPS(1); for (int i = 0; i < commandList.Data.Length; i++) - { + { switch ((ParcelMediaCommandEnum)commandList.Data[i]) { case ParcelMediaCommandEnum.Play: @@ -6839,7 +6839,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (!agent.IsChildAgent) { agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); - } + } } break; case ParcelMediaCommandEnum.Stop: @@ -6870,7 +6870,7 @@ namespace OpenSim.Region.ScriptEngine.Common { //Set the new media URL only if the user is the owner of the land osSetParcelMediaURL(commandList.Data[i + 1].ToString()); - + List scenePresenceList = World.GetScenePresences(); LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); //Send an update of the mediaURL to all the clients that are in the parcel @@ -6881,8 +6881,8 @@ namespace OpenSim.Region.ScriptEngine.Common //Send parcel media update to the client agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); } - } - + } + } i++; } @@ -6892,7 +6892,7 @@ namespace OpenSim.Region.ScriptEngine.Common NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); break; }//end switch - + } @@ -6935,7 +6935,7 @@ namespace OpenSim.Region.ScriptEngine.Common } } return list; - + } public LSL_Types.LSLInteger llModPow(int a, int b, int c) @@ -6979,7 +6979,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == LLUUID.Zero) return new LSL_Types.Vector3(); if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) return new LSL_Types.Vector3(); @@ -6989,7 +6989,7 @@ namespace OpenSim.Region.ScriptEngine.Common return new LSL_Types.Vector3(); } ScenePresence presence = World.GetScenePresence(m_host.OwnerID); - if (presence != null) + if (presence != null) { LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); return pos; @@ -7111,8 +7111,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetCameraParams(LSL_Types.list rules) { m_host.AddScriptLPS(1); - - // our key in the object we are in + + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7126,10 +7126,10 @@ namespace OpenSim.Region.ScriptEngine.Common if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + SortedDictionary parameters = new SortedDictionary(); object[] data = rules.Data; for (int i = 0; i < data.Length; ++i) { @@ -7142,8 +7142,8 @@ namespace OpenSim.Region.ScriptEngine.Common case BuiltIn_Commands_BaseClass.CAMERA_FOCUS_OFFSET: case BuiltIn_Commands_BaseClass.CAMERA_POSITION: LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; - parameters.Add(type + 1, (float)v.x); - parameters.Add(type + 2, (float)v.y); + parameters.Add(type + 1, (float)v.x); + parameters.Add(type + 2, (float)v.y); parameters.Add(type + 3, (float)v.z); break; default: @@ -7163,7 +7163,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); - // our key in the object we are in + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7177,10 +7177,10 @@ namespace OpenSim.Region.ScriptEngine.Common if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + presence.ControllingClient.SendClearFollowCamProperties(objectID); } diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index e98dec6..3b317ac 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs @@ -703,7 +703,7 @@ namespace OpenSim.Region.ScriptEngine.Common // Otherwise, if we have strings, compare them alphabetically. string str1 = new string(space1); string str2 = new string(space2); - + int result; if (char.IsDigit(space1[0]) && char.IsDigit(space2[0])) @@ -1427,22 +1427,22 @@ namespace OpenSim.Region.ScriptEngine.Common bool ret = i1.value != i2.value; return ret; } - + static public LSLInteger operator +(LSLInteger i1, int i2) { return new LSLInteger(i1.value + i2); } - + static public LSLInteger operator -(LSLInteger i1, int i2) { return new LSLInteger(i1.value - i2); } - + static public LSLInteger operator *(LSLInteger i1, int i2) { return new LSLInteger(i1.value * i2); } - + static public LSLInteger operator /(LSLInteger i1, int i2) { return new LSLInteger(i1.value / i2); @@ -1452,22 +1452,22 @@ namespace OpenSim.Region.ScriptEngine.Common { return new LSLFloat((double)i1.value + f); } - + static public LSLFloat operator -(LSLInteger i1, double f) { return new LSLFloat((double)i1.value - f); } - + static public LSLFloat operator *(LSLInteger i1, double f) { return new LSLFloat((double)i1.value * f); } - + static public LSLFloat operator /(LSLInteger i1, double f) { return new LSLFloat((double)i1.value / f); } - + static public LSLInteger operator -(LSLInteger i) { return new LSLInteger(-i.value); @@ -1623,17 +1623,17 @@ namespace OpenSim.Region.ScriptEngine.Common f.value--; return f; } - + static public LSLFloat operator +(LSLFloat f, int i) { return new LSLFloat(f.value + (double)i); } - + static public LSLFloat operator -(LSLFloat f, int i) { return new LSLFloat(f.value - (double)i); } - + static public LSLFloat operator *(LSLFloat f, int i) { return new LSLFloat(f.value * (double)i); diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs index 5f86c9c..77cc7ea 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs @@ -88,7 +88,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin { if (!DataserverRequests.ContainsKey(identifier)) return; - + ds=DataserverRequests[identifier]; DataserverRequests.Remove(identifier); } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index 79c1dde..5c57874 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// Queue containing events waiting to be executed /// public Queue eventQueue = new Queue(); - + #region " Queue structures " /// /// Queue item structure @@ -193,7 +193,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } #endregion - + #region " Shutdown all threads " ~EventQueueManager() { @@ -408,10 +408,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase // Set flag if script should be removed or not EventQueueThread.KillCurrentScript = KillScriptOnMaxFunctionExecutionTime; - + // Abort this thread AbortThreadClass(EventQueueThread); - + // We do not need to start another, MaintenenceThread will do that for us //StartNewThreadClass(); } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index 255ab99..4376e00 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public class EventQueueThreadClass : iScriptEngineFunctionModule { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// How many ms to sleep if queue is empty /// diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index f04ac01..9a465f6 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs @@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.Common void remote_data(uint localID, LLUUID itemID); void http_response(uint localID, LLUUID itemID); } - + public interface ServerRemotingObject { RemoteEvents Events(); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 06c7387..fa3e35b 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs @@ -355,8 +355,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL private static string CreateYPCompilerScript(string compileScript) { - - compileScript = String.Empty + "using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog; " + "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs index 3f7b95e..8618d6c 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL myCode = myCode.Substring(0, cs_pointer); } myCode.Replace("//yp", "%YPCode"); - + StringWriter myCS_SW = new StringWriter(); StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs index 999208d..415c646 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { _arity = arity; } - + /// /// Append the answer to the list and update the indexes, if any. /// Elements of answer must be ground, since arguments with unbound variables make this diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs index 9a1f00d..56ed719 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs @@ -1,20 +1,20 @@ /* * Copyright (C) 2007-2008, Jeff Thompson - * + * * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without + * + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software + * * Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. /// /// the error term of the error - /// the message term of the error. If this is a string, it is converted to an + /// the message term of the error. If this is a string, it is converted to an /// Atom so it can be used by Prolog code. /// Message, converted to a string, is use as the printable exception message. /// @@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); } - public class TypeErrorInfo + public class TypeErrorInfo { public readonly Atom _Type; public readonly object _Culprit; @@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// public object getProcedureName() { - if (!(_Type._name == "procedure" && + if (!(_Type._name == "procedure" && _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) return null; return ((Functor2)_Culprit)._arg1; } /// - /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. + /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. /// Otherwise return -1. /// /// diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs index b69f9c4..694e733 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs @@ -1,20 +1,20 @@ /* * Copyright (C) 2007-2008, Jeff Thompson - * + * * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without + * + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software + * * Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// /// Convert term to an int. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { throw new PrologException (new Functor2 - ("type_error", Atom.a("evaluable"), - new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), + ("type_error", Atom.a("evaluable"), + new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), "Term must be an integer"); } } @@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// /// Convert term to a double. This may convert an int to a double, etc. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog // Assume it is a char type like "a". term = YP.getValue(((Functor2)term)._arg1); if (term is Variable) - throw new PrologException(Atom.a("instantiation_error"), + throw new PrologException(Atom.a("instantiation_error"), "Expected a number but the argument is an unbound variable"); try @@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog if (term1TypeCode == -2) { // Variable. - // We always check for equality first because we want to be sure - // that less than returns false if the terms are equal, in + // We always check for equality first because we want to be sure + // that less than returns false if the terms are equal, in // case that the less than check really behaves like less than or equal. if ((Variable)Term1 != (Variable)Term2) // The hash code should be unique to a Variable object. @@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// Type code is -2 if term is a Variable, 0 if it is an Atom, - /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, + /// Type code is -2 if term is a Variable, 0 if it is an Atom, + /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, /// 4 if it is Functor. /// Otherwise, type code is -1. /// This does not call YP.getValue(term). @@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog "Arg 2 List has an element which is an unbound variable"); if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) throw new PrologException - (new Functor2("type_error", Atom.a("character"), listAtom), + (new Functor2("type_error", Atom.a("character"), listAtom), "Arg 2 List has an element which is not a one character atom"); charArray[i] = ((Atom)listAtom)._name[0]; } @@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog int codeInt; if (!getInt(codeArray[i], out codeInt) || codeInt < 0) throw new PrologException - (new Functor1("representation_error", Atom.a("character_code")), + (new Functor1("representation_error", Atom.a("character_code")), "Element of Arg 2 List is not a character code"); charArray[i] = (char)codeInt; } @@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { if (!YP.number(Number)) throw new PrologException - (new Functor2("type_error", Atom.a("number"), Number), + (new Functor2("type_error", Atom.a("number"), Number), "Arg 1 Number is not var or number"); // We just checked, so convertDouble shouldn't throw an exception. numberString = YP.doubleToString(YP.convertDouble(Number)); @@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) throw new PrologException - (new Functor2("type_error", Atom.a("character"), Char), + (new Functor2("type_error", Atom.a("character"), Char), "Arg 1 Char is not var or one-character atom"); if (Code is Variable) @@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { List clauses; if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) - return unknownPredicate(name, arguments.Length, + return unknownPredicate(name, arguments.Length, "Undefined dynamic predicate: " + name + "/" + arguments.Length); if (clauses.Count == 1) @@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// If _prologFlags["unknown"] is fail then return fail(), else if + /// If _prologFlags["unknown"] is fail then return fail(), else if /// _prologFlags["unknown"] is warning then write the message to YP.write and /// return fail(), else throw a PrologException for existence_error. . /// @@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// This is deprecated and just calls matchDynamic. This matches all clauses, + /// This is deprecated and just calls matchDynamic. This matches all clauses, /// not just the ones defined with assertFact. /// /// @@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// dynamic predicate. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable current_predicate(object NameSlashArity, Type declaringClass) @@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog Functor2 NameArityFunctor = NameSlashArity as Functor2; if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) throw new PrologException - (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), + (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), "Must be a name/arity predicate indicator"); object name = YP.getValue(NameArityFunctor._arg1); object arity = YP.getValue(NameArityFunctor._arg2); @@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from + /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. - /// Otherwise, compile the goal as a single clause predicate and invoke it. + /// Otherwise, compile the goal as a single clause predicate and invoke it. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable getIterator(object Goal, Type declaringClass) @@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); if (!_prologFlags.ContainsKey(((Atom)Key)._name)) throw new PrologException - (new Functor2("domain_error", Atom.a("prolog_flag"), Key), + (new Functor2("domain_error", Atom.a("prolog_flag"), Key), "Arg 1 Key is not a recognized flag"); foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) @@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog string results = ""; for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) { - //Console.WriteLine( m ); + //Console.WriteLine( m ); results += presep+ m + postsep; } return results; @@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog #pragma warning restore 0168 } } - + /// /// CodeListReader extends TextReader and overrides Read to read the next code from /// the CodeList which is a Prolog list of integer character codes. @@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// public override int Read() { - Functor2 CodeListPair = _CodeList as Functor2; + Functor2 CodeListPair = _CodeList as Functor2; int code; if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && getInt(CodeListPair._arg1, out code))) diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 42d9bf8..c94b56a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs @@ -39,13 +39,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine public class ScriptManager : Common.ScriptEngineBase.ScriptManager { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public ScriptManager(Common.ScriptEngineBase.ScriptEngine scriptEngine) : base(scriptEngine) { base.m_scriptEngine = scriptEngine; } - private Compiler.LSL.Compiler LSLCompiler; + private Compiler.LSL.Compiler LSLCompiler; public override void Initialize() { @@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine public override void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) { m_log.DebugFormat( - "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", + "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", m_scriptEngine.ScriptEngineName, localID, itemID); //IScriptHost root = host.GetRoot(); @@ -73,13 +73,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine string CompiledScriptFile = String.Empty; SceneObjectPart m_host = World.GetSceneObjectPart(localID); - + if (null == m_host) { m_log.ErrorFormat( - "[{0}]: Could not find scene object part corresponding to localID {1} to start script", + "[{0}]: Could not find scene object part corresponding to localID {1} to start script", m_scriptEngine.ScriptEngineName, localID); - + return; } diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index 6924dd2..21888fa 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs @@ -53,12 +53,12 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer public EventManager(ScriptEngine _ScriptEngine) { myScriptEngine = _ScriptEngine; - + m_TCPClient = new TCPClient(); RPC = new TRPC_Remote(m_TCPClient); RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort); - + myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events"); //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; myScriptEngine.World.EventManager.OnRezScript += OnRezScript; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9604828..4de207a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -348,23 +348,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. */ - + /* How we arrived at this llEuler2Rot - * + * * Experiment in SL to determine conventions: * llEuler2Rot()=<1,0,0,0> * llEuler2Rot(<0,PI,0>)=<0,1,0,0> * llEuler2Rot(<0,0,PI>)=<0,0,1,0> - * + * * Important facts about Quaternions * - multiplication is non-commutative (a*b != b*a) * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication - * + * * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): * Qx = c1+i*s1 * Qy = c2+j*s2; * Qz = c3+k*s3; - * + * * Rotations applied in order (from above) Z, Y, X * Q = (Qz * Qy) * Qx * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) @@ -376,23 +376,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api * y=j*(c1*s2*c3-s1*c2*s3) * z=k*(s1*s2*c3+c1*c2*s3) * s= c1*c2*c3-s1*s2*s3 - * + * * This implementation agrees with the functions found here: * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions * And with the results in SL. - * + * * It's also possible to calculate llEuler2Rot by direct multiplication of * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function - * from the wiki). - * Apparently in some cases this is better from a numerical precision perspective? - */ + * from the wiki). + * Apparently in some cases this is better from a numerical precision perspective? + */ public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) { m_host.AddScriptLPS(1); double x,y,z,s; - + double c1 = Math.Cos(v.x/2.0); double c2 = Math.Cos(v.y/2.0); double c3 = Math.Cos(v.z/2.0); @@ -404,7 +404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api y = c1*s2*c3-s1*c2*s3; z = s1*s2*c3+c1*c2*s3; s = c1*c2*c3-s1*s2*s3; - + return new LSL_Types.Quaternion(x, y, z, s); } @@ -414,7 +414,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api double x, y, z, s; int f = 0; // Important Note: q1= is equal to q2=<-x,-y,-z,-s> - // Computing quaternion x,y,z,s values + // Computing quaternion x,y,z,s values x = ((fwd.x - left.y - up.z + 1) / 4); x *= x; x = Math.Sqrt(Math.Sqrt(x)); @@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api s *= s; s = Math.Sqrt(Math.Sqrt(s)); - // Set f for signs detection + // Set f for signs detection if (fwd.y + left.x >= 0) { f += 1; } if (fwd.z + up.x >= 0) { f += 2; } if (left.z - up.y >= 0) { f += 4; } @@ -1013,9 +1013,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - - public void SetGlow(SceneObjectPart part, int face, float glow) - { + + public void SetGlow(SceneObjectPart part, int face, float glow) + { LLObject.TextureEntry tex = part.Shape.Textures; if (face > -1) { @@ -1023,7 +1023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api tex.FaceTextures[face].Glow = glow; part.UpdateTexture(tex); return; - } + } else if (face == -1) { for (uint i = 0; i < 32; i++) @@ -1038,15 +1038,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - + public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) { - + Shininess sval = new Shininess(); - + switch (shiny) { - case 0: + case 0: sval = Shininess.None; break; case 1: @@ -1062,7 +1062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api sval = Shininess.None; break; } - + LLObject.TextureEntry tex = part.Shape.Textures; if (face > -1) { @@ -1070,8 +1070,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api tex.FaceTextures[face].Shiny = sval; tex.FaceTextures[face].Bump = bump; part.UpdateTexture(tex); - return; - } + return; + } else if (face == -1) { for (uint i = 0; i < 32; i++) @@ -1088,8 +1088,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - - public void SetFullBright(SceneObjectPart part, int face, bool bright) + + public void SetFullBright(SceneObjectPart part, int face, bool bright) { LLObject.TextureEntry tex = part.Shape.Textures; if (face > -1) @@ -1106,14 +1106,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (tex.FaceTextures[i] != null) { tex.FaceTextures[i].Fullbright = bright; - } + } } tex.DefaultTexture.Fullbright = bright; part.UpdateTexture(tex); return; } } - + public double llGetAlpha(int face) { m_host.AddScriptLPS(1); @@ -1169,7 +1169,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// Set flexi parameters of a part. - /// + /// /// FIXME: Much of this code should probably be within the part itself. /// /// @@ -1179,7 +1179,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// - /// + /// private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, float wind, float tension, LSL_Types.Vector3 Force) { @@ -1230,7 +1230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// Set a light point on a part - /// + /// /// FIXME: Much of this code should probably be in SceneObjectGroup /// /// @@ -1238,7 +1238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// - /// + /// private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) { if (part == null) @@ -2880,13 +2880,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool found = false; LLUUID destId = LLUUID.Zero; LLUUID objId = LLUUID.Zero; - + if (!LLUUID.TryParse(destination, out destId)) { llSay(0, "Could not parse key " + destination); return; } - + // move the first object found with this inventory name foreach (KeyValuePair inv in m_host.TaskInventory) { @@ -4451,7 +4451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() { Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); - + // TODO find out about the other defaults and add them here ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); @@ -4465,7 +4465,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ps.PartMaxAge = 10.0f; return ps; } - + public void llParticleSystem(LSL_Types.list rules) { m_host.AddScriptLPS(1); @@ -4660,7 +4660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api itemList.Add(itemID); } } - + if (itemList.Count == 0) return; @@ -4936,11 +4936,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); return Util.Md5Hash(src + ":" + nonce.ToString()); } - + private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); - + if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && @@ -4998,23 +4998,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); shapeBlock.PathTwist = (sbyte)(200 * twist.y); - + shapeBlock.ObjectLocalID = m_host.LocalId; - + // retain pathcurve - shapeBlock.PathCurve = m_host.Shape.PathCurve; - + shapeBlock.PathCurve = m_host.Shape.PathCurve; + return shapeBlock; } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; - + if (taper_b.x < 0f) { taper_b.x = 0f; @@ -5051,25 +5051,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } shapeBlock.PathShearX = (byte)(100 * topshear.x); shapeBlock.PathShearY = (byte)(100 * topshear.y); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + // profile/path swapped for a sphere shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + shapeBlock.ProfileCurve += fudge; - + shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 100; - + if (dimple.x < 0f) { dimple.x = 0f; @@ -5092,22 +5092,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; // profile/path swapped for a torrus, tube, ring shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + if (holesize.x < 0.05f) { holesize.x = 0.05f; @@ -5212,15 +5212,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api skew = 0.95f; } shapeBlock.PathSkew = (sbyte)(100 * skew); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(string map, int type) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); LLUUID sculptId; - + if (!LLUUID.TryParse(map, out sculptId)) { llSay(0, "Could not parse key " + map); @@ -5230,7 +5230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api shapeBlock.ObjectLocalID = m_host.LocalId; shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 150; - + if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && @@ -5239,7 +5239,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // default type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; } - + // retain pathcurve shapeBlock.PathCurve = m_host.Shape.PathCurve; @@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) { m_host.AddScriptLPS(1); - + if (m_host.ParentGroup == null) return; @@ -5302,13 +5302,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetRot(part, q); break; - + case (int)ScriptBaseClass.PRIM_TYPE: if (remain < 3) return; - + code = Convert.ToInt32(rules.Data[idx++]); - + remain = rules.Length - idx; float hollow; LSL_Types.Vector3 twist; @@ -5319,9 +5319,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api float skew; LSL_Types.Vector3 holesize; LSL_Types.Vector3 profilecut; - + switch (code) - { + { case (int)ScriptBaseClass.PRIM_TYPE_BOX: if (remain < 6) return; @@ -5335,7 +5335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); break; - + case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: if (remain < 6) return; @@ -5350,12 +5350,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); break; - + case (int)ScriptBaseClass.PRIM_TYPE_PRISM: if (remain < 6) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5377,12 +5377,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); break; - + case (int)ScriptBaseClass.PRIM_TYPE_TORUS: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5396,12 +5396,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); break; - + case (int)ScriptBaseClass.PRIM_TYPE_TUBE: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5415,12 +5415,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); break; - + case (int)ScriptBaseClass.PRIM_TYPE_RING: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5434,7 +5434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); break; - + case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: if (remain < 2) return; @@ -5445,7 +5445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetPrimitiveShapeParams(map, face); break; } - + break; case (int)ScriptBaseClass.PRIM_TEXTURE: @@ -5509,31 +5509,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; face = Convert.ToInt32(rules.Data[idx++]); float glow = (float)Convert.ToDouble(rules.Data[idx++]); - + SetGlow(part, face, glow); - + break; case (int)ScriptBaseClass.PRIM_BUMP_SHINY: if (remain < 3) - return; + return; face = Convert.ToInt32(rules.Data[idx++]); int shiny = Convert.ToInt32(rules.Data[idx++]); Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); - + SetShiny(part, face, shiny, bump); - + break; case (int)ScriptBaseClass.PRIM_FULLBRIGHT: if (remain < 2) return; - face = Convert.ToInt32(rules.Data[idx++]); + face = Convert.ToInt32(rules.Data[idx++]); string bv = rules.Data[idx++].ToString(); bool st; if (bv.Equals("1")) st = true; else st = false; - + SetFullBright(part, face , st); break; case (int)ScriptBaseClass.PRIM_MATERIAL: @@ -5552,29 +5552,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PRIM_PHANTOM: if (remain < 1) return; - + string ph = rules.Data[idx++].ToString(); bool phantom; - + if (ph.Equals("1")) phantom = true; else phantom = false; - + part.ScriptSetPhantomStatus(phantom); part.ScheduleFullUpdate(); break; case (int)ScriptBaseClass.PRIM_PHYSICS: if (remain < 1) - return; + return; string phy = rules.Data[idx++].ToString(); bool physics; - + if (phy.Equals("1")) physics = true; else physics = false; - + m_host.ScriptSetPhysicsStatus(physics); part.ScheduleFullUpdate(); break; @@ -5645,7 +5645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.list llGetAnimationList( string id ) { m_host.AddScriptLPS(1); - + LSL_Types.list l = new LSL_Types.list(); ScenePresence av = World.GetScenePresence(id); if (av == null) @@ -6758,7 +6758,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) m_host.AddScriptLPS(1); for (int i = 0; i < commandList.Data.Length; i++) - { + { switch ((ParcelMediaCommandEnum)commandList.Data[i]) { case ParcelMediaCommandEnum.Play: @@ -6768,7 +6768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!agent.IsChildAgent) { agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); - } + } } break; case ParcelMediaCommandEnum.Stop: @@ -6799,7 +6799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { //Set the new media URL only if the user is the owner of the land osSetParcelMediaURL(commandList.Data[i + 1].ToString()); - + List scenePresenceList = World.GetScenePresences(); LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); //Send an update of the mediaURL to all the clients that are in the parcel @@ -6810,8 +6810,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //Send parcel media update to the client agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); } - } - + } + } i++; } @@ -6821,7 +6821,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); break; }//end switch - + } @@ -6864,7 +6864,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } return list; - + } public LSL_Types.LSLInteger llModPow(int a, int b, int c) @@ -6908,7 +6908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == LLUUID.Zero) return new LSL_Types.Vector3(); if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) return new LSL_Types.Vector3(); @@ -7036,8 +7036,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetCameraParams(LSL_Types.list rules) { m_host.AddScriptLPS(1); - - // our key in the object we are in + + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7051,10 +7051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + SortedDictionary parameters = new SortedDictionary(); object[] data = rules.Data; for (int i = 0; i < data.Length; ++i) { @@ -7067,8 +7067,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.CAMERA_FOCUS_OFFSET: case ScriptBaseClass.CAMERA_POSITION: LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; - parameters.Add(type + 1, (float)v.x); - parameters.Add(type + 2, (float)v.y); + parameters.Add(type + 1, (float)v.x); + parameters.Add(type + 2, (float)v.y); parameters.Add(type + 3, (float)v.z); break; default: @@ -7088,7 +7088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - // our key in the object we are in + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7102,10 +7102,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + presence.ControllingClient.SendClearFollowCamProperties(objectID); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs index 6c88ae86..52d277e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs @@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins { if (!DataserverRequests.ContainsKey(identifier)) return; - + ds=DataserverRequests[identifier]; DataserverRequests.Remove(identifier); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs index 89bf51c..3f3cf39 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins new LSL_Types.LSLInteger(rInfo.GetIntValue()), new LSL_Types.LSLString(rInfo.GetStrVal()) }; - + foreach (AsyncCommandManager m in m_CmdManager.Managers) { if (m.m_ScriptEngine.PostScriptEvent( diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index 5b32cde..c28aa9a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return; MethodInfo mi = inits[api]; - + Object[] args = new Object[1]; args[0] = data; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs index 681b2f2..d6a339b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { _arity = arity; } - + /// /// Append the answer to the list and update the indexes, if any. /// Elements of answer must be ground, since arguments with unbound variables make this diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs index a2fe7ec..9f5ae3d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs @@ -1,20 +1,20 @@ /* * Copyright (C) 2007-2008, Jeff Thompson - * + * * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without + * + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software + * * Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. /// /// the error term of the error - /// the message term of the error. If this is a string, it is converted to an + /// the message term of the error. If this is a string, it is converted to an /// Atom so it can be used by Prolog code. /// Message, converted to a string, is use as the printable exception message. /// @@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); } - public class TypeErrorInfo + public class TypeErrorInfo { public readonly Atom _Type; public readonly object _Culprit; @@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// public object getProcedureName() { - if (!(_Type._name == "procedure" && + if (!(_Type._name == "procedure" && _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) return null; return ((Functor2)_Culprit)._arg1; } /// - /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. + /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. /// Otherwise return -1. /// /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 97c9087..2e90d74 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs @@ -1,20 +1,20 @@ /* * Copyright (C) 2007-2008, Jeff Thompson - * + * * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without + * + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software + * * Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// /// Convert term to an int. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { throw new PrologException (new Functor2 - ("type_error", Atom.a("evaluable"), - new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), + ("type_error", Atom.a("evaluable"), + new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), "Term must be an integer"); } } @@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// /// Convert term to a double. This may convert an int to a double, etc. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog // Assume it is a char type like "a". term = YP.getValue(((Functor2)term)._arg1); if (term is Variable) - throw new PrologException(Atom.a("instantiation_error"), + throw new PrologException(Atom.a("instantiation_error"), "Expected a number but the argument is an unbound variable"); try @@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog if (term1TypeCode == -2) { // Variable. - // We always check for equality first because we want to be sure - // that less than returns false if the terms are equal, in + // We always check for equality first because we want to be sure + // that less than returns false if the terms are equal, in // case that the less than check really behaves like less than or equal. if ((Variable)Term1 != (Variable)Term2) // The hash code should be unique to a Variable object. @@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// Type code is -2 if term is a Variable, 0 if it is an Atom, - /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, + /// Type code is -2 if term is a Variable, 0 if it is an Atom, + /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, /// 4 if it is Functor. /// Otherwise, type code is -1. /// This does not call YP.getValue(term). @@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog "Arg 2 List has an element which is an unbound variable"); if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) throw new PrologException - (new Functor2("type_error", Atom.a("character"), listAtom), + (new Functor2("type_error", Atom.a("character"), listAtom), "Arg 2 List has an element which is not a one character atom"); charArray[i] = ((Atom)listAtom)._name[0]; } @@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog int codeInt; if (!getInt(codeArray[i], out codeInt) || codeInt < 0) throw new PrologException - (new Functor1("representation_error", Atom.a("character_code")), + (new Functor1("representation_error", Atom.a("character_code")), "Element of Arg 2 List is not a character code"); charArray[i] = (char)codeInt; } @@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { if (!YP.number(Number)) throw new PrologException - (new Functor2("type_error", Atom.a("number"), Number), + (new Functor2("type_error", Atom.a("number"), Number), "Arg 1 Number is not var or number"); // We just checked, so convertDouble shouldn't throw an exception. numberString = YP.doubleToString(YP.convertDouble(Number)); @@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) throw new PrologException - (new Functor2("type_error", Atom.a("character"), Char), + (new Functor2("type_error", Atom.a("character"), Char), "Arg 1 Char is not var or one-character atom"); if (Code is Variable) @@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { List clauses; if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) - return unknownPredicate(name, arguments.Length, + return unknownPredicate(name, arguments.Length, "Undefined dynamic predicate: " + name + "/" + arguments.Length); if (clauses.Count == 1) @@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// If _prologFlags["unknown"] is fail then return fail(), else if + /// If _prologFlags["unknown"] is fail then return fail(), else if /// _prologFlags["unknown"] is warning then write the message to YP.write and /// return fail(), else throw a PrologException for existence_error. . /// @@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// This is deprecated and just calls matchDynamic. This matches all clauses, + /// This is deprecated and just calls matchDynamic. This matches all clauses, /// not just the ones defined with assertFact. /// /// @@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// dynamic predicate. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable current_predicate(object NameSlashArity, Type declaringClass) @@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog Functor2 NameArityFunctor = NameSlashArity as Functor2; if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) throw new PrologException - (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), + (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), "Must be a name/arity predicate indicator"); object name = YP.getValue(NameArityFunctor._arg1); object arity = YP.getValue(NameArityFunctor._arg2); @@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from + /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. - /// Otherwise, compile the goal as a single clause predicate and invoke it. + /// Otherwise, compile the goal as a single clause predicate and invoke it. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable getIterator(object Goal, Type declaringClass) @@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); if (!_prologFlags.ContainsKey(((Atom)Key)._name)) throw new PrologException - (new Functor2("domain_error", Atom.a("prolog_flag"), Key), + (new Functor2("domain_error", Atom.a("prolog_flag"), Key), "Arg 1 Key is not a recognized flag"); foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) @@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog string results = ""; for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) { - //Console.WriteLine( m ); + //Console.WriteLine( m ); results += presep+ m + postsep; } return results; @@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog #pragma warning restore 0168 } } - + /// /// CodeListReader extends TextReader and overrides Read to read the next code from /// the CodeList which is a Prolog list of integer character codes. @@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// public override int Read() { - Functor2 CodeListPair = _CodeList as Functor2; + Functor2 CodeListPair = _CodeList as Functor2; int code; if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && getInt(CodeListPair._arg1, out code))) diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs index f9b160d..0f79019 100644 --- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs @@ -54,11 +54,11 @@ namespace OpenSim.Region.ScriptEngine.Shared { string path = Path.Combine(Directory.GetCurrentDirectory(), Path.Combine(s, assemblyName))+".dll"; - + if (File.Exists(path)) return Assembly.LoadFrom(path); } - + return null; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 4962023..db90f3e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -412,8 +412,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools private static string CreateYPCompilerScript(string compileScript) { - - compileScript = String.Empty + "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs index 57e8776..45f92e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs @@ -87,9 +87,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools string quote = String.Empty; bool last_was_escape = false; int quote_replaced_count = 0; - + string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";"); - + string removecomments = conelinecomments.Replace(removefwnoncomments, ""); removecomments = cstylecomments.Replace(removecomments, ""); string[] localscript = removecomments.Split('"'); @@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools // checks for alpha.alpha way of referring to objects in C# // ignores alpha.x alpha.y, alpha.z for refering to vector components Match SecurityM; - + // BROKEN: this check is very wrong. It block's any url in strings. SecurityM = Regex.Match(checkscript, @"(?:[a-zA-Z])\.(?:[a-rt-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs index 831b918..22b3742 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools myCode = myCode.Substring(0, cs_pointer); } myCode.Replace("//yp", "%YPCode"); - + StringWriter myCS_SW = new StringWriter(); StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 8326e16..5497e2c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1335,22 +1335,22 @@ namespace OpenSim.Region.ScriptEngine.Shared bool ret = i1.value != i2.value; return ret; } - + static public LSLInteger operator +(LSLInteger i1, int i2) { return new LSLInteger(i1.value + i2); } - + static public LSLInteger operator -(LSLInteger i1, int i2) { return new LSLInteger(i1.value - i2); } - + static public LSLInteger operator *(LSLInteger i1, int i2) { return new LSLInteger(i1.value * i2); } - + static public LSLInteger operator /(LSLInteger i1, int i2) { return new LSLInteger(i1.value / i2); @@ -1360,22 +1360,22 @@ namespace OpenSim.Region.ScriptEngine.Shared { return new LSLFloat((double)i1.value + f); } - + static public LSLFloat operator -(LSLInteger i1, double f) { return new LSLFloat((double)i1.value - f); } - + static public LSLFloat operator *(LSLInteger i1, double f) { return new LSLFloat((double)i1.value * f); } - + static public LSLFloat operator /(LSLInteger i1, double f) { return new LSLFloat((double)i1.value / f); } - + static public LSLInteger operator -(LSLInteger i) { return new LSLInteger(-i.value); @@ -1536,17 +1536,17 @@ namespace OpenSim.Region.ScriptEngine.Shared f.value--; return f; } - + static public LSLFloat operator +(LSLFloat f, int i) { return new LSLFloat(f.value + (double)i); } - + static public LSLFloat operator -(LSLFloat f, int i) { return new LSLFloat(f.value - (double)i); } - + static public LSLFloat operator *(LSLFloat f, int i) { return new LSLFloat(f.value * (double)i); diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index cdba1ac..c528c02 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -363,7 +363,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine new WorkItemCallback( this.DoOnRezScriptQueue), new Object[0]); } - else + else { m_CurrentCompile = null; } @@ -394,7 +394,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine new WorkItemCallback( this.DoOnRezScriptQueue), new Object[0]); } - else + else { m_CurrentCompile = null; } @@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine { string savedState = Path.Combine(Path.GetDirectoryName(m_Assembly), m_ItemID.ToString() + ".state"); - + try { File.Delete(savedState); -- cgit v1.1