diff options
author | Jeff Ames | 2008-06-09 08:46:33 +0000 |
---|---|---|
committer | Jeff Ames | 2008-06-09 08:46:33 +0000 |
commit | dfb63b56230bdd3bfd897d499ce977ea9ee9891d (patch) | |
tree | 1d340aa26183382142d5df917388eacc3084033c /OpenSim/Region | |
parent | Mantis#1469. Thank you kindly, Mikem for a patch that addresses: (diff) | |
download | opensim-SC_OLD-dfb63b56230bdd3bfd897d499ce977ea9ee9891d.zip opensim-SC_OLD-dfb63b56230bdd3bfd897d499ce977ea9ee9891d.tar.gz opensim-SC_OLD-dfb63b56230bdd3bfd897d499ce977ea9ee9891d.tar.bz2 opensim-SC_OLD-dfb63b56230bdd3bfd897d499ce977ea9ee9891d.tar.xz |
Update svn properties. Formatting cleanup.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 105 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/Script/LSL_Types.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 20 |
5 files changed, 67 insertions, 65 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index a903fd8..64ea157 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -677,60 +677,61 @@ namespace OpenSim | |||
677 | return result; | 677 | return result; |
678 | } | 678 | } |
679 | 679 | ||
680 | /// <summary> | 680 | /// <summary> |
681 | /// Runs the best matching plugin command | 681 | /// Runs the best matching plugin command |
682 | /// | 682 | /// |
683 | /// returns true if a match was found, false otherwise. | 683 | /// returns true if a match was found, false otherwise. |
684 | /// </summary> | 684 | /// </summary> |
685 | public bool RunPluginCommands(string cmdWithParams) | 685 | public bool RunPluginCommands(string cmdWithParams) |
686 | { | 686 | { |
687 | ConsolePluginCommand bestMatch = null; | 687 | ConsolePluginCommand bestMatch = null; |
688 | int bestLength = 0; | 688 | int bestLength = 0; |
689 | foreach (ConsolePluginCommand cmdinfo in m_PluginCommandInfos) | 689 | foreach (ConsolePluginCommand cmdinfo in m_PluginCommandInfos) |
690 | { | 690 | { |
691 | int matchLen = cmdinfo.matchLength(cmdWithParams); | 691 | int matchLen = cmdinfo.matchLength(cmdWithParams); |
692 | if (matchLen > bestLength) | 692 | if (matchLen > bestLength) |
693 | { | 693 | { |
694 | bestMatch = cmdinfo; | 694 | bestMatch = cmdinfo; |
695 | bestLength = matchLen; | 695 | bestLength = matchLen; |
696 | } | 696 | } |
697 | } | 697 | } |
698 | if (bestMatch == null) return false; | 698 | if (bestMatch == null) return false; |
699 | bestMatch.Run(cmdWithParams.Substring(bestLength)); | 699 | bestMatch.Run(cmdWithParams.Substring(bestLength)); |
700 | return true; | 700 | return true; |
701 | } | 701 | } |
702 | 702 | ||
703 | /// <summary> | 703 | /// <summary> |
704 | /// Show the matching plugins command help | 704 | /// Show the matching plugins command help |
705 | /// </summary> | 705 | /// </summary> |
706 | public void ShowPluginCommandsHelp(string cmdWithParams, ConsoleBase console) | 706 | public void ShowPluginCommandsHelp(string cmdWithParams, ConsoleBase console) |
707 | { | 707 | { |
708 | foreach (ConsolePluginCommand cmdinfo in m_PluginCommandInfos) | 708 | foreach (ConsolePluginCommand cmdinfo in m_PluginCommandInfos) |
709 | { | 709 | { |
710 | if (cmdinfo.IsHelpfull(cmdWithParams)) | 710 | if (cmdinfo.IsHelpfull(cmdWithParams)) |
711 | { | 711 | { |
712 | cmdinfo.ShowHelp(console); | 712 | cmdinfo.ShowHelp(console); |
713 | } | 713 | } |
714 | } | 714 | } |
715 | } | 715 | } |
716 | 716 | ||
717 | /// <summary> | 717 | /// <summary> |
718 | /// Registers a new console plugin command | 718 | /// Registers a new console plugin command |
719 | /// </summary> | 719 | /// </summary> |
720 | public static void RegisterCmd(string cmd, ConsoleCommand deligate, string help) | 720 | public static void RegisterCmd(string cmd, ConsoleCommand deligate, string help) |
721 | { | 721 | { |
722 | RegisterConsolePluginCommand(new ConsolePluginCommand(cmd, deligate, help)); | 722 | RegisterConsolePluginCommand(new ConsolePluginCommand(cmd, deligate, help)); |
723 | } | 723 | } |
724 | /// <summary> | 724 | |
725 | /// Registers a new console plugin command | 725 | /// <summary> |
726 | /// </summary> | 726 | /// Registers a new console plugin command |
727 | public static void RegisterConsolePluginCommand(ConsolePluginCommand pluginCommand) | 727 | /// </summary> |
728 | { | 728 | public static void RegisterConsolePluginCommand(ConsolePluginCommand pluginCommand) |
729 | m_PluginCommandInfos.Add(pluginCommand); | 729 | { |
730 | } | 730 | m_PluginCommandInfos.Add(pluginCommand); |
731 | } | ||
731 | #endregion | 732 | #endregion |
733 | } | ||
732 | 734 | ||
733 | } | ||
734 | /// <summary> | 735 | /// <summary> |
735 | /// Holder object for a new console plugin command | 736 | /// Holder object for a new console plugin command |
736 | /// | 737 | /// |
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index b3663b7..d7a6d5b 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -174,9 +174,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
174 | 174 | ||
175 | foreach (EntityBase entity in moveEntities) | 175 | foreach (EntityBase entity in moveEntities) |
176 | { | 176 | { |
177 | if(entity != null)entity.UpdateMovement(); | ||
178 | //cfk. This throws occaisional exceptions on a heavily used region | 177 | //cfk. This throws occaisional exceptions on a heavily used region |
179 | //and I added this null check to try to preclude the exception. | 178 | //and I added this null check to try to preclude the exception. |
179 | if (entity != null) | ||
180 | entity.UpdateMovement(); | ||
180 | } | 181 | } |
181 | } | 182 | } |
182 | 183 | ||
diff --git a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs index 46c6c33..fce00e8 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs | |||
@@ -626,7 +626,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
626 | XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); | 626 | XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); |
627 | if (d == null) | 627 | if (d == null) |
628 | return new LSL_Types.LSLInteger(0); | 628 | return new LSL_Types.LSLInteger(0); |
629 | if(m_host.GroupID == d.Group) | 629 | if (m_host.GroupID == d.Group) |
630 | return new LSL_Types.LSLInteger(1); | 630 | return new LSL_Types.LSLInteger(1); |
631 | return new LSL_Types.LSLInteger(0); | 631 | return new LSL_Types.LSLInteger(0); |
632 | } | 632 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Script/LSL_Types.cs b/OpenSim/Region/ScriptEngine/XEngine/Script/LSL_Types.cs index a325629..8bd3d73 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/Script/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/Script/LSL_Types.cs | |||
@@ -1414,7 +1414,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Script | |||
1414 | 1414 | ||
1415 | public LSLFloat(Object o) | 1415 | public LSLFloat(Object o) |
1416 | { | 1416 | { |
1417 | if(!((o is double) || (o is float))) | 1417 | if (!((o is double) || (o is float))) |
1418 | { | 1418 | { |
1419 | value = 0.0; | 1419 | value = 0.0; |
1420 | return; | 1420 | return; |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index a5da317..0b0ff3d 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -701,10 +701,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
701 | public void Populate(Scene scene) | 701 | public void Populate(Scene scene) |
702 | { | 702 | { |
703 | SceneObjectPart part = scene.GetSceneObjectPart(Key); | 703 | SceneObjectPart part = scene.GetSceneObjectPart(Key); |
704 | if(part == null) // Avatar, maybe? | 704 | if (part == null) // Avatar, maybe? |
705 | { | 705 | { |
706 | ScenePresence presence = scene.GetScenePresence(Key); | 706 | ScenePresence presence = scene.GetScenePresence(Key); |
707 | if(presence == null) | 707 | if (presence == null) |
708 | return; | 708 | return; |
709 | 709 | ||
710 | Name = presence.Firstname + " " + presence.Lastname; | 710 | Name = presence.Firstname + " " + presence.Lastname; |
@@ -724,7 +724,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
724 | presence.Velocity.Z); | 724 | presence.Velocity.Z); |
725 | 725 | ||
726 | Type = 0x01; // Avatar | 726 | Type = 0x01; // Avatar |
727 | if(presence.Velocity != LLVector3.Zero) | 727 | if (presence.Velocity != LLVector3.Zero) |
728 | Type |= 0x02; // Active | 728 | Type |= 0x02; // Active |
729 | 729 | ||
730 | Group = presence.ControllingClient.ActiveGroupId; | 730 | Group = presence.ControllingClient.ActiveGroupId; |
@@ -739,14 +739,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
739 | Group = part.GroupID; | 739 | Group = part.GroupID; |
740 | Name = part.Name; | 740 | Name = part.Name; |
741 | Owner = part.OwnerID; | 741 | Owner = part.OwnerID; |
742 | if(part.Velocity == LLVector3.Zero) | 742 | if (part.Velocity == LLVector3.Zero) |
743 | Type = 0x04; // Passive | 743 | Type = 0x04; // Passive |
744 | else | 744 | else |
745 | Type = 0x02; // Passive | 745 | Type = 0x02; // Passive |
746 | 746 | ||
747 | foreach (SceneObjectPart p in part.ParentGroup.Children.Values) | 747 | foreach (SceneObjectPart p in part.ParentGroup.Children.Values) |
748 | { | 748 | { |
749 | if(part.ContainsScripts()) | 749 | if (part.ContainsScripts()) |
750 | { | 750 | { |
751 | Type |= 0x08; // Scripted | 751 | Type |= 0x08; // Scripted |
752 | break; | 752 | break; |
@@ -964,7 +964,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
964 | 964 | ||
965 | m_Engine.Log.DebugFormat("[XEngine] Successfully retrieved state for script {0}.{1}", m_PrimName, m_ScriptName); | 965 | m_Engine.Log.DebugFormat("[XEngine] Successfully retrieved state for script {0}.{1}", m_PrimName, m_ScriptName); |
966 | 966 | ||
967 | if(m_RunEvents) | 967 | if (m_RunEvents) |
968 | { | 968 | { |
969 | m_RunEvents = false; | 969 | m_RunEvents = false; |
970 | Start(); | 970 | Start(); |
@@ -973,7 +973,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
973 | // we get new rez events on sim restart, too | 973 | // we get new rez events on sim restart, too |
974 | // but if there is state, then we fire the change | 974 | // but if there is state, then we fire the change |
975 | // event | 975 | // event |
976 | if(stateSource == StateSource.NewRez) | 976 | if (stateSource == StateSource.NewRez) |
977 | { | 977 | { |
978 | // m_Engine.Log.Debug("[XEngine] Posted changed(CHANGED_REGION_RESTART) to script"); | 978 | // m_Engine.Log.Debug("[XEngine] Posted changed(CHANGED_REGION_RESTART) to script"); |
979 | PostEvent(new XEventParams("changed", | 979 | PostEvent(new XEventParams("changed", |
@@ -1315,7 +1315,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1315 | { | 1315 | { |
1316 | Console.WriteLine("Unable to save xml\n"+e.ToString()); | 1316 | Console.WriteLine("Unable to save xml\n"+e.ToString()); |
1317 | } | 1317 | } |
1318 | if(!File.Exists(Path.Combine(Path.GetDirectoryName(assembly), m_ItemID.ToString() + ".state"))) | 1318 | if (!File.Exists(Path.Combine(Path.GetDirectoryName(assembly), m_ItemID.ToString() + ".state"))) |
1319 | { | 1319 | { |
1320 | throw new Exception("Completed persistence save, but no file was created"); | 1320 | throw new Exception("Completed persistence save, but no file was created"); |
1321 | } | 1321 | } |
@@ -1328,7 +1328,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1328 | { | 1328 | { |
1329 | bool running = instance.Running; | 1329 | bool running = instance.Running; |
1330 | 1330 | ||
1331 | if(running) | 1331 | if (running) |
1332 | instance.Stop(50); | 1332 | instance.Stop(50); |
1333 | 1333 | ||
1334 | XmlDocument xmldoc = new XmlDocument(); | 1334 | XmlDocument xmldoc = new XmlDocument(); |
@@ -1455,7 +1455,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1455 | 1455 | ||
1456 | rootElement.AppendChild(plugins); | 1456 | rootElement.AppendChild(plugins); |
1457 | 1457 | ||
1458 | if(running) | 1458 | if (running) |
1459 | instance.Start(); | 1459 | instance.Start(); |
1460 | 1460 | ||
1461 | return xmldoc.InnerXml; | 1461 | return xmldoc.InnerXml; |