aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorOren Hurvitz2015-07-13 12:37:18 +0300
committerOren Hurvitz2015-07-13 12:37:18 +0300
commite174dc87fb88d3a34238ecb51f83ab9cc3178409 (patch)
treea80aea5402328461cba073551bae65cd06d7b3e2 /OpenSim/Region/Framework/Scenes
parentBringing FSAssets more inline with current OpenSim standards. * If no connect... (diff)
downloadopensim-SC_OLD-e174dc87fb88d3a34238ecb51f83ab9cc3178409.zip
opensim-SC_OLD-e174dc87fb88d3a34238ecb51f83ab9cc3178409.tar.gz
opensim-SC_OLD-e174dc87fb88d3a34238ecb51f83ab9cc3178409.tar.bz2
opensim-SC_OLD-e174dc87fb88d3a34238ecb51f83ab9cc3178409.tar.xz
Fixed the whitespace in Scene.cs
The whitespace in this file was fubared recently
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs1030
1 files changed, 515 insertions, 515 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 23b2e90..b876fc6 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1,29 +1,29 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4 *
5* Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSimulator Project nor the 12 * * Neither the name of the OpenSimulator Project nor the
13* names of its contributors may be used to endorse or promote products 13 * names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15* 15 *
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY 16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
@@ -121,8 +121,8 @@ namespace OpenSim.Region.Framework.Scenes
121 IPhysicsParameters physScene = PhysicsScene as IPhysicsParameters; 121 IPhysicsParameters physScene = PhysicsScene as IPhysicsParameters;
122 122
123 if (physScene != null) 123 if (physScene != null)
124 physScene.SetPhysicsParameter( 124 physScene.SetPhysicsParameter(
125 "Active", m_physicsEnabled.ToString(), PhysParameterEntry.APPLY_TO_NONE); 125 "Active", m_physicsEnabled.ToString(), PhysParameterEntry.APPLY_TO_NONE);
126 } 126 }
127 } 127 }
128 } 128 }
@@ -147,7 +147,7 @@ namespace OpenSim.Region.Framework.Scenes
147 foreach (EntityBase ent in entities) 147 foreach (EntityBase ent in entities)
148 { 148 {
149 if (ent is SceneObjectGroup) 149 if (ent is SceneObjectGroup)
150 ((SceneObjectGroup)ent).RemoveScriptInstances(false); 150 ((SceneObjectGroup)ent).RemoveScriptInstances(false);
151 } 151 }
152 } 152 }
153 else 153 else
@@ -499,7 +499,7 @@ namespace OpenSim.Region.Framework.Scenes
499 if (value) 499 if (value)
500 { 500 {
501 if (!m_active) 501 if (!m_active)
502 Start(false); 502 Start(false);
503 } 503 }
504 else 504 else
505 { 505 {
@@ -662,7 +662,7 @@ namespace OpenSim.Region.Framework.Scenes
662 get 662 get
663 { 663 {
664 if (m_LibraryService == null) 664 if (m_LibraryService == null)
665 m_LibraryService = RequestModuleInterface<ILibraryService>(); 665 m_LibraryService = RequestModuleInterface<ILibraryService>();
666 666
667 return m_LibraryService; 667 return m_LibraryService;
668 } 668 }
@@ -673,7 +673,7 @@ namespace OpenSim.Region.Framework.Scenes
673 get 673 get
674 { 674 {
675 if (m_simulationService == null) 675 if (m_simulationService == null)
676 m_simulationService = RequestModuleInterface<ISimulationService>(); 676 m_simulationService = RequestModuleInterface<ISimulationService>();
677 677
678 return m_simulationService; 678 return m_simulationService;
679 } 679 }
@@ -684,7 +684,7 @@ namespace OpenSim.Region.Framework.Scenes
684 get 684 get
685 { 685 {
686 if (m_AuthenticationService == null) 686 if (m_AuthenticationService == null)
687 m_AuthenticationService = RequestModuleInterface<IAuthenticationService>(); 687 m_AuthenticationService = RequestModuleInterface<IAuthenticationService>();
688 return m_AuthenticationService; 688 return m_AuthenticationService;
689 } 689 }
690 } 690 }
@@ -694,7 +694,7 @@ namespace OpenSim.Region.Framework.Scenes
694 get 694 get
695 { 695 {
696 if (m_PresenceService == null) 696 if (m_PresenceService == null)
697 m_PresenceService = RequestModuleInterface<IPresenceService>(); 697 m_PresenceService = RequestModuleInterface<IPresenceService>();
698 return m_PresenceService; 698 return m_PresenceService;
699 } 699 }
700 } 700 }
@@ -704,7 +704,7 @@ namespace OpenSim.Region.Framework.Scenes
704 get 704 get
705 { 705 {
706 if (m_UserAccountService == null) 706 if (m_UserAccountService == null)
707 m_UserAccountService = RequestModuleInterface<IUserAccountService>(); 707 m_UserAccountService = RequestModuleInterface<IUserAccountService>();
708 return m_UserAccountService; 708 return m_UserAccountService;
709 } 709 }
710 } 710 }
@@ -714,7 +714,7 @@ namespace OpenSim.Region.Framework.Scenes
714 get 714 get
715 { 715 {
716 if (m_AvatarService == null) 716 if (m_AvatarService == null)
717 m_AvatarService = RequestModuleInterface<IAvatarService>(); 717 m_AvatarService = RequestModuleInterface<IAvatarService>();
718 return m_AvatarService; 718 return m_AvatarService;
719 } 719 }
720 } 720 }
@@ -724,7 +724,7 @@ namespace OpenSim.Region.Framework.Scenes
724 get 724 get
725 { 725 {
726 if (m_GridUserService == null) 726 if (m_GridUserService == null)
727 m_GridUserService = RequestModuleInterface<IGridUserService>(); 727 m_GridUserService = RequestModuleInterface<IGridUserService>();
728 return m_GridUserService; 728 return m_GridUserService;
729 } 729 }
730 } 730 }
@@ -835,10 +835,10 @@ namespace OpenSim.Region.Framework.Scenes
835 #region Constructors 835 #region Constructors
836 836
837 public Scene(RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene, 837 public Scene(RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene,
838 SceneCommunicationService sceneGridService, 838 SceneCommunicationService sceneGridService,
839 ISimulationDataService simDataService, IEstateDataService estateDataService, 839 ISimulationDataService simDataService, IEstateDataService estateDataService,
840 IConfigSource config, string simulatorVersion) 840 IConfigSource config, string simulatorVersion)
841 : this(regInfo, physicsScene) 841 : this(regInfo, physicsScene)
842 { 842 {
843 m_config = config; 843 m_config = config;
844 MinFrameTicks = 89; 844 MinFrameTicks = 89;
@@ -895,20 +895,20 @@ namespace OpenSim.Region.Framework.Scenes
895 } 895 }
896 896
897 if (updatedTerrainTextures) 897 if (updatedTerrainTextures)
898 rs.Save(); 898 rs.Save();
899 899
900 RegionInfo.RegionSettings = rs; 900 RegionInfo.RegionSettings = rs;
901 901
902 if (estateDataService != null) 902 if (estateDataService != null)
903 RegionInfo.EstateSettings = estateDataService.LoadEstateSettings(RegionInfo.RegionID, false); 903 RegionInfo.EstateSettings = estateDataService.LoadEstateSettings(RegionInfo.RegionID, false);
904 904
905 #endregion Region Settings 905 #endregion Region Settings
906 906
907 //Bind Storage Manager functions to some land manager functions for this scene 907 //Bind Storage Manager functions to some land manager functions for this scene
908 EventManager.OnLandObjectAdded += 908 EventManager.OnLandObjectAdded +=
909 new EventManager.LandObjectAdded(simDataService.StoreLandObject); 909 new EventManager.LandObjectAdded(simDataService.StoreLandObject);
910 EventManager.OnLandObjectRemoved += 910 EventManager.OnLandObjectRemoved +=
911 new EventManager.LandObjectRemoved(simDataService.RemoveLandObject); 911 new EventManager.LandObjectRemoved(simDataService.RemoveLandObject);
912 912
913 RegisterDefaultSceneEvents(); 913 RegisterDefaultSceneEvents();
914 914
@@ -933,7 +933,7 @@ namespace OpenSim.Region.Framework.Scenes
933 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); 933 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance);
934 UseBackup = startupConfig.GetBoolean("UseSceneBackup", UseBackup); 934 UseBackup = startupConfig.GetBoolean("UseSceneBackup", UseBackup);
935 if (!UseBackup) 935 if (!UseBackup)
936 m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); 936 m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName);
937 937
938 //Animation states 938 //Animation states
939 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); 939 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
@@ -988,10 +988,10 @@ namespace OpenSim.Region.Framework.Scenes
988 m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); 988 m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
989 m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); 989 m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
990 m_dontPersistBefore = 990 m_dontPersistBefore =
991 startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE); 991 startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE);
992 m_dontPersistBefore *= 10000000; 992 m_dontPersistBefore *= 10000000;
993 m_persistAfter = 993 m_persistAfter =
994 startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); 994 startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
995 m_persistAfter *= 10000000; 995 m_persistAfter *= 10000000;
996 996
997 m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); 997 m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine");
@@ -1004,7 +1004,7 @@ namespace OpenSim.Region.Framework.Scenes
1004 string[] possibleMapConfigSections = new string[] { "Map", "Startup" }; 1004 string[] possibleMapConfigSections = new string[] { "Map", "Startup" };
1005 1005
1006 m_generateMaptiles 1006 m_generateMaptiles
1007 = Util.GetConfigVarFromSections<bool>(config, "GenerateMaptiles", possibleMapConfigSections, true); 1007 = Util.GetConfigVarFromSections<bool>(config, "GenerateMaptiles", possibleMapConfigSections, true);
1008 1008
1009 if (m_generateMaptiles) 1009 if (m_generateMaptiles)
1010 { 1010 {
@@ -1021,8 +1021,8 @@ namespace OpenSim.Region.Framework.Scenes
1021 else 1021 else
1022 { 1022 {
1023 string tile 1023 string tile
1024 = Util.GetConfigVarFromSections<string>( 1024 = Util.GetConfigVarFromSections<string>(
1025 config, "MaptileStaticUUID", possibleMapConfigSections, UUID.Zero.ToString()); 1025 config, "MaptileStaticUUID", possibleMapConfigSections, UUID.Zero.ToString());
1026 1026
1027 UUID tileID; 1027 UUID tileID;
1028 1028
@@ -1040,8 +1040,8 @@ namespace OpenSim.Region.Framework.Scenes
1040 string[] possibleAccessControlConfigSections = new string[] { "AccessControl", "Startup" }; 1040 string[] possibleAccessControlConfigSections = new string[] { "AccessControl", "Startup" };
1041 1041
1042 string grant 1042 string grant
1043 = Util.GetConfigVarFromSections<string>( 1043 = Util.GetConfigVarFromSections<string>(
1044 config, "AllowedClients", possibleAccessControlConfigSections, ""); 1044 config, "AllowedClients", possibleAccessControlConfigSections, "");
1045 1045
1046 if (grant.Length > 0) 1046 if (grant.Length > 0)
1047 { 1047 {
@@ -1052,8 +1052,8 @@ namespace OpenSim.Region.Framework.Scenes
1052 } 1052 }
1053 1053
1054 grant 1054 grant
1055 = Util.GetConfigVarFromSections<string>( 1055 = Util.GetConfigVarFromSections<string>(
1056 config, "BannedClients", possibleAccessControlConfigSections, ""); 1056 config, "BannedClients", possibleAccessControlConfigSections, "");
1057 1057
1058 if (grant.Length > 0) 1058 if (grant.Length > 0)
1059 { 1059 {
@@ -1064,17 +1064,17 @@ namespace OpenSim.Region.Framework.Scenes
1064 } 1064 }
1065 1065
1066 if (startupConfig.Contains("MinFrameTime")) 1066 if (startupConfig.Contains("MinFrameTime"))
1067 MinFrameTicks = (int)(startupConfig.GetFloat("MinFrameTime") * 1000); 1067 MinFrameTicks = (int)(startupConfig.GetFloat("MinFrameTime") * 1000);
1068 1068
1069 m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup); 1069 m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup);
1070 m_update_coarse_locations = startupConfig.GetInt("UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations); 1070 m_update_coarse_locations = startupConfig.GetInt("UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations);
1071 m_update_entitymovement = startupConfig.GetInt("UpdateEntityMovementEveryNFrames", m_update_entitymovement); 1071 m_update_entitymovement = startupConfig.GetInt("UpdateEntityMovementEveryNFrames", m_update_entitymovement);
1072 m_update_events = startupConfig.GetInt("UpdateEventsEveryNFrames", m_update_events); 1072 m_update_events = startupConfig.GetInt("UpdateEventsEveryNFrames", m_update_events);
1073 m_update_objects = startupConfig.GetInt("UpdateObjectsEveryNFrames", m_update_objects); 1073 m_update_objects = startupConfig.GetInt("UpdateObjectsEveryNFrames", m_update_objects);
1074 m_update_physics = startupConfig.GetInt("UpdatePhysicsEveryNFrames", m_update_physics); 1074 m_update_physics = startupConfig.GetInt("UpdatePhysicsEveryNFrames", m_update_physics);
1075 m_update_presences = startupConfig.GetInt("UpdateAgentsEveryNFrames", m_update_presences); 1075 m_update_presences = startupConfig.GetInt("UpdateAgentsEveryNFrames", m_update_presences);
1076 m_update_terrain = startupConfig.GetInt("UpdateTerrainEveryNFrames", m_update_terrain); 1076 m_update_terrain = startupConfig.GetInt("UpdateTerrainEveryNFrames", m_update_terrain);
1077 m_update_temp_cleaning = startupConfig.GetInt("UpdateTempCleaningEveryNSeconds", m_update_temp_cleaning); 1077 m_update_temp_cleaning = startupConfig.GetInt("UpdateTempCleaningEveryNSeconds", m_update_temp_cleaning);
1078 } 1078 }
1079 1079
1080 // FIXME: Ultimately this should be in a module. 1080 // FIXME: Ultimately this should be in a module.
@@ -1084,7 +1084,7 @@ namespace OpenSim.Region.Framework.Scenes
1084 if (appearanceConfig != null) 1084 if (appearanceConfig != null)
1085 { 1085 {
1086 SendPeriodicAppearanceUpdates 1086 SendPeriodicAppearanceUpdates
1087 = appearanceConfig.GetBoolean("ResendAppearanceUpdates", SendPeriodicAppearanceUpdates); 1087 = appearanceConfig.GetBoolean("ResendAppearanceUpdates", SendPeriodicAppearanceUpdates);
1088 } 1088 }
1089 1089
1090 #endregion Region Config 1090 #endregion Region Config
@@ -1113,23 +1113,23 @@ namespace OpenSim.Region.Framework.Scenes
1113 } 1113 }
1114 1114
1115 IsReprioritizationEnabled 1115 IsReprioritizationEnabled
1116 = interestConfig.GetBoolean("ReprioritizationEnabled", IsReprioritizationEnabled); 1116 = interestConfig.GetBoolean("ReprioritizationEnabled", IsReprioritizationEnabled);
1117 ReprioritizationInterval 1117 ReprioritizationInterval
1118 = interestConfig.GetDouble("ReprioritizationInterval", ReprioritizationInterval); 1118 = interestConfig.GetDouble("ReprioritizationInterval", ReprioritizationInterval);
1119 RootReprioritizationDistance 1119 RootReprioritizationDistance
1120 = interestConfig.GetDouble("RootReprioritizationDistance", RootReprioritizationDistance); 1120 = interestConfig.GetDouble("RootReprioritizationDistance", RootReprioritizationDistance);
1121 ChildReprioritizationDistance 1121 ChildReprioritizationDistance
1122 = interestConfig.GetDouble("ChildReprioritizationDistance", ChildReprioritizationDistance); 1122 = interestConfig.GetDouble("ChildReprioritizationDistance", ChildReprioritizationDistance);
1123 1123
1124 RootTerseUpdatePeriod = interestConfig.GetInt("RootTerseUpdatePeriod", RootTerseUpdatePeriod); 1124 RootTerseUpdatePeriod = interestConfig.GetInt("RootTerseUpdatePeriod", RootTerseUpdatePeriod);
1125 ChildTerseUpdatePeriod = interestConfig.GetInt("ChildTerseUpdatePeriod", ChildTerseUpdatePeriod); 1125 ChildTerseUpdatePeriod = interestConfig.GetInt("ChildTerseUpdatePeriod", ChildTerseUpdatePeriod);
1126 1126
1127 RootPositionUpdateTolerance 1127 RootPositionUpdateTolerance
1128 = interestConfig.GetFloat("RootPositionUpdateTolerance", RootPositionUpdateTolerance); 1128 = interestConfig.GetFloat("RootPositionUpdateTolerance", RootPositionUpdateTolerance);
1129 RootRotationUpdateTolerance 1129 RootRotationUpdateTolerance
1130 = interestConfig.GetFloat("RootRotationUpdateTolerance", RootRotationUpdateTolerance); 1130 = interestConfig.GetFloat("RootRotationUpdateTolerance", RootRotationUpdateTolerance);
1131 RootVelocityUpdateTolerance 1131 RootVelocityUpdateTolerance
1132 = interestConfig.GetFloat("RootVelocityUpdateTolerance", RootVelocityUpdateTolerance); 1132 = interestConfig.GetFloat("RootVelocityUpdateTolerance", RootVelocityUpdateTolerance);
1133 } 1133 }
1134 1134
1135 m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", UpdatePrioritizationScheme); 1135 m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", UpdatePrioritizationScheme);
@@ -1140,9 +1140,9 @@ namespace OpenSim.Region.Framework.Scenes
1140 // if the timer is based on a high-resolution performance counter or based on the system timer; 1140 // if the timer is based on a high-resolution performance counter or based on the system timer;
1141 // the performance counter will provide a more precise time than the system timer 1141 // the performance counter will provide a more precise time than the system timer
1142 if (Stopwatch.IsHighResolution) 1142 if (Stopwatch.IsHighResolution)
1143 m_log.InfoFormat("[SCENE]: Using high-resolution performance counter for statistics."); 1143 m_log.InfoFormat("[SCENE]: Using high-resolution performance counter for statistics.");
1144 else 1144 else
1145 m_log.InfoFormat("[SCENE]: Using system timer for statistics."); 1145 m_log.InfoFormat("[SCENE]: Using system timer for statistics.");
1146 1146
1147 // Acquire the statistics section of the OpenSim.ini file located 1147 // Acquire the statistics section of the OpenSim.ini file located
1148 // in the bin directory 1148 // in the bin directory
@@ -1172,7 +1172,7 @@ namespace OpenSim.Region.Framework.Scenes
1172 } 1172 }
1173 1173
1174 public Scene(RegionInfo regInfo, PhysicsScene physicsScene) 1174 public Scene(RegionInfo regInfo, PhysicsScene physicsScene)
1175 : base(regInfo) 1175 : base(regInfo)
1176 { 1176 {
1177 m_sceneGraph = new SceneGraph(this); 1177 m_sceneGraph = new SceneGraph(this);
1178 m_sceneGraph.PhysicsScene = physicsScene; 1178 m_sceneGraph.PhysicsScene = physicsScene;
@@ -1184,7 +1184,7 @@ namespace OpenSim.Region.Framework.Scenes
1184 // Out of memory 1184 // Out of memory
1185 // Operating system has killed the plugin 1185 // Operating system has killed the plugin
1186 m_sceneGraph.UnRecoverableError 1186 m_sceneGraph.UnRecoverableError
1187 += () => 1187 += () =>
1188 { 1188 {
1189 m_log.ErrorFormat("[SCENE]: Restarting region {0} due to unrecoverable physics crash", Name); 1189 m_log.ErrorFormat("[SCENE]: Restarting region {0} due to unrecoverable physics crash", Name);
1190 RestartNow(); 1190 RestartNow();
@@ -1232,7 +1232,7 @@ namespace OpenSim.Region.Framework.Scenes
1232 IDialogModule dm = RequestModuleInterface<IDialogModule>(); 1232 IDialogModule dm = RequestModuleInterface<IDialogModule>();
1233 1233
1234 if (dm != null) 1234 if (dm != null)
1235 m_eventManager.OnPermissionError += dm.SendAlertToUser; 1235 m_eventManager.OnPermissionError += dm.SendAlertToUser;
1236 1236
1237 m_eventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement; 1237 m_eventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement;
1238 } 1238 }
@@ -1262,7 +1262,7 @@ namespace OpenSim.Region.Framework.Scenes
1262 //int resultY = Math.Abs((int)ycell - (int)RegionInfo.RegionLocY); 1262 //int resultY = Math.Abs((int)ycell - (int)RegionInfo.RegionLocY);
1263 //if (resultX <= 1 && resultY <= 1) 1263 //if (resultX <= 1 && resultY <= 1)
1264 float dist = (float)Math.Max(DefaultDrawDistance, 1264 float dist = (float)Math.Max(DefaultDrawDistance,
1265 (float)Math.Max(RegionInfo.RegionSizeX, RegionInfo.RegionSizeY)); 1265 (float)Math.Max(RegionInfo.RegionSizeX, RegionInfo.RegionSizeY));
1266 uint newRegionX, newRegionY, thisRegionX, thisRegionY; 1266 uint newRegionX, newRegionY, thisRegionX, thisRegionY;
1267 Util.RegionHandleToRegionLoc(otherRegion.RegionHandle, out newRegionX, out newRegionY); 1267 Util.RegionHandleToRegionLoc(otherRegion.RegionHandle, out newRegionX, out newRegionY);
1268 Util.RegionHandleToRegionLoc(RegionInfo.RegionHandle, out thisRegionX, out thisRegionY); 1268 Util.RegionHandleToRegionLoc(RegionInfo.RegionHandle, out thisRegionX, out thisRegionY);
@@ -1286,7 +1286,7 @@ namespace OpenSim.Region.Framework.Scenes
1286 old.Add(otherRegion.RegionHandle); 1286 old.Add(otherRegion.RegionHandle);
1287 agent.DropOldNeighbours(old); 1287 agent.DropOldNeighbours(old);
1288 if (EntityTransferModule != null && agent.PresenceType != PresenceType.Npc) 1288 if (EntityTransferModule != null && agent.PresenceType != PresenceType.Npc)
1289 EntityTransferModule.EnableChildAgent(agent, otherRegion); 1289 EntityTransferModule.EnableChildAgent(agent, otherRegion);
1290 }); 1290 });
1291 } 1291 }
1292 catch (NullReferenceException) 1292 catch (NullReferenceException)
@@ -1299,8 +1299,8 @@ namespace OpenSim.Region.Framework.Scenes
1299 else 1299 else
1300 { 1300 {
1301 m_log.InfoFormat( 1301 m_log.InfoFormat(
1302 "[SCENE]: Got notice about far away Region: {0} at ({1}, {2})", 1302 "[SCENE]: Got notice about far away Region: {0} at ({1}, {2})",
1303 otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY); 1303 otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY);
1304 } 1304 }
1305 } 1305 }
1306 } 1306 }
@@ -1378,7 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes
1378 ForEachRootScenePresence(delegate(ScenePresence agent) 1378 ForEachRootScenePresence(delegate(ScenePresence agent)
1379 { 1379 {
1380 if (EntityTransferModule != null && agent.PresenceType != PresenceType.Npc) 1380 if (EntityTransferModule != null && agent.PresenceType != PresenceType.Npc)
1381 EntityTransferModule.EnableChildAgent(agent, r); 1381 EntityTransferModule.EnableChildAgent(agent, r);
1382 }); 1382 });
1383 } 1383 }
1384 catch (NullReferenceException) 1384 catch (NullReferenceException)
@@ -1420,7 +1420,7 @@ namespace OpenSim.Region.Framework.Scenes
1420 avatar.RemoveNeighbourRegion(RegionInfo.RegionHandle); 1420 avatar.RemoveNeighbourRegion(RegionInfo.RegionHandle);
1421 1421
1422 if (!avatar.IsChildAgent) 1422 if (!avatar.IsChildAgent)
1423 avatar.ControllingClient.Kick("The simulator is going down."); 1423 avatar.ControllingClient.Kick("The simulator is going down.");
1424 1424
1425 avatar.ControllingClient.SendShutdownConnectionNotice(); 1425 avatar.ControllingClient.SendShutdownConnectionNotice();
1426 }); 1426 });
@@ -1442,7 +1442,7 @@ namespace OpenSim.Region.Framework.Scenes
1442 m_sceneGraph.Close(); 1442 m_sceneGraph.Close();
1443 1443
1444 if (!GridService.DeregisterRegion(RegionInfo.RegionID)) 1444 if (!GridService.DeregisterRegion(RegionInfo.RegionID))
1445 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); 1445 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name);
1446 1446
1447 base.Close(); 1447 base.Close();
1448 1448
@@ -1473,7 +1473,7 @@ namespace OpenSim.Region.Framework.Scenes
1473 public void Start(bool startScripts) 1473 public void Start(bool startScripts)
1474 { 1474 {
1475 if (IsRunning) 1475 if (IsRunning)
1476 return; 1476 return;
1477 1477
1478 m_isRunning = true; 1478 m_isRunning = true;
1479 m_active = true; 1479 m_active = true;
@@ -1487,8 +1487,8 @@ namespace OpenSim.Region.Framework.Scenes
1487 } 1487 }
1488 1488
1489 m_heartbeatThread 1489 m_heartbeatThread
1490 = WorkManager.StartThread( 1490 = WorkManager.StartThread(
1491 Heartbeat, string.Format("Heartbeat-({0})", RegionInfo.RegionName.Replace(" ", "_")), ThreadPriority.Normal, false, false); 1491 Heartbeat, string.Format("Heartbeat-({0})", RegionInfo.RegionName.Replace(" ", "_")), ThreadPriority.Normal, false, false);
1492 1492
1493 StartScripts(); 1493 StartScripts();
1494 } 1494 }
@@ -1529,7 +1529,7 @@ namespace OpenSim.Region.Framework.Scenes
1529 Update(1); 1529 Update(1);
1530 1530
1531 WorkManager.StartThread( 1531 WorkManager.StartThread(
1532 Maintenance, string.Format("Maintenance ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, true); 1532 Maintenance, string.Format("Maintenance ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, true);
1533 1533
1534 Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true; 1534 Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true;
1535 m_lastFrameTick = Util.EnvironmentTickCount(); 1535 m_lastFrameTick = Util.EnvironmentTickCount();
@@ -1555,7 +1555,7 @@ namespace OpenSim.Region.Framework.Scenes
1555 private void Update(object sender, ElapsedEventArgs e) 1555 private void Update(object sender, ElapsedEventArgs e)
1556 { 1556 {
1557 if (m_isTimerUpdateRunning) 1557 if (m_isTimerUpdateRunning)
1558 return; 1558 return;
1559 1559
1560 m_isTimerUpdateRunning = true; 1560 m_isTimerUpdateRunning = true;
1561 1561
@@ -1587,7 +1587,7 @@ namespace OpenSim.Region.Framework.Scenes
1587 int previousMaintenanceTick; 1587 int previousMaintenanceTick;
1588 1588
1589 if (runs >= 0) 1589 if (runs >= 0)
1590 endRun = MaintenanceRun + runs; 1590 endRun = MaintenanceRun + runs;
1591 1591
1592 List<Vector3> coarseLocations; 1592 List<Vector3> coarseLocations;
1593 List<UUID> avatarUUIDs; 1593 List<UUID> avatarUUIDs;
@@ -1597,7 +1597,7 @@ namespace OpenSim.Region.Framework.Scenes
1597 runtc = Util.EnvironmentTickCount(); 1597 runtc = Util.EnvironmentTickCount();
1598 ++MaintenanceRun; 1598 ++MaintenanceRun;
1599 1599
1600 // m_log.DebugFormat("[SCENE]: Maintenance run {0} in {1}", MaintenanceRun, Name); 1600 // m_log.DebugFormat("[SCENE]: Maintenance run {0} in {1}", MaintenanceRun, Name);
1601 1601
1602 // Coarse locations relate to positions of green dots on the mini-map (on a SecondLife client) 1602 // Coarse locations relate to positions of green dots on the mini-map (on a SecondLife client)
1603 if (MaintenanceRun % (m_update_coarse_locations / 10) == 0) 1603 if (MaintenanceRun % (m_update_coarse_locations / 10) == 0)
@@ -1612,7 +1612,7 @@ namespace OpenSim.Region.Framework.Scenes
1612 1612
1613 if (SendPeriodicAppearanceUpdates && MaintenanceRun % 60 == 0) 1613 if (SendPeriodicAppearanceUpdates && MaintenanceRun % 60 == 0)
1614 { 1614 {
1615 // m_log.DebugFormat("[SCENE]: Sending periodic appearance updates"); 1615 // m_log.DebugFormat("[SCENE]: Sending periodic appearance updates");
1616 1616
1617 if (AvatarFactory != null) 1617 if (AvatarFactory != null)
1618 { 1618 {
@@ -1623,14 +1623,14 @@ namespace OpenSim.Region.Framework.Scenes
1623 // Delete temp-on-rez stuff 1623 // Delete temp-on-rez stuff
1624 if (MaintenanceRun % m_update_temp_cleaning == 0 && !m_cleaningTemps) 1624 if (MaintenanceRun % m_update_temp_cleaning == 0 && !m_cleaningTemps)
1625 { 1625 {
1626 // m_log.DebugFormat("[SCENE]: Running temp-on-rez cleaning in {0}", Name); 1626 // m_log.DebugFormat("[SCENE]: Running temp-on-rez cleaning in {0}", Name);
1627 tmpMS = Util.EnvironmentTickCount(); 1627 tmpMS = Util.EnvironmentTickCount();
1628 m_cleaningTemps = true; 1628 m_cleaningTemps = true;
1629 1629
1630 WorkManager.RunInThread( 1630 WorkManager.RunInThread(
1631 delegate { CleanTempObjects(); m_cleaningTemps = false; }, 1631 delegate { CleanTempObjects(); m_cleaningTemps = false; },
1632 null, 1632 null,
1633 string.Format("CleanTempObjects ({0})", Name)); 1633 string.Format("CleanTempObjects ({0})", Name));
1634 1634
1635 tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS); 1635 tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS);
1636 } 1636 }
@@ -1643,17 +1643,17 @@ namespace OpenSim.Region.Framework.Scenes
1643 runtc = MinMaintenanceTicks - runtc; 1643 runtc = MinMaintenanceTicks - runtc;
1644 1644
1645 if (runtc > 0) 1645 if (runtc > 0)
1646 m_maintenanceWaitEvent.WaitOne(runtc); 1646 m_maintenanceWaitEvent.WaitOne(runtc);
1647 1647
1648 // Optionally warn if a frame takes double the amount of time that it should. 1648 // Optionally warn if a frame takes double the amount of time that it should.
1649 if (DebugUpdates 1649 if (DebugUpdates
1650 && Util.EnvironmentTickCountSubtract( 1650 && Util.EnvironmentTickCountSubtract(
1651 m_lastMaintenanceTick, previousMaintenanceTick) > MinMaintenanceTicks * 2) 1651 m_lastMaintenanceTick, previousMaintenanceTick) > MinMaintenanceTicks * 2)
1652 m_log.WarnFormat( 1652 m_log.WarnFormat(
1653 "[SCENE]: Maintenance took {0} ms (desired max {1} ms) in {2}", 1653 "[SCENE]: Maintenance took {0} ms (desired max {1} ms) in {2}",
1654 Util.EnvironmentTickCountSubtract(m_lastMaintenanceTick, previousMaintenanceTick), 1654 Util.EnvironmentTickCountSubtract(m_lastMaintenanceTick, previousMaintenanceTick),
1655 MinMaintenanceTicks, 1655 MinMaintenanceTicks,
1656 RegionInfo.RegionName); 1656 RegionInfo.RegionName);
1657 } 1657 }
1658 } 1658 }
1659 1659
@@ -1662,7 +1662,7 @@ namespace OpenSim.Region.Framework.Scenes
1662 long? endFrame = null; 1662 long? endFrame = null;
1663 1663
1664 if (frames >= 0) 1664 if (frames >= 0)
1665 endFrame = Frame + frames; 1665 endFrame = Frame + frames;
1666 1666
1667 float physicsFPS = 0f; 1667 float physicsFPS = 0f;
1668 int previousFrameTick, tmpMS; 1668 int previousFrameTick, tmpMS;
@@ -1686,7 +1686,7 @@ namespace OpenSim.Region.Framework.Scenes
1686 { 1686 {
1687 ++Frame; 1687 ++Frame;
1688 1688
1689 // m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName); 1689 // m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName);
1690 1690
1691 agentMS = eventMS = backupMS = terrainMS = landMS = spareMS = 0; 1691 agentMS = eventMS = backupMS = terrainMS = landMS = spareMS = 0;
1692 1692
@@ -1748,7 +1748,7 @@ namespace OpenSim.Region.Framework.Scenes
1748 tmpMS = Util.EnvironmentTickCount(); 1748 tmpMS = Util.EnvironmentTickCount();
1749 simFrameStopwatch.Restart(); 1749 simFrameStopwatch.Restart();
1750 if (Frame % m_update_entitymovement == 0) 1750 if (Frame % m_update_entitymovement == 0)
1751 m_sceneGraph.UpdateScenePresenceMovement(); 1751 m_sceneGraph.UpdateScenePresenceMovement();
1752 1752
1753 // Get the simulation frame time that the avatar force input 1753 // Get the simulation frame time that the avatar force input
1754 // took 1754 // took
@@ -1764,10 +1764,10 @@ namespace OpenSim.Region.Framework.Scenes
1764 if (Frame % m_update_physics == 0) 1764 if (Frame % m_update_physics == 0)
1765 { 1765 {
1766 if (PhysicsEnabled) 1766 if (PhysicsEnabled)
1767 physicsFPS = m_sceneGraph.UpdatePhysics(MinFrameSeconds); 1767 physicsFPS = m_sceneGraph.UpdatePhysics(MinFrameSeconds);
1768 1768
1769 if (SynchronizeScene != null) 1769 if (SynchronizeScene != null)
1770 SynchronizeScene(this); 1770 SynchronizeScene(this);
1771 } 1771 }
1772 1772
1773 // Add the main physics update time to the prepare physics time 1773 // Add the main physics update time to the prepare physics time
@@ -1785,12 +1785,12 @@ namespace OpenSim.Region.Framework.Scenes
1785 // Update SceneObjectGroups that have scheduled themselves for updates 1785 // Update SceneObjectGroups that have scheduled themselves for updates
1786 // Objects queue their updates onto all scene presences 1786 // Objects queue their updates onto all scene presences
1787 if (Frame % m_update_objects == 0) 1787 if (Frame % m_update_objects == 0)
1788 m_sceneGraph.UpdateObjectGroups(); 1788 m_sceneGraph.UpdateObjectGroups();
1789 1789
1790 // Run through all ScenePresences looking for updates 1790 // Run through all ScenePresences looking for updates
1791 // Presence updates and queued object updates for each presence are sent to clients 1791 // Presence updates and queued object updates for each presence are sent to clients
1792 if (Frame % m_update_presences == 0) 1792 if (Frame % m_update_presences == 0)
1793 m_sceneGraph.UpdatePresences(); 1793 m_sceneGraph.UpdatePresences();
1794 1794
1795 agentMS += Util.EnvironmentTickCountSubtract(tmpMS); 1795 agentMS += Util.EnvironmentTickCountSubtract(tmpMS);
1796 1796
@@ -1817,7 +1817,7 @@ namespace OpenSim.Region.Framework.Scenes
1817 1817
1818 if (!LoginsEnabled && Frame == 20) 1818 if (!LoginsEnabled && Frame == 20)
1819 { 1819 {
1820 // m_log.DebugFormat("{0} {1} {2}", LoginsDisabled, m_sceneGraph.GetActiveScriptsCount(), LoginLock); 1820 // m_log.DebugFormat("{0} {1} {2}", LoginsDisabled, m_sceneGraph.GetActiveScriptsCount(), LoginLock);
1821 1821
1822 // In 99.9% of cases it is a bad idea to manually force garbage collection. However, 1822 // In 99.9% of cases it is a bad idea to manually force garbage collection. However,
1823 // this is a rare case where we know we have just went through a long cycle of heap 1823 // this is a rare case where we know we have just went through a long cycle of heap
@@ -1857,8 +1857,8 @@ namespace OpenSim.Region.Framework.Scenes
1857 catch (Exception e) 1857 catch (Exception e)
1858 { 1858 {
1859 m_log.ErrorFormat( 1859 m_log.ErrorFormat(
1860 "[SCENE]: Failed on region {0} with exception {1}{2}", 1860 "[SCENE]: Failed on region {0} with exception {1}{2}",
1861 RegionInfo.RegionName, e.Message, e.StackTrace); 1861 RegionInfo.RegionName, e.Message, e.StackTrace);
1862 } 1862 }
1863 1863
1864 EventManager.TriggerRegionHeartbeatEnd(this); 1864 EventManager.TriggerRegionHeartbeatEnd(this);
@@ -1876,9 +1876,9 @@ namespace OpenSim.Region.Framework.Scenes
1876 spareMS = MinFrameTicks - Util.EnvironmentTickCountSubtract(m_lastFrameTick); 1876 spareMS = MinFrameTicks - Util.EnvironmentTickCountSubtract(m_lastFrameTick);
1877 1877
1878 if (spareMS > 0) 1878 if (spareMS > 0)
1879 m_updateWaitEvent.WaitOne(spareMS); 1879 m_updateWaitEvent.WaitOne(spareMS);
1880 else 1880 else
1881 spareMS = 0; 1881 spareMS = 0;
1882 } 1882 }
1883 else 1883 else
1884 { 1884 {
@@ -1921,13 +1921,13 @@ namespace OpenSim.Region.Framework.Scenes
1921 1921
1922 // Optionally warn if a frame takes double the amount of time that it should. 1922 // Optionally warn if a frame takes double the amount of time that it should.
1923 if (DebugUpdates 1923 if (DebugUpdates
1924 && Util.EnvironmentTickCountSubtract( 1924 && Util.EnvironmentTickCountSubtract(
1925 m_lastFrameTick, previousFrameTick) > MinFrameTicks * 2) 1925 m_lastFrameTick, previousFrameTick) > MinFrameTicks * 2)
1926 m_log.WarnFormat( 1926 m_log.WarnFormat(
1927 "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", 1927 "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}",
1928 Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick), 1928 Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick),
1929 MinFrameTicks, 1929 MinFrameTicks,
1930 RegionInfo.RegionName); 1930 RegionInfo.RegionName);
1931 } 1931 }
1932 1932
1933 // Finished updating scene frame, so stop the total frame's Stopwatch 1933 // Finished updating scene frame, so stop the total frame's Stopwatch
@@ -1939,13 +1939,13 @@ namespace OpenSim.Region.Framework.Scenes
1939 public void AddGroupTarget(SceneObjectGroup grp) 1939 public void AddGroupTarget(SceneObjectGroup grp)
1940 { 1940 {
1941 lock (m_groupsWithTargets) 1941 lock (m_groupsWithTargets)
1942 m_groupsWithTargets[grp.UUID] = grp; 1942 m_groupsWithTargets[grp.UUID] = grp;
1943 } 1943 }
1944 1944
1945 public void RemoveGroupTarget(SceneObjectGroup grp) 1945 public void RemoveGroupTarget(SceneObjectGroup grp)
1946 { 1946 {
1947 lock (m_groupsWithTargets) 1947 lock (m_groupsWithTargets)
1948 m_groupsWithTargets.Remove(grp.UUID); 1948 m_groupsWithTargets.Remove(grp.UUID);
1949 } 1949 }
1950 1950
1951 private void CheckAtTargets() 1951 private void CheckAtTargets()
@@ -1955,13 +1955,13 @@ namespace OpenSim.Region.Framework.Scenes
1955 lock (m_groupsWithTargets) 1955 lock (m_groupsWithTargets)
1956 { 1956 {
1957 if (m_groupsWithTargets.Count != 0) 1957 if (m_groupsWithTargets.Count != 0)
1958 objs = new List<SceneObjectGroup>(m_groupsWithTargets.Values); 1958 objs = new List<SceneObjectGroup>(m_groupsWithTargets.Values);
1959 } 1959 }
1960 1960
1961 if (objs != null) 1961 if (objs != null)
1962 { 1962 {
1963 foreach (SceneObjectGroup entry in objs) 1963 foreach (SceneObjectGroup entry in objs)
1964 entry.checkAtTargets(); 1964 entry.checkAtTargets();
1965 } 1965 }
1966 } 1966 }
1967 1967
@@ -2044,13 +2044,13 @@ namespace OpenSim.Region.Framework.Scenes
2044 // We must fill in a null-terminated 'empty' string here since bytes[0] will crash viewer 3. 2044 // We must fill in a null-terminated 'empty' string here since bytes[0] will crash viewer 3.
2045 msg.binaryBucket = Util.StringToBytes256("\0"); 2045 msg.binaryBucket = Util.StringToBytes256("\0");
2046 if (ret.Value.count > 1) 2046 if (ret.Value.count > 1)
2047 msg.message = string.Format("Your {0} objects were returned from {1} in region {2} due to {3}", ret.Value.count, ret.Value.location.ToString(), RegionInfo.RegionName, ret.Value.reason); 2047 msg.message = string.Format("Your {0} objects were returned from {1} in region {2} due to {3}", ret.Value.count, ret.Value.location.ToString(), RegionInfo.RegionName, ret.Value.reason);
2048 else 2048 else
2049 msg.message = string.Format("Your object {0} was returned from {1} in region {2} due to {3}", ret.Value.objectName, ret.Value.location.ToString(), RegionInfo.RegionName, ret.Value.reason); 2049 msg.message = string.Format("Your object {0} was returned from {1} in region {2} due to {3}", ret.Value.objectName, ret.Value.location.ToString(), RegionInfo.RegionName, ret.Value.reason);
2050 2050
2051 IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>(); 2051 IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>();
2052 if (tr != null) 2052 if (tr != null)
2053 tr.SendInstantMessage(msg, delegate(bool success) { }); 2053 tr.SendInstantMessage(msg, delegate(bool success) { });
2054 } 2054 }
2055 m_returns.Clear(); 2055 m_returns.Clear();
2056 } 2056 }
@@ -2141,7 +2141,7 @@ namespace OpenSim.Region.Framework.Scenes
2141 IConfig terrainConfig = m_config.Configs["Terrain"]; 2141 IConfig terrainConfig = m_config.Configs["Terrain"];
2142 String m_InitialTerrain = "pinhead-island"; 2142 String m_InitialTerrain = "pinhead-island";
2143 if (terrainConfig != null) 2143 if (terrainConfig != null)
2144 m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain); 2144 m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain);
2145 2145
2146 m_log.InfoFormat("[TERRAIN]: No default terrain. Generating a new terrain {0}.", m_InitialTerrain); 2146 m_log.InfoFormat("[TERRAIN]: No default terrain. Generating a new terrain {0}.", m_InitialTerrain);
2147 Heightmap = new TerrainChannel(m_InitialTerrain, (int)RegionInfo.RegionSizeX, (int)RegionInfo.RegionSizeY, (int)RegionInfo.RegionSizeZ); 2147 Heightmap = new TerrainChannel(m_InitialTerrain, (int)RegionInfo.RegionSizeX, (int)RegionInfo.RegionSizeY, (int)RegionInfo.RegionSizeZ);
@@ -2156,8 +2156,8 @@ namespace OpenSim.Region.Framework.Scenes
2156 catch (IOException e) 2156 catch (IOException e)
2157 { 2157 {
2158 m_log.WarnFormat( 2158 m_log.WarnFormat(
2159 "[TERRAIN]: Scene.cs: LoadWorldMap() - Regenerating as failed with exception {0}{1}", 2159 "[TERRAIN]: Scene.cs: LoadWorldMap() - Regenerating as failed with exception {0}{1}",
2160 e.Message, e.StackTrace); 2160 e.Message, e.StackTrace);
2161 2161
2162 // Non standard region size. If there's an old terrain in the database, it might read past the buffer 2162 // Non standard region size. If there's an old terrain in the database, it might read past the buffer
2163#pragma warning disable 0162 2163#pragma warning disable 0162
@@ -2171,7 +2171,7 @@ namespace OpenSim.Region.Framework.Scenes
2171 catch (Exception e) 2171 catch (Exception e)
2172 { 2172 {
2173 m_log.WarnFormat( 2173 m_log.WarnFormat(
2174 "[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception {0}{1}", e.Message, e.StackTrace); 2174 "[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception {0}{1}", e.Message, e.StackTrace);
2175 } 2175 }
2176 } 2176 }
2177 2177
@@ -2192,14 +2192,14 @@ namespace OpenSim.Region.Framework.Scenes
2192 2192
2193 GridRegion region = new GridRegion(RegionInfo); 2193 GridRegion region = new GridRegion(RegionInfo);
2194 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); 2194 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
2195 // m_log.DebugFormat("[SCENE]: RegisterRegionWithGrid. name={0},id={1},loc=<{2},{3}>,size=<{4},{5}>", 2195 // m_log.DebugFormat("[SCENE]: RegisterRegionWithGrid. name={0},id={1},loc=<{2},{3}>,size=<{4},{5}>",
2196 // m_regionName, 2196 // m_regionName,
2197 // RegionInfo.RegionID, 2197 // RegionInfo.RegionID,
2198 // RegionInfo.RegionLocX, RegionInfo.RegionLocY, 2198 // RegionInfo.RegionLocX, RegionInfo.RegionLocY,
2199 // RegionInfo.RegionSizeX, RegionInfo.RegionSizeY); 2199 // RegionInfo.RegionSizeX, RegionInfo.RegionSizeY);
2200 2200
2201 if (error != String.Empty) 2201 if (error != String.Empty)
2202 throw new Exception(error); 2202 throw new Exception(error);
2203 } 2203 }
2204 2204
2205 #endregion 2205 #endregion
@@ -2268,14 +2268,14 @@ namespace OpenSim.Region.Framework.Scenes
2268 public bool SupportsRayCastFiltered() 2268 public bool SupportsRayCastFiltered()
2269 { 2269 {
2270 if (PhysicsScene == null) 2270 if (PhysicsScene == null)
2271 return false; 2271 return false;
2272 return PhysicsScene.SupportsRaycastWorldFiltered(); 2272 return PhysicsScene.SupportsRaycastWorldFiltered();
2273 } 2273 }
2274 2274
2275 public object RayCastFiltered(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter) 2275 public object RayCastFiltered(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter)
2276 { 2276 {
2277 if (PhysicsScene == null) 2277 if (PhysicsScene == null)
2278 return null; 2278 return null;
2279 return PhysicsScene.RaycastWorld(position, direction, length, Count, filter); 2279 return PhysicsScene.RaycastWorld(position, direction, length, Count, filter);
2280 } 2280 }
2281 2281
@@ -2397,8 +2397,8 @@ namespace OpenSim.Region.Framework.Scenes
2397 /// <param name="RayTargetID"></param> 2397 /// <param name="RayTargetID"></param>
2398 /// <param name="RayEndIsIntersection"></param> 2398 /// <param name="RayEndIsIntersection"></param>
2399 public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, 2399 public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape,
2400 byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, 2400 byte bypassRaycast, Vector3 RayStart, UUID RayTargetID,
2401 byte RayEndIsIntersection) 2401 byte RayEndIsIntersection)
2402 { 2402 {
2403 Vector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new Vector3(0.5f, 0.5f, 0.5f), false); 2403 Vector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new Vector3(0.5f, 0.5f, 0.5f), false);
2404 2404
@@ -2413,12 +2413,12 @@ namespace OpenSim.Region.Framework.Scenes
2413 { 2413 {
2414 IClientAPI client = null; 2414 IClientAPI client = null;
2415 if (TryGetClient(ownerID, out client)) 2415 if (TryGetClient(ownerID, out client))
2416 client.SendAlertMessage("You cannot create objects here."); 2416 client.SendAlertMessage("You cannot create objects here.");
2417 } 2417 }
2418 } 2418 }
2419 2419
2420 public virtual SceneObjectGroup AddNewPrim( 2420 public virtual SceneObjectGroup AddNewPrim(
2421 UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) 2421 UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
2422 { 2422 {
2423 //m_log.DebugFormat( 2423 //m_log.DebugFormat(
2424 // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName); 2424 // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
@@ -2439,7 +2439,7 @@ namespace OpenSim.Region.Framework.Scenes
2439 } 2439 }
2440 2440
2441 if (UserManagementModule != null) 2441 if (UserManagementModule != null)
2442 sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID); 2442 sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID);
2443 2443
2444 sceneObject.ScheduleGroupForFullUpdate(); 2444 sceneObject.ScheduleGroupForFullUpdate();
2445 2445
@@ -2467,7 +2467,7 @@ namespace OpenSim.Region.Framework.Scenes
2467 /// true if the object was added, false if an object with the same uuid was already in the scene 2467 /// true if the object was added, false if an object with the same uuid was already in the scene
2468 /// </returns> 2468 /// </returns>
2469 public bool AddRestoredSceneObject( 2469 public bool AddRestoredSceneObject(
2470 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) 2470 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
2471 { 2471 {
2472 if (m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates)) 2472 if (m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates))
2473 { 2473 {
@@ -2496,7 +2496,7 @@ namespace OpenSim.Region.Framework.Scenes
2496 /// true if the object was added, false if an object with the same uuid was already in the scene 2496 /// true if the object was added, false if an object with the same uuid was already in the scene
2497 /// </returns> 2497 /// </returns>
2498 public bool AddRestoredSceneObject( 2498 public bool AddRestoredSceneObject(
2499 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) 2499 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
2500 { 2500 {
2501 return AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true); 2501 return AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true);
2502 } 2502 }
@@ -2552,7 +2552,7 @@ namespace OpenSim.Region.Framework.Scenes
2552 /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param> 2552 /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param>
2553 /// <returns></returns> 2553 /// <returns></returns>
2554 public bool AddNewSceneObject( 2554 public bool AddNewSceneObject(
2555 SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel) 2555 SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel)
2556 { 2556 {
2557 if (m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, pos, rot, vel)) 2557 if (m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, pos, rot, vel))
2558 { 2558 {
@@ -2577,7 +2577,7 @@ namespace OpenSim.Region.Framework.Scenes
2577 { 2577 {
2578 SceneObjectGroup sog = (SceneObjectGroup)e; 2578 SceneObjectGroup sog = (SceneObjectGroup)e;
2579 if (!sog.IsAttachment) 2579 if (!sog.IsAttachment)
2580 DeleteSceneObject((SceneObjectGroup)e, false); 2580 DeleteSceneObject((SceneObjectGroup)e, false);
2581 } 2581 }
2582 } 2582 }
2583 } 2583 }
@@ -2604,12 +2604,12 @@ namespace OpenSim.Region.Framework.Scenes
2604 /// <param name="removeScripts">If true, then scripts are removed. If false, then they are only stopped.</para> 2604 /// <param name="removeScripts">If true, then scripts are removed. If false, then they are only stopped.</para>
2605 public void DeleteSceneObject(SceneObjectGroup group, bool silent, bool removeScripts) 2605 public void DeleteSceneObject(SceneObjectGroup group, bool silent, bool removeScripts)
2606 { 2606 {
2607 // m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID); 2607 // m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID);
2608 2608
2609 if (removeScripts) 2609 if (removeScripts)
2610 group.RemoveScriptInstances(true); 2610 group.RemoveScriptInstances(true);
2611 else 2611 else
2612 group.StopScriptInstances(); 2612 group.StopScriptInstances();
2613 2613
2614 SceneObjectPart[] partList = group.Parts; 2614 SceneObjectPart[] partList = group.Parts;
2615 2615
@@ -2639,7 +2639,7 @@ namespace OpenSim.Region.Framework.Scenes
2639 2639
2640 group.DeleteGroupFromScene(silent); 2640 group.DeleteGroupFromScene(silent);
2641 2641
2642 // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); 2642 // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID);
2643 } 2643 }
2644 2644
2645 /// <summary> 2645 /// <summary>
@@ -2659,7 +2659,7 @@ namespace OpenSim.Region.Framework.Scenes
2659 // database update, because RemoveObject() works by searching on the SceneGroupID. 2659 // database update, because RemoveObject() works by searching on the SceneGroupID.
2660 // This is an expensive thing to do so only do it if absolutely necessary. 2660 // This is an expensive thing to do so only do it if absolutely necessary.
2661 if (so.GroupContainsForeignPrims) 2661 if (so.GroupContainsForeignPrims)
2662 ForceSceneObjectBackup(so); 2662 ForceSceneObjectBackup(so);
2663 2663
2664 so.DetachFromBackup(); 2664 so.DetachFromBackup();
2665 SimulationDataService.RemoveObject(so.UUID, RegionInfo.RegionID); 2665 SimulationDataService.RemoveObject(so.UUID, RegionInfo.RegionID);
@@ -2684,9 +2684,9 @@ namespace OpenSim.Region.Framework.Scenes
2684 public void CrossPrimGroupIntoNewRegion(Vector3 attemptedPosition, SceneObjectGroup grp, bool silent) 2684 public void CrossPrimGroupIntoNewRegion(Vector3 attemptedPosition, SceneObjectGroup grp, bool silent)
2685 { 2685 {
2686 if (grp == null) 2686 if (grp == null)
2687 return; 2687 return;
2688 if (grp.IsDeleted) 2688 if (grp.IsDeleted)
2689 return; 2689 return;
2690 2690
2691 if (grp.RootPart.DIE_AT_EDGE) 2691 if (grp.RootPart.DIE_AT_EDGE)
2692 { 2692 {
@@ -2720,7 +2720,7 @@ namespace OpenSim.Region.Framework.Scenes
2720 } 2720 }
2721 2721
2722 if (EntityTransferModule != null) 2722 if (EntityTransferModule != null)
2723 EntityTransferModule.Cross(grp, attemptedPosition, silent); 2723 EntityTransferModule.Cross(grp, attemptedPosition, silent);
2724 } 2724 }
2725 2725
2726 // Simple test to see if a position is in the current region. 2726 // Simple test to see if a position is in the current region.
@@ -2733,14 +2733,14 @@ namespace OpenSim.Region.Framework.Scenes
2733 int xx = (int)Math.Floor(pos.X); 2733 int xx = (int)Math.Floor(pos.X);
2734 int yy = (int)Math.Floor(pos.Y); 2734 int yy = (int)Math.Floor(pos.Y);
2735 if (xx < 0 || yy < 0) 2735 if (xx < 0 || yy < 0)
2736 return false; 2736 return false;
2737 2737
2738 IRegionCombinerModule regionCombinerModule = RequestModuleInterface<IRegionCombinerModule>(); 2738 IRegionCombinerModule regionCombinerModule = RequestModuleInterface<IRegionCombinerModule>();
2739 if (regionCombinerModule == null) 2739 if (regionCombinerModule == null)
2740 { 2740 {
2741 // Regular region. Just check for region size 2741 // Regular region. Just check for region size
2742 if (xx < RegionInfo.RegionSizeX && yy < RegionInfo.RegionSizeY) 2742 if (xx < RegionInfo.RegionSizeX && yy < RegionInfo.RegionSizeY)
2743 ret = true; 2743 ret = true;
2744 } 2744 }
2745 else 2745 else
2746 { 2746 {
@@ -2774,7 +2774,7 @@ namespace OpenSim.Region.Framework.Scenes
2774 } 2774 }
2775 2775
2776 if (!EntityTransferModule.HandleIncomingSceneObject(newObject, newPosition)) 2776 if (!EntityTransferModule.HandleIncomingSceneObject(newObject, newPosition))
2777 return false; 2777 return false;
2778 2778
2779 // Do this as late as possible so that listeners have full access to the incoming object 2779 // Do this as late as possible so that listeners have full access to the incoming object
2780 EventManager.TriggerOnIncomingSceneObject(newObject); 2780 EventManager.TriggerOnIncomingSceneObject(newObject);
@@ -2795,7 +2795,7 @@ namespace OpenSim.Region.Framework.Scenes
2795 // 2795 //
2796 SceneObjectPart[] parts = sceneObject.Parts; 2796 SceneObjectPart[] parts = sceneObject.Parts;
2797 for (int i = 0; i < parts.Length; i++) 2797 for (int i = 0; i < parts.Length; i++)
2798 parts[i].LocalId = 0; 2798 parts[i].LocalId = 0;
2799 2799
2800 if (sceneObject.IsAttachmentCheckFull()) // Attachment 2800 if (sceneObject.IsAttachmentCheckFull()) // Attachment
2801 { 2801 {
@@ -2816,10 +2816,10 @@ namespace OpenSim.Region.Framework.Scenes
2816 { 2816 {
2817 SceneObjectGroup grp = sceneObject; 2817 SceneObjectGroup grp = sceneObject;
2818 2818
2819 // m_log.DebugFormat( 2819 // m_log.DebugFormat(
2820 // "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.FromItemID, grp.UUID); 2820 // "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.FromItemID, grp.UUID);
2821 // m_log.DebugFormat( 2821 // m_log.DebugFormat(
2822 // "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); 2822 // "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
2823 2823
2824 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2824 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2825 2825
@@ -2827,7 +2827,7 @@ namespace OpenSim.Region.Framework.Scenes
2827 // information that this is due to a teleport/border cross rather than an ordinary attachment. 2827 // information that this is due to a teleport/border cross rather than an ordinary attachment.
2828 // We currently do this in Scene.MakeRootAgent() instead. 2828 // We currently do this in Scene.MakeRootAgent() instead.
2829 if (AttachmentsModule != null) 2829 if (AttachmentsModule != null)
2830 AttachmentsModule.AttachObject(sp, grp, 0, false, false, true); 2830 AttachmentsModule.AttachObject(sp, grp, 0, false, false, true);
2831 } 2831 }
2832 else 2832 else
2833 { 2833 {
@@ -2876,10 +2876,10 @@ namespace OpenSim.Region.Framework.Scenes
2876 lock (aCircuit) 2876 lock (aCircuit)
2877 { 2877 {
2878 vialogin 2878 vialogin
2879 = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 2879 = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0
2880 || (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0; 2880 || (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
2881 2881
2882 // CheckHeartbeat(); 2882 // CheckHeartbeat();
2883 2883
2884 sp = GetScenePresence(client.AgentId); 2884 sp = GetScenePresence(client.AgentId);
2885 2885
@@ -2890,8 +2890,8 @@ namespace OpenSim.Region.Framework.Scenes
2890 if (sp == null) 2890 if (sp == null)
2891 { 2891 {
2892 m_log.DebugFormat( 2892 m_log.DebugFormat(
2893 "[SCENE]: Adding new child scene presence {0} {1} to scene {2} at pos {3}", 2893 "[SCENE]: Adding new child scene presence {0} {1} to scene {2} at pos {3}",
2894 client.Name, client.AgentId, RegionInfo.RegionName, client.StartPos); 2894 client.Name, client.AgentId, RegionInfo.RegionName, client.StartPos);
2895 2895
2896 sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance, type); 2896 sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance, type);
2897 2897
@@ -2922,8 +2922,8 @@ namespace OpenSim.Region.Framework.Scenes
2922 client.SceneAgent = sp; 2922 client.SceneAgent = sp;
2923 2923
2924 m_log.WarnFormat( 2924 m_log.WarnFormat(
2925 "[SCENE]: Already found {0} scene presence for {1} in {2} when asked to add new scene presence", 2925 "[SCENE]: Already found {0} scene presence for {1} in {2} when asked to add new scene presence",
2926 sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName); 2926 sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName);
2927 2927
2928 reallyNew = false; 2928 reallyNew = false;
2929 } 2929 }
@@ -2934,10 +2934,10 @@ namespace OpenSim.Region.Framework.Scenes
2934 CacheUserName(sp, aCircuit); 2934 CacheUserName(sp, aCircuit);
2935 2935
2936 if (reallyNew) 2936 if (reallyNew)
2937 EventManager.TriggerOnNewClient(client); 2937 EventManager.TriggerOnNewClient(client);
2938 2938
2939 if (vialogin) 2939 if (vialogin)
2940 EventManager.TriggerOnClientLogin(client); 2940 EventManager.TriggerOnClientLogin(client);
2941 } 2941 }
2942 2942
2943 // User has logged into the scene so update the list of users logging 2943 // User has logged into the scene so update the list of users logging
@@ -2956,9 +2956,9 @@ namespace OpenSim.Region.Framework.Scenes
2956 { 2956 {
2957 AgentCircuitData circuit = AuthenticateHandler.GetAgentCircuitData(agentID); 2957 AgentCircuitData circuit = AuthenticateHandler.GetAgentCircuitData(agentID);
2958 if (circuit != null && circuit.ServiceURLs != null && circuit.ServiceURLs.ContainsKey("HomeURI")) 2958 if (circuit != null && circuit.ServiceURLs != null && circuit.ServiceURLs.ContainsKey("HomeURI"))
2959 return circuit.ServiceURLs["HomeURI"].ToString(); 2959 return circuit.ServiceURLs["HomeURI"].ToString();
2960 else 2960 else
2961 return null; 2961 return null;
2962 } 2962 }
2963 2963
2964 /// <summary> 2964 /// <summary>
@@ -2981,7 +2981,7 @@ namespace OpenSim.Region.Framework.Scenes
2981 string homeURL = string.Empty; 2981 string homeURL = string.Empty;
2982 2982
2983 if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) 2983 if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
2984 homeURL = aCircuit.ServiceURLs["HomeURI"].ToString(); 2984 homeURL = aCircuit.ServiceURLs["HomeURI"].ToString();
2985 2985
2986 if (aCircuit.lastname.StartsWith("@")) 2986 if (aCircuit.lastname.StartsWith("@"))
2987 { 2987 {
@@ -3017,7 +3017,7 @@ namespace OpenSim.Region.Framework.Scenes
3017 return false; 3017 return false;
3018 } 3018 }
3019 else 3019 else
3020 m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 3020 m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
3021 3021
3022 } 3022 }
3023 } 3023 }
@@ -3025,7 +3025,7 @@ namespace OpenSim.Region.Framework.Scenes
3025 else if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) 3025 else if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
3026 { 3026 {
3027 m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via regular login. Client IP verification not performed.", 3027 m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via regular login. Client IP verification not performed.",
3028 aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 3028 aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
3029 vialogin = true; 3029 vialogin = true;
3030 } 3030 }
3031 3031
@@ -3069,7 +3069,7 @@ namespace OpenSim.Region.Framework.Scenes
3069 } 3069 }
3070 } 3070 }
3071 else 3071 else
3072 return true; 3072 return true;
3073 } 3073 }
3074 3074
3075 return false; 3075 return false;
@@ -3353,7 +3353,7 @@ namespace OpenSim.Region.Framework.Scenes
3353 { 3353 {
3354 SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity); 3354 SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity);
3355 if (copy != null) 3355 if (copy != null)
3356 EventManager.TriggerObjectAddedToScene(copy); 3356 EventManager.TriggerObjectAddedToScene(copy);
3357 } 3357 }
3358 3358
3359 /// <summary> 3359 /// <summary>
@@ -3372,8 +3372,8 @@ namespace OpenSim.Region.Framework.Scenes
3372 /// <param name="CopyCenters">Position the object at the center of the face that it's colliding with</param> 3372 /// <param name="CopyCenters">Position the object at the center of the face that it's colliding with</param>
3373 /// <param name="CopyRotates">Rotate the object the same as the localID object</param> 3373 /// <param name="CopyRotates">Rotate the object the same as the localID object</param>
3374 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, 3374 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID,
3375 UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart, 3375 UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart,
3376 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) 3376 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates)
3377 { 3377 {
3378 Vector3 pos; 3378 Vector3 pos;
3379 const bool frontFacesOnly = true; 3379 const bool frontFacesOnly = true;
@@ -3434,13 +3434,13 @@ namespace OpenSim.Region.Framework.Scenes
3434 } 3434 }
3435 3435
3436 if (copy != null) 3436 if (copy != null)
3437 EventManager.TriggerObjectAddedToScene(copy); 3437 EventManager.TriggerObjectAddedToScene(copy);
3438 } 3438 }
3439 } 3439 }
3440 } 3440 }
3441 3441
3442 /// <summary> 3442 /// <summary>
3443 /// Get the avatar apperance for the given client. 3443 /// Get the avatar appearance for the given client.
3444 /// </summary> 3444 /// </summary>
3445 /// <param name="client"></param> 3445 /// <param name="client"></param>
3446 /// <param name="appearance"></param> 3446 /// <param name="appearance"></param>
@@ -3485,7 +3485,7 @@ namespace OpenSim.Region.Framework.Scenes
3485 if (acd == null) 3485 if (acd == null)
3486 { 3486 {
3487 m_log.ErrorFormat( 3487 m_log.ErrorFormat(
3488 "[SCENE]: No agent circuit found for {0} in {1}, aborting Scene.RemoveClient", agentID, Name); 3488 "[SCENE]: No agent circuit found for {0} in {1}, aborting Scene.RemoveClient", agentID, Name);
3489 3489
3490 return; 3490 return;
3491 } 3491 }
@@ -3503,7 +3503,7 @@ namespace OpenSim.Region.Framework.Scenes
3503 if (avatar == null) 3503 if (avatar == null)
3504 { 3504 {
3505 m_log.ErrorFormat( 3505 m_log.ErrorFormat(
3506 "[SCENE]: Called RemoveClient() with agent ID {0} but no such presence is in the scene.", agentID); 3506 "[SCENE]: Called RemoveClient() with agent ID {0} but no such presence is in the scene.", agentID);
3507 m_authenticateHandler.RemoveCircuit(agentID); 3507 m_authenticateHandler.RemoveCircuit(agentID);
3508 3508
3509 return; 3509 return;
@@ -3514,8 +3514,8 @@ namespace OpenSim.Region.Framework.Scenes
3514 isChildAgent = avatar.IsChildAgent; 3514 isChildAgent = avatar.IsChildAgent;
3515 3515
3516 m_log.DebugFormat( 3516 m_log.DebugFormat(
3517 "[SCENE]: Removing {0} agent {1} {2} from {3}", 3517 "[SCENE]: Removing {0} agent {1} {2} from {3}",
3518 isChildAgent ? "child" : "root", avatar.Name, agentID, Name); 3518 isChildAgent ? "child" : "root", avatar.Name, agentID, Name);
3519 3519
3520 // Don't do this to root agents, it's not nice for the viewer 3520 // Don't do this to root agents, it's not nice for the viewer
3521 if (closeChildAgents && isChildAgent) 3521 if (closeChildAgents && isChildAgent)
@@ -3536,7 +3536,7 @@ namespace OpenSim.Region.Framework.Scenes
3536 // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop 3536 // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop
3537 // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI 3537 // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI
3538 if (closeChildAgents && CapsModule != null) 3538 if (closeChildAgents && CapsModule != null)
3539 CapsModule.RemoveCaps(agentID); 3539 CapsModule.RemoveCaps(agentID);
3540 3540
3541 if (closeChildAgents && !isChildAgent) 3541 if (closeChildAgents && !isChildAgent)
3542 { 3542 {
@@ -3558,22 +3558,22 @@ namespace OpenSim.Region.Framework.Scenes
3558 } 3558 }
3559 3559
3560 ForEachClient( 3560 ForEachClient(
3561 delegate(IClientAPI client) 3561 delegate(IClientAPI client)
3562 { 3562 {
3563 //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway 3563 //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway
3564 try { client.SendKillObject(new List<uint> { avatar.LocalId }); } 3564 try { client.SendKillObject(new List<uint> { avatar.LocalId }); }
3565 catch (NullReferenceException) { } 3565 catch (NullReferenceException) { }
3566 }); 3566 });
3567 } 3567 }
3568 3568
3569 // It's possible for child agents to have transactions if changes are being made cross-border. 3569 // It's possible for child agents to have transactions if changes are being made cross-border.
3570 if (AgentTransactionsModule != null) 3570 if (AgentTransactionsModule != null)
3571 AgentTransactionsModule.RemoveAgentAssetTransactions(agentID); 3571 AgentTransactionsModule.RemoveAgentAssetTransactions(agentID);
3572 } 3572 }
3573 catch (Exception e) 3573 catch (Exception e)
3574 { 3574 {
3575 m_log.Error( 3575 m_log.Error(
3576 string.Format("[SCENE]: Exception removing {0} from {1}. Cleaning up. Exception ", avatar.Name, Name), e); 3576 string.Format("[SCENE]: Exception removing {0} from {1}. Cleaning up. Exception ", avatar.Name, Name), e);
3577 } 3577 }
3578 finally 3578 finally
3579 { 3579 {
@@ -3591,7 +3591,7 @@ namespace OpenSim.Region.Framework.Scenes
3591 catch (Exception e) 3591 catch (Exception e)
3592 { 3592 {
3593 m_log.Error( 3593 m_log.Error(
3594 string.Format("[SCENE]: Exception in final clean up of {0} in {1}. Exception ", avatar.Name, Name), e); 3594 string.Format("[SCENE]: Exception in final clean up of {0} in {1}. Exception ", avatar.Name, Name), e);
3595 } 3595 }
3596 } 3596 }
3597 } 3597 }
@@ -3637,7 +3637,7 @@ namespace OpenSim.Region.Framework.Scenes
3637 if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid 3637 if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid
3638 { 3638 {
3639 if (part.ParentGroup.RootPart != part) // Child part 3639 if (part.ParentGroup.RootPart != part) // Child part
3640 continue; 3640 continue;
3641 } 3641 }
3642 } 3642 }
3643 deleteIDs.Add(localID); 3643 deleteIDs.Add(localID);
@@ -3690,7 +3690,7 @@ namespace OpenSim.Region.Framework.Scenes
3690 public bool NewUserConnection(AgentCircuitData acd, uint teleportFlags, GridRegion source, out string reason, bool requirePresenceLookup) 3690 public bool NewUserConnection(AgentCircuitData acd, uint teleportFlags, GridRegion source, out string reason, bool requirePresenceLookup)
3691 { 3691 {
3692 bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 || 3692 bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 ||
3693 (teleportFlags & (uint)TPFlags.ViaHGLogin) != 0); 3693 (teleportFlags & (uint)TPFlags.ViaHGLogin) != 0);
3694 bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0); 3694 bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0);
3695 bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0); 3695 bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0);
3696 3696
@@ -3706,18 +3706,18 @@ namespace OpenSim.Region.Framework.Scenes
3706 // Don't disable this log message - it's too helpful 3706 // Don't disable this log message - it's too helpful
3707 string curViewer = Util.GetViewerName(acd); 3707 string curViewer = Util.GetViewerName(acd);
3708 m_log.DebugFormat( 3708 m_log.DebugFormat(
3709 "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9}. {10}", 3709 "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9}. {10}",
3710 RegionInfo.RegionName, 3710 RegionInfo.RegionName,
3711 (acd.child ? "child" : "root"), 3711 (acd.child ? "child" : "root"),
3712 acd.firstname, 3712 acd.firstname,
3713 acd.lastname, 3713 acd.lastname,
3714 acd.AgentID, 3714 acd.AgentID,
3715 acd.circuitcode, 3715 acd.circuitcode,
3716 acd.IPAddress, 3716 acd.IPAddress,
3717 curViewer, 3717 curViewer,
3718 ((TPFlags)teleportFlags).ToString(), 3718 ((TPFlags)teleportFlags).ToString(),
3719 acd.startpos, 3719 acd.startpos,
3720 (source == null) ? "" : string.Format("From region {0} ({1}){2}", source.RegionName, source.RegionID, (source.RawServerURI == null) ? "" : " @ " + source.ServerURI) 3720 (source == null) ? "" : string.Format("From region {0} ({1}){2}", source.RegionName, source.RegionID, (source.RawServerURI == null) ? "" : " @ " + source.ServerURI)
3721 ); 3721 );
3722 3722
3723 if (!LoginsEnabled) 3723 if (!LoginsEnabled)
@@ -3763,8 +3763,8 @@ namespace OpenSim.Region.Framework.Scenes
3763 if (ViewerDenied) 3763 if (ViewerDenied)
3764 { 3764 {
3765 m_log.DebugFormat( 3765 m_log.DebugFormat(
3766 "[SCENE]: Access denied for {0} {1} using {2}", 3766 "[SCENE]: Access denied for {0} {1} using {2}",
3767 acd.firstname, acd.lastname, curViewer); 3767 acd.firstname, acd.lastname, curViewer);
3768 reason = "Access denied, your viewer is banned by the region owner"; 3768 reason = "Access denied, your viewer is banned by the region owner";
3769 return false; 3769 return false;
3770 } 3770 }
@@ -3779,12 +3779,12 @@ namespace OpenSim.Region.Framework.Scenes
3779 // We need to ensure that we are not already removing the scene presence before we ask it not to be 3779 // We need to ensure that we are not already removing the scene presence before we ask it not to be
3780 // closed. 3780 // closed.
3781 if (sp != null && sp.IsChildAgent 3781 if (sp != null && sp.IsChildAgent
3782 && (sp.LifecycleState == ScenePresenceState.Running 3782 && (sp.LifecycleState == ScenePresenceState.Running
3783 || sp.LifecycleState == ScenePresenceState.PreRemove)) 3783 || sp.LifecycleState == ScenePresenceState.PreRemove))
3784 { 3784 {
3785 m_log.DebugFormat( 3785 m_log.DebugFormat(
3786 "[SCENE]: Reusing existing child scene presence for {0}, state {1} in {2}", 3786 "[SCENE]: Reusing existing child scene presence for {0}, state {1} in {2}",
3787 sp.Name, sp.LifecycleState, Name); 3787 sp.Name, sp.LifecycleState, Name);
3788 3788
3789 // In the case where, for example, an A B C D region layout, an avatar may 3789 // In the case where, for example, an A B C D region layout, an avatar may
3790 // teleport from A -> D, but then -> C before A has asked B to close its old child agent. When C 3790 // teleport from A -> D, but then -> C before A has asked B to close its old child agent. When C
@@ -3796,15 +3796,15 @@ namespace OpenSim.Region.Framework.Scenes
3796 // vulnerable to an issue when a viewer quits a region without sending a proper logout but then 3796 // vulnerable to an issue when a viewer quits a region without sending a proper logout but then
3797 // re-establishes the connection on a relogin. This could wrongly set the DoNotCloseAfterTeleport 3797 // re-establishes the connection on a relogin. This could wrongly set the DoNotCloseAfterTeleport
3798 // flag when no teleport had taken place (and hence no close was going to come). 3798 // flag when no teleport had taken place (and hence no close was going to come).
3799 // if (!acd.ChildrenCapSeeds.ContainsKey(RegionInfo.RegionHandle)) 3799// if (!acd.ChildrenCapSeeds.ContainsKey(RegionInfo.RegionHandle))
3800 // { 3800// {
3801 // m_log.DebugFormat( 3801// m_log.DebugFormat(
3802 // "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.", 3802// "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.",
3803 // sp.Name, Name); 3803// sp.Name, Name);
3804 // 3804//
3805 // sp.DoNotCloseAfterTeleport = true; 3805// sp.DoNotCloseAfterTeleport = true;
3806 // } 3806// }
3807 // else if (EntityTransferModule.IsInTransit(sp.UUID)) 3807// else if (EntityTransferModule.IsInTransit(sp.UUID))
3808 3808
3809 sp.LifecycleState = ScenePresenceState.Running; 3809 sp.LifecycleState = ScenePresenceState.Running;
3810 3810
@@ -3813,8 +3813,8 @@ namespace OpenSim.Region.Framework.Scenes
3813 sp.DoNotCloseAfterTeleport = true; 3813 sp.DoNotCloseAfterTeleport = true;
3814 3814
3815 m_log.DebugFormat( 3815 m_log.DebugFormat(
3816 "[SCENE]: Set DoNotCloseAfterTeleport for child scene presence {0} in {1} because this region will attempt end-of-teleport close from a previous close.", 3816 "[SCENE]: Set DoNotCloseAfterTeleport for child scene presence {0} in {1} because this region will attempt end-of-teleport close from a previous close.",
3817 sp.Name, Name); 3817 sp.Name, Name);
3818 } 3818 }
3819 } 3819 }
3820 } 3820 }
@@ -3828,21 +3828,21 @@ namespace OpenSim.Region.Framework.Scenes
3828 int pollsLeft = polls; 3828 int pollsLeft = polls;
3829 3829
3830 while (sp.LifecycleState == ScenePresenceState.Removing && pollsLeft-- > 0) 3830 while (sp.LifecycleState == ScenePresenceState.Removing && pollsLeft-- > 0)
3831 Thread.Sleep(pollInterval); 3831 Thread.Sleep(pollInterval);
3832 3832
3833 if (sp.LifecycleState == ScenePresenceState.Removing) 3833 if (sp.LifecycleState == ScenePresenceState.Removing)
3834 { 3834 {
3835 m_log.WarnFormat( 3835 m_log.WarnFormat(
3836 "[SCENE]: Agent {0} in {1} was still being removed after {2}s. Aborting NewUserConnection.", 3836 "[SCENE]: Agent {0} in {1} was still being removed after {2}s. Aborting NewUserConnection.",
3837 sp.Name, Name, polls * pollInterval / 1000); 3837 sp.Name, Name, polls * pollInterval / 1000);
3838 3838
3839 return false; 3839 return false;
3840 } 3840 }
3841 else if (polls != pollsLeft) 3841 else if (polls != pollsLeft)
3842 { 3842 {
3843 m_log.DebugFormat( 3843 m_log.DebugFormat(
3844 "[SCENE]: NewUserConnection for agent {0} in {1} had to wait {2}s for in-progress removal to complete on an old presence.", 3844 "[SCENE]: NewUserConnection for agent {0} in {1} had to wait {2}s for in-progress removal to complete on an old presence.",
3845 sp.Name, Name, polls * pollInterval / 1000); 3845 sp.Name, Name, polls * pollInterval / 1000);
3846 } 3846 }
3847 } 3847 }
3848 3848
@@ -3858,11 +3858,11 @@ namespace OpenSim.Region.Framework.Scenes
3858 // Or the same user is trying to be root twice here, won't work. 3858 // Or the same user is trying to be root twice here, won't work.
3859 // Kill it. 3859 // Kill it.
3860 m_log.WarnFormat( 3860 m_log.WarnFormat(
3861 "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", 3861 "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.",
3862 sp.Name, sp.UUID, RegionInfo.RegionName); 3862 sp.Name, sp.UUID, RegionInfo.RegionName);
3863 3863
3864 if (sp.ControllingClient != null) 3864 if (sp.ControllingClient != null)
3865 CloseAgent(sp.UUID, true); 3865 CloseAgent(sp.UUID, true);
3866 3866
3867 sp = null; 3867 sp = null;
3868 } 3868 }
@@ -3903,7 +3903,7 @@ namespace OpenSim.Region.Framework.Scenes
3903 catch (Exception e) 3903 catch (Exception e)
3904 { 3904 {
3905 m_log.ErrorFormat( 3905 m_log.ErrorFormat(
3906 "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); 3906 "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace);
3907 3907
3908 m_authenticateHandler.RemoveCircuit(acd.circuitcode); 3908 m_authenticateHandler.RemoveCircuit(acd.circuitcode);
3909 return false; 3909 return false;
@@ -3921,16 +3921,16 @@ namespace OpenSim.Region.Framework.Scenes
3921 catch (Exception e) 3921 catch (Exception e)
3922 { 3922 {
3923 m_log.ErrorFormat( 3923 m_log.ErrorFormat(
3924 "[SCENE]: Exception authorizing user {0}{1}", e.Message, e.StackTrace); 3924 "[SCENE]: Exception authorizing user {0}{1}", e.Message, e.StackTrace);
3925 3925
3926 m_authenticateHandler.RemoveCircuit(acd.circuitcode); 3926 m_authenticateHandler.RemoveCircuit(acd.circuitcode);
3927 return false; 3927 return false;
3928 } 3928 }
3929 3929
3930 m_log.InfoFormat( 3930 m_log.InfoFormat(
3931 "[SCENE]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", 3931 "[SCENE]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})",
3932 Name, (acd.child ? "child" : "root"), acd.firstname, acd.lastname, 3932 Name, (acd.child ? "child" : "root"), acd.firstname, acd.lastname,
3933 acd.AgentID, acd.circuitcode); 3933 acd.AgentID, acd.circuitcode);
3934 3934
3935 if (CapsModule != null) 3935 if (CapsModule != null)
3936 { 3936 {
@@ -3947,8 +3947,8 @@ namespace OpenSim.Region.Framework.Scenes
3947 if (sp.IsChildAgent) 3947 if (sp.IsChildAgent)
3948 { 3948 {
3949 m_log.DebugFormat( 3949 m_log.DebugFormat(
3950 "[SCENE]: Adjusting known seeds for existing agent {0} in {1}", 3950 "[SCENE]: Adjusting known seeds for existing agent {0} in {1}",
3951 acd.AgentID, RegionInfo.RegionName); 3951 acd.AgentID, RegionInfo.RegionName);
3952 3952
3953 sp.AdjustKnownSeeds(); 3953 sp.AdjustKnownSeeds();
3954 3954
@@ -3968,7 +3968,7 @@ namespace OpenSim.Region.Framework.Scenes
3968 3968
3969 if (vialogin) 3969 if (vialogin)
3970 { 3970 {
3971 // CleanDroppedAttachments(); 3971// CleanDroppedAttachments();
3972 3972
3973 // Make sure avatar position is in the region (why it wouldn't be is a mystery but do sanity checking) 3973 // Make sure avatar position is in the region (why it wouldn't be is a mystery but do sanity checking)
3974 if (acd.startpos.X < 0) acd.startpos.X = 1f; 3974 if (acd.startpos.X < 0) acd.startpos.X = 1f;
@@ -3976,14 +3976,14 @@ namespace OpenSim.Region.Framework.Scenes
3976 if (acd.startpos.Y < 0) acd.startpos.Y = 1f; 3976 if (acd.startpos.Y < 0) acd.startpos.Y = 1f;
3977 if (acd.startpos.Y >= RegionInfo.RegionSizeY) acd.startpos.Y = RegionInfo.RegionSizeY - 1f; 3977 if (acd.startpos.Y >= RegionInfo.RegionSizeY) acd.startpos.Y = RegionInfo.RegionSizeY - 1f;
3978 3978
3979 // m_log.DebugFormat( 3979// m_log.DebugFormat(
3980 // "[SCENE]: Found telehub object {0} for new user connection {1} to {2}", 3980// "[SCENE]: Found telehub object {0} for new user connection {1} to {2}",
3981 // RegionInfo.RegionSettings.TelehubObject, acd.Name, Name); 3981// RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
3982 3982
3983 // Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags 3983 // Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
3984 if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && 3984 if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
3985 RegionInfo.EstateSettings.AllowDirectTeleport == false && 3985 RegionInfo.EstateSettings.AllowDirectTeleport == false &&
3986 !viahome && !godlike) 3986 !viahome && !godlike)
3987 { 3987 {
3988 SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject); 3988 SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
3989 3989
@@ -3995,15 +3995,15 @@ namespace OpenSim.Region.Framework.Scenes
3995 { 3995 {
3996 // We have multiple SpawnPoints, Route the agent to a random or sequential one 3996 // We have multiple SpawnPoints, Route the agent to a random or sequential one
3997 if (SpawnPointRouting == "random") 3997 if (SpawnPointRouting == "random")
3998 acd.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count) - 1].GetLocation( 3998 acd.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count) - 1].GetLocation(
3999 telehub.AbsolutePosition, 3999 telehub.AbsolutePosition,
4000 telehub.GroupRotation 4000 telehub.GroupRotation
4001 ); 4001 );
4002 else 4002 else
4003 acd.startpos = spawnpoints[SpawnPoint()].GetLocation( 4003 acd.startpos = spawnpoints[SpawnPoint()].GetLocation(
4004 telehub.AbsolutePosition, 4004 telehub.AbsolutePosition,
4005 telehub.GroupRotation 4005 telehub.GroupRotation
4006 ); 4006 );
4007 } 4007 }
4008 else if (spawnpoints.Count == 1) 4008 else if (spawnpoints.Count == 1)
4009 { 4009 {
@@ -4013,15 +4013,15 @@ namespace OpenSim.Region.Framework.Scenes
4013 else 4013 else
4014 { 4014 {
4015 m_log.DebugFormat( 4015 m_log.DebugFormat(
4016 "[SCENE]: No spawnpoints defined for telehub {0} for {1} in {2}. Continuing.", 4016 "[SCENE]: No spawnpoints defined for telehub {0} for {1} in {2}. Continuing.",
4017 RegionInfo.RegionSettings.TelehubObject, acd.Name, Name); 4017 RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
4018 } 4018 }
4019 } 4019 }
4020 else 4020 else
4021 { 4021 {
4022 m_log.DebugFormat( 4022 m_log.DebugFormat(
4023 "[SCENE]: No telehub {0} found to direct {1} in {2}. Continuing.", 4023 "[SCENE]: No telehub {0} found to direct {1} in {2}. Continuing.",
4024 RegionInfo.RegionSettings.TelehubObject, acd.Name, Name); 4024 RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
4025 } 4025 }
4026 4026
4027 // Final permissions check; this time we don't allow changing the position 4027 // Final permissions check; this time we don't allow changing the position
@@ -4058,7 +4058,7 @@ namespace OpenSim.Region.Framework.Scenes
4058 { 4058 {
4059 ILandObject land = LandChannel.GetLandObject(pos); 4059 ILandObject land = LandChannel.GetLandObject(pos);
4060 if (land == null) 4060 if (land == null)
4061 return true; 4061 return true;
4062 4062
4063 if (land.IsBannedFromLand(agentID) || land.IsRestrictedFromLand(agentID)) 4063 if (land.IsBannedFromLand(agentID) || land.IsRestrictedFromLand(agentID))
4064 { 4064 {
@@ -4072,21 +4072,21 @@ namespace OpenSim.Region.Framework.Scenes
4072 public bool TestLandRestrictions(UUID agentID, out string reason, ref float posX, ref float posY) 4072 public bool TestLandRestrictions(UUID agentID, out string reason, ref float posX, ref float posY)
4073 { 4073 {
4074 if (posX < 0) 4074 if (posX < 0)
4075 posX = 0; 4075 posX = 0;
4076 else if (posX >= (float)RegionInfo.RegionSizeX) 4076 else if (posX >= (float)RegionInfo.RegionSizeX)
4077 posX = (float)RegionInfo.RegionSizeX - 0.001f; 4077 posX = (float)RegionInfo.RegionSizeX - 0.001f;
4078 if (posY < 0) 4078 if (posY < 0)
4079 posY = 0; 4079 posY = 0;
4080 else if (posY >= (float)RegionInfo.RegionSizeY) 4080 else if (posY >= (float)RegionInfo.RegionSizeY)
4081 posY = (float)RegionInfo.RegionSizeY - 0.001f; 4081 posY = (float)RegionInfo.RegionSizeY - 0.001f;
4082 4082
4083 reason = String.Empty; 4083 reason = String.Empty;
4084 if (Permissions.IsGod(agentID)) 4084 if (Permissions.IsGod(agentID))
4085 return true; 4085 return true;
4086 4086
4087 ILandObject land = LandChannel.GetLandObject(posX, posY); 4087 ILandObject land = LandChannel.GetLandObject(posX, posY);
4088 if (land == null) 4088 if (land == null)
4089 return false; 4089 return false;
4090 4090
4091 bool banned = land.IsBannedFromLand(agentID); 4091 bool banned = land.IsBannedFromLand(agentID);
4092 bool restricted = land.IsRestrictedFromLand(agentID); 4092 bool restricted = land.IsRestrictedFromLand(agentID);
@@ -4110,7 +4110,7 @@ namespace OpenSim.Region.Framework.Scenes
4110 else 4110 else
4111 { 4111 {
4112 reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", 4112 reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.",
4113 RegionInfo.RegionName); 4113 RegionInfo.RegionName);
4114 } 4114 }
4115 return false; 4115 return false;
4116 } 4116 }
@@ -4165,10 +4165,10 @@ namespace OpenSim.Region.Framework.Scenes
4165 if (AuthorizationService != null) 4165 if (AuthorizationService != null)
4166 { 4166 {
4167 if (!AuthorizationService.IsAuthorizedForRegion( 4167 if (!AuthorizationService.IsAuthorizedForRegion(
4168 agent.AgentID.ToString(), agent.firstname, agent.lastname, RegionInfo.RegionID.ToString(), out reason)) 4168 agent.AgentID.ToString(), agent.firstname, agent.lastname, RegionInfo.RegionID.ToString(), out reason))
4169 { 4169 {
4170 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because: {4}", 4170 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because: {4}",
4171 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName, reason); 4171 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName, reason);
4172 4172
4173 return false; 4173 return false;
4174 } 4174 }
@@ -4185,9 +4185,9 @@ namespace OpenSim.Region.Framework.Scenes
4185 if (RegionInfo.EstateSettings.IsBanned(agent.AgentID)) 4185 if (RegionInfo.EstateSettings.IsBanned(agent.AgentID))
4186 { 4186 {
4187 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", 4187 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist",
4188 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); 4188 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
4189 reason = String.Format("Denied access to region {0}: You have been banned from that region.", 4189 reason = String.Format("Denied access to region {0}: You have been banned from that region.",
4190 RegionInfo.RegionName); 4190 RegionInfo.RegionName);
4191 return false; 4191 return false;
4192 } 4192 }
4193 } 4193 }
@@ -4205,7 +4205,7 @@ namespace OpenSim.Region.Framework.Scenes
4205 if (GroupMembership != null) 4205 if (GroupMembership != null)
4206 { 4206 {
4207 for (int i = 0; i < GroupMembership.Length; i++) 4207 for (int i = 0; i < GroupMembership.Length; i++)
4208 agentGroups.Add(GroupMembership[i].GroupID); 4208 agentGroups.Add(GroupMembership[i].GroupID);
4209 } 4209 }
4210 else 4210 else
4211 { 4211 {
@@ -4233,13 +4233,13 @@ namespace OpenSim.Region.Framework.Scenes
4233 } 4233 }
4234 4234
4235 if (!RegionInfo.EstateSettings.PublicAccess && 4235 if (!RegionInfo.EstateSettings.PublicAccess &&
4236 !RegionInfo.EstateSettings.HasAccess(agent.AgentID) && 4236 !RegionInfo.EstateSettings.HasAccess(agent.AgentID) &&
4237 !groupAccess) 4237 !groupAccess)
4238 { 4238 {
4239 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", 4239 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate",
4240 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); 4240 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
4241 reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", 4241 reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.",
4242 RegionInfo.RegionName); 4242 RegionInfo.RegionName);
4243 return false; 4243 return false;
4244 } 4244 }
4245 } 4245 }
@@ -4295,69 +4295,69 @@ namespace OpenSim.Region.Framework.Scenes
4295 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); 4295 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
4296 } 4296 }
4297 4297
4298 // /// <summary> 4298// /// <summary>
4299 // /// The Grid has requested that we log-off a user. Log them off. 4299// /// The Grid has requested that we log-off a user. Log them off.
4300 // /// </summary> 4300// /// </summary>
4301 // /// <param name="AvatarID">Unique ID of the avatar to log-off</param> 4301// /// <param name="AvatarID">Unique ID of the avatar to log-off</param>
4302 // /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param> 4302// /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param>
4303 // /// <param name="message">message to display to the user. Reason for being logged off</param> 4303// /// <param name="message">message to display to the user. Reason for being logged off</param>
4304 // public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message) 4304// public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
4305 // { 4305// {
4306 // ScenePresence loggingOffUser = GetScenePresence(AvatarID); 4306// ScenePresence loggingOffUser = GetScenePresence(AvatarID);
4307 // if (loggingOffUser != null) 4307// if (loggingOffUser != null)
4308 // { 4308// {
4309 // UUID localRegionSecret = UUID.Zero; 4309// UUID localRegionSecret = UUID.Zero;
4310 // bool parsedsecret = UUID.TryParse(RegionInfo.regionSecret, out localRegionSecret); 4310// bool parsedsecret = UUID.TryParse(RegionInfo.regionSecret, out localRegionSecret);
4311 // 4311//
4312 // // Region Secret is used here in case a new sessionid overwrites an old one on the user server. 4312// // Region Secret is used here in case a new sessionid overwrites an old one on the user server.
4313 // // Will update the user server in a few revisions to use it. 4313// // Will update the user server in a few revisions to use it.
4314 // 4314//
4315 // if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret)) 4315// if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret))
4316 // { 4316// {
4317 // m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles); 4317// m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles);
4318 // loggingOffUser.ControllingClient.Kick(message); 4318// loggingOffUser.ControllingClient.Kick(message);
4319 // // Give them a second to receive the message! 4319// // Give them a second to receive the message!
4320 // Thread.Sleep(1000); 4320// Thread.Sleep(1000);
4321 // loggingOffUser.ControllingClient.Close(); 4321// loggingOffUser.ControllingClient.Close();
4322 // } 4322// }
4323 // else 4323// else
4324 // { 4324// {
4325 // m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate"); 4325// m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
4326 // } 4326// }
4327 // } 4327// }
4328 // else 4328// else
4329 // { 4329// {
4330 // m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString()); 4330// m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
4331 // } 4331// }
4332 // } 4332// }
4333 4333
4334 // /// <summary> 4334// /// <summary>
4335 // /// Triggered when an agent crosses into this sim. Also happens on initial login. 4335// /// Triggered when an agent crosses into this sim. Also happens on initial login.
4336 // /// </summary> 4336// /// </summary>
4337 // /// <param name="agentID"></param> 4337// /// <param name="agentID"></param>
4338 // /// <param name="position"></param> 4338// /// <param name="position"></param>
4339 // /// <param name="isFlying"></param> 4339// /// <param name="isFlying"></param>
4340 // public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) 4340// public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
4341 // { 4341// {
4342 // ScenePresence presence = GetScenePresence(agentID); 4342// ScenePresence presence = GetScenePresence(agentID);
4343 // if (presence != null) 4343// if (presence != null)
4344 // { 4344// {
4345 // try 4345// try
4346 // { 4346// {
4347 // presence.MakeRootAgent(position, isFlying); 4347// presence.MakeRootAgent(position, isFlying);
4348 // } 4348// }
4349 // catch (Exception e) 4349// catch (Exception e)
4350 // { 4350// {
4351 // m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace); 4351// m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace);
4352 // } 4352// }
4353 // } 4353// }
4354 // else 4354// else
4355 // { 4355// {
4356 // m_log.ErrorFormat( 4356// m_log.ErrorFormat(
4357 // "[SCENE]: Could not find presence for agent {0} crossing into scene {1}", 4357// "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
4358 // agentID, RegionInfo.RegionName); 4358// agentID, RegionInfo.RegionName);
4359 // } 4359// }
4360 // } 4360// }
4361 4361
4362 /// <summary> 4362 /// <summary>
4363 /// We've got an update about an agent that sees into this region, 4363 /// We've got an update about an agent that sees into this region,
@@ -4369,15 +4369,15 @@ namespace OpenSim.Region.Framework.Scenes
4369 public virtual bool IncomingUpdateChildAgent(AgentData cAgentData) 4369 public virtual bool IncomingUpdateChildAgent(AgentData cAgentData)
4370 { 4370 {
4371 m_log.DebugFormat( 4371 m_log.DebugFormat(
4372 "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); 4372 "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName);
4373 4373
4374 // TODO: This check should probably be in QueryAccess(). 4374 // TODO: This check should probably be in QueryAccess().
4375 ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, RegionInfo.RegionSizeX / 2, RegionInfo.RegionSizeY / 2); 4375 ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, RegionInfo.RegionSizeX / 2, RegionInfo.RegionSizeY / 2);
4376 if (nearestParcel == null) 4376 if (nearestParcel == null)
4377 { 4377 {
4378 m_log.InfoFormat( 4378 m_log.InfoFormat(
4379 "[SCENE]: Denying root agent entry to {0} in {1}: no allowed parcel", 4379 "[SCENE]: Denying root agent entry to {0} in {1}: no allowed parcel",
4380 cAgentData.AgentID, RegionInfo.RegionName); 4380 cAgentData.AgentID, RegionInfo.RegionName);
4381 4381
4382 return false; 4382 return false;
4383 } 4383 }
@@ -4393,11 +4393,11 @@ namespace OpenSim.Region.Framework.Scenes
4393 if (cAgentData.SessionID != sp.ControllingClient.SessionId) 4393 if (cAgentData.SessionID != sp.ControllingClient.SessionId)
4394 { 4394 {
4395 m_log.WarnFormat( 4395 m_log.WarnFormat(
4396 "[SCENE]: Attempt to update agent {0} with invalid session id {1} (possibly from simulator in older version; tell them to update).", 4396 "[SCENE]: Attempt to update agent {0} with invalid session id {1} (possibly from simulator in older version; tell them to update).",
4397 sp.UUID, cAgentData.SessionID); 4397 sp.UUID, cAgentData.SessionID);
4398 4398
4399 Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}", 4399 Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}",
4400 sp.UUID, sp.ControllingClient.SessionId, cAgentData.SessionID)); 4400 sp.UUID, sp.ControllingClient.SessionId, cAgentData.SessionID));
4401 } 4401 }
4402 4402
4403 sp.UpdateChildAgent(cAgentData); 4403 sp.UpdateChildAgent(cAgentData);
@@ -4406,19 +4406,19 @@ namespace OpenSim.Region.Framework.Scenes
4406 if (cAgentData.SenderWantsToWaitForRoot) 4406 if (cAgentData.SenderWantsToWaitForRoot)
4407 { 4407 {
4408 while (sp.IsChildAgent && ntimes-- > 0) 4408 while (sp.IsChildAgent && ntimes-- > 0)
4409 Thread.Sleep(1000); 4409 Thread.Sleep(1000);
4410 4410
4411 if (sp.IsChildAgent) 4411 if (sp.IsChildAgent)
4412 m_log.WarnFormat( 4412 m_log.WarnFormat(
4413 "[SCENE]: Found presence {0} {1} unexpectedly still child in {2}", 4413 "[SCENE]: Found presence {0} {1} unexpectedly still child in {2}",
4414 sp.Name, sp.UUID, Name); 4414 sp.Name, sp.UUID, Name);
4415 else 4415 else
4416 m_log.InfoFormat( 4416 m_log.InfoFormat(
4417 "[SCENE]: Found presence {0} {1} as root in {2} after {3} waits", 4417 "[SCENE]: Found presence {0} {1} as root in {2} after {3} waits",
4418 sp.Name, sp.UUID, Name, 20 - ntimes); 4418 sp.Name, sp.UUID, Name, 20 - ntimes);
4419 4419
4420 if (sp.IsChildAgent) 4420 if (sp.IsChildAgent)
4421 return false; 4421 return false;
4422 } 4422 }
4423 4423
4424 return true; 4424 return true;
@@ -4435,17 +4435,17 @@ namespace OpenSim.Region.Framework.Scenes
4435 /// <returns>true if we handled it.</returns> 4435 /// <returns>true if we handled it.</returns>
4436 public virtual bool IncomingUpdateChildAgent(AgentPosition cAgentData) 4436 public virtual bool IncomingUpdateChildAgent(AgentPosition cAgentData)
4437 { 4437 {
4438 // m_log.DebugFormat( 4438// m_log.DebugFormat(
4439 // "[SCENE PRESENCE]: IncomingChildAgentDataUpdate POSITION for {0} in {1}, position {2}", 4439// "[SCENE PRESENCE]: IncomingChildAgentDataUpdate POSITION for {0} in {1}, position {2}",
4440 // cAgentData.AgentID, Name, cAgentData.Position); 4440// cAgentData.AgentID, Name, cAgentData.Position);
4441 4441
4442 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); 4442 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
4443 if (childAgentUpdate != null) 4443 if (childAgentUpdate != null)
4444 { 4444 {
4445 // if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID) 4445// if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID)
4446 // // Only warn for now 4446// // Only warn for now
4447 // m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?", 4447// m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?",
4448 // childAgentUpdate.UUID, cAgentData.SessionID); 4448// childAgentUpdate.UUID, cAgentData.SessionID);
4449 4449
4450 // I can't imagine *yet* why we would get an update if the agent is a root agent.. 4450 // I can't imagine *yet* why we would get an update if the agent is a root agent..
4451 // however to avoid a race condition crossing borders.. 4451 // however to avoid a race condition crossing borders..
@@ -4477,12 +4477,12 @@ namespace OpenSim.Region.Framework.Scenes
4477 int ntimes = 20; 4477 int ntimes = 20;
4478 ScenePresence sp = null; 4478 ScenePresence sp = null;
4479 while ((sp = GetScenePresence(agentID)) == null && (ntimes-- > 0)) 4479 while ((sp = GetScenePresence(agentID)) == null && (ntimes-- > 0))
4480 Thread.Sleep(1000); 4480 Thread.Sleep(1000);
4481 4481
4482 if (sp == null) 4482 if (sp == null)
4483 m_log.WarnFormat( 4483 m_log.WarnFormat(
4484 "[SCENE PRESENCE]: Did not find presence with id {0} in {1} before timeout", 4484 "[SCENE PRESENCE]: Did not find presence with id {0} in {1} before timeout",
4485 agentID, RegionInfo.RegionName); 4485 agentID, RegionInfo.RegionName);
4486 4486
4487 return sp; 4487 return sp;
4488 } 4488 }
@@ -4504,8 +4504,8 @@ namespace OpenSim.Region.Framework.Scenes
4504 if (acd == null) 4504 if (acd == null)
4505 { 4505 {
4506 m_log.DebugFormat( 4506 m_log.DebugFormat(
4507 "[SCENE]: Request to close agent {0} but no such agent in scene {1}. May have been closed previously.", 4507 "[SCENE]: Request to close agent {0} but no such agent in scene {1}. May have been closed previously.",
4508 agentID, Name); 4508 agentID, Name);
4509 4509
4510 return false; 4510 return false;
4511 } 4511 }
@@ -4517,8 +4517,8 @@ namespace OpenSim.Region.Framework.Scenes
4517 else 4517 else
4518 { 4518 {
4519 m_log.WarnFormat( 4519 m_log.WarnFormat(
4520 "[SCENE]: Request to close agent {0} with invalid authorization token {1} in {2}", 4520 "[SCENE]: Request to close agent {0} with invalid authorization token {1} in {2}",
4521 agentID, auth_token, Name); 4521 agentID, auth_token, Name);
4522 } 4522 }
4523 4523
4524 return false; 4524 return false;
@@ -4544,8 +4544,8 @@ namespace OpenSim.Region.Framework.Scenes
4544 if (sp.DoNotCloseAfterTeleport) 4544 if (sp.DoNotCloseAfterTeleport)
4545 { 4545 {
4546 m_log.DebugFormat( 4546 m_log.DebugFormat(
4547 "[SCENE]: Not pre-closing {0} agent {1} in {2} since another simulator has re-established the child connection", 4547 "[SCENE]: Not pre-closing {0} agent {1} in {2} since another simulator has re-established the child connection",
4548 sp.IsChildAgent ? "child" : "root", sp.Name, Name); 4548 sp.IsChildAgent ? "child" : "root", sp.Name, Name);
4549 4549
4550 // Need to reset the flag so that a subsequent close after another teleport can succeed. 4550 // Need to reset the flag so that a subsequent close after another teleport can succeed.
4551 sp.DoNotCloseAfterTeleport = false; 4551 sp.DoNotCloseAfterTeleport = false;
@@ -4556,8 +4556,8 @@ namespace OpenSim.Region.Framework.Scenes
4556 if (sp.LifecycleState != ScenePresenceState.Running) 4556 if (sp.LifecycleState != ScenePresenceState.Running)
4557 { 4557 {
4558 m_log.DebugFormat( 4558 m_log.DebugFormat(
4559 "[SCENE]: Called IncomingPreCloseAgent() for {0} in {1} but presence is already in state {2}", 4559 "[SCENE]: Called IncomingPreCloseAgent() for {0} in {1} but presence is already in state {2}",
4560 sp.Name, Name, sp.LifecycleState); 4560 sp.Name, Name, sp.LifecycleState);
4561 4561
4562 return false; 4562 return false;
4563 } 4563 }
@@ -4587,8 +4587,8 @@ namespace OpenSim.Region.Framework.Scenes
4587 if (sp == null) 4587 if (sp == null)
4588 { 4588 {
4589 m_log.DebugFormat( 4589 m_log.DebugFormat(
4590 "[SCENE]: Called CloseClient() with agent ID {0} but no such presence is in {1}", 4590 "[SCENE]: Called CloseClient() with agent ID {0} but no such presence is in {1}",
4591 agentID, Name); 4591 agentID, Name);
4592 4592
4593 return false; 4593 return false;
4594 } 4594 }
@@ -4596,8 +4596,8 @@ namespace OpenSim.Region.Framework.Scenes
4596 if (sp.LifecycleState != ScenePresenceState.Running && sp.LifecycleState != ScenePresenceState.PreRemove) 4596 if (sp.LifecycleState != ScenePresenceState.Running && sp.LifecycleState != ScenePresenceState.PreRemove)
4597 { 4597 {
4598 m_log.DebugFormat( 4598 m_log.DebugFormat(
4599 "[SCENE]: Called CloseClient() for {0} in {1} but presence is already in state {2}", 4599 "[SCENE]: Called CloseClient() for {0} in {1} but presence is already in state {2}",
4600 sp.Name, Name, sp.LifecycleState); 4600 sp.Name, Name, sp.LifecycleState);
4601 4601
4602 return false; 4602 return false;
4603 } 4603 }
@@ -4608,8 +4608,8 @@ namespace OpenSim.Region.Framework.Scenes
4608 if (sp.DoNotCloseAfterTeleport) 4608 if (sp.DoNotCloseAfterTeleport)
4609 { 4609 {
4610 m_log.DebugFormat( 4610 m_log.DebugFormat(
4611 "[SCENE]: Not closing {0} agent {1} in {2} since another simulator has re-established the child connection", 4611 "[SCENE]: Not closing {0} agent {1} in {2} since another simulator has re-established the child connection",
4612 sp.IsChildAgent ? "child" : "root", sp.Name, Name); 4612 sp.IsChildAgent ? "child" : "root", sp.Name, Name);
4613 4613
4614 // Need to reset the flag so that a subsequent close after another teleport can succeed. 4614 // Need to reset the flag so that a subsequent close after another teleport can succeed.
4615 sp.DoNotCloseAfterTeleport = false; 4615 sp.DoNotCloseAfterTeleport = false;
@@ -4637,7 +4637,7 @@ namespace OpenSim.Region.Framework.Scenes
4637 /// <param name="lookAt"></param> 4637 /// <param name="lookAt"></param>
4638 /// <param name="teleportFlags"></param> 4638 /// <param name="teleportFlags"></param>
4639 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position, 4639 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position,
4640 Vector3 lookat, uint teleportFlags) 4640 Vector3 lookat, uint teleportFlags)
4641 { 4641 {
4642 GridRegion region = GridService.GetRegionByName(RegionInfo.ScopeID, regionName); 4642 GridRegion region = GridService.GetRegionByName(RegionInfo.ScopeID, regionName);
4643 4643
@@ -4660,7 +4660,7 @@ namespace OpenSim.Region.Framework.Scenes
4660 /// <param name="lookAt"></param> 4660 /// <param name="lookAt"></param>
4661 /// <param name="teleportFlags"></param> 4661 /// <param name="teleportFlags"></param>
4662 public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, Vector3 position, 4662 public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, Vector3 position,
4663 Vector3 lookAt, uint teleportFlags) 4663 Vector3 lookAt, uint teleportFlags)
4664 { 4664 {
4665 ScenePresence sp = GetScenePresence(remoteClient.AgentId); 4665 ScenePresence sp = GetScenePresence(remoteClient.AgentId);
4666 if (sp != null) 4666 if (sp != null)
@@ -4759,8 +4759,8 @@ namespace OpenSim.Region.Framework.Scenes
4759 if (part.Name == cmdparams[2]) 4759 if (part.Name == cmdparams[2])
4760 { 4760 {
4761 part.Resize( 4761 part.Resize(
4762 new Vector3(Convert.ToSingle(cmdparams[3]), Convert.ToSingle(cmdparams[4]), 4762 new Vector3(Convert.ToSingle(cmdparams[3]), Convert.ToSingle(cmdparams[4]),
4763 Convert.ToSingle(cmdparams[5]))); 4763 Convert.ToSingle(cmdparams[5])));
4764 4764
4765 m_log.DebugFormat("Edited scale of Primitive: {0}", part.Name); 4765 m_log.DebugFormat("Edited scale of Primitive: {0}", part.Name);
4766 } 4766 }
@@ -4821,7 +4821,7 @@ namespace OpenSim.Region.Framework.Scenes
4821 return true; 4821 return true;
4822 } 4822 }
4823 else if (((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) 4823 else if (((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0)
4824 && (parcel.LandData.GroupID != UUID.Zero) && (parcel.LandData.GroupID == part.GroupID)) 4824 && (parcel.LandData.GroupID != UUID.Zero) && (parcel.LandData.GroupID == part.GroupID))
4825 { 4825 {
4826 return true; 4826 return true;
4827 } 4827 }
@@ -5163,15 +5163,15 @@ namespace OpenSim.Region.Framework.Scenes
5163 #endregion 5163 #endregion
5164 5164
5165 5165
5166 // Commented pending deletion since this method no longer appears to do anything at all 5166// Commented pending deletion since this method no longer appears to do anything at all
5167 // public bool NeedSceneCacheClear(UUID agentID) 5167// public bool NeedSceneCacheClear(UUID agentID)
5168 // { 5168// {
5169 // IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>(); 5169// IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
5170 // if (inv == null) 5170// if (inv == null)
5171 // return true; 5171// return true;
5172 // 5172//
5173 // return inv.NeedSceneCacheClear(agentID, this); 5173// return inv.NeedSceneCacheClear(agentID, this);
5174 // } 5174// }
5175 5175
5176 public void CleanTempObjects() 5176 public void CleanTempObjects()
5177 { 5177 {
@@ -5187,7 +5187,7 @@ namespace OpenSim.Region.Framework.Scenes
5187 if ((grp.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) 5187 if ((grp.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
5188 { 5188 {
5189 if (grp.RootPart.Expires <= DateTime.Now) 5189 if (grp.RootPart.Expires <= DateTime.Now)
5190 DeleteSceneObject(grp, false); 5190 DeleteSceneObject(grp, false);
5191 } 5191 }
5192 } 5192 }
5193 } 5193 }
@@ -5216,18 +5216,18 @@ namespace OpenSim.Region.Framework.Scenes
5216 int health = 1; // Start at 1, means we're up 5216 int health = 1; // Start at 1, means we're up
5217 5217
5218 if ((Util.EnvironmentTickCountSubtract(m_lastFrameTick)) < 1000) 5218 if ((Util.EnvironmentTickCountSubtract(m_lastFrameTick)) < 1000)
5219 health += 1; 5219 health += 1;
5220 else 5220 else
5221 return health; 5221 return health;
5222 5222
5223 // A login in the last 4 mins? We can't be doing too badly 5223 // A login in the last 4 mins? We can't be doing too badly
5224 // 5224 //
5225 if ((Util.EnvironmentTickCountSubtract(m_LastLogin)) < 240000) 5225 if ((Util.EnvironmentTickCountSubtract(m_LastLogin)) < 240000)
5226 health++; 5226 health++;
5227 else 5227 else
5228 return health; 5228 return health;
5229 5229
5230 // CheckHeartbeat(); 5230// CheckHeartbeat();
5231 5231
5232 return health; 5232 return health;
5233 } 5233 }
@@ -5257,41 +5257,41 @@ namespace OpenSim.Region.Framework.Scenes
5257 jointProxyObject.AngularVelocity = trackedBody.AngularVelocity; 5257 jointProxyObject.AngularVelocity = trackedBody.AngularVelocity;
5258 switch (joint.Type) 5258 switch (joint.Type)
5259 { 5259 {
5260 case PhysicsJointType.Ball: 5260 case PhysicsJointType.Ball:
5261 { 5261 {
5262 Vector3 jointAnchor = PhysicsScene.GetJointAnchor(joint); 5262 Vector3 jointAnchor = PhysicsScene.GetJointAnchor(joint);
5263 Vector3 proxyPos = jointAnchor; 5263 Vector3 proxyPos = jointAnchor;
5264 jointProxyObject.ParentGroup.UpdateGroupPosition(proxyPos); // schedules the entire group for a terse update 5264 jointProxyObject.ParentGroup.UpdateGroupPosition(proxyPos); // schedules the entire group for a terse update
5265 } 5265 }
5266 break; 5266 break;
5267 5267
5268 case PhysicsJointType.Hinge: 5268 case PhysicsJointType.Hinge:
5269 { 5269 {
5270 Vector3 jointAnchor = PhysicsScene.GetJointAnchor(joint); 5270 Vector3 jointAnchor = PhysicsScene.GetJointAnchor(joint);
5271 5271
5272 // Normally, we would just ask the physics scene to return the axis for the joint. 5272 // Normally, we would just ask the physics scene to return the axis for the joint.
5273 // Unfortunately, ODE sometimes returns <0,0,0> for the joint axis, which should 5273 // Unfortunately, ODE sometimes returns <0,0,0> for the joint axis, which should
5274 // never occur. Therefore we cannot rely on ODE to always return a correct joint axis. 5274 // never occur. Therefore we cannot rely on ODE to always return a correct joint axis.
5275 // Therefore the following call does not always work: 5275 // Therefore the following call does not always work:
5276 //PhysicsVector phyJointAxis = _PhyScene.GetJointAxis(joint); 5276 //PhysicsVector phyJointAxis = _PhyScene.GetJointAxis(joint);
5277 5277
5278 // instead we compute the joint orientation by saving the original joint orientation 5278 // instead we compute the joint orientation by saving the original joint orientation
5279 // relative to one of the jointed bodies, and applying this transformation 5279 // relative to one of the jointed bodies, and applying this transformation
5280 // to the current position of the jointed bodies (the tracked body) to compute the 5280 // to the current position of the jointed bodies (the tracked body) to compute the
5281 // current joint orientation. 5281 // current joint orientation.
5282 5282
5283 if (joint.TrackedBodyName == null) 5283 if (joint.TrackedBodyName == null)
5284 { 5284 {
5285 jointErrorMessage(joint, "joint.TrackedBodyName is null, joint " + joint.ObjectNameInScene); 5285 jointErrorMessage(joint, "joint.TrackedBodyName is null, joint " + joint.ObjectNameInScene);
5286 } 5286 }
5287 5287
5288 Vector3 proxyPos = jointAnchor; 5288 Vector3 proxyPos = jointAnchor;
5289 Quaternion q = trackedBody.RotationOffset * joint.LocalRotation; 5289 Quaternion q = trackedBody.RotationOffset * joint.LocalRotation;
5290 5290
5291 jointProxyObject.ParentGroup.UpdateGroupPosition(proxyPos); // schedules the entire group for a terse update 5291 jointProxyObject.ParentGroup.UpdateGroupPosition(proxyPos); // schedules the entire group for a terse update
5292 jointProxyObject.ParentGroup.UpdateGroupRotationR(q); // schedules the entire group for a terse update 5292 jointProxyObject.ParentGroup.UpdateGroupRotationR(q); // schedules the entire group for a terse update
5293 } 5293 }
5294 break; 5294 break;
5295 } 5295 }
5296 } 5296 }
5297 5297
@@ -5332,30 +5332,30 @@ namespace OpenSim.Region.Framework.Scenes
5332 if (joint != null) 5332 if (joint != null)
5333 { 5333 {
5334 if (joint.ErrorMessageCount > PhysicsJoint.maxErrorMessages) 5334 if (joint.ErrorMessageCount > PhysicsJoint.maxErrorMessages)
5335 return; 5335 return;
5336 5336
5337 SceneObjectPart jointProxyObject = GetSceneObjectPart(joint.ObjectNameInScene); 5337 SceneObjectPart jointProxyObject = GetSceneObjectPart(joint.ObjectNameInScene);
5338 if (jointProxyObject != null) 5338 if (jointProxyObject != null)
5339 { 5339 {
5340 SimChat(Utils.StringToBytes("[NINJA]: " + message), 5340 SimChat(Utils.StringToBytes("[NINJA]: " + message),
5341 ChatTypeEnum.DebugChannel,
5342 2147483647,
5343 jointProxyObject.AbsolutePosition,
5344 jointProxyObject.Name,
5345 jointProxyObject.UUID,
5346 false);
5347
5348 joint.ErrorMessageCount++;
5349
5350 if (joint.ErrorMessageCount > PhysicsJoint.maxErrorMessages)
5351 {
5352 SimChat(Utils.StringToBytes("[NINJA]: Too many messages for this joint, suppressing further messages."),
5353 ChatTypeEnum.DebugChannel, 5341 ChatTypeEnum.DebugChannel,
5354 2147483647, 5342 2147483647,
5355 jointProxyObject.AbsolutePosition, 5343 jointProxyObject.AbsolutePosition,
5356 jointProxyObject.Name, 5344 jointProxyObject.Name,
5357 jointProxyObject.UUID, 5345 jointProxyObject.UUID,
5358 false); 5346 false);
5347
5348 joint.ErrorMessageCount++;
5349
5350 if (joint.ErrorMessageCount > PhysicsJoint.maxErrorMessages)
5351 {
5352 SimChat(Utils.StringToBytes("[NINJA]: Too many messages for this joint, suppressing further messages."),
5353 ChatTypeEnum.DebugChannel,
5354 2147483647,
5355 jointProxyObject.AbsolutePosition,
5356 jointProxyObject.Name,
5357 jointProxyObject.UUID,
5358 false);
5359 } 5359 }
5360 } 5360 }
5361 else 5361 else
@@ -5368,9 +5368,9 @@ namespace OpenSim.Region.Framework.Scenes
5368 public Scene ConsoleScene() 5368 public Scene ConsoleScene()
5369 { 5369 {
5370 if (MainConsole.Instance == null) 5370 if (MainConsole.Instance == null)
5371 return null; 5371 return null;
5372 if (MainConsole.Instance.ConsoleScene is Scene) 5372 if (MainConsole.Instance.ConsoleScene is Scene)
5373 return (Scene)MainConsole.Instance.ConsoleScene; 5373 return (Scene)MainConsole.Instance.ConsoleScene;
5374 return null; 5374 return null;
5375 } 5375 }
5376 5376
@@ -5381,13 +5381,13 @@ namespace OpenSim.Region.Framework.Scenes
5381 public float GetGroundHeight(float x, float y) 5381 public float GetGroundHeight(float x, float y)
5382 { 5382 {
5383 if (x < 0) 5383 if (x < 0)
5384 x = 0; 5384 x = 0;
5385 if (x >= Heightmap.Width) 5385 if (x >= Heightmap.Width)
5386 x = Heightmap.Width - 1; 5386 x = Heightmap.Width - 1;
5387 if (y < 0) 5387 if (y < 0)
5388 y = 0; 5388 y = 0;
5389 if (y >= Heightmap.Height) 5389 if (y >= Heightmap.Height)
5390 y = Heightmap.Height - 1; 5390 y = Heightmap.Height - 1;
5391 5391
5392 Vector3 p0 = new Vector3(x, y, (float)Heightmap[(int)x, (int)y]); 5392 Vector3 p0 = new Vector3(x, y, (float)Heightmap[(int)x, (int)y]);
5393 Vector3 p1 = p0; 5393 Vector3 p1 = p0;
@@ -5395,11 +5395,11 @@ namespace OpenSim.Region.Framework.Scenes
5395 5395
5396 p1.X += 1.0f; 5396 p1.X += 1.0f;
5397 if (p1.X < Heightmap.Width) 5397 if (p1.X < Heightmap.Width)
5398 p1.Z = (float)Heightmap[(int)p1.X, (int)p1.Y]; 5398 p1.Z = (float)Heightmap[(int)p1.X, (int)p1.Y];
5399 5399
5400 p2.Y += 1.0f; 5400 p2.Y += 1.0f;
5401 if (p2.Y < Heightmap.Height) 5401 if (p2.Y < Heightmap.Height)
5402 p2.Z = (float)Heightmap[(int)p2.X, (int)p2.Y]; 5402 p2.Z = (float)Heightmap[(int)p2.X, (int)p2.Y];
5403 5403
5404 Vector3 v0 = new Vector3(p1.X - p0.X, p1.Y - p0.Y, p1.Z - p0.Z); 5404 Vector3 v0 = new Vector3(p1.X - p0.X, p1.Y - p0.Y, p1.Z - p0.Z);
5405 Vector3 v1 = new Vector3(p2.X - p0.X, p2.Y - p0.Y, p2.Z - p0.Z); 5405 Vector3 v1 = new Vector3(p2.X - p0.X, p2.Y - p0.Y, p2.Z - p0.Z);
@@ -5419,14 +5419,14 @@ namespace OpenSim.Region.Framework.Scenes
5419 return (((vsn.X * xdiff) + (vsn.Y * ydiff)) / (-1 * vsn.Z)) + p0.Z; 5419 return (((vsn.X * xdiff) + (vsn.Y * ydiff)) / (-1 * vsn.Z)) + p0.Z;
5420 } 5420 }
5421 5421
5422 // private void CheckHeartbeat() 5422// private void CheckHeartbeat()
5423 // { 5423// {
5424 // if (m_firstHeartbeat) 5424// if (m_firstHeartbeat)
5425 // return; 5425// return;
5426 // 5426//
5427 // if (Util.EnvironmentTickCountSubtract(m_lastFrameTick) > 2000) 5427// if (Util.EnvironmentTickCountSubtract(m_lastFrameTick) > 2000)
5428 // StartTimer(); 5428// StartTimer();
5429 // } 5429// }
5430 5430
5431 public override ISceneObject DeserializeObject(string representation) 5431 public override ISceneObject DeserializeObject(string representation)
5432 { 5432 {
@@ -5579,9 +5579,9 @@ namespace OpenSim.Region.Framework.Scenes
5579 private Vector3 GetNearestRegionEdgePosition(ScenePresence avatar) 5579 private Vector3 GetNearestRegionEdgePosition(ScenePresence avatar)
5580 { 5580 {
5581 float xdistance = avatar.AbsolutePosition.X < RegionInfo.RegionSizeX / 2 5581 float xdistance = avatar.AbsolutePosition.X < RegionInfo.RegionSizeX / 2
5582 ? avatar.AbsolutePosition.X : RegionInfo.RegionSizeX - avatar.AbsolutePosition.X; 5582 ? avatar.AbsolutePosition.X : RegionInfo.RegionSizeX - avatar.AbsolutePosition.X;
5583 float ydistance = avatar.AbsolutePosition.Y < RegionInfo.RegionSizeY / 2 5583 float ydistance = avatar.AbsolutePosition.Y < RegionInfo.RegionSizeY / 2
5584 ? avatar.AbsolutePosition.Y : RegionInfo.RegionSizeY - avatar.AbsolutePosition.Y; 5584 ? avatar.AbsolutePosition.Y : RegionInfo.RegionSizeY - avatar.AbsolutePosition.Y;
5585 5585
5586 //find out what vertical edge to go to 5586 //find out what vertical edge to go to
5587 if (xdistance < ydistance) 5587 if (xdistance < ydistance)
@@ -5628,7 +5628,7 @@ namespace OpenSim.Region.Framework.Scenes
5628 { 5628 {
5629 IEstateDataService estateDataService = EstateDataService; 5629 IEstateDataService estateDataService = EstateDataService;
5630 if (estateDataService == null) 5630 if (estateDataService == null)
5631 return new List<UUID>(0); 5631 return new List<UUID>(0);
5632 5632
5633 return estateDataService.GetRegions(estateID); 5633 return estateDataService.GetRegions(estateID);
5634 } 5634 }
@@ -5651,8 +5651,8 @@ namespace OpenSim.Region.Framework.Scenes
5651 private void HandleReloadEstate(string module, string[] cmd) 5651 private void HandleReloadEstate(string module, string[] cmd)
5652 { 5652 {
5653 if (MainConsole.Instance.ConsoleScene == null || 5653 if (MainConsole.Instance.ConsoleScene == null ||
5654 (MainConsole.Instance.ConsoleScene is Scene && 5654 (MainConsole.Instance.ConsoleScene is Scene &&
5655 (Scene)MainConsole.Instance.ConsoleScene == this)) 5655 (Scene)MainConsole.Instance.ConsoleScene == this))
5656 { 5656 {
5657 ReloadEstateData(); 5657 ReloadEstateData();
5658 } 5658 }
@@ -5670,8 +5670,8 @@ namespace OpenSim.Region.Framework.Scenes
5670 /// <param name="maxZ"></param> 5670 /// <param name="maxZ"></param>
5671 /// <returns></returns> 5671 /// <returns></returns>
5672 public static Vector3[] GetCombinedBoundingBox( 5672 public static Vector3[] GetCombinedBoundingBox(
5673 List<SceneObjectGroup> objects, 5673 List<SceneObjectGroup> objects,
5674 out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ) 5674 out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ)
5675 { 5675 {
5676 minX = float.MaxValue; 5676 minX = float.MaxValue;
5677 maxX = float.MinValue; 5677 maxX = float.MinValue;
@@ -5690,9 +5690,9 @@ namespace OpenSim.Region.Framework.Scenes
5690 5690
5691 g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ); 5691 g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ);
5692 5692
5693 // m_log.DebugFormat( 5693// m_log.DebugFormat(
5694 // "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}", 5694// "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}",
5695 // g.Name, new Vector3(ominX, ominY, ominZ), new Vector3(omaxX, omaxY, omaxZ)); 5695// g.Name, new Vector3(ominX, ominY, ominZ), new Vector3(omaxX, omaxY, omaxZ));
5696 5696
5697 ominX += vec.X; 5697 ominX += vec.X;
5698 omaxX += vec.X; 5698 omaxX += vec.X;
@@ -5702,17 +5702,17 @@ namespace OpenSim.Region.Framework.Scenes
5702 omaxZ += vec.Z; 5702 omaxZ += vec.Z;
5703 5703
5704 if (minX > ominX) 5704 if (minX > ominX)
5705 minX = ominX; 5705 minX = ominX;
5706 if (minY > ominY) 5706 if (minY > ominY)
5707 minY = ominY; 5707 minY = ominY;
5708 if (minZ > ominZ) 5708 if (minZ > ominZ)
5709 minZ = ominZ; 5709 minZ = ominZ;
5710 if (maxX < omaxX) 5710 if (maxX < omaxX)
5711 maxX = omaxX; 5711 maxX = omaxX;
5712 if (maxY < omaxY) 5712 if (maxY < omaxY)
5713 maxY = omaxY; 5713 maxY = omaxY;
5714 if (maxZ < omaxZ) 5714 if (maxZ < omaxZ)
5715 maxZ = omaxZ; 5715 maxZ = omaxZ;
5716 } 5716 }
5717 5717
5718 foreach (SceneObjectGroup g in objects) 5718 foreach (SceneObjectGroup g in objects)
@@ -5737,7 +5737,7 @@ namespace OpenSim.Region.Framework.Scenes
5737 { 5737 {
5738 IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); 5738 IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>();
5739 if (mapModule != null) 5739 if (mapModule != null)
5740 mapModule.GenerateMaptile(); 5740 mapModule.GenerateMaptile();
5741 } 5741 }
5742 5742
5743 private void RegenerateMaptileAndReregister(object sender, ElapsedEventArgs e) 5743 private void RegenerateMaptileAndReregister(object sender, ElapsedEventArgs e)
@@ -5778,7 +5778,7 @@ namespace OpenSim.Region.Framework.Scenes
5778 } 5778 }
5779 5779
5780 if (!AllowAvatarCrossing && !viaTeleport) 5780 if (!AllowAvatarCrossing && !viaTeleport)
5781 return false; 5781 return false;
5782 5782
5783 // FIXME: Root agent count is currently known to be inaccurate. This forces a recount before we check. 5783 // FIXME: Root agent count is currently known to be inaccurate. This forces a recount before we check.
5784 // However, the long term fix is to make sure root agent count is always accurate. 5784 // However, the long term fix is to make sure root agent count is always accurate.
@@ -5793,8 +5793,8 @@ namespace OpenSim.Region.Framework.Scenes
5793 reason = "The region is full"; 5793 reason = "The region is full";
5794 5794
5795 m_log.DebugFormat( 5795 m_log.DebugFormat(
5796 "[SCENE]: Denying presence with id {0} entry into {1} since region is at agent limit of {2}", 5796 "[SCENE]: Denying presence with id {0} entry into {1} since region is at agent limit of {2}",
5797 agentID, RegionInfo.RegionName, RegionInfo.RegionSettings.AgentLimit); 5797 agentID, RegionInfo.RegionName, RegionInfo.RegionSettings.AgentLimit);
5798 5798
5799 return false; 5799 return false;
5800 } 5800 }
@@ -5808,7 +5808,7 @@ namespace OpenSim.Region.Framework.Scenes
5808 { 5808 {
5809 client = presence.ControllingClient; 5809 client = presence.ControllingClient;
5810 if (client != null) 5810 if (client != null)
5811 aCircuit = client.RequestClientInfo(); 5811 aCircuit = client.RequestClientInfo();
5812 } 5812 }
5813 5813
5814 // We may be called before there is a presence or a client. 5814 // We may be called before there is a presence or a client.
@@ -5850,9 +5850,9 @@ namespace OpenSim.Region.Framework.Scenes
5850 Vector3 spawnPoint = sp.GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); 5850 Vector3 spawnPoint = sp.GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
5851 ILandObject land = LandChannel.GetLandObject(spawnPoint.X, spawnPoint.Y); 5851 ILandObject land = LandChannel.GetLandObject(spawnPoint.X, spawnPoint.Y);
5852 if (land == null) 5852 if (land == null)
5853 continue; 5853 continue;
5854 if (land.IsEitherBannedOrRestricted(agentID)) 5854 if (land.IsEitherBannedOrRestricted(agentID))
5855 continue; 5855 continue;
5856 banned = false; 5856 banned = false;
5857 break; 5857 break;
5858 } 5858 }
@@ -5895,9 +5895,9 @@ namespace OpenSim.Region.Framework.Scenes
5895 if (banned || restricted) 5895 if (banned || restricted)
5896 { 5896 {
5897 if (banned) 5897 if (banned)
5898 reason = "You are banned from the parcel"; 5898 reason = "You are banned from the parcel";
5899 else 5899 else
5900 reason = "The parcel is restricted"; 5900 reason = "The parcel is restricted";
5901 return false; 5901 return false;
5902 } 5902 }
5903 } 5903 }
@@ -5919,15 +5919,15 @@ namespace OpenSim.Region.Framework.Scenes
5919 if (presence.MovingToTarget) 5919 if (presence.MovingToTarget)
5920 { 5920 {
5921 double distanceToTarget = Util.GetDistanceTo(presence.AbsolutePosition, presence.MoveToPositionTarget); 5921 double distanceToTarget = Util.GetDistanceTo(presence.AbsolutePosition, presence.MoveToPositionTarget);
5922 // m_log.DebugFormat( 5922// m_log.DebugFormat(
5923 // "[SCENE]: Abs pos of {0} is {1}, target {2}, distance {3}", 5923// "[SCENE]: Abs pos of {0} is {1}, target {2}, distance {3}",
5924 // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget); 5924// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget);
5925 5925
5926 // Check the error term of the current position in relation to the target position 5926 // Check the error term of the current position in relation to the target position
5927 if (distanceToTarget <= ScenePresence.SIGNIFICANT_MOVEMENT) 5927 if (distanceToTarget <= ScenePresence.SIGNIFICANT_MOVEMENT)
5928 { 5928 {
5929 // We are close enough to the target 5929 // We are close enough to the target
5930 // m_log.DebugFormat("[SCENEE]: Stopping autopilot of {0}", presence.Name); 5930// m_log.DebugFormat("[SCENEE]: Stopping autopilot of {0}", presence.Name);
5931 5931
5932 presence.Velocity = Vector3.Zero; 5932 presence.Velocity = Vector3.Zero;
5933 presence.AbsolutePosition = presence.MoveToPositionTarget; 5933 presence.AbsolutePosition = presence.MoveToPositionTarget;
@@ -5941,28 +5941,28 @@ namespace OpenSim.Region.Framework.Scenes
5941 // least be able to set collision status once, rather than 5 times to give it enough 5941 // least be able to set collision status once, rather than 5 times to give it enough
5942 // weighting so that that PhysicsActor thinks it really is colliding. 5942 // weighting so that that PhysicsActor thinks it really is colliding.
5943 for (int i = 0; i < 5; i++) 5943 for (int i = 0; i < 5; i++)
5944 presence.IsColliding = true; 5944 presence.IsColliding = true;
5945 5945
5946 if (presence.LandAtTarget) 5946 if (presence.LandAtTarget)
5947 presence.Flying = false; 5947 presence.Flying = false;
5948 5948
5949 // Vector3 targetPos = presence.MoveToPositionTarget; 5949// Vector3 targetPos = presence.MoveToPositionTarget;
5950 // float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y]; 5950// float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y];
5951 // if (targetPos.Z - terrainHeight < 0.2) 5951// if (targetPos.Z - terrainHeight < 0.2)
5952 // { 5952// {
5953 // presence.Flying = false; 5953// presence.Flying = false;
5954 // } 5954// }
5955 } 5955 }
5956 5956
5957 // m_log.DebugFormat( 5957// m_log.DebugFormat(
5958 // "[SCENE]: AgentControlFlags {0}, MovementFlag {1} for {2}", 5958// "[SCENE]: AgentControlFlags {0}, MovementFlag {1} for {2}",
5959 // presence.AgentControlFlags, presence.MovementFlag, presence.Name); 5959// presence.AgentControlFlags, presence.MovementFlag, presence.Name);
5960 } 5960 }
5961 else 5961 else
5962 { 5962 {
5963 // m_log.DebugFormat( 5963// m_log.DebugFormat(
5964 // "[SCENE]: Updating npc {0} at {1} for next movement to {2}", 5964// "[SCENE]: Updating npc {0} at {1} for next movement to {2}",
5965 // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget); 5965// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
5966 5966
5967 Vector3 agent_control_v3 = new Vector3(); 5967 Vector3 agent_control_v3 = new Vector3();
5968 presence.HandleMoveToTargetUpdate(1, ref agent_control_v3); 5968 presence.HandleMoveToTargetUpdate(1, ref agent_control_v3);
@@ -5977,11 +5977,11 @@ namespace OpenSim.Region.Framework.Scenes
5977 int spawnpoints = RegionInfo.RegionSettings.SpawnPoints().Count; 5977 int spawnpoints = RegionInfo.RegionSettings.SpawnPoints().Count;
5978 5978
5979 if (spawnpoints == 0) 5979 if (spawnpoints == 0)
5980 return 0; 5980 return 0;
5981 5981
5982 m_SpawnPoint++; 5982 m_SpawnPoint++;
5983 if (m_SpawnPoint > spawnpoints) 5983 if (m_SpawnPoint > spawnpoints)
5984 m_SpawnPoint = 1; 5984 m_SpawnPoint = 1;
5985 return m_SpawnPoint - 1; 5985 return m_SpawnPoint - 1;
5986 } 5986 }
5987 5987
@@ -6011,12 +6011,12 @@ namespace OpenSim.Region.Framework.Scenes
6011 public string GetExtraSetting(string name) 6011 public string GetExtraSetting(string name)
6012 { 6012 {
6013 if (m_extraSettings == null) 6013 if (m_extraSettings == null)
6014 return String.Empty; 6014 return String.Empty;
6015 6015
6016 string val; 6016 string val;
6017 6017
6018 if (!m_extraSettings.TryGetValue(name, out val)) 6018 if (!m_extraSettings.TryGetValue(name, out val))
6019 return String.Empty; 6019 return String.Empty;
6020 6020
6021 return val; 6021 return val;
6022 } 6022 }
@@ -6024,14 +6024,14 @@ namespace OpenSim.Region.Framework.Scenes
6024 public void StoreExtraSetting(string name, string val) 6024 public void StoreExtraSetting(string name, string val)
6025 { 6025 {
6026 if (m_extraSettings == null) 6026 if (m_extraSettings == null)
6027 return; 6027 return;
6028 6028
6029 string oldVal; 6029 string oldVal;
6030 6030
6031 if (m_extraSettings.TryGetValue(name, out oldVal)) 6031 if (m_extraSettings.TryGetValue(name, out oldVal))
6032 { 6032 {
6033 if (oldVal == val) 6033 if (oldVal == val)
6034 return; 6034 return;
6035 } 6035 }
6036 6036
6037 m_extraSettings[name] = val; 6037 m_extraSettings[name] = val;
@@ -6044,10 +6044,10 @@ namespace OpenSim.Region.Framework.Scenes
6044 public void RemoveExtraSetting(string name) 6044 public void RemoveExtraSetting(string name)
6045 { 6045 {
6046 if (m_extraSettings == null) 6046 if (m_extraSettings == null)
6047 return; 6047 return;
6048 6048
6049 if (!m_extraSettings.ContainsKey(name)) 6049 if (!m_extraSettings.ContainsKey(name))
6050 return; 6050 return;
6051 6051
6052 m_extraSettings.Remove(name); 6052 m_extraSettings.Remove(name);
6053 6053