aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/Application.cs8
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs82
-rw-r--r--OpenSim/Region/Application/OpenSimMainConsole.cs24
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs232
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs30
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs12
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs32
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs8
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs8
-rw-r--r--OpenSim/Region/Communications/Local/LocalInventoryService.cs18
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs46
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs2
-rw-r--r--OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs132
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs84
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs42
-rw-r--r--OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/DataSnapshot/DataRequestHandler.cs4
-rw-r--r--OpenSim/Region/DataSnapshot/DataSnapshotManager.cs12
-rw-r--r--OpenSim/Region/DataSnapshot/Interfaces/IDataSnapshotProvider.cs2
-rw-r--r--OpenSim/Region/DataSnapshot/LandSnapshot.cs8
-rw-r--r--OpenSim/Region/DataSnapshot/ObjectSnapshot.cs2
-rw-r--r--OpenSim/Region/Environment/InstantMessageReceiver.cs4
-rw-r--r--OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs2
-rw-r--r--OpenSim/Region/Environment/Interfaces/IScenePermissions.cs2
-rw-r--r--OpenSim/Region/Environment/Interfaces/ITextureSender.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs18
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs12
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs20
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs22
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs34
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs26
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs136
-rw-r--r--OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/EntityBase.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs82
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs444
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs262
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs60
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneEvents.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs118
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs132
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs184
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs202
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs184
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs88
-rw-r--r--OpenSim/Region/Environment/Types/UpdateQueue.cs4
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs18
-rw-r--r--OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs8
-rw-r--r--OpenSim/Region/Modules/AvatarFactory/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/Modules/SvnSerialiser/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs20
-rw-r--r--OpenSim/Region/Physics/BulletXPlugin/TriangleIndexVertexArray.cs4
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsActor.cs22
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs8
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsSensor.cs2
-rw-r--r--OpenSim/Region/Physics/Manager/ZeroMesher.cs4
-rw-r--r--OpenSim/Region/Physics/Meshing/HelperTypes.cs14
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs64
-rw-r--r--OpenSim/Region/Physics/Meshing/SimpleHull.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs62
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs226
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs208
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSPlugin.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ExecutorBase.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs290
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_Types.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Common/TRPC/TCPServer.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs12
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs27
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs28
-rw-r--r--OpenSim/Region/ScriptEngine/LSOEngine/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs2
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs10
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs14
119 files changed, 2068 insertions, 2181 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index d349d37..b2c710a 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -59,7 +59,7 @@ namespace OpenSim
59 } 59 }
60 60
61 Console.WriteLine("Starting...\n"); 61 Console.WriteLine("Starting...\n");
62 62
63 Culture.SetCurrentCulture(); 63 Culture.SetCurrentCulture();
64 64
65 ArgvConfigSource configSource = new ArgvConfigSource(args); 65 ArgvConfigSource configSource = new ArgvConfigSource(args);
@@ -110,7 +110,7 @@ namespace OpenSim
110 _IsHandlingException = true; 110 _IsHandlingException = true;
111 // TODO: Add config option to allow users to turn off error reporting 111 // TODO: Add config option to allow users to turn off error reporting
112 // TODO: Post error report (disabled for now) 112 // TODO: Post error report (disabled for now)
113 113
114 string msg = String.Empty; 114 string msg = String.Empty;
115 msg += "\r\n"; 115 msg += "\r\n";
116 msg += "APPLICATION EXCEPTION DETECTED: " + e.ToString() + "\r\n"; 116 msg += "APPLICATION EXCEPTION DETECTED: " + e.ToString() + "\r\n";
@@ -122,7 +122,7 @@ namespace OpenSim
122 msg += "InnerException: " + ex.InnerException.ToString() + "\r\n"; 122 msg += "InnerException: " + ex.InnerException.ToString() + "\r\n";
123 123
124 msg += "\r\n"; 124 msg += "\r\n";
125 msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n"; 125 msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n";
126 126
127 // Do we not always want to see exception messages? 127 // Do we not always want to see exception messages?
128// if (e.IsTerminating) 128// if (e.IsTerminating)
@@ -132,7 +132,7 @@ namespace OpenSim
132 try 132 try
133 { 133 {
134 // DISABLED UNTIL WE CAN DISCUSS IF THIS IS MORALLY RIGHT OR NOT 134 // DISABLED UNTIL WE CAN DISCUSS IF THIS IS MORALLY RIGHT OR NOT
135 // Note! Needs reference to System.Web 135 // Note! Needs reference to System.Web
136 //System.Net.WebClient wc = new WebClient(); 136 //System.Net.WebClient wc = new WebClient();
137 //wc.DownloadData("http://www.opensimulator.org/ErrorReport.php?Msg=" + 137 //wc.DownloadData("http://www.opensimulator.org/ErrorReport.php?Msg=" +
138 // System.Web.HttpUtility.UrlEncode(msg)); 138 // System.Web.HttpUtility.UrlEncode(msg));
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index a8f4bd4..7f13281 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -50,14 +50,14 @@ using OpenSim.Region.Physics.Manager;
50namespace OpenSim 50namespace OpenSim
51{ 51{
52 public class OpenSimMain : RegionApplicationBase 52 public class OpenSimMain : RegionApplicationBase
53 { 53 {
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 55
56 /// <summary> 56 /// <summary>
57 /// Holds a human readable build version for this server. 57 /// Holds a human readable build version for this server.
58 /// </summary> 58 /// </summary>
59 protected string buildVersion; 59 protected string buildVersion;
60 60
61 protected string proxyUrl; 61 protected string proxyUrl;
62 protected int proxyOffset = 0; 62 protected int proxyOffset = 0;
63 63
@@ -90,42 +90,42 @@ namespace OpenSim
90 private string m_standaloneUserSource; 90 private string m_standaloneUserSource;
91 91
92 protected string m_assetStorage = "local"; 92 protected string m_assetStorage = "local";
93 93
94 public ConsoleCommand CreateAccount = null; 94 public ConsoleCommand CreateAccount = null;
95 protected bool m_dumpAssetsToFile; 95 protected bool m_dumpAssetsToFile;
96 96
97 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); 97 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
98 98
99 protected IConfigSource m_finalConfig = null; 99 protected IConfigSource m_finalConfig = null;
100 100
101 protected IniConfigSource m_config; 101 protected IniConfigSource m_config;
102 102
103 public IniConfigSource ConfigSource 103 public IniConfigSource ConfigSource
104 { 104 {
105 get { return m_config; } 105 get { return m_config; }
106 set { m_config = value; } 106 set { m_config = value; }
107 } 107 }
108 108
109 public List<IClientNetworkServer> ClientServers 109 public List<IClientNetworkServer> ClientServers
110 { 110 {
111 get { return m_clientServers; } 111 get { return m_clientServers; }
112 } 112 }
113 113
114 public List<RegionInfo> RegionData 114 public List<RegionInfo> RegionData
115 { 115 {
116 get { return m_regionData; } 116 get { return m_regionData; }
117 } 117 }
118 118
119 public new BaseHttpServer HttpServer 119 public new BaseHttpServer HttpServer
120 { 120 {
121 get { return m_httpServer; } 121 get { return m_httpServer; }
122 } 122 }
123 123
124 public new uint HttpServerPort 124 public new uint HttpServerPort
125 { 125 {
126 get { return m_httpServerPort; } 126 get { return m_httpServerPort; }
127 } 127 }
128 128
129 protected ModuleLoader m_moduleLoader; 129 protected ModuleLoader m_moduleLoader;
130 130
131 public ModuleLoader ModuleLoader 131 public ModuleLoader ModuleLoader
@@ -146,10 +146,10 @@ namespace OpenSim
146 146
147 if (Directory.Exists("addin-db-001")) 147 if (Directory.Exists("addin-db-001"))
148 Directory.Delete("addin-db-001", true); 148 Directory.Delete("addin-db-001", true);
149 149
150 150
151 m_log.Info("[OPENSIM MAIN]: PLEASE IGNORE THE SCANNING ERRORS BELOW. These are the result of a temporary problem with our plugins manager."); 151 m_log.Info("[OPENSIM MAIN]: PLEASE IGNORE THE SCANNING ERRORS BELOW. These are the result of a temporary problem with our plugins manager.");
152 152
153 AddinManager.Initialize("."); 153 AddinManager.Initialize(".");
154 AddinManager.Registry.Update(null); 154 AddinManager.Registry.Update(null);
155 155
@@ -270,13 +270,13 @@ namespace OpenSim
270 m_sandbox = !startupConfig.GetBoolean("gridmode", false); 270 m_sandbox = !startupConfig.GetBoolean("gridmode", false);
271 m_physicsEngine = startupConfig.GetString("physics", "basicphysics"); 271 m_physicsEngine = startupConfig.GetString("physics", "basicphysics");
272 m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher"); 272 m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher");
273 273
274 m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); 274 m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
275 275
276 m_see_into_region_from_neighbor = startupConfig.GetBoolean("see_into_this_sim_from_neighbor", true); 276 m_see_into_region_from_neighbor = startupConfig.GetBoolean("see_into_this_sim_from_neighbor", true);
277 277
278 m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.Data.SQLite.dll"); 278 m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.Data.SQLite.dll");
279 if (m_storageDll == "OpenSim.DataStore.MonoSqlite.dll") 279 if (m_storageDll == "OpenSim.DataStore.MonoSqlite.dll")
280 { 280 {
281 m_storageDll = "OpenSim.Data.SQLite.dll"; 281 m_storageDll = "OpenSim.Data.SQLite.dll";
282 Console.WriteLine("WARNING: OpenSim.DataStore.MonoSqlite.dll is deprecated. Set storage_plugin to OpenSim.Data.SQLite.dll."); 282 Console.WriteLine("WARNING: OpenSim.DataStore.MonoSqlite.dll is deprecated. Set storage_plugin to OpenSim.Data.SQLite.dll.");
@@ -311,10 +311,10 @@ namespace OpenSim
311 311
312 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); 312 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
313 } 313 }
314 314
315 315
316 m_networkServersInfo.loadFromConfiguration(m_config); 316 m_networkServersInfo.loadFromConfiguration(m_config);
317 317
318 } 318 }
319 319
320 private ManualResetEvent WorldHasComeToAnEnd = new ManualResetEvent(false); 320 private ManualResetEvent WorldHasComeToAnEnd = new ManualResetEvent(false);
@@ -331,19 +331,19 @@ namespace OpenSim
331 m_log.Info("========================= STARTING OPENSIM ========================="); 331 m_log.Info("========================= STARTING OPENSIM =========================");
332 m_log.Info("===================================================================="); 332 m_log.Info("====================================================================");
333 m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", m_sandbox ? "sandbox" : "grid"); 333 m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", m_sandbox ? "sandbox" : "grid");
334 334
335 InternalStartUp(); 335 InternalStartUp();
336 336
337 // We are done with startup 337 // We are done with startup
338 m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", 338 m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}",
339 m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); 339 m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : "");
340 340
341 WorldHasComeToAnEnd.WaitOne(); 341 WorldHasComeToAnEnd.WaitOne();
342 m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye."); 342 m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye.");
343 343
344 Environment.Exit(0); 344 Environment.Exit(0);
345 } 345 }
346 346
347 /// <summary> 347 /// <summary>
348 /// Print the version information available to the library. This include a subversion number if the root 348 /// Print the version information available to the library. This include a subversion number if the root
349 /// .svn/entries file is present. 349 /// .svn/entries file is present.
@@ -392,9 +392,9 @@ namespace OpenSim
392 protected void InternalStartUp() 392 protected void InternalStartUp()
393 { 393 {
394 printAvailableVersionInformation(); 394 printAvailableVersionInformation();
395 395
396 m_stats = StatsManager.StartCollectingSimExtraStats(); 396 m_stats = StatsManager.StartCollectingSimExtraStats();
397 397
398 // Do baseclass startup sequence: OpenSim.Region.ClientStack.RegionApplicationBase.StartUp 398 // Do baseclass startup sequence: OpenSim.Region.ClientStack.RegionApplicationBase.StartUp
399 // TerrainManager, StorageManager, HTTP Server 399 // TerrainManager, StorageManager, HTTP Server
400 // This base will call abstract Initialize 400 // This base will call abstract Initialize
@@ -425,7 +425,7 @@ namespace OpenSim
425 425
426 // set up XMLRPC handler for client's initial login request message 426 // set up XMLRPC handler for client's initial login request message
427 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); 427 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
428 428
429 // provides the web form login 429 // provides the web form login
430 m_httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); 430 m_httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin);
431 431
@@ -524,12 +524,12 @@ namespace OpenSim
524 regionInfo.originRegionID = regionInfo.RegionID; 524 regionInfo.originRegionID = regionInfo.RegionID;
525 525
526 // set initial ServerURI 526 // set initial ServerURI
527 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName 527 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName
528 + ":" + regionInfo.InternalEndPoint.Port.ToString(); 528 + ":" + regionInfo.InternalEndPoint.Port.ToString();
529
530 regionInfo.HttpPort = m_httpServerPort;
531 529
532 if ((proxyUrl.Length > 0) && (portadd_flag)) 530 regionInfo.HttpPort = m_httpServerPort;
531
532 if ((proxyUrl.Length > 0) && (portadd_flag))
533 { 533 {
534 // set proxy url to RegionInfo 534 // set proxy url to RegionInfo
535 regionInfo.proxyUrl = proxyUrl; 535 regionInfo.proxyUrl = proxyUrl;
@@ -574,9 +574,9 @@ namespace OpenSim
574 scene.SetModuleInterfaces(); 574 scene.SetModuleInterfaces();
575 575
576 //moved these here as the terrain texture has to be created after the modules are initialized 576 //moved these here as the terrain texture has to be created after the modules are initialized
577 // and has to happen before the region is registered with the grid. 577 // and has to happen before the region is registered with the grid.
578 scene.CreateTerrainTexture(true); 578 scene.CreateTerrainTexture(true);
579 579
580 try 580 try
581 { 581 {
582 scene.RegisterRegionWithGrid(); 582 scene.RegisterRegionWithGrid();
@@ -584,18 +584,18 @@ namespace OpenSim
584 catch (Exception e) 584 catch (Exception e)
585 { 585 {
586 m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e); 586 m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e);
587 587
588 // Carrying on now causes a lot of confusion down the line - we need to get the user's attention 588 // Carrying on now causes a lot of confusion down the line - we need to get the user's attention
589 System.Environment.Exit(1); 589 System.Environment.Exit(1);
590 } 590 }
591 591
592 // We need to do this after we've initialized the scripting engines. 592 // We need to do this after we've initialized the scripting engines.
593 scene.StartScripts(); 593 scene.StartScripts();
594 594
595 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 595 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
596 scene.LandChannel.PerformParcelPrimCountUpdate(); 596 scene.LandChannel.PerformParcelPrimCountUpdate();
597 597
598 m_sceneManager.Add(scene); 598 m_sceneManager.Add(scene);
599 599
600 m_clientServers.Add(clientServer); 600 m_clientServers.Add(clientServer);
601 m_regionData.Add(regionInfo); 601 m_regionData.Add(regionInfo);
@@ -625,7 +625,7 @@ namespace OpenSim
625 new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache, 625 new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache,
626 storageManager, m_httpServer, 626 storageManager, m_httpServer,
627 m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_see_into_region_from_neighbor, m_config); 627 m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_see_into_region_from_neighbor, m_config);
628 628
629 } 629 }
630 630
631 public void handleRestartRegion(RegionInfo whichRegion) 631 public void handleRestartRegion(RegionInfo whichRegion)
@@ -650,7 +650,7 @@ namespace OpenSim
650 m_clientServers.RemoveAt(clientServerElement); 650 m_clientServers.RemoveAt(clientServerElement);
651 } 651 }
652 652
653 //Removing the region from the sim's database of regions.. 653 //Removing the region from the sim's database of regions..
654 int RegionHandleElement = -1; 654 int RegionHandleElement = -1;
655 for (int i = 0; i < m_regionData.Count; i++) 655 for (int i = 0; i < m_regionData.Count; i++)
656 { 656 {
@@ -676,7 +676,7 @@ namespace OpenSim
676 676
677 /// <summary> 677 /// <summary>
678 /// Handler to supply the current status of this sim 678 /// Handler to supply the current status of this sim
679 /// 679 ///
680 /// Currently this is always OK if the simulator is still listening for connections on its HTTP service 680 /// Currently this is always OK if the simulator is still listening for connections on its HTTP service
681 /// </summary> 681 /// </summary>
682 protected class SimStatusHandler : IStreamedRequestHandler 682 protected class SimStatusHandler : IStreamedRequestHandler
@@ -709,9 +709,9 @@ namespace OpenSim
709 /// </summary> 709 /// </summary>
710 public override void Shutdown() 710 public override void Shutdown()
711 { 711 {
712 if (proxyUrl.Length > 0) 712 if (proxyUrl.Length > 0)
713 { 713 {
714 Util.XmlRpcCommand(proxyUrl, "Stop"); 714 Util.XmlRpcCommand(proxyUrl, "Stop");
715 } 715 }
716 716
717 m_log.Info("[SHUTDOWN]: Closing all threads"); 717 m_log.Info("[SHUTDOWN]: Closing all threads");
@@ -721,9 +721,9 @@ namespace OpenSim
721 m_log.Info("[SHUTDOWN]: Closing console and terminating"); 721 m_log.Info("[SHUTDOWN]: Closing console and terminating");
722 722
723 m_sceneManager.Close(); 723 m_sceneManager.Close();
724 724
725 WorldHasComeToAnEnd.Set(); 725 WorldHasComeToAnEnd.Set();
726 726
727 base.Shutdown(); 727 base.Shutdown();
728 } 728 }
729 729
diff --git a/OpenSim/Region/Application/OpenSimMainConsole.cs b/OpenSim/Region/Application/OpenSimMainConsole.cs
index 2381f57..1b2600c 100644
--- a/OpenSim/Region/Application/OpenSimMainConsole.cs
+++ b/OpenSim/Region/Application/OpenSimMainConsole.cs
@@ -47,7 +47,7 @@ namespace OpenSim
47 public delegate void ConsoleCommand(string[] comParams); 47 public delegate void ConsoleCommand(string[] comParams);
48 48
49 public class OpenSimMainConsole : OpenSimMain, conscmd_callback 49 public class OpenSimMainConsole : OpenSimMain, conscmd_callback
50 { 50 {
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 protected string m_startupCommandsFile; 53 protected string m_startupCommandsFile;
@@ -83,12 +83,12 @@ namespace OpenSim
83 // 83 //
84 // Called from app startup (OpenSim.Application) 84 // Called from app startup (OpenSim.Application)
85 // 85 //
86 86
87 m_log.Info("===================================================================="); 87 m_log.Info("====================================================================");
88 m_log.Info("========================= STARTING OPENSIM ========================="); 88 m_log.Info("========================= STARTING OPENSIM =========================");
89 m_log.Info("===================================================================="); 89 m_log.Info("====================================================================");
90 m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid")); 90 m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid"));
91 91
92 m_console = CreateConsole(); 92 m_console = CreateConsole();
93 MainConsole.Instance = m_console; 93 MainConsole.Instance = m_console;
94 InternalStartUp(); 94 InternalStartUp();
@@ -111,7 +111,7 @@ namespace OpenSim
111 m_scriptTimer.Interval = 1200 * 1000; 111 m_scriptTimer.Interval = 1200 * 1000;
112 m_scriptTimer.Elapsed += RunAutoTimerScript; 112 m_scriptTimer.Elapsed += RunAutoTimerScript;
113 } 113 }
114 114
115 PrintFileToConsole("startuplogo.txt"); 115 PrintFileToConsole("startuplogo.txt");
116 } 116 }
117 117
@@ -131,7 +131,7 @@ namespace OpenSim
131 #region Console Commands 131 #region Console Commands
132 132
133 /// <summary> 133 /// <summary>
134 /// 134 ///
135 /// </summary> 135 /// </summary>
136 /// <param name="fileName"></param> 136 /// <param name="fileName"></param>
137 private void RunCommandScript(string fileName) 137 private void RunCommandScript(string fileName)
@@ -178,7 +178,7 @@ namespace OpenSim
178 public override void RunCmd(string command, string[] cmdparams) 178 public override void RunCmd(string command, string[] cmdparams)
179 { 179 {
180 base.RunCmd(command, cmdparams); 180 base.RunCmd(command, cmdparams);
181 181
182 switch (command) 182 switch (command)
183 { 183 {
184 case "clear-assets": 184 case "clear-assets":
@@ -252,7 +252,7 @@ namespace OpenSim
252 m_console.Notice("set-time [x] - set the current scene time phase"); 252 m_console.Notice("set-time [x] - set the current scene time phase");
253 m_console.Notice("show assets - show state of asset cache."); 253 m_console.Notice("show assets - show state of asset cache.");
254 m_console.Notice("show users - show info about connected users."); 254 m_console.Notice("show users - show info about connected users.");
255 m_console.Notice("show modules - shows info about loaded modules."); 255 m_console.Notice("show modules - shows info about loaded modules.");
256 m_console.Notice("show version - show the running build version."); 256 m_console.Notice("show version - show the running build version.");
257 m_console.Notice("threads - list threads"); 257 m_console.Notice("threads - list threads");
258 m_console.Notice("config set section field value - set a config value"); 258 m_console.Notice("config set section field value - set a config value");
@@ -264,7 +264,7 @@ namespace OpenSim
264 case "threads": 264 case "threads":
265// m_console.Notice("THREAD", Process.GetCurrentProcess().Threads.Count + " threads running:"); 265// m_console.Notice("THREAD", Process.GetCurrentProcess().Threads.Count + " threads running:");
266// int _tc = 0; 266// int _tc = 0;
267 267
268// foreach (ProcessThread pt in Process.GetCurrentProcess().Threads) 268// foreach (ProcessThread pt in Process.GetCurrentProcess().Threads)
269// { 269// {
270// _tc++; 270// _tc++;
@@ -388,7 +388,7 @@ namespace OpenSim
388 if (m_sceneManager.TryGetScene(regName, out killScene)) 388 if (m_sceneManager.TryGetScene(regName, out killScene))
389 { 389 {
390 // only need to check this if we are not at the 390 // only need to check this if we are not at the
391 // root level 391 // root level
392 if ((m_sceneManager.CurrentScene != null) && 392 if ((m_sceneManager.CurrentScene != null) &&
393 (m_sceneManager.CurrentScene.RegionInfo.RegionID == killScene.RegionInfo.RegionID)) 393 (m_sceneManager.CurrentScene.RegionInfo.RegionID == killScene.RegionInfo.RegionID))
394 { 394 {
@@ -520,7 +520,7 @@ namespace OpenSim
520 { 520 {
521 foreach (Scene s in new ArrayList(m_sceneManager.Scenes)) 521 foreach (Scene s in new ArrayList(m_sceneManager.Scenes))
522 { 522 {
523 523
524 m_console.Notice("Loading module: " + cmdparams[1]); 524 m_console.Notice("Loading module: " + cmdparams[1]);
525 m_moduleLoader.LoadRegionModules(cmdparams[1], s); 525 m_moduleLoader.LoadRegionModules(cmdparams[1], s);
526 } 526 }
@@ -529,7 +529,7 @@ namespace OpenSim
529 } 529 }
530 } 530 }
531 531
532 break; 532 break;
533 default: 533 default:
534 string[] tmpPluginArgs = new string[cmdparams.Length + 1]; 534 string[] tmpPluginArgs = new string[cmdparams.Length + 1];
535 cmdparams.CopyTo(tmpPluginArgs, 1); 535 cmdparams.CopyTo(tmpPluginArgs, 1);
@@ -570,7 +570,7 @@ namespace OpenSim
570 public override void Show(string ShowWhat) 570 public override void Show(string ShowWhat)
571 { 571 {
572 base.Show(ShowWhat); 572 base.Show(ShowWhat);
573 573
574 switch (ShowWhat) 574 switch (ShowWhat)
575 { 575 {
576 case "assets": 576 case "assets":
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 1eab16b..d6329ce 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -57,14 +57,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
57 57
58 // ~ClientView() 58 // ~ClientView()
59 // { 59 // {
60 // m_log.Info("[CLIENTVIEW]: Destructor called"); 60 // m_log.Info("[CLIENTVIEW]: Destructor called");
61 // } 61 // }
62 62
63 /* static variables */ 63 /* static variables */
64 public static TerrainManager TerrainManager; 64 public static TerrainManager TerrainManager;
65 65
66 public delegate bool SynchronizeClientHandler(IScene scene, Packet packet, LLUUID agentID, ThrottleOutPacketType throttlePacketType); 66 public delegate bool SynchronizeClientHandler(IScene scene, Packet packet, LLUUID agentID, ThrottleOutPacketType throttlePacketType);
67 public static SynchronizeClientHandler SynchronizeClient = null; 67 public static SynchronizeClientHandler SynchronizeClient = null;
68 /* private variables */ 68 /* private variables */
69 private readonly LLUUID m_sessionId; 69 private readonly LLUUID m_sessionId;
70 private LLUUID m_secureSessionId = LLUUID.Zero; 70 private LLUUID m_secureSessionId = LLUUID.Zero;
@@ -201,7 +201,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
201 private RemoveInventoryFolder handlerRemoveInventoryFolder = null; 201 private RemoveInventoryFolder handlerRemoveInventoryFolder = null;
202 private RequestTaskInventory handlerRequestTaskInventory = null; //OnRequestTaskInventory; 202 private RequestTaskInventory handlerRequestTaskInventory = null; //OnRequestTaskInventory;
203 private UpdateTaskInventory handlerUpdateTaskInventory = null; //OnUpdateTaskInventory; 203 private UpdateTaskInventory handlerUpdateTaskInventory = null; //OnUpdateTaskInventory;
204 private MoveTaskInventory handlerMoveTaskItem = null; 204 private MoveTaskInventory handlerMoveTaskItem = null;
205 private RemoveTaskInventory handlerRemoveTaskItem = null; //OnRemoveTaskItem; 205 private RemoveTaskInventory handlerRemoveTaskItem = null; //OnRemoveTaskItem;
206 private RezScript handlerRezScript = null; //OnRezScript; 206 private RezScript handlerRezScript = null; //OnRezScript;
207 private RequestMapBlocks handlerRequestMapBlocks = null; //OnRequestMapBlocks; 207 private RequestMapBlocks handlerRequestMapBlocks = null; //OnRequestMapBlocks;
@@ -324,7 +324,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
324 /* METHODS */ 324 /* METHODS */
325 325
326 public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, 326 public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer,
327 AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP) 327 AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP)
328 { 328 {
329 m_moneyBalance = 1000; 329 m_moneyBalance = 1000;
330 330
@@ -348,12 +348,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
348 348
349 m_userEndPoint = remoteEP; 349 m_userEndPoint = remoteEP;
350 m_proxyEndPoint = proxyEP; 350 m_proxyEndPoint = proxyEP;
351 351
352 m_startpos = m_authenticateSessionsHandler.GetPosition(circuitCode); 352 m_startpos = m_authenticateSessionsHandler.GetPosition(circuitCode);
353 353
354 // While working on this, the BlockingQueue had me fooled for a bit. 354 // While working on this, the BlockingQueue had me fooled for a bit.
355 // The Blocking queue causes the thread to stop until there's something 355 // The Blocking queue causes the thread to stop until there's something
356 // in it to process. It's an on-purpose threadlock though because 356 // in it to process. It's an on-purpose threadlock though because
357 // without it, the clientloop will suck up all sim resources. 357 // without it, the clientloop will suck up all sim resources.
358 358
359 m_packetQueue = new LLPacketQueue(agentId); 359 m_packetQueue = new LLPacketQueue(agentId);
@@ -379,9 +379,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
379 m_scene.RemoveClient(AgentId); 379 m_scene.RemoveClient(AgentId);
380 380
381 //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 381 //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false));
382 //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); 382 //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true));
383 383
384 // Send the STOP packet 384 // Send the STOP packet
385 DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator); 385 DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
386 OutPacket(disable, ThrottleOutPacketType.Unknown); 386 OutPacket(disable, ThrottleOutPacketType.Unknown);
387 387
@@ -398,12 +398,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
398 // flushing out all it's packets. There should probably 398 // flushing out all it's packets. There should probably
399 // be a better mechanism here 399 // be a better mechanism here
400 400
401 // We can't reach into other scenes and close the connection 401 // We can't reach into other scenes and close the connection
402 // We need to do this over grid communications 402 // We need to do this over grid communications
403 //m_scene.CloseAllAgents(CircuitCode); 403 //m_scene.CloseAllAgents(CircuitCode);
404 404
405 // If we're not shutting down the circuit, then this is the last time we'll go here. 405 // If we're not shutting down the circuit, then this is the last time we'll go here.
406 // If we are shutting down the circuit, the UDP Server will come back here with 406 // If we are shutting down the circuit, the UDP Server will come back here with
407 // ShutDownCircuit = false 407 // ShutDownCircuit = false
408 if (!(shutdownCircuit)) 408 if (!(shutdownCircuit))
409 { 409 {
@@ -641,7 +641,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
641 { 641 {
642 //this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache); 642 //this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache);
643 643
644 // Establish our two timers. We could probably get this down to one 644 // Establish our two timers. We could probably get this down to one
645 m_ackTimer = new Timer(750); 645 m_ackTimer = new Timer(750);
646 m_ackTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); 646 m_ackTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed);
647 m_ackTimer.Start(); 647 m_ackTimer.Start();
@@ -791,7 +791,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
791 public event ParcelJoinRequest OnParcelJoinRequest; 791 public event ParcelJoinRequest OnParcelJoinRequest;
792 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; 792 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
793 public event ParcelSelectObjects OnParcelSelectObjects; 793 public event ParcelSelectObjects OnParcelSelectObjects;
794 public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; 794 public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
795 public event ParcelAbandonRequest OnParcelAbandonRequest; 795 public event ParcelAbandonRequest OnParcelAbandonRequest;
796 public event RegionInfoRequest OnRegionInfoRequest; 796 public event RegionInfoRequest OnRegionInfoRequest;
797 public event EstateCovenantRequest OnEstateCovenantRequest; 797 public event EstateCovenantRequest OnEstateCovenantRequest;
@@ -834,7 +834,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
834 #region Scene/Avatar to Client 834 #region Scene/Avatar to Client
835 835
836 /// <summary> 836 /// <summary>
837 /// 837 ///
838 /// </summary> 838 /// </summary>
839 /// <param name="regionInfo"></param> 839 /// <param name="regionInfo"></param>
840 public void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) 840 public void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args)
@@ -871,7 +871,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
871 } 871 }
872 872
873 /// <summary> 873 /// <summary>
874 /// 874 ///
875 /// </summary> 875 /// </summary>
876 /// <param name="regInfo"></param> 876 /// <param name="regInfo"></param>
877 public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) 877 public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look)
@@ -898,7 +898,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
898 } 898 }
899 899
900 /// <summary> 900 /// <summary>
901 /// 901 ///
902 /// </summary> 902 /// </summary>
903 /// <param name="message"></param> 903 /// <param name="message"></param>
904 /// <param name="type"></param> 904 /// <param name="type"></param>
@@ -934,17 +934,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
934 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) 934 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp)
935 { 935 {
936 SendInstantMessage( 936 SendInstantMessage(
937 fromAgent, fromAgentSession, message, toAgent, 937 fromAgent, fromAgentSession, message, toAgent,
938 imSessionID, fromName, dialog, timeStamp, new byte[0]); 938 imSessionID, fromName, dialog, timeStamp, new byte[0]);
939 } 939 }
940 940
941 /// <summary> 941 /// <summary>
942 /// Send an instant message to this client 942 /// Send an instant message to this client
943 /// </summary> 943 /// </summary>
944 /// <param name="message"></param> 944 /// <param name="message"></param>
945 /// <param name="target"></param> 945 /// <param name="target"></param>
946 public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, 946 public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent,
947 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp, 947 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp,
948 byte[] binaryBucket) 948 byte[] binaryBucket)
949 { 949 {
950 if (((Scene)(this.m_scene)).ExternalChecks.ExternalChecksCanInstantMessage(fromAgent, toAgent)) 950 if (((Scene)(this.m_scene)).ExternalChecks.ExternalChecksCanInstantMessage(fromAgent, toAgent))
@@ -1031,7 +1031,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1031 } 1031 }
1032 1032
1033 /// <summary> 1033 /// <summary>
1034 /// 1034 ///
1035 /// </summary> 1035 /// </summary>
1036 /// <param name="neighbourHandle"></param> 1036 /// <param name="neighbourHandle"></param>
1037 /// <param name="neighbourIP"></param> 1037 /// <param name="neighbourIP"></param>
@@ -1056,7 +1056,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1056 } 1056 }
1057 1057
1058 /// <summary> 1058 /// <summary>
1059 /// 1059 ///
1060 /// </summary> 1060 /// </summary>
1061 /// <returns></returns> 1061 /// <returns></returns>
1062 public AgentCircuitData RequestClientInfo() 1062 public AgentCircuitData RequestClientInfo()
@@ -1166,7 +1166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1166 } 1166 }
1167 1167
1168 /// <summary> 1168 /// <summary>
1169 /// 1169 ///
1170 /// </summary> 1170 /// </summary>
1171 public void SendTeleportFailed(string reason) 1171 public void SendTeleportFailed(string reason)
1172 { 1172 {
@@ -1179,7 +1179,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1179 } 1179 }
1180 1180
1181 /// <summary> 1181 /// <summary>
1182 /// 1182 ///
1183 /// </summary> 1183 /// </summary>
1184 public void SendTeleportLocationStart() 1184 public void SendTeleportLocationStart()
1185 { 1185 {
@@ -1250,7 +1250,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1250 1250
1251 /// <summary> 1251 /// <summary>
1252 /// Send information about the items contained in a folder to the client. 1252 /// Send information about the items contained in a folder to the client.
1253 /// 1253 ///
1254 /// XXX This method needs some refactoring loving 1254 /// XXX This method needs some refactoring loving
1255 /// </summary> 1255 /// </summary>
1256 /// <param name="ownerID">The owner of the folder</param> 1256 /// <param name="ownerID">The owner of the folder</param>
@@ -1261,8 +1261,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1261 public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, 1261 public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items,
1262 List<InventoryFolderBase> folders, 1262 List<InventoryFolderBase> folders,
1263 bool fetchFolders, bool fetchItems) 1263 bool fetchFolders, bool fetchItems)
1264 { 1264 {
1265 // An inventory descendents packet consists of a single agent section and an inventory details 1265 // An inventory descendents packet consists of a single agent section and an inventory details
1266 // section for each inventory item. The size of each inventory item is approximately 550 bytes. 1266 // section for each inventory item. The size of each inventory item is approximately 550 bytes.
1267 // In theory, UDP has a maximum packet size of 64k, so it should be possible to send descendent 1267 // In theory, UDP has a maximum packet size of 64k, so it should be possible to send descendent
1268 // packets containing metadata for in excess of 100 items. But in practice, there may be other 1268 // packets containing metadata for in excess of 100 items. But in practice, there may be other
@@ -1367,7 +1367,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1367 1367
1368 if (i < MAX_ITEMS_PER_PACKET) 1368 if (i < MAX_ITEMS_PER_PACKET)
1369 { 1369 {
1370 1370
1371 OutPacket(descend, ThrottleOutPacketType.Asset); 1371 OutPacket(descend, ThrottleOutPacketType.Asset);
1372 } 1372 }
1373 } 1373 }
@@ -1376,7 +1376,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1376 if (fetchFolders) 1376 if (fetchFolders)
1377 { 1377 {
1378 InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID); 1378 InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID);
1379 1379
1380 if (folders.Count < MAX_ITEMS_PER_PACKET) 1380 if (folders.Count < MAX_ITEMS_PER_PACKET)
1381 { 1381 {
1382 descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders.Count]; 1382 descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders.Count];
@@ -1493,27 +1493,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1493 inventoryReply.Header.Zerocoded = true; 1493 inventoryReply.Header.Zerocoded = true;
1494 OutPacket(inventoryReply, ThrottleOutPacketType.Asset); 1494 OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
1495 } 1495 }
1496 1496
1497 /// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see> 1497 /// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see>
1498 public void SendBulkUpdateInventory(InventoryItemBase item) 1498 public void SendBulkUpdateInventory(InventoryItemBase item)
1499 { 1499 {
1500 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; 1500 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All;
1501 1501
1502 BulkUpdateInventoryPacket bulkUpdate 1502 BulkUpdateInventoryPacket bulkUpdate
1503 = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory); 1503 = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory);
1504 1504
1505 bulkUpdate.AgentData.AgentID = AgentId; 1505 bulkUpdate.AgentData.AgentID = AgentId;
1506 bulkUpdate.AgentData.TransactionID = LLUUID.Random(); 1506 bulkUpdate.AgentData.TransactionID = LLUUID.Random();
1507 1507
1508 bulkUpdate.FolderData = new BulkUpdateInventoryPacket.FolderDataBlock[1]; 1508 bulkUpdate.FolderData = new BulkUpdateInventoryPacket.FolderDataBlock[1];
1509 bulkUpdate.FolderData[0] = new BulkUpdateInventoryPacket.FolderDataBlock(); 1509 bulkUpdate.FolderData[0] = new BulkUpdateInventoryPacket.FolderDataBlock();
1510 bulkUpdate.FolderData[0].FolderID = LLUUID.Zero; 1510 bulkUpdate.FolderData[0].FolderID = LLUUID.Zero;
1511 bulkUpdate.FolderData[0].ParentID = LLUUID.Zero; 1511 bulkUpdate.FolderData[0].ParentID = LLUUID.Zero;
1512 bulkUpdate.FolderData[0].Type = -1; 1512 bulkUpdate.FolderData[0].Type = -1;
1513 bulkUpdate.FolderData[0].Name = new byte[0]; 1513 bulkUpdate.FolderData[0].Name = new byte[0];
1514 1514
1515 bulkUpdate.ItemData = new BulkUpdateInventoryPacket.ItemDataBlock[1]; 1515 bulkUpdate.ItemData = new BulkUpdateInventoryPacket.ItemDataBlock[1];
1516 bulkUpdate.ItemData[0] = new BulkUpdateInventoryPacket.ItemDataBlock(); 1516 bulkUpdate.ItemData[0] = new BulkUpdateInventoryPacket.ItemDataBlock();
1517 bulkUpdate.ItemData[0].ItemID = item.ID; 1517 bulkUpdate.ItemData[0].ItemID = item.ID;
1518 bulkUpdate.ItemData[0].AssetID = item.AssetID; 1518 bulkUpdate.ItemData[0].AssetID = item.AssetID;
1519 bulkUpdate.ItemData[0].CreatorID = item.Creator; 1519 bulkUpdate.ItemData[0].CreatorID = item.Creator;
@@ -1553,11 +1553,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1553 public void SendInventoryItemCreateUpdate(InventoryItemBase Item) 1553 public void SendInventoryItemCreateUpdate(InventoryItemBase Item)
1554 { 1554 {
1555 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; 1555 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All;
1556 1556
1557 UpdateCreateInventoryItemPacket InventoryReply 1557 UpdateCreateInventoryItemPacket InventoryReply
1558 = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket( 1558 = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket(
1559 PacketType.UpdateCreateInventoryItem); 1559 PacketType.UpdateCreateInventoryItem);
1560 1560
1561 // TODO: don't create new blocks if recycling an old packet 1561 // TODO: don't create new blocks if recycling an old packet
1562 InventoryReply.AgentData.AgentID = AgentId; 1562 InventoryReply.AgentData.AgentID = AgentId;
1563 InventoryReply.AgentData.SimApproved = true; 1563 InventoryReply.AgentData.SimApproved = true;
@@ -1719,7 +1719,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1719 /// </summary> 1719 /// </summary>
1720 /// <param name="message"></param> 1720 /// <param name="message"></param>
1721 /// <param name="modal">On the linden client, if this true then it displays a one button text box placed in the 1721 /// <param name="modal">On the linden client, if this true then it displays a one button text box placed in the
1722 /// middle of the window. If false, the message is displayed in a brief duration blue information box (as for 1722 /// middle of the window. If false, the message is displayed in a brief duration blue information box (as for
1723 /// the AlertMessage packet).</param> 1723 /// the AlertMessage packet).</param>
1724 public void SendAgentAlertMessage(string message, bool modal) 1724 public void SendAgentAlertMessage(string message, bool modal)
1725 { 1725 {
@@ -1784,7 +1784,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1784 sound.DataBlock.OwnerID = ownerID; 1784 sound.DataBlock.OwnerID = ownerID;
1785 sound.DataBlock.Gain = gain; 1785 sound.DataBlock.Gain = gain;
1786 sound.DataBlock.Flags = flags; 1786 sound.DataBlock.Flags = flags;
1787 1787
1788 OutPacket(sound, ThrottleOutPacketType.Task); 1788 OutPacket(sound, ThrottleOutPacketType.Task);
1789 } 1789 }
1790 1790
@@ -1907,7 +1907,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1907 #region Appearance/ Wearables Methods 1907 #region Appearance/ Wearables Methods
1908 1908
1909 /// <summary> 1909 /// <summary>
1910 /// 1910 ///
1911 /// </summary> 1911 /// </summary>
1912 /// <param name="wearables"></param> 1912 /// <param name="wearables"></param>
1913 public void SendWearables(AvatarWearable[] wearables, int serial) 1913 public void SendWearables(AvatarWearable[] wearables, int serial)
@@ -1933,7 +1933,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1933 } 1933 }
1934 1934
1935 /// <summary> 1935 /// <summary>
1936 /// 1936 ///
1937 /// </summary> 1937 /// </summary>
1938 /// <param name="agentID"></param> 1938 /// <param name="agentID"></param>
1939 /// <param name="visualParams"></param> 1939 /// <param name="visualParams"></param>
@@ -2016,7 +2016,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2016 } 2016 }
2017 2017
2018 /// <summary> 2018 /// <summary>
2019 /// 2019 ///
2020 /// </summary> 2020 /// </summary>
2021 /// <param name="regionHandle"></param> 2021 /// <param name="regionHandle"></param>
2022 /// <param name="timeDilation"></param> 2022 /// <param name="timeDilation"></param>
@@ -2071,14 +2071,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2071 #region Primitive Packet/data Sending Methods 2071 #region Primitive Packet/data Sending Methods
2072 2072
2073 /// <summary> 2073 /// <summary>
2074 /// 2074 ///
2075 /// </summary> 2075 /// </summary>
2076 /// <param name="localID"></param> 2076 /// <param name="localID"></param>
2077 /// <param name="rotation"></param> 2077 /// <param name="rotation"></param>
2078 /// <param name="attachPoint"></param> 2078 /// <param name="attachPoint"></param>
2079 public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) 2079 public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint)
2080 { 2080 {
2081 2081
2082 ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach); 2082 ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach);
2083 Console.WriteLine("Attach object!"); 2083 Console.WriteLine("Attach object!");
2084 // TODO: don't create new blocks if recycling an old packet 2084 // TODO: don't create new blocks if recycling an old packet
@@ -2094,9 +2094,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2094 } 2094 }
2095 2095
2096 public void SendPrimitiveToClient( 2096 public void SendPrimitiveToClient(
2097 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, 2097 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
2098 LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, 2098 LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel,
2099 uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color, 2099 uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color,
2100 uint parentID, byte[] particleSystem, byte clickAction) 2100 uint parentID, byte[] particleSystem, byte clickAction)
2101 { 2101 {
2102 byte[] textureanim = new byte[0]; 2102 byte[] textureanim = new byte[0];
@@ -2108,7 +2108,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2108 } 2108 }
2109 2109
2110 public void SendPrimitiveToClient( 2110 public void SendPrimitiveToClient(
2111 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, 2111 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
2112 LLVector3 pos, LLVector3 velocity, LLVector3 acceleration, LLQuaternion rotation, LLVector3 rotational_velocity, 2112 LLVector3 pos, LLVector3 velocity, LLVector3 acceleration, LLQuaternion rotation, LLVector3 rotational_velocity,
2113 uint flags, 2113 uint flags,
2114 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, 2114 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
@@ -2125,15 +2125,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2125 outPacket.ObjectData[0].ID = localID; 2125 outPacket.ObjectData[0].ID = localID;
2126 outPacket.ObjectData[0].FullID = objectID; 2126 outPacket.ObjectData[0].FullID = objectID;
2127 outPacket.ObjectData[0].OwnerID = ownerID; 2127 outPacket.ObjectData[0].OwnerID = ownerID;
2128 2128
2129 // Anything more than 255 will cause libsecondlife to barf 2129 // Anything more than 255 will cause libsecondlife to barf
2130 if (text.Length > 255) 2130 if (text.Length > 255)
2131 { 2131 {
2132 text = text.Remove(255); 2132 text = text.Remove(255);
2133 } 2133 }
2134 2134
2135 outPacket.ObjectData[0].Text = Helpers.StringToField(text); 2135 outPacket.ObjectData[0].Text = Helpers.StringToField(text);
2136 2136
2137 outPacket.ObjectData[0].TextColor[0] = color[0]; 2137 outPacket.ObjectData[0].TextColor[0] = color[0];
2138 outPacket.ObjectData[0].TextColor[1] = color[1]; 2138 outPacket.ObjectData[0].TextColor[1] = color[1];
2139 outPacket.ObjectData[0].TextColor[2] = color[2]; 2139 outPacket.ObjectData[0].TextColor[2] = color[2];
@@ -2148,7 +2148,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2148 // Necessary??? 2148 // Necessary???
2149 outPacket.ObjectData[0].JointAxisOrAnchor = new LLVector3(0, 0, 2); 2149 outPacket.ObjectData[0].JointAxisOrAnchor = new LLVector3(0, 0, 2);
2150 outPacket.ObjectData[0].JointPivot = new LLVector3(0, 0, 0); 2150 outPacket.ObjectData[0].JointPivot = new LLVector3(0, 0, 0);
2151 2151
2152 // Item from inventory??? 2152 // Item from inventory???
2153 outPacket.ObjectData[0].NameValue = 2153 outPacket.ObjectData[0].NameValue =
2154 Helpers.StringToField("AttachItemID STRING RW SV " + AssetId.UUID); 2154 Helpers.StringToField("AttachItemID STRING RW SV " + AssetId.UUID);
@@ -2179,7 +2179,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2179 } 2179 }
2180 2180
2181 /// <summary> 2181 /// <summary>
2182 /// 2182 ///
2183 /// </summary> 2183 /// </summary>
2184 /// <param name="regionHandle"></param> 2184 /// <param name="regionHandle"></param>
2185 /// <param name="timeDilation"></param> 2185 /// <param name="timeDilation"></param>
@@ -2194,7 +2194,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2194 terse.RegionData.RegionHandle = regionHandle; 2194 terse.RegionData.RegionHandle = regionHandle;
2195 terse.RegionData.TimeDilation = timeDilation; 2195 terse.RegionData.TimeDilation = timeDilation;
2196 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 2196 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
2197 terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity, state); // AssetID should fall into here probably somehow... 2197 terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity, state); // AssetID should fall into here probably somehow...
2198 terse.Header.Reliable = false; 2198 terse.Header.Reliable = false;
2199 terse.Header.Zerocoded = true; 2199 terse.Header.Zerocoded = true;
2200 OutPacket(terse, ThrottleOutPacketType.Task); 2200 OutPacket(terse, ThrottleOutPacketType.Task);
@@ -2251,7 +2251,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2251 2251
2252 if (ImageSize > 0) 2252 if (ImageSize > 0)
2253 im.ImageID.Size = ImageSize; 2253 im.ImageID.Size = ImageSize;
2254 2254
2255 im.ImageData.Data = ImageData; 2255 im.ImageData.Data = ImageData;
2256 im.ImageID.Codec = imageCodec; 2256 im.ImageID.Codec = imageCodec;
2257 im.Header.Zerocoded = true; 2257 im.Header.Zerocoded = true;
@@ -2270,7 +2270,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2270 2270
2271 public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID, 2271 public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID,
2272 uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, 2272 uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask,
2273 uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category, 2273 uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category,
2274 LLUUID LastOwnerID, string ObjectName, string Description) 2274 LLUUID LastOwnerID, string ObjectName, string Description)
2275 { 2275 {
2276 ObjectPropertiesFamilyPacket objPropFamilyPack = (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily); 2276 ObjectPropertiesFamilyPacket objPropFamilyPack = (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily);
@@ -2301,9 +2301,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2301 } 2301 }
2302 2302
2303 public void SendObjectPropertiesReply(LLUUID ItemID, ulong CreationDate, LLUUID CreatorUUID, LLUUID FolderUUID, LLUUID FromTaskUUID, 2303 public void SendObjectPropertiesReply(LLUUID ItemID, ulong CreationDate, LLUUID CreatorUUID, LLUUID FolderUUID, LLUUID FromTaskUUID,
2304 LLUUID GroupUUID, short InventorySerial, LLUUID LastOwnerUUID, LLUUID ObjectUUID, 2304 LLUUID GroupUUID, short InventorySerial, LLUUID LastOwnerUUID, LLUUID ObjectUUID,
2305 LLUUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName, 2305 LLUUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName,
2306 string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, 2306 string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask,
2307 uint BaseMask) 2307 uint BaseMask)
2308 { 2308 {
2309 ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); 2309 ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
@@ -2409,7 +2409,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2409 rinfoblk.WaterHeight = args.waterHeight; 2409 rinfoblk.WaterHeight = args.waterHeight;
2410 rinfoblk.SimName = Helpers.StringToField(args.simName); 2410 rinfoblk.SimName = Helpers.StringToField(args.simName);
2411 2411
2412 2412
2413 rinfopack.RegionInfo = rinfoblk; 2413 rinfopack.RegionInfo = rinfoblk;
2414 2414
2415 this.OutPacket(rinfopack, ThrottleOutPacketType.Task); 2415 this.OutPacket(rinfopack, ThrottleOutPacketType.Task);
@@ -2638,7 +2638,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2638 notifyCount = 32; 2638 notifyCount = 32;
2639 } 2639 }
2640 2640
2641 2641
2642 2642
2643 ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock 2643 ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock
2644 = new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount]; 2644 = new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount];
@@ -2758,7 +2758,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2758 } 2758 }
2759 2759
2760 /// <summary> 2760 /// <summary>
2761 /// 2761 ///
2762 /// </summary> 2762 /// </summary>
2763 /// <param name="localID"></param> 2763 /// <param name="localID"></param>
2764 /// <param name="position"></param> 2764 /// <param name="position"></param>
@@ -2852,8 +2852,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2852 bytes[i++] = (byte)(rvelz % 256); 2852 bytes[i++] = (byte)(rvelz % 256);
2853 bytes[i++] = (byte)((rvelz >> 8) % 256); 2853 bytes[i++] = (byte)((rvelz >> 8) % 256);
2854 dat.Data = bytes; 2854 dat.Data = bytes;
2855 2855
2856 2856
2857 return dat; 2857 return dat;
2858 } 2858 }
2859 2859
@@ -2931,7 +2931,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2931 2931
2932 2932
2933 /// <summary> 2933 /// <summary>
2934 /// 2934 ///
2935 /// </summary> 2935 /// </summary>
2936 /// <returns></returns> 2936 /// <returns></returns>
2937 public ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry) 2937 public ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry)
@@ -2966,7 +2966,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2966 } 2966 }
2967 2967
2968 /// <summary> 2968 /// <summary>
2969 /// 2969 ///
2970 /// </summary> 2970 /// </summary>
2971 /// <param name="objdata"></param> 2971 /// <param name="objdata"></param>
2972 protected void SetDefaultAvatarPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata) 2972 protected void SetDefaultAvatarPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata)
@@ -3093,7 +3093,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3093 3093
3094 return true; 3094 return true;
3095 } 3095 }
3096 3096
3097 public void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question) 3097 public void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question)
3098 { 3098 {
3099 ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion); 3099 ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion);
@@ -3136,7 +3136,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3136 /// <summary> 3136 /// <summary>
3137 /// Send a response back to a client when it asks the asset server (via the region server) if it has 3137 /// Send a response back to a client when it asks the asset server (via the region server) if it has
3138 /// its appearance texture cached. 3138 /// its appearance texture cached.
3139 /// 3139 ///
3140 /// At the moment, we always reply that there is no cached texture. 3140 /// At the moment, we always reply that there is no cached texture.
3141 /// </summary> 3141 /// </summary>
3142 /// <param name="simclient"></param> 3142 /// <param name="simclient"></param>
@@ -3154,7 +3154,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3154 m_cachedTextureSerial++; 3154 m_cachedTextureSerial++;
3155 cachedresp.WearableData = 3155 cachedresp.WearableData =
3156 new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length]; 3156 new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length];
3157 3157
3158 for (int i = 0; i < cachedtex.WearableData.Length; i++) 3158 for (int i = 0; i < cachedtex.WearableData.Length; i++)
3159 { 3159 {
3160 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); 3160 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
@@ -3162,8 +3162,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3162 cachedresp.WearableData[i].TextureID = LLUUID.Zero; 3162 cachedresp.WearableData[i].TextureID = LLUUID.Zero;
3163 cachedresp.WearableData[i].HostName = new byte[0]; 3163 cachedresp.WearableData[i].HostName = new byte[0];
3164 } 3164 }
3165 3165
3166 // Temporarily throw these packets on to the wind queue, so we can identify whether these 3166 // Temporarily throw these packets on to the wind queue, so we can identify whether these
3167 // are somehow the source of the packet bloat. 3167 // are somehow the source of the packet bloat.
3168 cachedresp.Header.Zerocoded = true; 3168 cachedresp.Header.Zerocoded = true;
3169 OutPacket(cachedresp, ThrottleOutPacketType.Wind); 3169 OutPacket(cachedresp, ThrottleOutPacketType.Wind);
@@ -3245,7 +3245,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3245 // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); 3245 // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
3246 handlerUpdatePrimScale(localId, scale1, this); 3246 handlerUpdatePrimScale(localId, scale1, this);
3247 3247
3248 3248
3249 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; 3249 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
3250 if (handlerUpdatePrimSinglePosition != null) 3250 if (handlerUpdatePrimSinglePosition != null)
3251 { 3251 {
@@ -3414,7 +3414,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3414 3414
3415 // Previously ClientView.m_packetQueue 3415 // Previously ClientView.m_packetQueue
3416 3416
3417 // A thread safe sequence number allocator. 3417 // A thread safe sequence number allocator.
3418 protected uint NextSeqNum() 3418 protected uint NextSeqNum()
3419 { 3419 {
3420 // Set the sequence number 3420 // Set the sequence number
@@ -3490,7 +3490,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3490 { 3490 {
3491 // Keep track of when this packet was sent out 3491 // Keep track of when this packet was sent out
3492 Pack.TickCount = System.Environment.TickCount; 3492 Pack.TickCount = System.Environment.TickCount;
3493 3493
3494 if (!Pack.Header.Resent) 3494 if (!Pack.Header.Resent)
3495 { 3495 {
3496 Pack.Header.Sequence = NextSeqNum(); 3496 Pack.Header.Sequence = NextSeqNum();
@@ -3510,7 +3510,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3510 try 3510 try
3511 { 3511 {
3512 byte[] sendbuffer = Pack.ToBytes(); 3512 byte[] sendbuffer = Pack.ToBytes();
3513 PacketPool.Instance.ReturnPacket(Pack); 3513 PacketPool.Instance.ReturnPacket(Pack);
3514 3514
3515 if (Pack.Header.Zerocoded) 3515 if (Pack.Header.Zerocoded)
3516 { 3516 {
@@ -3737,7 +3737,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3737 } 3737 }
3738 } 3738 }
3739 3739
3740 private bool m_packetProcessingEnabled = true; 3740 private bool m_packetProcessingEnabled = true;
3741 3741
3742 public bool IsActive { 3742 public bool IsActive {
3743 get { return m_packetProcessingEnabled; } 3743 get { return m_packetProcessingEnabled; }
@@ -3750,7 +3750,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3750 3750
3751 if (ProcessPacketMethod(Pack)) 3751 if (ProcessPacketMethod(Pack))
3752 { 3752 {
3753 //there is a handler registered that handled this packet type 3753 //there is a handler registered that handled this packet type
3754 return; 3754 return;
3755 } 3755 }
3756 else 3756 else
@@ -3972,7 +3972,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3972 { 3972 {
3973 // Temporarily protect ourselves from the mantis #951 failure. 3973 // Temporarily protect ourselves from the mantis #951 failure.
3974 // However, we could do this for several other handlers where a failure isn't terminal 3974 // However, we could do this for several other handlers where a failure isn't terminal
3975 // for the client session anyway, in order to protect ourselves against bad code in plugins 3975 // for the client session anyway, in order to protect ourselves against bad code in plugins
3976 try 3976 try
3977 { 3977 {
3978 List<byte> visualparams = new List<byte>(); 3978 List<byte> visualparams = new List<byte>();
@@ -3986,7 +3986,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3986 catch (Exception e) 3986 catch (Exception e)
3987 { 3987 {
3988 m_log.ErrorFormat( 3988 m_log.ErrorFormat(
3989 "[CLIENT VIEW]: AgentSetApperance packet handler threw an exception, {0}", 3989 "[CLIENT VIEW]: AgentSetApperance packet handler threw an exception, {0}",
3990 e); 3990 e);
3991 } 3991 }
3992 } 3992 }
@@ -4027,7 +4027,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4027 if (handlerDetachAttachmentIntoInv != null) 4027 if (handlerDetachAttachmentIntoInv != null)
4028 { 4028 {
4029 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack; 4029 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack;
4030 4030
4031 LLUUID itemID = detachtoInv.ObjectData.ItemID; 4031 LLUUID itemID = detachtoInv.ObjectData.ItemID;
4032 LLUUID ATTACH_agentID = detachtoInv.ObjectData.AgentID; 4032 LLUUID ATTACH_agentID = detachtoInv.ObjectData.AgentID;
4033 4033
@@ -4223,7 +4223,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4223 m_probesWithNoIngressPackets = 0; 4223 m_probesWithNoIngressPackets = 0;
4224 m_clientBlocked = false; 4224 m_clientBlocked = false;
4225 SendStartPingCheck(0); 4225 SendStartPingCheck(0);
4226 4226
4227 break; 4227 break;
4228 4228
4229 case PacketType.ForceScriptControlRelease: 4229 case PacketType.ForceScriptControlRelease:
@@ -4284,12 +4284,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4284 // m_log.Info("[REZData]: " + addPacket.ToString()); 4284 // m_log.Info("[REZData]: " + addPacket.ToString());
4285 //BypassRaycast: 1 4285 //BypassRaycast: 1
4286 //RayStart: <69.79469, 158.2652, 98.40343> 4286 //RayStart: <69.79469, 158.2652, 98.40343>
4287 //RayEnd: <61.97724, 141.995, 92.58341> 4287 //RayEnd: <61.97724, 141.995, 92.58341>
4288 //RayTargetID: 00000000-0000-0000-0000-000000000000 4288 //RayTargetID: 00000000-0000-0000-0000-000000000000
4289 4289
4290 //Check to see if adding the prim is allowed; useful for any module wanting to restrict the 4290 //Check to see if adding the prim is allowed; useful for any module wanting to restrict the
4291 //object from rezing initially 4291 //object from rezing initially
4292 4292
4293 handlerAddPrim = OnAddPrim; 4293 handlerAddPrim = OnAddPrim;
4294 if (handlerAddPrim != null) 4294 if (handlerAddPrim != null)
4295 handlerAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection); 4295 handlerAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection);
@@ -4532,10 +4532,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4532 } 4532 }
4533 } 4533 }
4534 4534
4535 // Here's our data, 4535 // Here's our data,
4536 // PermField contains the field the info goes into 4536 // PermField contains the field the info goes into
4537 // PermField determines which mask we're changing 4537 // PermField determines which mask we're changing
4538 // 4538 //
4539 // chmask is the mask of the change 4539 // chmask is the mask of the change
4540 // setTF is whether we're adding it or taking it away 4540 // setTF is whether we're adding it or taking it away
4541 // 4541 //
@@ -4969,11 +4969,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4969 } 4969 }
4970 } 4970 }
4971 } 4971 }
4972 4972
4973 break; 4973 break;
4974 4974
4975 case PacketType.RemoveTaskInventory: 4975 case PacketType.RemoveTaskInventory:
4976 4976
4977 RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket)Pack; 4977 RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket)Pack;
4978 4978
4979 handlerRemoveTaskItem = OnRemoveTaskItem; 4979 handlerRemoveTaskItem = OnRemoveTaskItem;
@@ -4982,27 +4982,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4982 { 4982 {
4983 handlerRemoveTaskItem(this, removeTask.InventoryData.ItemID, removeTask.InventoryData.LocalID); 4983 handlerRemoveTaskItem(this, removeTask.InventoryData.ItemID, removeTask.InventoryData.LocalID);
4984 } 4984 }
4985 4985
4986 break; 4986 break;
4987 4987
4988 case PacketType.MoveTaskInventory: 4988 case PacketType.MoveTaskInventory:
4989 4989
4990 MoveTaskInventoryPacket moveTaskInventoryPacket = (MoveTaskInventoryPacket)Pack; 4990 MoveTaskInventoryPacket moveTaskInventoryPacket = (MoveTaskInventoryPacket)Pack;
4991 4991
4992 handlerMoveTaskItem = OnMoveTaskItem; 4992 handlerMoveTaskItem = OnMoveTaskItem;
4993 4993
4994 if (handlerMoveTaskItem != null) 4994 if (handlerMoveTaskItem != null)
4995 { 4995 {
4996 handlerMoveTaskItem( 4996 handlerMoveTaskItem(
4997 this, moveTaskInventoryPacket.AgentData.FolderID, 4997 this, moveTaskInventoryPacket.AgentData.FolderID,
4998 moveTaskInventoryPacket.InventoryData.LocalID, 4998 moveTaskInventoryPacket.InventoryData.LocalID,
4999 moveTaskInventoryPacket.InventoryData.ItemID); 4999 moveTaskInventoryPacket.InventoryData.ItemID);
5000 } 5000 }
5001 5001
5002 break; 5002 break;
5003 5003
5004 case PacketType.RezScript: 5004 case PacketType.RezScript:
5005 5005
5006 //Console.WriteLine(Pack.ToString()); 5006 //Console.WriteLine(Pack.ToString());
5007 RezScriptPacket rezScriptx = (RezScriptPacket)Pack; 5007 RezScriptPacket rezScriptx = (RezScriptPacket)Pack;
5008 5008
@@ -5013,7 +5013,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5013 handlerRezScript(this, rezScriptx.InventoryBlock.ItemID, rezScriptx.UpdateBlock.ObjectLocalID); 5013 handlerRezScript(this, rezScriptx.InventoryBlock.ItemID, rezScriptx.UpdateBlock.ObjectLocalID);
5014 } 5014 }
5015 break; 5015 break;
5016 5016
5017 case PacketType.MapLayerRequest: 5017 case PacketType.MapLayerRequest:
5018 RequestMapLayer(); 5018 RequestMapLayer();
5019 break; 5019 break;
@@ -5054,7 +5054,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5054 tpCancel.Info.AgentID = tpReq.Info.AgentID; 5054 tpCancel.Info.AgentID = tpReq.Info.AgentID;
5055 OutPacket(tpCancel, ThrottleOutPacketType.Task); 5055 OutPacket(tpCancel, ThrottleOutPacketType.Task);
5056 } 5056 }
5057 5057
5058 5058
5059 try 5059 try
5060 { 5060 {
@@ -5072,7 +5072,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5072 } 5072 }
5073 else 5073 else
5074 { 5074 {
5075 5075
5076 // Teleport home request 5076 // Teleport home request
5077 handlerTeleportHomeRequest = OnTeleportHomeRequest; 5077 handlerTeleportHomeRequest = OnTeleportHomeRequest;
5078 if (handlerTeleportHomeRequest != null) 5078 if (handlerTeleportHomeRequest != null)
@@ -5121,7 +5121,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5121 5121
5122 #endregion 5122 #endregion
5123 5123
5124 5124
5125 case PacketType.UUIDNameRequest: 5125 case PacketType.UUIDNameRequest:
5126 UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; 5126 UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack;
5127 foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock) 5127 foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock)
@@ -5262,7 +5262,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5262 break; 5262 break;
5263 case PacketType.ParcelRelease: 5263 case PacketType.ParcelRelease:
5264 ParcelReleasePacket releasePacket = (ParcelReleasePacket)Pack; 5264 ParcelReleasePacket releasePacket = (ParcelReleasePacket)Pack;
5265 5265
5266 handlerParcelAbandonRequest = OnParcelAbandonRequest; 5266 handlerParcelAbandonRequest = OnParcelAbandonRequest;
5267 if (handlerParcelAbandonRequest != null) 5267 if (handlerParcelAbandonRequest != null)
5268 { 5268 {
@@ -5378,7 +5378,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5378 float SunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter)); 5378 float SunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter));
5379 5379
5380 OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseFixedSun, SunHour); 5380 OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseFixedSun, SunHour);
5381 5381
5382 } 5382 }
5383 catch (Exception ex) 5383 catch (Exception ex)
5384 { 5384 {
@@ -5462,7 +5462,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5462 LLUUID Prey = LLUUID.Zero; 5462 LLUUID Prey = LLUUID.Zero;
5463 5463
5464 Helpers.TryParse(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter), out Prey); 5464 Helpers.TryParse(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter), out Prey);
5465 5465
5466 OnEstateTeleportOneUserHomeRequest(this,invoice,SenderID,Prey); 5466 OnEstateTeleportOneUserHomeRequest(this,invoice,SenderID,Prey);
5467 } 5467 }
5468 break; 5468 break;
@@ -5500,7 +5500,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5500 RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack; 5500 RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack;
5501 RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock; 5501 RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock;
5502 LLUUID token = rblock.Token; 5502 LLUUID token = rblock.Token;
5503 5503
5504 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; 5504 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData;
5505 5505
5506 handlerReqGodlikePowers = OnRequestGodlikePowers; 5506 handlerReqGodlikePowers = OnRequestGodlikePowers;
@@ -5623,7 +5623,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5623 // TODO: Don't display this one, we handle it at a lower level 5623 // TODO: Don't display this one, we handle it at a lower level
5624 //m_log.Warn("[CLIENT]: unhandled UseCircuitCode packet"); 5624 //m_log.Warn("[CLIENT]: unhandled UseCircuitCode packet");
5625 break; 5625 break;
5626 5626
5627 case PacketType.AgentHeightWidth: 5627 case PacketType.AgentHeightWidth:
5628 // TODO: handle this packet 5628 // TODO: handle this packet
5629 m_log.Warn("[CLIENT]: unhandled AgentHeightWidth packet"); 5629 m_log.Warn("[CLIENT]: unhandled AgentHeightWidth packet");
@@ -5741,7 +5741,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5741 OutPacket(offp, ThrottleOutPacketType.Task); 5741 OutPacket(offp, ThrottleOutPacketType.Task);
5742 } 5742 }
5743 5743
5744 public void SendSitResponse(LLUUID TargetID, LLVector3 OffsetPos, LLQuaternion SitOrientation, bool autopilot, 5744 public void SendSitResponse(LLUUID TargetID, LLVector3 OffsetPos, LLQuaternion SitOrientation, bool autopilot,
5745 LLVector3 CameraAtOffset, LLVector3 CameraEyeOffset, bool ForceMouseLook) 5745 LLVector3 CameraAtOffset, LLVector3 CameraEyeOffset, bool ForceMouseLook)
5746 { 5746 {
5747 AvatarSitResponsePacket avatarSitResponse = new AvatarSitResponsePacket(); 5747 AvatarSitResponsePacket avatarSitResponse = new AvatarSitResponsePacket();
@@ -5766,7 +5766,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5766 GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock(); 5766 GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock();
5767 5767
5768 adb.AgentID = AgentId; 5768 adb.AgentID = AgentId;
5769 adb.SessionID = SessionId; // More security 5769 adb.SessionID = SessionId; // More security
5770 gdb.GodLevel = (byte)AdminLevel; 5770 gdb.GodLevel = (byte)AdminLevel;
5771 gdb.Token = Token; 5771 gdb.Token = Token;
5772 //respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock; 5772 //respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
@@ -5790,7 +5790,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5790 Group.GroupPowers = GroupMembership[i].groupPowers; 5790 Group.GroupPowers = GroupMembership[i].groupPowers;
5791 Groups[i] = Group; 5791 Groups[i] = Group;
5792 Groupupdate.GroupData = Groups; 5792 Groupupdate.GroupData = Groups;
5793 5793
5794 } 5794 }
5795 Groupupdate.AgentData.AgentID = AgentId; 5795 Groupupdate.AgentData.AgentID = AgentId;
5796 OutPacket(Groupupdate, ThrottleOutPacketType.Task); 5796 OutPacket(Groupupdate, ThrottleOutPacketType.Task);
@@ -5800,7 +5800,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5800 public ClientInfo GetClientInfo() 5800 public ClientInfo GetClientInfo()
5801 { 5801 {
5802 //MainLog.Instance.Verbose("CLIENT", "GetClientInfo BGN"); 5802 //MainLog.Instance.Verbose("CLIENT", "GetClientInfo BGN");
5803 5803
5804 ClientInfo info = new ClientInfo(); 5804 ClientInfo info = new ClientInfo();
5805 info.userEP = this.m_userEndPoint; 5805 info.userEP = this.m_userEndPoint;
5806 info.proxyEP = this.m_proxyEndPoint; 5806 info.proxyEP = this.m_proxyEndPoint;
@@ -5822,7 +5822,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5822 QueItem[] queitems = m_packetQueue.GetQueueArray(); 5822 QueItem[] queitems = m_packetQueue.GetQueueArray();
5823 5823
5824 MainLog.Instance.Verbose("CLIENT", "Queue Count : [{0}]", queitems.Length); 5824 MainLog.Instance.Verbose("CLIENT", "Queue Count : [{0}]", queitems.Length);
5825 5825
5826 for (int i = 0; i < queitems.Length; i++) 5826 for (int i = 0; i < queitems.Length; i++)
5827 { 5827 {
5828 if (queitems[i].Incoming == false) 5828 if (queitems[i].Incoming == false)
@@ -5862,7 +5862,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5862 } 5862 }
5863 catch (Exception) 5863 catch (Exception)
5864 { 5864 {
5865 5865
5866 } 5866 }
5867 5867
5868 m_needAck.Add(key, packet); 5868 m_needAck.Add(key, packet);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index 8f90f34..8655d80 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -79,14 +79,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
79 // private long LastThrottle; 79 // private long LastThrottle;
80 // private long ThrottleInterval; 80 // private long ThrottleInterval;
81 private Timer throttleTimer; 81 private Timer throttleTimer;
82 82
83 private LLUUID m_agentId; 83 private LLUUID m_agentId;
84 84
85 public LLPacketQueue(LLUUID agentId) 85 public LLPacketQueue(LLUUID agentId)
86 { 86 {
87 // While working on this, the BlockingQueue had me fooled for a bit. 87 // While working on this, the BlockingQueue had me fooled for a bit.
88 // The Blocking queue causes the thread to stop until there's something 88 // The Blocking queue causes the thread to stop until there's something
89 // in it to process. it's an on-purpose threadlock though because 89 // in it to process. it's an on-purpose threadlock though because
90 // without it, the clientloop will suck up all sim resources. 90 // without it, the clientloop will suck up all sim resources.
91 91
92 SendQueue = new BlockingQueue<LLQueItem>(); 92 SendQueue = new BlockingQueue<LLQueItem>();
@@ -111,7 +111,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
111 AssetThrottle = new LLPacketThrottle(1000, 800000, 1000); 111 AssetThrottle = new LLPacketThrottle(1000, 800000, 1000);
112 TextureThrottle = new LLPacketThrottle(1000, 800000, 4000); 112 TextureThrottle = new LLPacketThrottle(1000, 800000, 4000);
113 // Total Throttle trumps all 113 // Total Throttle trumps all
114 // Number of bytes allowed to go out per second. (256kbps per client) 114 // Number of bytes allowed to go out per second. (256kbps per client)
115 TotalThrottle = new LLPacketThrottle(0, 1500000, 28000); 115 TotalThrottle = new LLPacketThrottle(0, 1500000, 28000);
116 116
117 throttleTimer = new Timer((int) (throttletimems/throttleTimeDivisor)); 117 throttleTimer = new Timer((int) (throttletimems/throttleTimeDivisor));
@@ -121,10 +121,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
121 // TIMERS needed for this 121 // TIMERS needed for this
122 // LastThrottle = DateTime.Now.Ticks; 122 // LastThrottle = DateTime.Now.Ticks;
123 // ThrottleInterval = (long)(throttletimems/throttleTimeDivisor); 123 // ThrottleInterval = (long)(throttletimems/throttleTimeDivisor);
124 124
125 m_agentId = agentId; 125 m_agentId = agentId;
126 126
127 if (StatsManager.SimExtraStats != null) 127 if (StatsManager.SimExtraStats != null)
128 { 128 {
129 StatsManager.SimExtraStats.RegisterPacketQueueStatsProvider(m_agentId, this); 129 StatsManager.SimExtraStats.RegisterPacketQueueStatsProvider(m_agentId, this);
130 } 130 }
@@ -234,11 +234,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
234 234
235 m_enabled = false; 235 m_enabled = false;
236 throttleTimer.Stop(); 236 throttleTimer.Stop();
237 237
238 if (StatsManager.SimExtraStats != null) 238 if (StatsManager.SimExtraStats != null)
239 { 239 {
240 StatsManager.SimExtraStats.DeregisterPacketQueueStatsProvider(m_agentId); 240 StatsManager.SimExtraStats.DeregisterPacketQueueStatsProvider(m_agentId);
241 } 241 }
242 } 242 }
243 243
244 private void ResetCounters() 244 private void ResetCounters()
@@ -275,7 +275,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
275 int MaxThrottleLoops = 4550; // 50*7 packets can be dequeued at once. 275 int MaxThrottleLoops = 4550; // 50*7 packets can be dequeued at once.
276 int throttleLoops = 0; 276 int throttleLoops = 0;
277 277
278 // We're going to dequeue all of the saved up packets until 278 // We're going to dequeue all of the saved up packets until
279 // we've hit the throttle limit or there's no more packets to send 279 // we've hit the throttle limit or there's no more packets to send
280 lock (this) 280 lock (this)
281 { 281 {
@@ -428,8 +428,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
428 //Agent Throttle Block contains 7 single floatingpoint values. 428 //Agent Throttle Block contains 7 single floatingpoint values.
429 int j = 0; 429 int j = 0;
430 430
431 // Some Systems may be big endian... 431 // Some Systems may be big endian...
432 // it might be smart to do this check more often... 432 // it might be smart to do this check more often...
433 if (!BitConverter.IsLittleEndian) 433 if (!BitConverter.IsLittleEndian)
434 for (int i = 0; i < 7; i++) 434 for (int i = 0; i < 7; i++)
435 Array.Reverse(throttle, j + i*singlefloat, singlefloat); 435 Array.Reverse(throttle, j + i*singlefloat, singlefloat);
@@ -508,7 +508,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
508 // effectively wiggling the slider causes things reset 508 // effectively wiggling the slider causes things reset
509 ResetCounters(); 509 ResetCounters();
510 } 510 }
511 511
512 // See IPullStatsProvider 512 // See IPullStatsProvider
513 public string GetStats() 513 public string GetStats()
514 { 514 {
@@ -522,7 +522,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
522 CloudOutgoingPacketQueue.Count, 522 CloudOutgoingPacketQueue.Count,
523 TaskOutgoingPacketQueue.Count, 523 TaskOutgoingPacketQueue.Count,
524 TextureOutgoingPacketQueue.Count, 524 TextureOutgoingPacketQueue.Count,
525 AssetOutgoingPacketQueue.Count); 525 AssetOutgoingPacketQueue.Count);
526 } 526 }
527 527
528 public LLQueItem[] GetQueueArray() 528 public LLQueItem[] GetQueueArray()
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
index 6a033c8..5983454 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
37{ 37{
38 public class LLPacketServer 38 public class LLPacketServer
39 { 39 {
40 //private static readonly log4net.ILog m_log 40 //private static readonly log4net.ILog m_log
41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 private LLClientStackNetworkHandler m_networkHandler; 43 private LLClientStackNetworkHandler m_networkHandler;
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
61 } 61 }
62 62
63 /// <summary> 63 /// <summary>
64 /// 64 ///
65 /// </summary> 65 /// </summary>
66 /// <param name="circuitCode"></param> 66 /// <param name="circuitCode"></param>
67 /// <param name="packet"></param> 67 /// <param name="packet"></param>
@@ -112,7 +112,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
112 } 112 }
113 113
114 /// <summary> 114 /// <summary>
115 /// 115 ///
116 /// </summary> 116 /// </summary>
117 /// <param name="buffer"></param> 117 /// <param name="buffer"></param>
118 /// <param name="size"></param> 118 /// <param name="size"></param>
@@ -124,7 +124,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
124 } 124 }
125 125
126 /// <summary> 126 /// <summary>
127 /// 127 ///
128 /// </summary> 128 /// </summary>
129 /// <param name="circuitcode"></param> 129 /// <param name="circuitcode"></param>
130 public virtual void CloseCircuit(uint circuitcode) 130 public virtual void CloseCircuit(uint circuitcode)
@@ -141,9 +141,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
141 public virtual void CloseClient(IClientAPI client) 141 public virtual void CloseClient(IClientAPI client)
142 { 142 {
143 //m_log.Info("PacketServer:CloseClient()"); 143 //m_log.Info("PacketServer:CloseClient()");
144 144
145 CloseCircuit(client.CircuitCode); 145 CloseCircuit(client.CircuitCode);
146 m_scene.ClientManager.Remove(client.CircuitCode); 146 m_scene.ClientManager.Remove(client.CircuitCode);
147 client.Close(false); 147 client.Close(false);
148 } 148 }
149 } 149 }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 5f83b50..c413416 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -171,11 +171,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
171 m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, 171 m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender,
172 ReceivedData, null); 172 ReceivedData, null);
173 173
174 // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. 174 // Ter: For some stupid reason ConnectionReset basically kills our async event structure..
175 // so therefore.. we've got to tell the server to BeginReceiveFrom again. 175 // so therefore.. we've got to tell the server to BeginReceiveFrom again.
176 // This will happen over and over until we've gone through all packets 176 // This will happen over and over until we've gone through all packets
177 // sent to and from this particular user. 177 // sent to and from this particular user.
178 // Stupid I know.. 178 // Stupid I know..
179 // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. 179 // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method.
180 } 180 }
181 catch (SocketException) 181 catch (SocketException)
@@ -195,12 +195,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
195 { 195 {
196 m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, 196 m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender,
197 ReceivedData, null); 197 ReceivedData, null);
198 198
199 // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. 199 // Ter: For some stupid reason ConnectionReset basically kills our async event structure..
200 // so therefore.. we've got to tell the server to BeginReceiveFrom again. 200 // so therefore.. we've got to tell the server to BeginReceiveFrom again.
201 // This will happen over and over until we've gone through all packets 201 // This will happen over and over until we've gone through all packets
202 // sent to and from this particular user. 202 // sent to and from this particular user.
203 // Stupid I know.. 203 // Stupid I know..
204 // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. 204 // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method.
205 } 205 }
206 catch (SocketException e2) 206 catch (SocketException e2)
@@ -208,7 +208,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
208 m_log.Error("[UDPSERVER]: " + e2.ToString()); 208 m_log.Error("[UDPSERVER]: " + e2.ToString());
209 } 209 }
210 210
211 // Here's some reference code! :D 211 // Here's some reference code! :D
212 // Shutdown and restart the UDP listener! hehe 212 // Shutdown and restart the UDP listener! hehe
213 // Shiny 213 // Shiny
214 214
@@ -228,11 +228,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
228 m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, 228 m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender,
229 ReceivedData, null); 229 ReceivedData, null);
230 230
231 // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. 231 // Ter: For some stupid reason ConnectionReset basically kills our async event structure..
232 // so therefore.. we've got to tell the server to BeginReceiveFrom again. 232 // so therefore.. we've got to tell the server to BeginReceiveFrom again.
233 // This will happen over and over until we've gone through all packets 233 // This will happen over and over until we've gone through all packets
234 // sent to and from this particular user. 234 // sent to and from this particular user.
235 // Stupid I know.. 235 // Stupid I know..
236 // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. 236 // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method.
237 } 237 }
238 238
@@ -283,11 +283,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
283 m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, 283 m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender,
284 ReceivedData, null); 284 ReceivedData, null);
285 285
286 // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. 286 // Ter: For some stupid reason ConnectionReset basically kills our async event structure..
287 // so therefore.. we've got to tell the server to BeginReceiveFrom again. 287 // so therefore.. we've got to tell the server to BeginReceiveFrom again.
288 // This will happen over and over until we've gone through all packets 288 // This will happen over and over until we've gone through all packets
289 // sent to and from this particular user. 289 // sent to and from this particular user.
290 // Stupid I know.. 290 // Stupid I know..
291 // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. 291 // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method.
292 } 292 }
293 catch (SocketException e5) 293 catch (SocketException e5)
@@ -351,7 +351,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
351 } 351 }
352 } 352 }
353 } 353 }
354 354
355 } 355 }
356 356
357 private void CloseEndPoint(EndPoint sender) 357 private void CloseEndPoint(EndPoint sender)
@@ -468,7 +468,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
468 public void RestoreClient(AgentCircuitData circuit, EndPoint userEP, EndPoint proxyEP) 468 public void RestoreClient(AgentCircuitData circuit, EndPoint userEP, EndPoint proxyEP)
469 { 469 {
470 //MainLog.Instance.Verbose("UDPSERVER", "RestoreClient"); 470 //MainLog.Instance.Verbose("UDPSERVER", "RestoreClient");
471 471
472 UseCircuitCodePacket useCircuit = new UseCircuitCodePacket(); 472 UseCircuitCodePacket useCircuit = new UseCircuitCodePacket();
473 useCircuit.CircuitCode.Code = circuit.circuitcode; 473 useCircuit.CircuitCode.Code = circuit.circuitcode;
474 useCircuit.CircuitCode.ID = circuit.AgentID; 474 useCircuit.CircuitCode.ID = circuit.AgentID;
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index b16f74b..586384f 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ClientStack
44{ 44{
45 public abstract class RegionApplicationBase : BaseOpenSimServer 45 public abstract class RegionApplicationBase : BaseOpenSimServer
46 { 46 {
47 private static readonly ILog m_log 47 private static readonly ILog m_log
48 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 protected AssetCache m_assetCache; 50 protected AssetCache m_assetCache;
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ClientStack
63 63
64 protected StorageManager m_storageManager; 64 protected StorageManager m_storageManager;
65 protected string m_storageConnectionString; 65 protected string m_storageConnectionString;
66 66
67 // An attribute to indicate whether prim inventories should be persisted. 67 // An attribute to indicate whether prim inventories should be persisted.
68 // Probably will be temporary until this stops being experimental. 68 // Probably will be temporary until this stops being experimental.
69 protected bool m_storagePersistPrimInventories; 69 protected bool m_storagePersistPrimInventories;
@@ -159,9 +159,9 @@ namespace OpenSim.Region.ClientStack
159 scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero; 159 scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero;
160 } 160 }
161 161
162 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 162 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
163 scene.StartTimer(); 163 scene.StartTimer();
164 164
165 return scene; 165 return scene;
166 } 166 }
167 167
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 39cf911..0203821 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -165,7 +165,7 @@ namespace OpenSim.Region.Communications.Local
165 } 165 }
166 166
167 /// <summary> 167 /// <summary>
168 /// 168 ///
169 /// </summary> 169 /// </summary>
170 /// <param name="regionHandle"></param> 170 /// <param name="regionHandle"></param>
171 /// <returns></returns> 171 /// <returns></returns>
@@ -188,7 +188,7 @@ namespace OpenSim.Region.Communications.Local
188 } 188 }
189 189
190 /// <summary> 190 /// <summary>
191 /// 191 ///
192 /// </summary> 192 /// </summary>
193 /// <param name="minX"></param> 193 /// <param name="minX"></param>
194 /// <param name="minY"></param> 194 /// <param name="minY"></param>
@@ -305,7 +305,7 @@ namespace OpenSim.Region.Communications.Local
305 } 305 }
306 306
307 /// <summary> 307 /// <summary>
308 /// 308 ///
309 /// </summary> 309 /// </summary>
310 /// <param name="regionHandle"></param> 310 /// <param name="regionHandle"></param>
311 /// <param name="agentData"></param> 311 /// <param name="agentData"></param>
@@ -338,7 +338,7 @@ namespace OpenSim.Region.Communications.Local
338 } 338 }
339 339
340 /// <summary> 340 /// <summary>
341 /// 341 ///
342 /// </summary> 342 /// </summary>
343 /// <param name="regionHandle"></param> 343 /// <param name="regionHandle"></param>
344 /// <param name="agentID"></param> 344 /// <param name="agentID"></param>
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
index 3d87007..4f60462 100644
--- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs
+++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
@@ -37,20 +37,20 @@ namespace OpenSim.Region.Communications.Local
37{ 37{
38 /// <summary> 38 /// <summary>
39 /// An implementation of user inventory where the inventory is held locally (e.g. when OpenSim is 39 /// An implementation of user inventory where the inventory is held locally (e.g. when OpenSim is
40 /// operating in standalone mode. 40 /// operating in standalone mode.
41 /// </summary> 41 /// </summary>
42 public class LocalInventoryService : InventoryServiceBase 42 public class LocalInventoryService : InventoryServiceBase
43 { 43 {
44 private static readonly ILog m_log 44 private static readonly ILog m_log
45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) 47 public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback)
48 { 48 {
49 m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID); 49 m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID);
50 50
51 List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID); 51 List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID);
52 InventoryFolderImpl rootFolder = null; 52 InventoryFolderImpl rootFolder = null;
53 53
54 List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); 54 List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>();
55 List<InventoryItemBase> items = new List<InventoryItemBase>(); 55 List<InventoryItemBase> items = new List<InventoryItemBase>();
56 56
@@ -76,11 +76,11 @@ namespace OpenSim.Region.Communications.Local
76 } 76 }
77 } 77 }
78 } 78 }
79 79
80 m_log.InfoFormat( 80 m_log.InfoFormat(
81 "[LOCAL INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items", 81 "[LOCAL INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items",
82 userID, folders.Count, items.Count); 82 userID, folders.Count, items.Count);
83 83
84 callback(folders, items); 84 callback(folders, items);
85 } 85 }
86 86
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 1781ef8..966fdd4 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Communications.Local
41 41
42 public class LocalLoginService : LoginService 42 public class LocalLoginService : LoginService
43 { 43 {
44 private static readonly ILog m_log 44 private static readonly ILog m_log
45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 private CommunicationsLocal m_Parent; 47 private CommunicationsLocal m_Parent;
@@ -55,8 +55,8 @@ namespace OpenSim.Region.Communications.Local
55 55
56 private LoginToRegionEvent handlerLoginToRegion = null; // OnLoginToRegion; 56 private LoginToRegionEvent handlerLoginToRegion = null; // OnLoginToRegion;
57 57
58 public LocalLoginService(UserManagerBase userManager, string welcomeMess, 58 public LocalLoginService(UserManagerBase userManager, string welcomeMess,
59 CommunicationsLocal parent, NetworkServersInfo serversInfo, 59 CommunicationsLocal parent, NetworkServersInfo serversInfo,
60 bool authenticate) 60 bool authenticate)
61 : base(userManager, parent.UserProfileCacheService.libraryRoot, welcomeMess) 61 : base(userManager, parent.UserProfileCacheService.libraryRoot, welcomeMess)
62 { 62 {
@@ -106,7 +106,7 @@ namespace OpenSim.Region.Communications.Local
106 { 106 {
107 m_log.Info( 107 m_log.Info(
108 "[LOGIN]: Authenticating " + profile.FirstName + " " + profile.SurName); 108 "[LOGIN]: Authenticating " + profile.FirstName + " " + profile.SurName);
109 109
110 if (!password.StartsWith("$1$")) 110 if (!password.StartsWith("$1$"))
111 password = "$1$" + Util.Md5Hash(password); 111 password = "$1$" + Util.Md5Hash(password);
112 112
@@ -157,7 +157,7 @@ namespace OpenSim.Region.Communications.Local
157 RegionInfo r = m_Parent.GridService.RequestClosestRegion(region); 157 RegionInfo r = m_Parent.GridService.RequestClosestRegion(region);
158 if (null == r) 158 if (null == r)
159 { 159 {
160 m_log.InfoFormat("[LOGIN]: Got Custom Login URL {0}, can't locate region {1}", 160 m_log.InfoFormat("[LOGIN]: Got Custom Login URL {0}, can't locate region {1}",
161 startLocationRequest, region); 161 startLocationRequest, region);
162 } 162 }
163 else 163 else
@@ -176,16 +176,16 @@ namespace OpenSim.Region.Communications.Local
176 176
177 if ((homeReg != null) && (reg != null)) 177 if ((homeReg != null) && (reg != null))
178 { 178 {
179 response.Home = "{'region_handle':[r" + 179 response.Home = "{'region_handle':[r" +
180 (homeReg.RegionLocX * Constants.RegionSize).ToString() + ",r" + 180 (homeReg.RegionLocX * Constants.RegionSize).ToString() + ",r" +
181 (homeReg.RegionLocY * Constants.RegionSize).ToString() + "], " + 181 (homeReg.RegionLocY * Constants.RegionSize).ToString() + "], " +
182 "'position':[r" + 182 "'position':[r" +
183 theUser.HomeLocation.X.ToString() + ",r" + 183 theUser.HomeLocation.X.ToString() + ",r" +
184 theUser.HomeLocation.Y.ToString() + ",r" + 184 theUser.HomeLocation.Y.ToString() + ",r" +
185 theUser.HomeLocation.Z.ToString() + "], " + 185 theUser.HomeLocation.Z.ToString() + "], " +
186 "'look_at':[r" + 186 "'look_at':[r" +
187 theUser.HomeLocation.X.ToString() + ",r" + 187 theUser.HomeLocation.X.ToString() + ",r" +
188 theUser.HomeLocation.Y.ToString() + ",r" + 188 theUser.HomeLocation.Y.ToString() + ",r" +
189 theUser.HomeLocation.Z.ToString() + "]}"; 189 theUser.HomeLocation.Z.ToString() + "]}";
190 string capsPath = Util.GetRandomCapsPath(); 190 string capsPath = Util.GetRandomCapsPath();
191 response.SimAddress = reg.ExternalEndPoint.Address.ToString(); 191 response.SimAddress = reg.ExternalEndPoint.Address.ToString();
@@ -201,17 +201,17 @@ namespace OpenSim.Region.Communications.Local
201 201
202 response.SeedCapability = "http://" + reg.ExternalHostName + ":" + 202 response.SeedCapability = "http://" + reg.ExternalHostName + ":" +
203 serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; 203 serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/";
204 204
205 m_log.DebugFormat( 205 m_log.DebugFormat(
206 "[CAPS]: Sending new CAPS seed url {0} to client {1}", 206 "[CAPS]: Sending new CAPS seed url {0} to client {1}",
207 response.SeedCapability, response.AgentID); 207 response.SeedCapability, response.AgentID);
208 208
209 theUser.CurrentAgent.Region = reg.RegionID; 209 theUser.CurrentAgent.Region = reg.RegionID;
210 theUser.CurrentAgent.Handle = reg.RegionHandle; 210 theUser.CurrentAgent.Handle = reg.RegionHandle;
211 211
212 LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList(); 212 LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList();
213 213
214 response.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(theUser.ID)); 214 response.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(theUser.ID));
215 215
216 Login _login = new Login(); 216 Login _login = new Login();
217 //copy data to login object 217 //copy data to login object
@@ -228,9 +228,9 @@ namespace OpenSim.Region.Communications.Local
228 _login.CapsPath = capsPath; 228 _login.CapsPath = capsPath;
229 229
230 m_log.InfoFormat( 230 m_log.InfoFormat(
231 "[LOGIN]: Telling region {0} @ {1},{2} ({3}:{4}) to expect user connection", 231 "[LOGIN]: Telling region {0} @ {1},{2} ({3}:{4}) to expect user connection",
232 reg.RegionName, response.RegionX, response.RegionY, response.SimAddress, response.SimPort); 232 reg.RegionName, response.RegionX, response.RegionY, response.SimAddress, response.SimPort);
233 233
234 handlerLoginToRegion = OnLoginToRegion; 234 handlerLoginToRegion = OnLoginToRegion;
235 if (handlerLoginToRegion != null) 235 if (handlerLoginToRegion != null)
236 { 236 {
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Communications.Local
257 return buddylistreturn; 257 return buddylistreturn;
258 } 258 }
259 259
260 // See LoginService 260 // See LoginService
261 protected override InventoryData GetInventorySkeleton(LLUUID userID) 261 protected override InventoryData GetInventorySkeleton(LLUUID userID)
262 { 262 {
263 List<InventoryFolderBase> folders = m_Parent.InventoryService.GetInventorySkeleton(userID); 263 List<InventoryFolderBase> folders = m_Parent.InventoryService.GetInventorySkeleton(userID);
@@ -265,10 +265,10 @@ namespace OpenSim.Region.Communications.Local
265 // If we have user auth but no inventory folders for some reason, create a new set of folders. 265 // If we have user auth but no inventory folders for some reason, create a new set of folders.
266 if (null == folders || 0 == folders.Count) 266 if (null == folders || 0 == folders.Count)
267 { 267 {
268 m_Parent.InventoryService.CreateNewUserInventory(userID); 268 m_Parent.InventoryService.CreateNewUserInventory(userID);
269 folders = m_Parent.InventoryService.GetInventorySkeleton(userID); 269 folders = m_Parent.InventoryService.GetInventorySkeleton(userID);
270 } 270 }
271 271
272 LLUUID rootID = LLUUID.Zero; 272 LLUUID rootID = LLUUID.Zero;
273 ArrayList AgentInventoryArray = new ArrayList(); 273 ArrayList AgentInventoryArray = new ArrayList();
274 Hashtable TempHash; 274 Hashtable TempHash;
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Communications.Local
286 TempHash["folder_id"] = InvFolder.ID.ToString(); 286 TempHash["folder_id"] = InvFolder.ID.ToString();
287 AgentInventoryArray.Add(TempHash); 287 AgentInventoryArray.Add(TempHash);
288 } 288 }
289 289
290 return new InventoryData(AgentInventoryArray, rootID); 290 return new InventoryData(AgentInventoryArray, rootID);
291 } 291 }
292 } 292 }
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index 2a66edc..47f596d 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Communications.Local
40 private IInventoryServices m_inventoryService; 40 private IInventoryServices m_inventoryService;
41 41
42 /// <summary> 42 /// <summary>
43 /// 43 ///
44 /// </summary> 44 /// </summary>
45 /// <param name="serversInfo"></param> 45 /// <param name="serversInfo"></param>
46 /// <param name="defaultHomeLocX"></param> 46 /// <param name="defaultHomeLocX"></param>
diff --git a/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs
index 2c88586..8712c00 100644
--- a/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30 30
31// General Information about an assembly is controlled through the following 31// General information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information 32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly. 33// associated with an assembly.
34 34
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
41[assembly : AssemblyTrademark("")] 41[assembly : AssemblyTrademark("")]
42[assembly : AssemblyCulture("")] 42[assembly : AssemblyCulture("")]
43 43
44// Setting ComVisible to false makes the types in this assembly not visible 44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from 45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type. 46// COM, set the ComVisible attribute to true on that type.
47 47
48[assembly : ComVisible(false)] 48[assembly : ComVisible(false)]
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
54// Version information for an assembly consists of the following four values: 54// Version information for an assembly consists of the following four values:
55// 55//
56// Major Version 56// Major Version
57// Minor Version 57// Minor Version
58// Build Number 58// Build Number
59// Revision 59// Revision
60// 60//
61// You can specify all the values or you can default the Revision and Build Numbers 61// You can specify all the values or you can default the Revision and Build Numbers
62// by using the '*' as shown below: 62// by using the '*' as shown below:
63 63
64[assembly : AssemblyVersion("1.0.0.0")] 64[assembly : AssemblyVersion("1.0.0.0")]
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index fb8dcf6..5e7e238 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -95,9 +95,9 @@ namespace OpenSim.Region.Communications.OGS1
95 public RegionCommsListener RegisterRegion(RegionInfo regionInfo) 95 public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
96 { 96 {
97 m_log.InfoFormat( 97 m_log.InfoFormat(
98 "[OGS1 GRID SERVICES]: Attempting to register region {0} with grid at {1}", 98 "[OGS1 GRID SERVICES]: Attempting to register region {0} with grid at {1}",
99 regionInfo.RegionName, serversInfo.GridURL); 99 regionInfo.RegionName, serversInfo.GridURL);
100 100
101 Hashtable GridParams = new Hashtable(); 101 Hashtable GridParams = new Hashtable();
102 // Login / Authentication 102 // Login / Authentication
103 103
@@ -122,7 +122,7 @@ namespace OpenSim.Region.Communications.OGS1
122 // not at all. Current strategy is to put the code in place to support the validity of this information 122 // not at all. Current strategy is to put the code in place to support the validity of this information
123 // and to roll forward debugging any issues from that point 123 // and to roll forward debugging any issues from that point
124 // 124 //
125 // this particular section of the mod attempts to supply a value from the region's xml file to the grid 125 // this particular section of the mod attempts to supply a value from the region's xml file to the grid
126 // server for the UUID of the region's owner (master avatar) 126 // server for the UUID of the region's owner (master avatar)
127 GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString(); 127 GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString();
128 128
@@ -139,14 +139,14 @@ namespace OpenSim.Region.Communications.OGS1
139 } 139 }
140 catch (Exception e) 140 catch (Exception e)
141 { 141 {
142 Exception e2 142 Exception e2
143 = new Exception( 143 = new Exception(
144 String.Format("Unable to connect to grid at {0}. Grid service not running?", serversInfo.GridURL), 144 String.Format("Unable to connect to grid at {0}. Grid service not running?", serversInfo.GridURL),
145 e); 145 e);
146 146
147 throw(e2); 147 throw(e2);
148 } 148 }
149 149
150 Hashtable GridRespData = (Hashtable)GridResp.Value; 150 Hashtable GridRespData = (Hashtable)GridResp.Value;
151 Hashtable griddatahash = GridRespData; 151 Hashtable griddatahash = GridRespData;
152 152
@@ -154,9 +154,9 @@ namespace OpenSim.Region.Communications.OGS1
154 if (GridRespData.ContainsKey("error")) 154 if (GridRespData.ContainsKey("error"))
155 { 155 {
156 string errorstring = (string) GridRespData["error"]; 156 string errorstring = (string) GridRespData["error"];
157 157
158 Exception e = new Exception(String.Format("Unable to connect to grid at {0}: {1}", serversInfo.GridURL, errorstring)); 158 Exception e = new Exception(String.Format("Unable to connect to grid at {0}: {1}", serversInfo.GridURL, errorstring));
159 159
160 throw e; 160 throw e;
161 } 161 }
162 else 162 else
@@ -170,9 +170,9 @@ namespace OpenSim.Region.Communications.OGS1
170 m_queuedGridSettings.Add("allow_forceful_banlines", "FALSE"); 170 m_queuedGridSettings.Add("allow_forceful_banlines", "FALSE");
171 } 171 }
172 } 172 }
173 173
174 m_log.InfoFormat( 174 m_log.InfoFormat(
175 "[OGS1 GRID SERVICES]: Region {0} successfully registered with grid at {1}", 175 "[OGS1 GRID SERVICES]: Region {0} successfully registered with grid at {1}",
176 regionInfo.RegionName, serversInfo.GridURL); 176 regionInfo.RegionName, serversInfo.GridURL);
177 } 177 }
178 return m_localBackend.RegisterRegion(regionInfo); 178 return m_localBackend.RegisterRegion(regionInfo);
@@ -245,7 +245,7 @@ namespace OpenSim.Region.Communications.OGS1
245 245
246 string externalIpStr = String.Empty; 246 string externalIpStr = String.Empty;
247 try 247 try
248 { 248 {
249 externalIpStr = Util.GetHostFromDNS(simIp).ToString(); 249 externalIpStr = Util.GetHostFromDNS(simIp).ToString();
250 } 250 }
251 catch (SocketException e) 251 catch (SocketException e)
@@ -253,16 +253,16 @@ namespace OpenSim.Region.Communications.OGS1
253 m_log.WarnFormat("RequestNeighbours(): Lookup of neighbour {0} failed! Not including in neighbours list. {1}", simIp, e); 253 m_log.WarnFormat("RequestNeighbours(): Lookup of neighbour {0} failed! Not including in neighbours list. {1}", simIp, e);
254 continue; 254 continue;
255 } 255 }
256 256
257 SimpleRegionInfo sri = new SimpleRegionInfo(regX, regY, simIp, port); 257 SimpleRegionInfo sri = new SimpleRegionInfo(regX, regY, simIp, port);
258 258
259 sri.RemotingPort = Convert.ToUInt32(neighbourData["remoting_port"]); 259 sri.RemotingPort = Convert.ToUInt32(neighbourData["remoting_port"]);
260 260
261 if (neighbourData.ContainsKey("http_port")) 261 if (neighbourData.ContainsKey("http_port"))
262 { 262 {
263 sri.HttpPort = Convert.ToUInt32(neighbourData["http_port"]); 263 sri.HttpPort = Convert.ToUInt32(neighbourData["http_port"]);
264 } 264 }
265 265
266 sri.RegionID = new LLUUID((string) neighbourData["uuid"]); 266 sri.RegionID = new LLUUID((string) neighbourData["uuid"]);
267 267
268 neighbours.Add(sri); 268 neighbours.Add(sri);
@@ -274,7 +274,7 @@ namespace OpenSim.Region.Communications.OGS1
274 } 274 }
275 275
276 /// <summary> 276 /// <summary>
277 /// 277 ///
278 /// </summary> 278 /// </summary>
279 /// <param name="regionHandle"></param> 279 /// <param name="regionHandle"></param>
280 /// <returns></returns> 280 /// <returns></returns>
@@ -309,7 +309,7 @@ namespace OpenSim.Region.Communications.OGS1
309 309
310 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); 310 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]);
311 regionInfo.RemotingAddress = internalIpStr; 311 regionInfo.RemotingAddress = internalIpStr;
312 312
313 if (responseData.ContainsKey("http_port")) 313 if (responseData.ContainsKey("http_port"))
314 { 314 {
315 regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); 315 regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]);
@@ -327,7 +327,7 @@ namespace OpenSim.Region.Communications.OGS1
327 } 327 }
328 328
329 /// <summary> 329 /// <summary>
330 /// 330 ///
331 /// </summary> 331 /// </summary>
332 /// <param name="regionHandle"></param> 332 /// <param name="regionHandle"></param>
333 /// <returns></returns> 333 /// <returns></returns>
@@ -372,7 +372,7 @@ namespace OpenSim.Region.Communications.OGS1
372 372
373 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); 373 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]);
374 regionInfo.RemotingAddress = internalIpStr; 374 regionInfo.RemotingAddress = internalIpStr;
375 375
376 if (responseData.ContainsKey("http_port")) 376 if (responseData.ContainsKey("http_port"))
377 { 377 {
378 regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); 378 regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]);
@@ -429,7 +429,7 @@ namespace OpenSim.Region.Communications.OGS1
429 429
430 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); 430 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]);
431 regionInfo.RemotingAddress = internalIpStr; 431 regionInfo.RemotingAddress = internalIpStr;
432 432
433 if (responseData.ContainsKey("http_port")) 433 if (responseData.ContainsKey("http_port"))
434 { 434 {
435 regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); 435 regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]);
@@ -451,7 +451,7 @@ namespace OpenSim.Region.Communications.OGS1
451 } 451 }
452 452
453 /// <summary> 453 /// <summary>
454 /// 454 ///
455 /// </summary> 455 /// </summary>
456 /// <param name="minX"></param> 456 /// <param name="minX"></param>
457 /// <param name="minY"></param> 457 /// <param name="minY"></param>
@@ -601,7 +601,7 @@ namespace OpenSim.Region.Communications.OGS1
601 #region m_interRegion Comms 601 #region m_interRegion Comms
602 602
603 /// <summary> 603 /// <summary>
604 /// 604 ///
605 /// </summary> 605 /// </summary>
606 private void StartRemoting() 606 private void StartRemoting()
607 { 607 {
@@ -688,55 +688,55 @@ namespace OpenSim.Region.Communications.OGS1
688 catch (RemotingException e) 688 catch (RemotingException e)
689 { 689 {
690 NoteDeadRegion(regionHandle); 690 NoteDeadRegion(regionHandle);
691 691
692 m_log.WarnFormat( 692 m_log.WarnFormat(
693 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 693 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
694 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 694 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
695 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 695 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
696 696
697 return false; 697 return false;
698 } 698 }
699 catch (SocketException e) 699 catch (SocketException e)
700 { 700 {
701 NoteDeadRegion(regionHandle); 701 NoteDeadRegion(regionHandle);
702 702
703 m_log.WarnFormat( 703 m_log.WarnFormat(
704 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 704 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
705 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 705 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
706 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 706 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
707 707
708 return false; 708 return false;
709 } 709 }
710 catch (InvalidCredentialException e) 710 catch (InvalidCredentialException e)
711 { 711 {
712 NoteDeadRegion(regionHandle); 712 NoteDeadRegion(regionHandle);
713 713
714 m_log.WarnFormat( 714 m_log.WarnFormat(
715 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 715 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
716 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 716 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
717 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 717 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
718 718
719 return false; 719 return false;
720 } 720 }
721 catch (AuthenticationException e) 721 catch (AuthenticationException e)
722 { 722 {
723 NoteDeadRegion(regionHandle); 723 NoteDeadRegion(regionHandle);
724 724
725 m_log.WarnFormat( 725 m_log.WarnFormat(
726 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 726 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
727 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 727 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
728 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 728 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
729 729
730 return false; 730 return false;
731 } 731 }
732 catch (Exception e) 732 catch (Exception e)
733 { 733 {
734 NoteDeadRegion(regionHandle); 734 NoteDeadRegion(regionHandle);
735 735
736 m_log.WarnFormat("[OGS1 GRID SERVICES]: Unable to connect to adjacent region: {0} {1},{2}", 736 m_log.WarnFormat("[OGS1 GRID SERVICES]: Unable to connect to adjacent region: {0} {1},{2}",
737 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 737 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
738 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 738 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
739 739
740 return false; 740 return false;
741 } 741 }
742 } 742 }
@@ -748,7 +748,7 @@ namespace OpenSim.Region.Communications.OGS1
748 } 748 }
749 749
750 /// <summary> 750 /// <summary>
751 /// 751 ///
752 /// </summary> 752 /// </summary>
753 /// <param name="regionHandle"></param> 753 /// <param name="regionHandle"></param>
754 /// <param name="agentData"></param> 754 /// <param name="agentData"></param>
@@ -797,56 +797,56 @@ namespace OpenSim.Region.Communications.OGS1
797 catch (RemotingException e) 797 catch (RemotingException e)
798 { 798 {
799 NoteDeadRegion(regionHandle); 799 NoteDeadRegion(regionHandle);
800 800
801 m_log.WarnFormat( 801 m_log.WarnFormat(
802 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 802 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
803 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 803 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
804 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 804 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
805 805
806 return false; 806 return false;
807 } 807 }
808 catch (SocketException e) 808 catch (SocketException e)
809 { 809 {
810 NoteDeadRegion(regionHandle); 810 NoteDeadRegion(regionHandle);
811 811
812 m_log.WarnFormat( 812 m_log.WarnFormat(
813 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 813 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
814 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 814 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
815 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 815 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
816 816
817 return false; 817 return false;
818 } 818 }
819 catch (InvalidCredentialException e) 819 catch (InvalidCredentialException e)
820 { 820 {
821 NoteDeadRegion(regionHandle); 821 NoteDeadRegion(regionHandle);
822 822
823 m_log.WarnFormat( 823 m_log.WarnFormat(
824 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 824 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
825 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 825 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
826 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 826 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
827 827
828 return false; 828 return false;
829 } 829 }
830 catch (AuthenticationException e) 830 catch (AuthenticationException e)
831 { 831 {
832 NoteDeadRegion(regionHandle); 832 NoteDeadRegion(regionHandle);
833 833
834 m_log.WarnFormat( 834 m_log.WarnFormat(
835 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 835 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
836 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 836 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
837 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 837 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
838 838
839 return false; 839 return false;
840 } 840 }
841 catch (Exception e) 841 catch (Exception e)
842 { 842 {
843 NoteDeadRegion(regionHandle); 843 NoteDeadRegion(regionHandle);
844 844
845 m_log.WarnFormat( 845 m_log.WarnFormat(
846 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 846 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
847 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 847 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
848 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 848 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
849 849
850 return false; 850 return false;
851 } 851 }
852 } 852 }
@@ -857,17 +857,17 @@ namespace OpenSim.Region.Communications.OGS1
857 SerializableRegionInfo regInfo = null; 857 SerializableRegionInfo regInfo = null;
858 try 858 try
859 { 859 {
860 // You may ask why this is in here... 860 // You may ask why this is in here...
861 // The region asking the grid services about itself.. 861 // The region asking the grid services about itself..
862 // And, surprisingly, the reason is.. it doesn't know 862 // And, surprisingly, the reason is.. it doesn't know
863 // it's own remoting port! How special. 863 // it's own remoting port! How special.
864 RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port); 864 RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port);
865 865
866 region = new SerializableRegionInfo(RequestNeighbourInfo(region.RegionHandle)); 866 region = new SerializableRegionInfo(RequestNeighbourInfo(region.RegionHandle));
867 region.RemotingAddress = region.ExternalHostName; 867 region.RemotingAddress = region.ExternalHostName;
868 region.RemotingPort = NetworkServersInfo.RemotingListenerPort; 868 region.RemotingPort = NetworkServersInfo.RemotingListenerPort;
869 region.HttpPort = serversInfo.HttpListenerPort; 869 region.HttpPort = serversInfo.HttpListenerPort;
870 870
871 if (m_localBackend.RegionUp(region, regionhandle)) 871 if (m_localBackend.RegionUp(region, regionhandle))
872 { 872 {
873 return true; 873 return true;
@@ -904,7 +904,7 @@ namespace OpenSim.Region.Communications.OGS1
904 } 904 }
905 else 905 else
906 { 906 {
907 // We're trying to inform ourselves via remoting. 907 // We're trying to inform ourselves via remoting.
908 // This is here because we're looping over the listeners before we get here. 908 // This is here because we're looping over the listeners before we get here.
909 // Odd but it should work. 909 // Odd but it should work.
910 return true; 910 return true;
@@ -963,7 +963,7 @@ namespace OpenSim.Region.Communications.OGS1
963 } 963 }
964 964
965 /// <summary> 965 /// <summary>
966 /// 966 ///
967 /// </summary> 967 /// </summary>
968 /// <param name="regionHandle"></param> 968 /// <param name="regionHandle"></param>
969 /// <param name="agentData"></param> 969 /// <param name="agentData"></param>
@@ -1058,7 +1058,7 @@ namespace OpenSim.Region.Communications.OGS1
1058 } 1058 }
1059 1059
1060 /// <summary> 1060 /// <summary>
1061 /// 1061 ///
1062 /// </summary> 1062 /// </summary>
1063 /// <param name="regionHandle"></param> 1063 /// <param name="regionHandle"></param>
1064 /// <param name="agentID"></param> 1064 /// <param name="agentID"></param>
@@ -1098,20 +1098,20 @@ namespace OpenSim.Region.Communications.OGS1
1098 1098
1099 return retValue; 1099 return retValue;
1100 } 1100 }
1101 //TODO need to see if we know about where this region is and use .net remoting 1101 //TODO need to see if we know about where this region is and use .net remoting
1102 // to inform it. 1102 // to inform it.
1103 NoteDeadRegion(regionHandle); 1103 NoteDeadRegion(regionHandle);
1104 return false; 1104 return false;
1105 } 1105 }
1106 catch (RemotingException e) 1106 catch (RemotingException e)
1107 { 1107 {
1108 NoteDeadRegion(regionHandle); 1108 NoteDeadRegion(regionHandle);
1109 1109
1110 m_log.WarnFormat( 1110 m_log.WarnFormat(
1111 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", 1111 "[OGS1 GRID SERVICES]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}",
1112 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); 1112 regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY);
1113 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 1113 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
1114 1114
1115 return false; 1115 return false;
1116 } 1116 }
1117 catch 1117 catch
@@ -1155,8 +1155,8 @@ namespace OpenSim.Region.Communications.OGS1
1155 1155
1156 return retValue; 1156 return retValue;
1157 } 1157 }
1158 //TODO need to see if we know about where this region is and use .net remoting 1158 //TODO need to see if we know about where this region is and use .net remoting
1159 // to inform it. 1159 // to inform it.
1160 NoteDeadRegion(regionHandle); 1160 NoteDeadRegion(regionHandle);
1161 return false; 1161 return false;
1162 } 1162 }
@@ -1184,7 +1184,7 @@ namespace OpenSim.Region.Communications.OGS1
1184 catch (AuthenticationException e) 1184 catch (AuthenticationException e)
1185 { 1185 {
1186 NoteDeadRegion(regionHandle); 1186 NoteDeadRegion(regionHandle);
1187 m_log.Warn("[OGS1 GRID SERVICES]: Authentication exception: Unable to connect to adjacent region: " + regionHandle); 1187 m_log.Warn("[OGS1 GRID SERVICES]: Authentication exception: Unable to connect to adjacent region: " + regionHandle);
1188 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message); 1188 m_log.DebugFormat("[OGS1 GRID SERVICES]: {0} {1}", e.Source, e.Message);
1189 return false; 1189 return false;
1190 } 1190 }
@@ -1230,8 +1230,8 @@ namespace OpenSim.Region.Communications.OGS1
1230 1230
1231 return true; 1231 return true;
1232 } 1232 }
1233 //TODO need to see if we know about where this region is and use .net remoting 1233 //TODO need to see if we know about where this region is and use .net remoting
1234 // to inform it. 1234 // to inform it.
1235 NoteDeadRegion(regionHandle); 1235 NoteDeadRegion(regionHandle);
1236 return false; 1236 return false;
1237 } 1237 }
@@ -1311,7 +1311,7 @@ namespace OpenSim.Region.Communications.OGS1
1311 #region Methods triggered by calls from external instances 1311 #region Methods triggered by calls from external instances
1312 1312
1313 /// <summary> 1313 /// <summary>
1314 /// 1314 ///
1315 /// </summary> 1315 /// </summary>
1316 /// <param name="regionHandle"></param> 1316 /// <param name="regionHandle"></param>
1317 /// <param name="agentData"></param> 1317 /// <param name="agentData"></param>
@@ -1342,7 +1342,7 @@ namespace OpenSim.Region.Communications.OGS1
1342 nRegionInfo.RegionLocX = regionData.X; 1342 nRegionInfo.RegionLocX = regionData.X;
1343 nRegionInfo.RegionLocY = regionData.Y; 1343 nRegionInfo.RegionLocY = regionData.Y;
1344 1344
1345 1345
1346 try 1346 try
1347 { 1347 {
1348 lock (m_deadRegionCache) 1348 lock (m_deadRegionCache)
@@ -1379,14 +1379,14 @@ namespace OpenSim.Region.Communications.OGS1
1379 } 1379 }
1380 1380
1381 /// <summary> 1381 /// <summary>
1382 /// 1382 ///
1383 /// </summary> 1383 /// </summary>
1384 /// <param name="regionHandle"></param> 1384 /// <param name="regionHandle"></param>
1385 /// <param name="agentData"></param> 1385 /// <param name="agentData"></param>
1386 /// <returns></returns> 1386 /// <returns></returns>
1387 public bool IncomingPrim(ulong regionHandle, LLUUID primID, string objData, int XMLMethod) 1387 public bool IncomingPrim(ulong regionHandle, LLUUID primID, string objData, int XMLMethod)
1388 { 1388 {
1389 // Is this necessary? 1389 // Is this necessary?
1390 try 1390 try
1391 { 1391 {
1392 m_localBackend.TriggerExpectPrim(regionHandle, primID, objData, XMLMethod); 1392 m_localBackend.TriggerExpectPrim(regionHandle, primID, objData, XMLMethod);
@@ -1401,7 +1401,7 @@ namespace OpenSim.Region.Communications.OGS1
1401 } 1401 }
1402 1402
1403 /// <summary> 1403 /// <summary>
1404 /// 1404 ///
1405 /// </summary> 1405 /// </summary>
1406 /// <param name="regionHandle"></param> 1406 /// <param name="regionHandle"></param>
1407 /// <param name="agentID"></param> 1407 /// <param name="agentID"></param>
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 0f75a09..9b3d878 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -41,11 +41,11 @@ namespace OpenSim.Region.Communications.OGS1
41{ 41{
42 public class OGS1InventoryService : IInventoryServices 42 public class OGS1InventoryService : IInventoryServices
43 { 43 {
44 private static readonly ILog m_log 44 private static readonly ILog m_log
45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 private string _inventoryServerUrl; 47 private string _inventoryServerUrl;
48 private Dictionary<LLUUID, InventoryReceiptCallback> m_RequestingInventory 48 private Dictionary<LLUUID, InventoryReceiptCallback> m_RequestingInventory
49 = new Dictionary<LLUUID, InventoryReceiptCallback>(); 49 = new Dictionary<LLUUID, InventoryReceiptCallback>();
50 50
51 public OGS1InventoryService(string inventoryServerUrl) 51 public OGS1InventoryService(string inventoryServerUrl)
@@ -65,26 +65,26 @@ namespace OpenSim.Region.Communications.OGS1
65 if (!m_RequestingInventory.ContainsKey(userID)) 65 if (!m_RequestingInventory.ContainsKey(userID))
66 { 66 {
67 m_RequestingInventory.Add(userID, callback); 67 m_RequestingInventory.Add(userID, callback);
68 68
69 try 69 try
70 { 70 {
71 m_log.InfoFormat( 71 m_log.InfoFormat(
72 "[OGS1 INVENTORY SERVICE]: Requesting inventory from {0}/GetInventory/ for user {1}", 72 "[OGS1 INVENTORY SERVICE]: Requesting inventory from {0}/GetInventory/ for user {1}",
73 _inventoryServerUrl, userID); 73 _inventoryServerUrl, userID);
74 74
75 RestObjectPosterResponse<InventoryCollection> requester 75 RestObjectPosterResponse<InventoryCollection> requester
76 = new RestObjectPosterResponse<InventoryCollection>(); 76 = new RestObjectPosterResponse<InventoryCollection>();
77 requester.ResponseCallback = InventoryResponse; 77 requester.ResponseCallback = InventoryResponse;
78 78
79 requester.BeginPostObject<Guid>(_inventoryServerUrl + "/GetInventory/", userID.UUID); 79 requester.BeginPostObject<Guid>(_inventoryServerUrl + "/GetInventory/", userID.UUID);
80 } 80 }
81 catch (WebException e) 81 catch (WebException e)
82 { 82 {
83 if (StatsManager.SimExtraStats != null) 83 if (StatsManager.SimExtraStats != null)
84 StatsManager.SimExtraStats.AddInventoryServiceRetrievalFailure(); 84 StatsManager.SimExtraStats.AddInventoryServiceRetrievalFailure();
85 85
86 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Request inventory operation failed, {0} {1}", 86 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Request inventory operation failed, {0} {1}",
87 e.Source, e.Message); 87 e.Source, e.Message);
88 } 88 }
89 } 89 }
90 else 90 else
@@ -92,11 +92,11 @@ namespace OpenSim.Region.Communications.OGS1
92 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: RequestInventoryForUser() - could you not find user profile for {0}", userID); 92 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: RequestInventoryForUser() - could you not find user profile for {0}", userID);
93 } 93 }
94 } 94 }
95 95
96 /// <summary> 96 /// <summary>
97 /// Callback used by the inventory server GetInventory request 97 /// Callback used by the inventory server GetInventory request
98 /// </summary> 98 /// </summary>
99 /// <param name="userID"></param> 99 /// <param name="userID"></param>
100 private void InventoryResponse(InventoryCollection response) 100 private void InventoryResponse(InventoryCollection response)
101 { 101 {
102 LLUUID userID = response.UserID; 102 LLUUID userID = response.UserID;
@@ -108,17 +108,17 @@ namespace OpenSim.Region.Communications.OGS1
108 108
109 InventoryFolderImpl rootFolder = null; 109 InventoryFolderImpl rootFolder = null;
110 InventoryReceiptCallback callback = m_RequestingInventory[userID]; 110 InventoryReceiptCallback callback = m_RequestingInventory[userID];
111 111
112 ICollection<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); 112 ICollection<InventoryFolderImpl> folders = new List<InventoryFolderImpl>();
113 ICollection<InventoryItemBase> items = new List<InventoryItemBase>(); 113 ICollection<InventoryItemBase> items = new List<InventoryItemBase>();
114 114
115 foreach (InventoryFolderBase folder in response.Folders) 115 foreach (InventoryFolderBase folder in response.Folders)
116 { 116 {
117 if (folder.ParentID == LLUUID.Zero) 117 if (folder.ParentID == LLUUID.Zero)
118 { 118 {
119 rootFolder = new InventoryFolderImpl(folder); 119 rootFolder = new InventoryFolderImpl(folder);
120 folders.Add(rootFolder); 120 folders.Add(rootFolder);
121 121
122 break; 122 break;
123 } 123 }
124 } 124 }
@@ -142,9 +142,9 @@ namespace OpenSim.Region.Communications.OGS1
142 { 142 {
143 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Did not get back an inventory containing a root folder for user {0}", userID); 143 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Did not get back an inventory containing a root folder for user {0}", userID);
144 } 144 }
145 145
146 callback(folders, items); 146 callback(folders, items);
147 147
148 m_RequestingInventory.Remove(userID); 148 m_RequestingInventory.Remove(userID);
149 } 149 }
150 else 150 else
@@ -158,7 +158,7 @@ namespace OpenSim.Region.Communications.OGS1
158 158
159 /// <summary> 159 /// <summary>
160 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> 160 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
161 /// </summary> 161 /// </summary>
162 public bool AddFolder(InventoryFolderBase folder) 162 public bool AddFolder(InventoryFolderBase folder)
163 { 163 {
164 try 164 try
@@ -168,68 +168,68 @@ namespace OpenSim.Region.Communications.OGS1
168 } 168 }
169 catch (WebException e) 169 catch (WebException e)
170 { 170 {
171 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory folder operation failed, {0} {1}", 171 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory folder operation failed, {0} {1}",
172 e.Source, e.Message); 172 e.Source, e.Message);
173 } 173 }
174 174
175 return false; 175 return false;
176 } 176 }
177 177
178 /// <summary> 178 /// <summary>
179 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> 179 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
180 /// </summary> 180 /// </summary>
181 /// <param name="folder"></param> 181 /// <param name="folder"></param>
182 public bool MoveFolder(InventoryFolderBase folder) 182 public bool MoveFolder(InventoryFolderBase folder)
183 { 183 {
184 try 184 try
185 { 185 {
186 return SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>( 186 return SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>(
187 "POST", _inventoryServerUrl + "/MoveFolder/", folder); 187 "POST", _inventoryServerUrl + "/MoveFolder/", folder);
188 } 188 }
189 catch (WebException e) 189 catch (WebException e)
190 { 190 {
191 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}", 191 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}",
192 e.Source, e.Message); 192 e.Source, e.Message);
193 } 193 }
194 194
195 return false; 195 return false;
196 } 196 }
197 197
198 /// <summary> 198 /// <summary>
199 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> 199 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
200 /// </summary> 200 /// </summary>
201 public bool PurgeFolder(InventoryFolderBase folder) 201 public bool PurgeFolder(InventoryFolderBase folder)
202 { 202 {
203 try 203 try
204 { 204 {
205 return SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>( 205 return SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>(
206 "POST", _inventoryServerUrl + "/PurgeFolder/", folder); 206 "POST", _inventoryServerUrl + "/PurgeFolder/", folder);
207 } 207 }
208 catch (WebException e) 208 catch (WebException e)
209 { 209 {
210 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}", 210 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}",
211 e.Source, e.Message); 211 e.Source, e.Message);
212 } 212 }
213 213
214 return false; 214 return false;
215 } 215 }
216 216
217 /// <summary> 217 /// <summary>
218 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> 218 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
219 /// </summary> 219 /// </summary>
220 public bool AddItem(InventoryItemBase item) 220 public bool AddItem(InventoryItemBase item)
221 { 221 {
222 try 222 try
223 { 223 {
224 return SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>( 224 return SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>(
225 "POST", _inventoryServerUrl + "/NewItem/", item); 225 "POST", _inventoryServerUrl + "/NewItem/", item);
226 } 226 }
227 catch (WebException e) 227 catch (WebException e)
228 { 228 {
229 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory item operation failed, {0} {1}", 229 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory item operation failed, {0} {1}",
230 e.Source, e.Message); 230 e.Source, e.Message);
231 } 231 }
232 232
233 return false; 233 return false;
234 } 234 }
235 235
@@ -246,26 +246,26 @@ namespace OpenSim.Region.Communications.OGS1
246 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Update new inventory item operation failed, {0} {1}", 246 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Update new inventory item operation failed, {0} {1}",
247 e.Source, e.Message); 247 e.Source, e.Message);
248 } 248 }
249 249
250 return false; 250 return false;
251 } 251 }
252 252
253 /// <summary> 253 /// <summary>
254 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> 254 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
255 /// </summary> 255 /// </summary>
256 public bool DeleteItem(InventoryItemBase item) 256 public bool DeleteItem(InventoryItemBase item)
257 { 257 {
258 try 258 try
259 { 259 {
260 return SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>( 260 return SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>(
261 "POST", _inventoryServerUrl + "/DeleteItem/", item); 261 "POST", _inventoryServerUrl + "/DeleteItem/", item);
262 } 262 }
263 catch (WebException e) 263 catch (WebException e)
264 { 264 {
265 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Delete inventory item operation failed, {0} {1}", 265 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Delete inventory item operation failed, {0} {1}",
266 e.Source, e.Message); 266 e.Source, e.Message);
267 } 267 }
268 268
269 return false; 269 return false;
270 } 270 }
271 271
@@ -283,12 +283,12 @@ namespace OpenSim.Region.Communications.OGS1
283 { 283 {
284 return false; 284 return false;
285 } 285 }
286 286
287 // See IInventoryServices 287 // See IInventoryServices
288 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) 288 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId)
289 { 289 {
290 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: The GetInventorySkeleton() method here should never be called!"); 290 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: The GetInventorySkeleton() method here should never be called!");
291 291
292 return new List<InventoryFolderBase>(); 292 return new List<InventoryFolderBase>();
293 } 293 }
294 294
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index e3ee2c1..63fad4a 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -117,8 +117,8 @@ namespace OpenSim.Region.Communications.OGS1
117 { 117 {
118 List<FriendListItem> buddylist = new List<FriendListItem>(); 118 List<FriendListItem> buddylist = new List<FriendListItem>();
119 int buddycount = Convert.ToInt32((string)data["avcount"]); 119 int buddycount = Convert.ToInt32((string)data["avcount"]);
120 120
121 121
122 for (int i = 0; i < buddycount; i++) 122 for (int i = 0; i < buddycount; i++)
123 { 123 {
124 FriendListItem buddylistitem = new FriendListItem(); 124 FriendListItem buddylistitem = new FriendListItem();
@@ -130,8 +130,8 @@ namespace OpenSim.Region.Communications.OGS1
130 130
131 buddylist.Add(buddylistitem); 131 buddylist.Add(buddylistitem);
132 } 132 }
133 133
134 134
135 return buddylist; 135 return buddylist;
136 } 136 }
137 137
@@ -201,7 +201,7 @@ namespace OpenSim.Region.Communications.OGS1
201 /// Get a user profile from the user server 201 /// Get a user profile from the user server
202 /// </summary> 202 /// </summary>
203 /// <param name="avatarID"></param> 203 /// <param name="avatarID"></param>
204 /// <returns>null if the request fails</returns> 204 /// <returns>null if the request fails</returns>
205 public UserProfileData GetUserProfile(string name) 205 public UserProfileData GetUserProfile(string name)
206 { 206 {
207 try 207 try
@@ -222,7 +222,7 @@ namespace OpenSim.Region.Communications.OGS1
222 "[OGS1 USER SERVICES]: Error when trying to fetch profile data by name from remote user server: {0}", 222 "[OGS1 USER SERVICES]: Error when trying to fetch profile data by name from remote user server: {0}",
223 e); 223 e);
224 } 224 }
225 225
226 return null; 226 return null;
227 } 227 }
228 228
@@ -251,7 +251,7 @@ namespace OpenSim.Region.Communications.OGS1
251 "[OGS1 USER SERVICES]: Error when trying to fetch profile data by uuid from remote user server: {0}", 251 "[OGS1 USER SERVICES]: Error when trying to fetch profile data by uuid from remote user server: {0}",
252 e); 252 e);
253 } 253 }
254 254
255 return null; 255 return null;
256 } 256 }
257 257
@@ -264,7 +264,7 @@ namespace OpenSim.Region.Communications.OGS1
264 /// Retrieve the user information for the given master uuid. 264 /// Retrieve the user information for the given master uuid.
265 /// </summary> 265 /// </summary>
266 /// <param name="uuid"></param> 266 /// <param name="uuid"></param>
267 /// <returns></returns> 267 /// <returns></returns>
268 public UserProfileData SetupMasterUser(string firstName, string lastName) 268 public UserProfileData SetupMasterUser(string firstName, string lastName)
269 { 269 {
270 return SetupMasterUser(firstName, lastName, String.Empty); 270 return SetupMasterUser(firstName, lastName, String.Empty);
@@ -274,7 +274,7 @@ namespace OpenSim.Region.Communications.OGS1
274 /// Retrieve the user information for the given master uuid. 274 /// Retrieve the user information for the given master uuid.
275 /// </summary> 275 /// </summary>
276 /// <param name="uuid"></param> 276 /// <param name="uuid"></param>
277 /// <returns></returns> 277 /// <returns></returns>
278 public UserProfileData SetupMasterUser(string firstName, string lastName, string password) 278 public UserProfileData SetupMasterUser(string firstName, string lastName, string password)
279 { 279 {
280 UserProfileData profile = GetUserProfile(firstName, lastName); 280 UserProfileData profile = GetUserProfile(firstName, lastName);
@@ -289,13 +289,13 @@ namespace OpenSim.Region.Communications.OGS1
289 public UserProfileData SetupMasterUser(LLUUID uuid) 289 public UserProfileData SetupMasterUser(LLUUID uuid)
290 { 290 {
291 UserProfileData data = GetUserProfile(uuid); 291 UserProfileData data = GetUserProfile(uuid);
292 292
293 if (data == null) 293 if (data == null)
294 { 294 {
295 throw new Exception( 295 throw new Exception(
296 "Could not retrieve profile for master user " + uuid + ". User server did not respond to the request."); 296 "Could not retrieve profile for master user " + uuid + ". User server did not respond to the request.");
297 } 297 }
298 298
299 return data; 299 return data;
300 } 300 }
301 301
@@ -405,9 +405,9 @@ namespace OpenSim.Region.Communications.OGS1
405 { 405 {
406 m_log.Warn("[GRID]: Error when trying to AddNewUserFriend: " + 406 m_log.Warn("[GRID]: Error when trying to AddNewUserFriend: " +
407 e.Message); 407 e.Message);
408 408
409 } 409 }
410 410
411 } 411 }
412 412
413 /// <summary> 413 /// <summary>
@@ -422,7 +422,7 @@ namespace OpenSim.Region.Communications.OGS1
422 Hashtable param = new Hashtable(); 422 Hashtable param = new Hashtable();
423 param["ownerID"] = friendlistowner.UUID.ToString(); 423 param["ownerID"] = friendlistowner.UUID.ToString();
424 param["friendID"] = friend.UUID.ToString(); 424 param["friendID"] = friend.UUID.ToString();
425 425
426 426
427 IList parameters = new ArrayList(); 427 IList parameters = new ArrayList();
428 parameters.Add(param); 428 parameters.Add(param);
@@ -458,7 +458,7 @@ namespace OpenSim.Region.Communications.OGS1
458 { 458 {
459 m_log.Warn("[GRID]: Error when trying to RemoveUserFriend: " + 459 m_log.Warn("[GRID]: Error when trying to RemoveUserFriend: " +
460 e.Message); 460 e.Message);
461 461
462 } 462 }
463 } 463 }
464 464
@@ -519,7 +519,7 @@ namespace OpenSim.Region.Communications.OGS1
519 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) 519 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
520 { 520 {
521 List<FriendListItem> buddylist = new List<FriendListItem>(); 521 List<FriendListItem> buddylist = new List<FriendListItem>();
522 522
523 try 523 try
524 { 524 {
525 Hashtable param = new Hashtable(); 525 Hashtable param = new Hashtable();
@@ -531,11 +531,11 @@ namespace OpenSim.Region.Communications.OGS1
531 XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000); 531 XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000);
532 Hashtable respData = (Hashtable) resp.Value; 532 Hashtable respData = (Hashtable) resp.Value;
533 533
534 if (respData.Contains("avcount")) 534 if (respData.Contains("avcount"))
535 { 535 {
536 buddylist = ConvertXMLRPCDataToFriendListItemList(respData); 536 buddylist = ConvertXMLRPCDataToFriendListItemList(respData);
537 } 537 }
538 538
539 } 539 }
540 catch (WebException e) 540 catch (WebException e)
541 { 541 {
@@ -550,7 +550,7 @@ namespace OpenSim.Region.Communications.OGS1
550 550
551 /// Appearance 551 /// Appearance
552 /// TODO: stubs for now to get us to a compiling state gently 552 /// TODO: stubs for now to get us to a compiling state gently
553 public AvatarAppearance GetUserAppearance(LLUUID user) 553 public AvatarAppearance GetUserAppearance(LLUUID user)
554 { 554 {
555 return new AvatarAppearance(); 555 return new AvatarAppearance();
556 } 556 }
@@ -564,12 +564,12 @@ namespace OpenSim.Region.Communications.OGS1
564 { 564 {
565 return; 565 return;
566 } 566 }
567 567
568 public void RemoveAttachment(LLUUID user, LLUUID item) 568 public void RemoveAttachment(LLUUID user, LLUUID item)
569 { 569 {
570 return; 570 return;
571 } 571 }
572 572
573 public List<LLUUID> GetAttachments(LLUUID user) 573 public List<LLUUID> GetAttachments(LLUUID user)
574 { 574 {
575 return new List<LLUUID>(); 575 return new List<LLUUID>();
diff --git a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
index 964180a..c15c604 100644
--- a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30 30
31// General Information about an assembly is controlled through the following 31// General information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information 32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly. 33// associated with an assembly.
34 34
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
41[assembly : AssemblyTrademark("")] 41[assembly : AssemblyTrademark("")]
42[assembly : AssemblyCulture("")] 42[assembly : AssemblyCulture("")]
43 43
44// Setting ComVisible to false makes the types in this assembly not visible 44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from 45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type. 46// COM, set the ComVisible attribute to true on that type.
47 47
48[assembly : ComVisible(false)] 48[assembly : ComVisible(false)]
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
54// Version information for an assembly consists of the following four values: 54// Version information for an assembly consists of the following four values:
55// 55//
56// Major Version 56// Major Version
57// Minor Version 57// Minor Version
58// Build Number 58// Build Number
59// Revision 59// Revision
60// 60//
61// You can specify all the values or you can default the Revision and Build Numbers 61// You can specify all the values or you can default the Revision and Build Numbers
62// by using the '*' as shown below: 62// by using the '*' as shown below:
63 63
64[assembly : AssemblyVersion("1.0.0.0")] 64[assembly : AssemblyVersion("1.0.0.0")]
diff --git a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs
index 2b18871..e08934b 100644
--- a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs
+++ b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs
@@ -23,7 +23,7 @@
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*/
28 28
29using System.Collections; 29using System.Collections;
@@ -65,7 +65,7 @@ namespace OpenSim.Region.DataSnapshot
65 reply["str_response_string"] = response.OuterXml; 65 reply["str_response_string"] = response.OuterXml;
66 reply["int_response_code"] = statuscode; 66 reply["int_response_code"] = statuscode;
67 reply["content_type"] = "text/xml"; 67 reply["content_type"] = "text/xml";
68 68
69 return reply; 69 return reply;
70 } 70 }
71 } 71 }
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
index 5831ddc..af3e547 100644
--- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
+++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
@@ -23,7 +23,7 @@
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*/
28 28
29using System; 29using System;
@@ -70,14 +70,14 @@ namespace OpenSim.Region.DataSnapshot
70 #region IRegionModule 70 #region IRegionModule
71 public void Close() 71 public void Close()
72 { 72 {
73 73
74 } 74 }
75 75
76 public void Initialise(Scene scene, IConfigSource config) 76 public void Initialise(Scene scene, IConfigSource config)
77 { 77 {
78 if (!m_scenes.Contains(scene)) 78 if (!m_scenes.Contains(scene))
79 m_scenes.Add(scene); 79 m_scenes.Add(scene);
80 80
81 if (!m_configLoaded) 81 if (!m_configLoaded)
82 { 82 {
83 m_configLoaded = true; 83 m_configLoaded = true;
@@ -317,7 +317,7 @@ namespace OpenSim.Region.DataSnapshot
317 317
318 private String GetRegionCategory(Scene scene) 318 private String GetRegionCategory(Scene scene)
319 { 319 {
320 320
321 //Boolean choice between: 321 //Boolean choice between:
322 // "PG" - Mormontown 322 // "PG" - Mormontown
323 // "Mature" - Sodom and Gomorrah 323 // "Mature" - Sodom and Gomorrah
@@ -396,7 +396,7 @@ namespace OpenSim.Region.DataSnapshot
396 } 396 }
397 397
398 /** 398 /**
399 * Reply to the http request 399 * Reply to the http request
400 */ 400 */
401 public XmlDocument GetSnapshot(string regionName) 401 public XmlDocument GetSnapshot(string regionName)
402 { 402 {
diff --git a/OpenSim/Region/DataSnapshot/Interfaces/IDataSnapshotProvider.cs b/OpenSim/Region/DataSnapshot/Interfaces/IDataSnapshotProvider.cs
index 9f19b43..fb9c51a 100644
--- a/OpenSim/Region/DataSnapshot/Interfaces/IDataSnapshotProvider.cs
+++ b/OpenSim/Region/DataSnapshot/Interfaces/IDataSnapshotProvider.cs
@@ -23,7 +23,7 @@
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*/
28 28
29using System.Xml; 29using System.Xml;
diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs
index b60232b..183c2a3 100644
--- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs
@@ -23,7 +23,7 @@
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*/
28 28
29using System; 29using System;
@@ -51,9 +51,9 @@ namespace OpenSim.Region.DataSnapshot
51 51
52 /* 52 /*
53 * David, I don't think we need this at all. When we do the snapshot, we can 53 * David, I don't think we need this at all. When we do the snapshot, we can
54 * simply look into the parcels that are marked for ShowDirectory -- see 54 * simply look into the parcels that are marked for ShowDirectory -- see
55 * conditional in RequestSnapshotData 55 * conditional in RequestSnapshotData
56 * 56 *
57 //Revise this, look for more direct way of checking for change in land 57 //Revise this, look for more direct way of checking for change in land
58 #region Client hooks 58 #region Client hooks
59 59
@@ -115,7 +115,7 @@ namespace OpenSim.Region.DataSnapshot
115 } 115 }
116 116
117 public XmlNode RequestSnapshotData(XmlDocument nodeFactory) 117 public XmlNode RequestSnapshotData(XmlDocument nodeFactory)
118 { 118 {
119 ILandChannel landChannel = (LandChannel)m_scene.LandChannel; 119 ILandChannel landChannel = (LandChannel)m_scene.LandChannel;
120 Dictionary<int, ILandObject> landList = null; 120 Dictionary<int, ILandObject> landList = null;
121 try 121 try
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
index b2ef6d3..3270c3a 100644
--- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.DataSnapshot
58 foreach (EntityBase entity in m_scene.Entities.Values) 58 foreach (EntityBase entity in m_scene.Entities.Values)
59 { 59 {
60 // only objects, not avatars 60 // only objects, not avatars
61 if (entity is SceneObjectGroup) 61 if (entity is SceneObjectGroup)
62 { 62 {
63 SceneObjectGroup obj = (SceneObjectGroup)entity; 63 SceneObjectGroup obj = (SceneObjectGroup)entity;
64 64
diff --git a/OpenSim/Region/Environment/InstantMessageReceiver.cs b/OpenSim/Region/Environment/InstantMessageReceiver.cs
index b82b4aa..d82bffc 100644
--- a/OpenSim/Region/Environment/InstantMessageReceiver.cs
+++ b/OpenSim/Region/Environment/InstantMessageReceiver.cs
@@ -32,11 +32,11 @@ namespace OpenSim.Region.Environment
32 /// <summary> 32 /// <summary>
33 /// Bit Vector for Which Modules to send an instant message to from the Scene or an Associated Module 33 /// Bit Vector for Which Modules to send an instant message to from the Scene or an Associated Module
34 /// </summary> 34 /// </summary>
35 35
36 // This prevents the Modules from sending Instant messages to other modules through the scene 36 // This prevents the Modules from sending Instant messages to other modules through the scene
37 // and then receiving the same messages 37 // and then receiving the same messages
38 38
39 // This is mostly here because on LLSL and the SecondLife Client, IMs,Groups and friends are linked 39 // This is mostly here because on LLSL and the SecondLife Client, IMs,Groups and friends are linked
40 // inseparably 40 // inseparably
41 41
42 [Flags] 42 [Flags]
diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
index 86958d1..d03e167 100644
--- a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
+++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
@@ -31,7 +31,7 @@ using OpenSim.Region.Environment.Scenes;
31 31
32namespace OpenSim.Region.Environment.Interfaces 32namespace OpenSim.Region.Environment.Interfaces
33{ 33{
34 public interface IAvatarFactory 34 public interface IAvatarFactory
35 { 35 {
36 bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance); 36 bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance);
37 void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance); 37 void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance);
diff --git a/OpenSim/Region/Environment/Interfaces/IScenePermissions.cs b/OpenSim/Region/Environment/Interfaces/IScenePermissions.cs
index f28b46c..eba4a04 100644
--- a/OpenSim/Region/Environment/Interfaces/IScenePermissions.cs
+++ b/OpenSim/Region/Environment/Interfaces/IScenePermissions.cs
@@ -28,7 +28,7 @@
28using libsecondlife; 28using libsecondlife;
29 29
30namespace OpenSim.Region.Environment.Interfaces 30namespace OpenSim.Region.Environment.Interfaces
31{ 31{
32 public interface IScenePermissions 32 public interface IScenePermissions
33 { 33 {
34 } 34 }
diff --git a/OpenSim/Region/Environment/Interfaces/ITextureSender.cs b/OpenSim/Region/Environment/Interfaces/ITextureSender.cs
index 1b9e4eb..ece1953 100644
--- a/OpenSim/Region/Environment/Interfaces/ITextureSender.cs
+++ b/OpenSim/Region/Environment/Interfaces/ITextureSender.cs
@@ -31,17 +31,17 @@ namespace OpenSim.Region.Environment.Interfaces
31 /// Interface for an object which can send texture information to a client 31 /// Interface for an object which can send texture information to a client
32 /// </summary> 32 /// </summary>
33 public interface ITextureSender 33 public interface ITextureSender
34 { 34 {
35 /// <summary> 35 /// <summary>
36 /// Are we in the process of sending the texture? 36 /// Are we in the process of sending the texture?
37 /// </summary> 37 /// </summary>
38 bool Sending { get; set; } 38 bool Sending { get; set; }
39 39
40 /// <summary> 40 /// <summary>
41 /// Has the texture send been cancelled? 41 /// Has the texture send been cancelled?
42 /// </summary> 42 /// </summary>
43 bool Cancel { get; set; } 43 bool Cancel { get; set; }
44 44
45 /// <summary> 45 /// <summary>
46 /// Update the non data properties of a texture request 46 /// Update the non data properties of a texture request
47 /// </summary> 47 /// </summary>
@@ -53,6 +53,6 @@ namespace OpenSim.Region.Environment.Interfaces
53 /// Send a texture packet to the client. 53 /// Send a texture packet to the client.
54 /// </summary> 54 /// </summary>
55 /// <returns>True if the last packet has been sent, false otherwise.</returns> 55 /// <returns>True if the last packet has been sent, false otherwise.</returns>
56 bool SendTexturePacket(); 56 bool SendTexturePacket();
57 } 57 }
58} 58}
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
index 48db51b..d3cf41e 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
@@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
216 public IClientAPI RequestUser; 216 public IClientAPI RequestUser;
217 public LLUUID TransferRequestID; 217 public LLUUID TransferRequestID;
218 //public bool AssetInCache; 218 //public bool AssetInCache;
219 //public int TimeRequested; 219 //public int TimeRequested;
220 220
221 public AssetRequest() 221 public AssetRequest()
222 { 222 {
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index bae23fa..65785af 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
40 /// </summary> 40 /// </summary>
41 public class AgentAssetTransactions 41 public class AgentAssetTransactions
42 { 42 {
43 //private static readonly log4net.ILog m_log 43 //private static readonly log4net.ILog m_log
44 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 44 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 // Fields 46 // Fields
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
192 } 192 }
193 193
194 ourClient.SendConfirmXfer(xferID, packetID); 194 ourClient.SendConfirmXfer(xferID, packetID);
195 195
196 if ((packetID & 0x80000000) != 0) 196 if ((packetID & 0x80000000) != 0)
197 { 197 {
198 SendCompleteMessage(); 198 SendCompleteMessage();
@@ -209,7 +209,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
209 /// <param name="xferID"></param> 209 /// <param name="xferID"></param>
210 /// <param name="packetID"></param> 210 /// <param name="packetID"></param>
211 /// <param name="data"></param> 211 /// <param name="data"></param>
212 /// <returns>True if the transfer is complete, false otherwise</returns> 212 /// <returns>True if the transfer is complete, false otherwise</returns>
213 public bool Initialise(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, 213 public bool Initialise(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data,
214 bool storeLocal, bool tempFile) 214 bool storeLocal, bool tempFile)
215 { 215 {
@@ -363,7 +363,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
363 363
364 private void DoCreateItem() 364 private void DoCreateItem()
365 { 365 {
366 //really need to fix this call, if lbsa71 saw this he would die. 366 //really need to fix this call, if lbsa71 saw this he would die.
367 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(Asset); 367 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(Asset);
368 CachedUserInfo userInfo = 368 CachedUserInfo userInfo =
369 m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails(ourClient.AgentId); 369 m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails(ourClient.AgentId);
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
index fcd0e0c..fd407d9 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
@@ -199,7 +199,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
199 199
200 /// <summary> 200 /// <summary>
201 /// Create an inventory item from data that has been received through a transaction. 201 /// Create an inventory item from data that has been received through a transaction.
202 /// 202 ///
203 /// This is called when new clothing or body parts are created. It may also be called in other 203 /// This is called when new clothing or body parts are created. It may also be called in other
204 /// situations. 204 /// situations.
205 /// </summary> 205 /// </summary>
@@ -229,8 +229,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
229 229
230 /// <summary> 230 /// <summary>
231 /// Update an inventory item with data that has been received through a transaction. 231 /// Update an inventory item with data that has been received through a transaction.
232 /// 232 ///
233 /// This is called when clothing or body parts are updated (for instance, with new textures or 233 /// This is called when clothing or body parts are updated (for instance, with new textures or
234 /// colours). It may also be called in other situations. 234 /// colours). It may also be called in other situations.
235 /// </summary> 235 /// </summary>
236 /// <param name="remoteClient"></param> 236 /// <param name="remoteClient"></param>
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
index 474ac75..8f81f3d 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
38{ 38{
39 public class TextureDownloadModule : IRegionModule 39 public class TextureDownloadModule : IRegionModule
40 { 40 {
41 //private static readonly log4net.ILog m_log 41 //private static readonly log4net.ILog m_log
42 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 42 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 /// <summary> 44 /// <summary>
@@ -212,7 +212,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
212 private void TextureSent(ITextureSender sender) 212 private void TextureSent(ITextureSender sender)
213 { 213 {
214 sender.Sending = false; 214 sender.Sending = false;
215 //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID); 215 //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID);
216 m_scene.AddPendingDownloads(-1); 216 m_scene.AddPendingDownloads(-1);
217 } 217 }
218 } 218 }
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
index 70e44d4..7c187c0 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
37 /// </summary> 37 /// </summary>
38 public class TextureNotFoundSender : ITextureSender 38 public class TextureNotFoundSender : ITextureSender
39 { 39 {
40 //private static readonly log4net.ILog m_log 40 //private static readonly log4net.ILog m_log
41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 private bool m_cancel = false; 43 private bool m_cancel = false;
@@ -80,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
80 public bool SendTexturePacket() 80 public bool SendTexturePacket()
81 { 81 {
82 //m_log.InfoFormat( 82 //m_log.InfoFormat(
83 // "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found", 83 // "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found",
84 // m_textureId); 84 // m_textureId);
85 85
86 ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); 86 ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
index d4fa39f..42624ad 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
39{ 39{
40 /// <summary> 40 /// <summary>
41 /// This module sets up texture senders in response to client texture requests, and places them on a 41 /// This module sets up texture senders in response to client texture requests, and places them on a
42 /// processing queue once those senders have the appropriate data (i.e. a texture retrieved from the 42 /// processing queue once those senders have the appropriate data (i.e. a texture retrieved from the
43 /// asset cache). 43 /// asset cache).
44 /// </summary> 44 /// </summary>
45 public class UserTextureDownloadService 45 public class UserTextureDownloadService
@@ -49,7 +49,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
49 49
50 /// <summary> 50 /// <summary>
51 /// We will allow the client to request the same texture n times before dropping further requests 51 /// We will allow the client to request the same texture n times before dropping further requests
52 /// 52 ///
53 /// This number includes repeated requests for the same texture at different resolutions (which we don't 53 /// This number includes repeated requests for the same texture at different resolutions (which we don't
54 /// currently handle properly as far as I know). However, this situation should be handled in a more 54 /// currently handle properly as far as I know). However, this situation should be handled in a more
55 /// sophisticated way. 55 /// sophisticated way.
@@ -80,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
80 /// We're going to limit requests for the same missing texture. 80 /// We're going to limit requests for the same missing texture.
81 /// XXX This is really a temporary solution to deal with the situation where a client continually requests 81 /// XXX This is really a temporary solution to deal with the situation where a client continually requests
82 /// the same missing textures 82 /// the same missing textures
83 /// </summary> 83 /// </summary>
84 private readonly IRequestLimitStrategy<LLUUID> missingTextureLimitStrategy 84 private readonly IRequestLimitStrategy<LLUUID> missingTextureLimitStrategy
85 = new RepeatLimitStrategy<LLUUID>(MAX_ALLOWED_TEXTURE_REQUESTS); 85 = new RepeatLimitStrategy<LLUUID>(MAX_ALLOWED_TEXTURE_REQUESTS);
86 86
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
93 } 93 }
94 94
95 /// <summary> 95 /// <summary>
96 /// Handle a texture request. This involves creating a texture sender and placing it on the 96 /// Handle a texture request. This involves creating a texture sender and placing it on the
97 /// previously passed in shared queue. 97 /// previously passed in shared queue.
98 /// </summary> 98 /// </summary>
99 /// <param name="e"></param> 99 /// <param name="e"></param>
@@ -108,7 +108,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
108 { 108 {
109 if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) 109 if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender))
110 { 110 {
111 // If we've received new non UUID information for this request and it hasn't dispatched 111 // If we've received new non UUID information for this request and it hasn't dispatched
112 // yet, then update the request accordingly. 112 // yet, then update the request accordingly.
113 textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); 113 textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber);
114 } 114 }
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
117 if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) 117 if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID))
118 { 118 {
119// m_log.DebugFormat( 119// m_log.DebugFormat(
120// "[USER TEXTURE DOWNLOAD SERVICE]: Refusing request for {0} from client {1}", 120// "[USER TEXTURE DOWNLOAD SERVICE]: Refusing request for {0} from client {1}",
121// e.RequestedAssetID, m_client.AgentId); 121// e.RequestedAssetID, m_client.AgentId);
122 122
123 return; 123 return;
@@ -128,9 +128,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
128 { 128 {
129 if (StatsManager.SimExtraStats != null) 129 if (StatsManager.SimExtraStats != null)
130 StatsManager.SimExtraStats.AddBlockedMissingTextureRequest(); 130 StatsManager.SimExtraStats.AddBlockedMissingTextureRequest();
131 131
132 // Commenting out this message for now as it causes too much noise with other 132 // Commenting out this message for now as it causes too much noise with other
133 // debug messages. 133 // debug messages.
134// m_log.DebugFormat( 134// m_log.DebugFormat(
135// "[USER TEXTURE DOWNLOAD SERVICE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", 135// "[USER TEXTURE DOWNLOAD SERVICE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests",
136// e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS); 136// e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS);
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
index ea84436..be73156 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
@@ -35,7 +35,7 @@ using OpenSim.Region.Environment.Interfaces;
35namespace OpenSim.Region.Environment.Modules.Agent.TextureSender 35namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// A TextureSender handles the process of receiving a texture requested by the client from the 38 /// A TextureSender handles the process of receiving a texture requested by the client from the
39 /// AssetCache, and then sending that texture back to the client. 39 /// AssetCache, and then sending that texture back to the client.
40 /// </summary> 40 /// </summary>
41 public class TextureSender : ITextureSender 41 public class TextureSender : ITextureSender
@@ -150,14 +150,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
150 { 150 {
151 if (NumPackets == 0) 151 if (NumPackets == 0)
152 { 152 {
153 153
154 RequestUser.SendImagePart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); 154 RequestUser.SendImagePart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2);
155 155
156 PacketCounter++; 156 PacketCounter++;
157 } 157 }
158 else 158 else
159 { 159 {
160 160
161 byte[] ImageData1 = new byte[600]; 161 byte[] ImageData1 = new byte[600];
162 Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); 162 Array.Copy(m_asset.Data, 0, ImageData1, 0, 600);
163 163
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
167 } 167 }
168 else 168 else
169 { 169 {
170 // Doesn't like to be refactored... 170 // Doesn't like to be refactored...
171 ImagePacketPacket im = new ImagePacketPacket(); 171 ImagePacketPacket im = new ImagePacketPacket();
172 im.Header.Reliable = false; 172 im.Header.Reliable = false;
173 im.ImageID.Packet = (ushort)(PacketCounter); 173 im.ImageID.Packet = (ushort)(PacketCounter);
diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
index 1b50bbd..16874d7 100644
--- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
98 } 98 }
99 99
100 /// <summary> 100 /// <summary>
101 /// 101 ///
102 /// </summary> 102 /// </summary>
103 /// <param name="remoteClient"></param> 103 /// <param name="remoteClient"></param>
104 /// <param name="xferID"></param> 104 /// <param name="xferID"></param>
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
index 9e5f376..a72010c 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
@@ -235,7 +235,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
235 { 235 {
236 TrySendChatMessage(presence, fromPos, regionPos, 236 TrySendChatMessage(presence, fromPos, regionPos,
237 fromAgentID, fromName, e.Type, message, ChatSourceType.Agent); 237 fromAgentID, fromName, e.Type, message, ChatSourceType.Agent);
238 238
239 } 239 }
240 }); 240 });
241 } 241 }
@@ -572,7 +572,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
572 string regex = @":(?<nick>\w*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)"; 572 string regex = @":(?<nick>\w*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)";
573 Regex RE = new Regex(regex, RegexOptions.Multiline); 573 Regex RE = new Regex(regex, RegexOptions.Multiline);
574 MatchCollection matches = RE.Matches(input); 574 MatchCollection matches = RE.Matches(input);
575 // Get some direct matches $1 $4 is a 575 // Get some direct matches $1 $4 is a
576 if ((matches.Count == 1) && (matches[0].Groups.Count == 5)) 576 if ((matches.Count == 1) && (matches[0].Groups.Count == 5))
577 { 577 {
578 result = new Dictionary<string, string>(); 578 result = new Dictionary<string, string>();
@@ -703,7 +703,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
703 703
704 public void ProcessIRCCommand(string command) 704 public void ProcessIRCCommand(string command)
705 { 705 {
706 //m_log.Info("[IRC]: ProcessIRCCommand:" + command); 706 //m_log.Info("[IRC]: ProcessIRCCommand:" + command);
707 707
708 string[] commArgs = new string[command.Split(' ').Length]; 708 string[] commArgs = new string[command.Split(' ').Length];
709 string c_server = m_server; 709 string c_server = m_server;
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
index c63fc93..fab546b 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
@@ -46,10 +46,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
46 /// Demo Economy/Money Module. This is not a production quality money/economy module! 46 /// Demo Economy/Money Module. This is not a production quality money/economy module!
47 /// This is a demo for you to use when making one that works for you. 47 /// This is a demo for you to use when making one that works for you.
48 /// // To use the following you need to add: 48 /// // To use the following you need to add:
49 /// -helperuri <ADDRESS TO HERE OR grid MONEY SERVER> 49 /// -helperuri <ADDRESS TO HERE OR grid MONEY SERVER>
50 /// to the command line parameters you use to start up your client 50 /// to the command line parameters you use to start up your client
51 /// This commonly looks like -helperuri http://127.0.0.1:9000/ 51 /// This commonly looks like -helperuri http://127.0.0.1:9000/
52 /// 52 ///
53 /// Centralized grid structure example using OpenSimWi Redux revision 9+ 53 /// Centralized grid structure example using OpenSimWi Redux revision 9+
54 /// svn co https://opensimwiredux.svn.sourceforge.net/svnroot/opensimwiredux 54 /// svn co https://opensimwiredux.svn.sourceforge.net/svnroot/opensimwiredux
55 /// </summary> 55 /// </summary>
@@ -147,7 +147,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
147 XMLRPCHandler = scene; 147 XMLRPCHandler = scene;
148 148
149 // To use the following you need to add: 149 // To use the following you need to add:
150 // -helperuri <ADDRESS TO HERE OR grid MONEY SERVER> 150 // -helperuri <ADDRESS TO HERE OR grid MONEY SERVER>
151 // to the command line parameters you use to start up your client 151 // to the command line parameters you use to start up your client
152 // This commonly looks like -helperuri http://127.0.0.1:9000/ 152 // This commonly looks like -helperuri http://127.0.0.1:9000/
153 153
@@ -276,7 +276,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
276 private void OnNewClient(IClientAPI client) 276 private void OnNewClient(IClientAPI client)
277 { 277 {
278 // Here we check if we're in grid mode 278 // Here we check if we're in grid mode
279 // I imagine that the 'check balance' 279 // I imagine that the 'check balance'
280 // function for the client should be here or shortly after 280 // function for the client should be here or shortly after
281 281
282 if (gridmode) 282 if (gridmode)
@@ -367,7 +367,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
367 { 367 {
368 lock (m_KnownClientFunds) 368 lock (m_KnownClientFunds)
369 { 369 {
370 // If we don't know about the sender, then the sender can't 370 // If we don't know about the sender, then the sender can't
371 // actually be here and therefore this is likely fraud or outdated. 371 // actually be here and therefore this is likely fraud or outdated.
372 if (m_MoneyAddress.Length == 0) 372 if (m_MoneyAddress.Length == 0)
373 { 373 {
@@ -1394,7 +1394,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1394 1394
1395 1395
1396 m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID; 1396 m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID;
1397 1397
1398 1398
1399 //m_log.Info("[MONEY]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); 1399 //m_log.Info("[MONEY]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + ".");
1400 // Claim User! my user! Mine mine mine! 1400 // Claim User! my user! Mine mine mine!
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
index 8c96392..c82f88d 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
@@ -97,9 +97,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
97 private void OnNewClient(IClientAPI client) 97 private void OnNewClient(IClientAPI client)
98 { 98 {
99 // All friends establishment protocol goes over instant message 99 // All friends establishment protocol goes over instant message
100 // There's no way to send a message from the sim 100 // There's no way to send a message from the sim
101 // to a user to 'add a friend' without causing dialog box spam 101 // to a user to 'add a friend' without causing dialog box spam
102 // 102 //
103 // The base set of friends are added when the user signs on in their XMLRPC response 103 // The base set of friends are added when the user signs on in their XMLRPC response
104 // Generated by LoginService. The friends are retreived from the database by the UserManager 104 // Generated by LoginService. The friends are retreived from the database by the UserManager
105 105
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
167 LLUUID[] Agents = new LLUUID[1]; 167 LLUUID[] Agents = new LLUUID[1];
168 Agents[0] = client.AgentId; 168 Agents[0] = client.AgentId;
169 av.ControllingClient.SendAgentOnline(Agents); 169 av.ControllingClient.SendAgentOnline(Agents);
170 170
171 } 171 }
172 } 172 }
173 } 173 }
@@ -223,14 +223,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
223 } 223 }
224 catch (IndexOutOfRangeException) 224 catch (IndexOutOfRangeException)
225 { 225 {
226 // Ignore the index out of range exception. 226 // Ignore the index out of range exception.
227 // This causes friend lists to get out of sync slightly.. however 227 // This causes friend lists to get out of sync slightly.. however
228 // prevents a sim crash. 228 // prevents a sim crash.
229 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off"); 229 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off");
230 } 230 }
231 catch (ArgumentOutOfRangeException) 231 catch (ArgumentOutOfRangeException)
232 { 232 {
233 // Ignore the index out of range exception. 233 // Ignore the index out of range exception.
234 // This causes friend lists to get out of sync slightly.. however 234 // This causes friend lists to get out of sync slightly.. however
235 // prevents a sim crash. 235 // prevents a sim crash.
236 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off"); 236 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off");
@@ -248,14 +248,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
248 248
249 catch (IndexOutOfRangeException) 249 catch (IndexOutOfRangeException)
250 { 250 {
251 // Ignore the index out of range exception. 251 // Ignore the index out of range exception.
252 // This causes friend lists to get out of sync slightly.. however 252 // This causes friend lists to get out of sync slightly.. however
253 // prevents a sim crash. 253 // prevents a sim crash.
254 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off"); 254 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off");
255 } 255 }
256 catch (ArgumentOutOfRangeException) 256 catch (ArgumentOutOfRangeException)
257 { 257 {
258 // Ignore the index out of range exception. 258 // Ignore the index out of range exception.
259 // This causes friend lists to get out of sync slightly.. however 259 // This causes friend lists to get out of sync slightly.. however
260 // prevents a sim crash. 260 // prevents a sim crash.
261 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off"); 261 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off");
@@ -411,10 +411,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
411 { 411 {
412 if (m_pendingFriendRequests.ContainsKey(transactionID)) 412 if (m_pendingFriendRequests.ContainsKey(transactionID))
413 { 413 {
414 // Found Pending Friend Request with that Transaction.. 414 // Found Pending Friend Request with that Transaction..
415 Scene SceneAgentIn = m_scene[0]; 415 Scene SceneAgentIn = m_scene[0];
416 416
417 // Found Pending Friend Request with that Transaction.. 417 // Found Pending Friend Request with that Transaction..
418 ScenePresence agentpresence = GetPresenceFromAgentID(agentID); 418 ScenePresence agentpresence = GetPresenceFromAgentID(agentID);
419 if (agentpresence != null) 419 if (agentpresence != null)
420 { 420 {
@@ -453,7 +453,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
453 { 453 {
454 Scene SceneAgentIn = m_scene[0]; 454 Scene SceneAgentIn = m_scene[0];
455 455
456 // Found Pending Friend Request with that Transaction.. 456 // Found Pending Friend Request with that Transaction..
457 ScenePresence agentpresence = GetPresenceFromAgentID(agentID); 457 ScenePresence agentpresence = GetPresenceFromAgentID(agentID);
458 if (agentpresence != null) 458 if (agentpresence != null)
459 { 459 {
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
index 624f307..e1cc688 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory
107 107
108 // First byte of the array is probably the item type 108 // First byte of the array is probably the item type
109 // Next 16 bytes are the UUID 109 // Next 16 bytes are the UUID
110 //Array.Copy(binaryBucket, 1, rawId, 0, 16); 110 //Array.Copy(binaryBucket, 1, rawId, 0, 16);
111 111
112 //LLUUID itemId = new LLUUID(new Guid(rawId)); 112 //LLUUID itemId = new LLUUID(new Guid(rawId));
113 LLUUID itemId = new LLUUID(binaryBucket, 1); 113 LLUUID itemId = new LLUUID(binaryBucket, 1);
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs
index 15825b6..2e2be7a 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles
86 } 86 }
87 87
88 /// <summary> 88 /// <summary>
89 /// 89 ///
90 /// </summary> 90 /// </summary>
91 /// <param name="remoteClient"></param> 91 /// <param name="remoteClient"></param>
92 /// <param name="avatarID"></param> 92 /// <param name="avatarID"></param>
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs
index 2112f91..f8651a3 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs
@@ -226,7 +226,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice
226 public string ProvisionVoiceAccountRequest(string request, string path, string param, 226 public string ProvisionVoiceAccountRequest(string request, string path, string param,
227 LLUUID agentID, Caps caps) 227 LLUUID agentID, Caps caps)
228 { 228 {
229 // we need to 229 // we need to
230 // - get user data from UserProfileCacheService 230 // - get user data from UserProfileCacheService
231 // - generate nonce for user voice account password 231 // - generate nonce for user voice account password
232 // - issue XmlRpc request to asterisk opensim front end: 232 // - issue XmlRpc request to asterisk opensim front end:
diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index e1339a3..87ecfee 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -40,25 +40,25 @@ using OpenSim.Region.Environment.Scenes;
40/***************************************************** 40/*****************************************************
41 * 41 *
42 * ScriptsHttpRequests 42 * ScriptsHttpRequests
43 * 43 *
44 * Implements the llHttpRequest and http_response 44 * Implements the llHttpRequest and http_response
45 * callback. 45 * callback.
46 * 46 *
47 * Some stuff was already in LSLLongCmdHandler, and then 47 * Some stuff was already in LSLLongCmdHandler, and then
48 * there was this file with a stub class in it. So, 48 * there was this file with a stub class in it. So,
49 * I am moving some of the objects and functions out of 49 * I am moving some of the objects and functions out of
50 * LSLLongCmdHandler, such as the HttpRequestClass, the 50 * LSLLongCmdHandler, such as the HttpRequestClass, the
51 * start and stop methods, and setting up pending and 51 * start and stop methods, and setting up pending and
52 * completed queues. These are processed in the 52 * completed queues. These are processed in the
53 * LSLLongCmdHandler polling loop. Similiar to the 53 * LSLLongCmdHandler polling loop. Similiar to the
54 * XMLRPCModule, since that seems to work. 54 * XMLRPCModule, since that seems to work.
55 * 55 *
56 * //TODO 56 * //TODO
57 * 57 *
58 * This probably needs some throttling mechanism but 58 * This probably needs some throttling mechanism but
59 * its wide open right now. This applies to both 59 * its wide open right now. This applies to both
60 * number of requests and data volume. 60 * number of requests and data volume.
61 * 61 *
62 * Linden puts all kinds of header fields in the requests. 62 * Linden puts all kinds of header fields in the requests.
63 * Not doing any of that: 63 * Not doing any of that:
64 * User-Agent 64 * User-Agent
@@ -71,13 +71,13 @@ using OpenSim.Region.Environment.Scenes;
71 * X-SecondLife-Local-Rotation 71 * X-SecondLife-Local-Rotation
72 * X-SecondLife-Owner-Name 72 * X-SecondLife-Owner-Name
73 * X-SecondLife-Owner-Key 73 * X-SecondLife-Owner-Key
74 * 74 *
75 * HTTPS support 75 * HTTPS support
76 * 76 *
77 * Configurable timeout? 77 * Configurable timeout?
78 * Configurable max repsonse size? 78 * Configurable max repsonse size?
79 * Configurable 79 * Configurable
80 * 80 *
81 * **************************************************/ 81 * **************************************************/
82 82
83namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest 83namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
diff --git a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs
index 626c60f..bbd4fa3 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs
@@ -226,7 +226,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender
226 foreach (string line in lines) 226 foreach (string line in lines)
227 { 227 {
228 string nextLine = line.Trim(); 228 string nextLine = line.Trim();
229 //replace with switch, or even better, do some proper parsing 229 //replace with switch, or even better, do some proper parsing
230 if (nextLine.StartsWith("MoveTo")) 230 if (nextLine.StartsWith("MoveTo"))
231 { 231 {
232 float x = 0; 232 float x = 0;
diff --git a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs
index 7a15708..4ed0fb5 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs
@@ -37,25 +37,25 @@ using OpenSim.Region.Environment.Scenes;
37/***************************************************** 37/*****************************************************
38 * 38 *
39 * WorldCommModule 39 * WorldCommModule
40 * 40 *
41 * 41 *
42 * Holding place for world comms - basically llListen 42 * Holding place for world comms - basically llListen
43 * function implementation. 43 * function implementation.
44 * 44 *
45 * lLListen(integer channel, string name, key id, string msg) 45 * lLListen(integer channel, string name, key id, string msg)
46 * The name, id, and msg arguments specify the filtering 46 * The name, id, and msg arguments specify the filtering
47 * criteria. You can pass the empty string 47 * criteria. You can pass the empty string
48 * (or NULL_KEY for id) for these to set a completely 48 * (or NULL_KEY for id) for these to set a completely
49 * open filter; this causes the listen() event handler to be 49 * open filter; this causes the listen() event handler to be
50 * invoked for all chat on the channel. To listen only 50 * invoked for all chat on the channel. To listen only
51 * for chat spoken by a specific object or avatar, 51 * for chat spoken by a specific object or avatar,
52 * specify the name and/or id arguments. To listen 52 * specify the name and/or id arguments. To listen
53 * only for a specific command, specify the 53 * only for a specific command, specify the
54 * (case-sensitive) msg argument. If msg is not empty, 54 * (case-sensitive) msg argument. If msg is not empty,
55 * listener will only hear strings which are exactly equal 55 * listener will only hear strings which are exactly equal
56 * to msg. You can also use all the arguments to establish 56 * to msg. You can also use all the arguments to establish
57 * the most restrictive filtering criteria. 57 * the most restrictive filtering criteria.
58 * 58 *
59 * It might be useful for each listener to maintain a message 59 * It might be useful for each listener to maintain a message
60 * digest, with a list of recent messages by UUID. This can 60 * digest, with a list of recent messages by UUID. This can
61 * be used to prevent in-world repeater loops. However, the 61 * be used to prevent in-world repeater loops. However, the
@@ -76,7 +76,7 @@ using OpenSim.Region.Environment.Scenes;
76 * Might be actually easier to map the global handle into 76 * Might be actually easier to map the global handle into
77 * script-local handle in the ScriptEngine. Not sure if its 77 * script-local handle in the ScriptEngine. Not sure if its
78 * worth the effort tho. 78 * worth the effort tho.
79 * 79 *
80 * **************************************************/ 80 * **************************************************/
81 81
82namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm 82namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
@@ -317,9 +317,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
317 } 317 }
318 318
319 /******************************************************************** 319 /********************************************************************
320 * 320 *
321 * Listener Stuff 321 * Listener Stuff
322 * 322 *
323 * *****************************************************************/ 323 * *****************************************************************/
324 324
325 private void DeliverClientMessage(Object sender, ChatFromViewerArgs e) 325 private void DeliverClientMessage(Object sender, ChatFromViewerArgs e)
diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
index a039d42..9d4e0fa 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
@@ -43,12 +43,12 @@ using OpenSim.Region.Environment.Scenes;
43/***************************************************** 43/*****************************************************
44 * 44 *
45 * XMLRPCModule 45 * XMLRPCModule
46 * 46 *
47 * Module for accepting incoming communications from 47 * Module for accepting incoming communications from
48 * external XMLRPC client and calling a remote data 48 * external XMLRPC client and calling a remote data
49 * procedure for a registered data channel/prim. 49 * procedure for a registered data channel/prim.
50 * 50 *
51 * 51 *
52 * 1. On module load, open a listener port 52 * 1. On module load, open a listener port
53 * 2. Attach an XMLRPC handler 53 * 2. Attach an XMLRPC handler
54 * 3. When a request is received: 54 * 3. When a request is received:
@@ -59,18 +59,18 @@ using OpenSim.Region.Environment.Scenes;
59 * 3.5 Return response to client caller 59 * 3.5 Return response to client caller
60 * 3.6 If no response from llRemoteDataReply within 60 * 3.6 If no response from llRemoteDataReply within
61 * RemoteReplyScriptTimeout, generate script timeout fault 61 * RemoteReplyScriptTimeout, generate script timeout fault
62 * 62 *
63 * Prims in script must: 63 * Prims in script must:
64 * 1. Open a remote data channel 64 * 1. Open a remote data channel
65 * 1.1 Generate a channel ID 65 * 1.1 Generate a channel ID
66 * 1.2 Register primid,channelid pair with module 66 * 1.2 Register primid,channelid pair with module
67 * 2. Implement the remote data procedure handler 67 * 2. Implement the remote data procedure handler
68 * 68 *
69 * llOpenRemoteDataChannel 69 * llOpenRemoteDataChannel
70 * llRemoteDataReply 70 * llRemoteDataReply
71 * remote_data(integer type, key channel, key messageid, string sender, integer ival, string sval) 71 * remote_data(integer type, key channel, key messageid, string sender, integer ival, string sval)
72 * llCloseRemoteDataChannel 72 * llCloseRemoteDataChannel
73 * 73 *
74 * **************************************************/ 74 * **************************************************/
75 75
76namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC 76namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
@@ -157,16 +157,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
157 157
158 /********************************************** 158 /**********************************************
159 * OpenXMLRPCChannel 159 * OpenXMLRPCChannel
160 * 160 *
161 * Generate a LLUUID channel key and add it and 161 * Generate a LLUUID channel key and add it and
162 * the prim id to dictionary <channelUUID, primUUID> 162 * the prim id to dictionary <channelUUID, primUUID>
163 * 163 *
164 * First check if there is a channel assigned for 164 * First check if there is a channel assigned for
165 * this itemID. If there is, then someone called 165 * this itemID. If there is, then someone called
166 * llOpenRemoteDataChannel twice. Just return the 166 * llOpenRemoteDataChannel twice. Just return the
167 * original channel. Other option is to delete the 167 * original channel. Other option is to delete the
168 * current channel and assign a new one. 168 * current channel and assign a new one.
169 * 169 *
170 * ********************************************/ 170 * ********************************************/
171 171
172 public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID) 172 public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID)
@@ -224,9 +224,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
224 224
225 /********************************************** 225 /**********************************************
226 * Remote Data Reply 226 * Remote Data Reply
227 * 227 *
228 * Response to RPC message 228 * Response to RPC message
229 * 229 *
230 *********************************************/ 230 *********************************************/
231 231
232 public void RemoteDataReply(string channel, string message_id, string sdata, int idata) 232 public void RemoteDataReply(string channel, string message_id, string sdata, int idata)
@@ -245,9 +245,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
245 245
246 /********************************************** 246 /**********************************************
247 * CloseXMLRPCChannel 247 * CloseXMLRPCChannel
248 * 248 *
249 * Remove channel from dictionary 249 * Remove channel from dictionary
250 * 250 *
251 *********************************************/ 251 *********************************************/
252 252
253 public void CloseXMLRPCChannel(LLUUID channelKey) 253 public void CloseXMLRPCChannel(LLUUID channelKey)
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
index b5d5e6e..82341a9 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
41 #region Constants 41 #region Constants
42 42
43 //Land types set with flags in ParcelOverlay. 43 //Land types set with flags in ParcelOverlay.
44 //Only one of these can be used. 44 //Only one of these can be used.
45 public const float BAN_LINE_SAFETY_HIEGHT = 100; 45 public const float BAN_LINE_SAFETY_HIEGHT = 100;
46 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000 46 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000
47 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000 47 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000
@@ -584,7 +584,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
584 if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) 584 if (byteArrayCount >= LAND_BLOCKS_PER_PACKET)
585 { 585 {
586 remote_client.sendLandParcelOverlay(byteArray, sequenceID); 586 remote_client.sendLandParcelOverlay(byteArray, sequenceID);
587 byteArrayCount = 0; 587 byteArrayCount = 0;
588 sequenceID++; 588 sequenceID++;
589 byteArray = new byte[LAND_BLOCKS_PER_PACKET]; 589 byteArray = new byte[LAND_BLOCKS_PER_PACKET];
590 } 590 }
@@ -655,7 +655,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
655 655
656 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) 656 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client)
657 { 657 {
658 658
659 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); 659 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client);
660 } 660 }
661 661
@@ -870,7 +870,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
870 } 870 }
871 871
872 public void handleAnyClientMovement(ScenePresence avatar) 872 public void handleAnyClientMovement(ScenePresence avatar)
873 //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance. 873 //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance.
874 { 874 {
875 ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); 875 ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
876 if (over != null) 876 if (over != null)
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
index b319370..54870d8 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
@@ -622,7 +622,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
622 /// <summary> 622 /// <summary>
623 /// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes 623 /// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes
624 /// aggreagete details such as the number of prims. 624 /// aggreagete details such as the number of prims.
625 /// 625 ///
626 /// </summary> 626 /// </summary>
627 /// <param name="remote_client"> 627 /// <param name="remote_client">
628 /// A <see cref="IClientAPI"/> 628 /// A <see cref="IClientAPI"/>
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index d31a250..43e8f36 100644
--- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
47 47
48 #region Constants 48 #region Constants
49 // These are here for testing. They will be taken out 49 // These are here for testing. They will be taken out
50 50
51 //private uint PERM_ALL = (uint)2147483647; 51 //private uint PERM_ALL = (uint)2147483647;
52 private uint PERM_COPY = (uint)32768; 52 private uint PERM_COPY = (uint)32768;
53 //private uint PERM_MODIFY = (uint)16384; 53 //private uint PERM_MODIFY = (uint)16384;
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
59 59
60 #region Bypass Permissions / Debug Permissions Stuff 60 #region Bypass Permissions / Debug Permissions Stuff
61 61
62 // Bypasses the permissions engine 62 // Bypasses the permissions engine
63 private bool m_bypassPermissions = false; 63 private bool m_bypassPermissions = false;
64 private bool m_bypassPermissionsValue = true; 64 private bool m_bypassPermissionsValue = true;
65 private bool m_debugPermissions = false; 65 private bool m_debugPermissions = false;
@@ -126,18 +126,18 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
126 public void Initialise(Scene scene, IConfigSource config) 126 public void Initialise(Scene scene, IConfigSource config)
127 { 127 {
128 m_scene = scene; 128 m_scene = scene;
129 129
130 IConfig myConfig = config.Configs["Startup"]; 130 IConfig myConfig = config.Configs["Startup"];
131
132 string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
133 131
134 List<string> modules=new List<string>(permissionModules.Split(',')); 132 string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
133
134 List<string> modules=new List<string>(permissionModules.Split(','));
135 135
136 if(!modules.Contains("DefaultPermissionsModule")) 136 if (!modules.Contains("DefaultPermissionsModule"))
137 return; 137 return;
138
139 m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
138 140
139 m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
140
141 m_scene.RegisterModuleInterface<IScenePermissions>(this); 141 m_scene.RegisterModuleInterface<IScenePermissions>(this);
142 142
143 //Register functions with Scene External Checks! 143 //Register functions with Scene External Checks!
@@ -212,7 +212,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
212 get { return false; } 212 get { return false; }
213 } 213 }
214 214
215 #endregion 215 #endregion
216 216
217 #region Helper Functions 217 #region Helper Functions
218 protected void SendPermissionError(LLUUID user, string reason) 218 protected void SendPermissionError(LLUUID user, string reason)
@@ -252,38 +252,38 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
252 } 252 }
253#endregion 253#endregion
254 254
255 public bool PropagatePermissions() 255 public bool PropagatePermissions()
256 { 256 {
257 return false; 257 return false;
258 } 258 }
259 259
260 public bool BypassPermissions() 260 public bool BypassPermissions()
261 { 261 {
262 return m_bypassPermissions; 262 return m_bypassPermissions;
263 } 263 }
264 264
265 public void SetBypassPermissions(bool value) 265 public void SetBypassPermissions(bool value)
266 { 266 {
267 m_bypassPermissions=value; 267 m_bypassPermissions=value;
268 } 268 }
269 269
270 #region Object Permissions 270 #region Object Permissions
271 271
272 public uint GenerateClientFlags(LLUUID user, LLUUID objID) 272 public uint GenerateClientFlags(LLUUID user, LLUUID objID)
273 { 273 {
274 // Here's the way this works, 274 // Here's the way this works,
275 // ObjectFlags and Permission flags are two different enumerations 275 // ObjectFlags and Permission flags are two different enumerations
276 // ObjectFlags, however, tells the client to change what it will allow the user to do. 276 // ObjectFlags, however, tells the client to change what it will allow the user to do.
277 // So, that means that all of the permissions type ObjectFlags are /temporary/ and only 277 // So, that means that all of the permissions type ObjectFlags are /temporary/ and only
278 // supposed to be set when customizing the objectflags for the client. 278 // supposed to be set when customizing the objectflags for the client.
279 279
280 // These temporary objectflags get computed and added in this function based on the 280 // These temporary objectflags get computed and added in this function based on the
281 // Permission mask that's appropriate! 281 // Permission mask that's appropriate!
282 // Outside of this method, they should never be added to objectflags! 282 // Outside of this method, they should never be added to objectflags!
283 // -teravus 283 // -teravus
284 284
285 SceneObjectPart task=m_scene.GetSceneObjectPart(objID); 285 SceneObjectPart task=m_scene.GetSceneObjectPart(objID);
286 286
287 // this shouldn't ever happen.. return no permissions/objectflags. 287 // this shouldn't ever happen.. return no permissions/objectflags.
288 if (task == null) 288 if (task == null)
289 return (uint)0; 289 return (uint)0;
@@ -292,7 +292,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
292 LLUUID objectOwner = task.OwnerID; 292 LLUUID objectOwner = task.OwnerID;
293 293
294 294
295 // Remove any of the objectFlags that are temporary. These will get added back if appropriate 295 // Remove any of the objectFlags that are temporary. These will get added back if appropriate
296 // in the next bit of code 296 // in the next bit of code
297 297
298 objflags &= (uint) 298 objflags &= (uint)
@@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
354 354
355 private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask) 355 private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask)
356 { 356 {
357 // We are adding the temporary objectflags to the object's objectflags based on the 357 // We are adding the temporary objectflags to the object's objectflags based on the
358 // permission flag given. These change the F flags on the client. 358 // permission flag given. These change the F flags on the client.
359 359
360 if ((setPermissionMask & (uint)PermissionMask.Copy) != 0) 360 if ((setPermissionMask & (uint)PermissionMask.Copy) != 0)
@@ -404,7 +404,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
404 locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); 404 locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0);
405 405
406 // People shouldn't be able to do anything with locked objects, except the Administrator 406 // People shouldn't be able to do anything with locked objects, except the Administrator
407 // The 'set permissions' runs through a different permission check, so when an object owner 407 // The 'set permissions' runs through a different permission check, so when an object owner
408 // sets an object locked, the only thing that they can do is unlock it. 408 // sets an object locked, the only thing that they can do is unlock it.
409 // 409 //
410 // Nobody but the object owner can set permissions on an object 410 // Nobody but the object owner can set permissions on an object
@@ -458,7 +458,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
458 bool permission = false; 458 bool permission = false;
459 string reason = "Only registered users may communicate with another account."; 459 string reason = "Only registered users may communicate with another account.";
460 460
461 461
462 if (IsAdministrator(user)) 462 if (IsAdministrator(user))
463 permission = true; 463 permission = true;
464 464
@@ -521,7 +521,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
521 return GenericParcelPermission(user, parcel); 521 return GenericParcelPermission(user, parcel);
522 } 522 }
523#endregion 523#endregion
524 524
525 #region Permission Checks 525 #region Permission Checks
526 private bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene) 526 private bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene)
527 { 527 {
@@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
607 { 607 {
608 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 608 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
609 if (m_bypassPermissions) return m_bypassPermissionsValue; 609 if (m_bypassPermissions) return m_bypassPermissionsValue;
610 610
611 return GenericCommunicationPermission(user, target); 611 return GenericCommunicationPermission(user, target);
612 } 612 }
613 613
@@ -632,8 +632,8 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
632 return false; 632 return false;
633 } 633 }
634 634
635 // The client 635 // The client
636 // may request to edit linked parts, and therefore, it needs 636 // may request to edit linked parts, and therefore, it needs
637 // to also check for SceneObjectPart 637 // to also check for SceneObjectPart
638 638
639 // If it's not an object, we cant edit it. 639 // If it's not an object, we cant edit it.
@@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
647 647
648 648
649 LLUUID taskOwner = null; 649 LLUUID taskOwner = null;
650 // Added this because at this point in time it wouldn't be wise for 650 // Added this because at this point in time it wouldn't be wise for
651 // the administrator object permissions to take effect. 651 // the administrator object permissions to take effect.
652 LLUUID objectOwner = task.OwnerID; 652 LLUUID objectOwner = task.OwnerID;
653 653
@@ -682,12 +682,12 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
682 682
683 683
684 // This is an exception to the generic object permission. 684 // This is an exception to the generic object permission.
685 // Administrators who lock their objects should not be able to move them, 685 // Administrators who lock their objects should not be able to move them,
686 // however generic object permission should return true. 686 // however generic object permission should return true.
687 // This keeps locked objects from being affected by random click + drag actions by accident 687 // This keeps locked objects from being affected by random click + drag actions by accident
688 // and allows the administrator to grab or delete a locked object. 688 // and allows the administrator to grab or delete a locked object.
689 689
690 // Administrators and estate managers are still able to click+grab locked objects not 690 // Administrators and estate managers are still able to click+grab locked objects not
691 // owned by them in the scene 691 // owned by them in the scene
692 // This is by design. 692 // This is by design.
693 693
@@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
834 834
835 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; 835 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID];
836 LLUUID taskOwner = null; 836 LLUUID taskOwner = null;
837 // Added this because at this point in time it wouldn't be wise for 837 // Added this because at this point in time it wouldn't be wise for
838 // the administrator object permissions to take effect. 838 // the administrator object permissions to take effect.
839 LLUUID objectOwner = task.OwnerID; 839 LLUUID objectOwner = task.OwnerID;
840 840
@@ -895,61 +895,61 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
895 895
896 #endregion 896 #endregion
897 897
898 public bool CanLinkObject(LLUUID userID, LLUUID objectID) 898 public bool CanLinkObject(LLUUID userID, LLUUID objectID)
899 { 899 {
900 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 900 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
901 if (m_bypassPermissions) return m_bypassPermissionsValue; 901 if (m_bypassPermissions) return m_bypassPermissionsValue;
902 902
903 return true; 903 return true;
904 } 904 }
905 905
906 public bool CanDelinkObject(LLUUID userID, LLUUID objectID) 906 public bool CanDelinkObject(LLUUID userID, LLUUID objectID)
907 { 907 {
908 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 908 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
909 if (m_bypassPermissions) return m_bypassPermissionsValue; 909 if (m_bypassPermissions) return m_bypassPermissionsValue;
910 910
911 return true; 911 return true;
912 } 912 }
913 913
914 public bool CanBuyLand(LLUUID userID, ILandObject parcel, Scene scene) 914 public bool CanBuyLand(LLUUID userID, ILandObject parcel, Scene scene)
915 { 915 {
916 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 916 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
917 if (m_bypassPermissions) return m_bypassPermissionsValue; 917 if (m_bypassPermissions) return m_bypassPermissionsValue;
918 918
919 return true; 919 return true;
920 } 920 }
921 921
922 public bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) 922 public bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
923 { 923 {
924 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 924 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
925 if (m_bypassPermissions) return m_bypassPermissionsValue; 925 if (m_bypassPermissions) return m_bypassPermissionsValue;
926 926
927 return true; 927 return true;
928 } 928 }
929 929
930 public bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) 930 public bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
931 { 931 {
932 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 932 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
933 if (m_bypassPermissions) return m_bypassPermissionsValue; 933 if (m_bypassPermissions) return m_bypassPermissionsValue;
934 934
935 return true; 935 return true;
936 } 936 }
937 937
938 public bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) 938 public bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID)
939 { 939 {
940 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 940 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
941 if (m_bypassPermissions) return m_bypassPermissionsValue; 941 if (m_bypassPermissions) return m_bypassPermissionsValue;
942 942
943 return true; 943 return true;
944 } 944 }
945 945
946 public bool CanTeleport(LLUUID userID) 946 public bool CanTeleport(LLUUID userID)
947 { 947 {
948 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 948 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
949 if (m_bypassPermissions) return m_bypassPermissionsValue; 949 if (m_bypassPermissions) return m_bypassPermissionsValue;
950 950
951 return true; 951 return true;
952 } 952 }
953 953
954 954
955 } 955 }
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
index beb74ce..1bdc702 100644
--- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules
99 // Current time in elpased seconds since Jan 1st 1970 99 // Current time in elpased seconds since Jan 1st 1970
100 private ulong CurrentTime 100 private ulong CurrentTime
101 { 101 {
102 get { 102 get {
103 return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000); 103 return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000);
104 } 104 }
105 } 105 }
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Modules
118 118
119 TimeZone local = TimeZone.CurrentTimeZone; 119 TimeZone local = TimeZone.CurrentTimeZone;
120 TicksOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; 120 TicksOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks;
121 121
122 m_log.Debug("[SUN] localtime offset is " + TicksOffset); 122 m_log.Debug("[SUN] localtime offset is " + TicksOffset);
123 123
124 // Align ticks with Second Life 124 // Align ticks with Second Life
@@ -246,7 +246,7 @@ namespace OpenSim.Region.Environment.Modules
246 avatar.ControllingClient.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition); 246 avatar.ControllingClient.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition);
247 } 247 }
248 248
249 // set estate settings for region access to sun position 249 // set estate settings for region access to sun position
250 m_scene.RegionInfo.EstateSettings.sunPosition = Position; 250 m_scene.RegionInfo.EstateSettings.sunPosition = Position;
251 } 251 }
252 252
@@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules
281 281
282 Position = LLVector3.Rot(Position,Tilt); 282 Position = LLVector3.Rot(Position,Tilt);
283 283
284 // Finally we shift the axis so that more of the 284 // Finally we shift the axis so that more of the
285 // circle is above the horizon than below. This 285 // circle is above the horizon than below. This
286 // makes the nights shorter than the days. 286 // makes the nights shorter than the days.
287 287
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
index eb981d9..98d69a5 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
@@ -31,9 +31,9 @@ using OpenSim.Region.Environment.Interfaces;
31namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders 31namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
32{ 32{
33 /// <summary> 33 /// <summary>
34 /// A generic windows bitmap loader. 34 /// A generic windows bitmap loader.
35 /// Should be capable of handling 24-bit RGB images. 35 /// Should be capable of handling 24-bit RGB images.
36 /// 36 ///
37 /// Uses the System.Drawing filesystem loader. 37 /// Uses the System.Drawing filesystem loader.
38 /// </summary> 38 /// </summary>
39 internal class BMP : GenericSystemDrawing 39 internal class BMP : GenericSystemDrawing
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
index 484bb89..bb819e1 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
@@ -33,7 +33,7 @@ using OpenSim.Region.Environment.Interfaces;
33namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders 33namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// A virtual class designed to have methods overloaded, 36 /// A virtual class designed to have methods overloaded,
37 /// this class provides an interface for a generic image 37 /// this class provides an interface for a generic image
38 /// saving and loading mechanism, but does not specify the 38 /// saving and loading mechanism, but does not specify the
39 /// format. It should not be insubstantiated directly. 39 /// format. It should not be insubstantiated directly.
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
99 } 99 }
100 100
101 /// <summary> 101 /// <summary>
102 /// Protected method, generates a grayscale bitmap 102 /// Protected method, generates a grayscale bitmap
103 /// image from a specified terrain channel. 103 /// image from a specified terrain channel.
104 /// </summary> 104 /// </summary>
105 /// <param name="map">The terrain channel to export to bitmap</param> 105 /// <param name="map">The terrain channel to export to bitmap</param>
@@ -134,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
134 } 134 }
135 135
136 /// <summary> 136 /// <summary>
137 /// Protected method, generates a coloured bitmap 137 /// Protected method, generates a coloured bitmap
138 /// image from a specified terrain channel. 138 /// image from a specified terrain channel.
139 /// </summary> 139 /// </summary>
140 /// <param name="map">The terrain channel to export to bitmap</param> 140 /// <param name="map">The terrain channel to export to bitmap</param>
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
index 0c4e3de..7bf88f0 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
@@ -43,14 +43,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
43 double sum = 0.0; 43 double sum = 0.0;
44 double step2 = 0.0; 44 double step2 = 0.0;
45 45
46 // compute delta map 46 // compute delta map
47 for (x = 0; x < map.Width; x++) 47 for (x = 0; x < map.Width; x++)
48 { 48 {
49 for (y = 0; y < map.Height; y++) 49 for (y = 0; y < map.Height; y++)
50 { 50 {
51 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 51 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
52 52
53 if (z > 0) // add in non-zero amount 53 if (z > 0) // add in non-zero amount
54 { 54 {
55 sum += map[x, y] * z; 55 sum += map[x, y] * z;
56 step2 += z; 56 step2 += z;
@@ -60,14 +60,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
60 60
61 double avg = sum / step2; 61 double avg = sum / step2;
62 62
63 // blend in map 63 // blend in map
64 for (x = 0; x < map.Width; x++) 64 for (x = 0; x < map.Width; x++)
65 { 65 {
66 for (y = 0; y < map.Height; y++) 66 for (y = 0; y < map.Height; y++)
67 { 67 {
68 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration; 68 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration;
69 69
70 if (z > 0) // add in non-zero amount 70 if (z > 0) // add in non-zero amount
71 { 71 {
72 if (z > 1.0) 72 if (z > 1.0)
73 z = 1.0; 73 z = 1.0;
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs
index f2a1800..6df8408 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs
@@ -32,8 +32,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
32{ 32{
33 /// <summary> 33 /// <summary>
34 /// Speed-Optimised Hybrid Erosion Brush 34 /// Speed-Optimised Hybrid Erosion Brush
35 /// 35 ///
36 /// As per Jacob Olsen's Paper 36 /// As per Jacob Olsen's Paper
37 /// http://www.oddlabs.com/download/terrain_generation.pdf 37 /// http://www.oddlabs.com/download/terrain_generation.pdf
38 /// </summary> 38 /// </summary>
39 public class OlsenSphere : ITerrainPaintableEffect 39 public class OlsenSphere : ITerrainPaintableEffect
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
164 { 164 {
165 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 165 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
166 166
167 if (z > 0) // add in non-zero amount 167 if (z > 0) // add in non-zero amount
168 { 168 {
169 const int NEIGHBOUR_ME = 4; 169 const int NEIGHBOUR_ME = 4;
170 const int NEIGHBOUR_MAX = 9; 170 const int NEIGHBOUR_MAX = 9;
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs
index 49946fd..fc0a579 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs
@@ -43,14 +43,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
43 double area = strength; 43 double area = strength;
44 double step = strength / 4.0; 44 double step = strength / 4.0;
45 45
46 // compute delta map 46 // compute delta map
47 for (x = 0; x < map.Width; x++) 47 for (x = 0; x < map.Width; x++)
48 { 48 {
49 for (y = 0; y < map.Height; y++) 49 for (y = 0; y < map.Height; y++)
50 { 50 {
51 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 51 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
52 52
53 if (z > 0) // add in non-zero amount 53 if (z > 0) // add in non-zero amount
54 { 54 {
55 double average = 0.0; 55 double average = 0.0;
56 int avgsteps = 0; 56 int avgsteps = 0;
@@ -69,14 +69,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
69 } 69 }
70 } 70 }
71 } 71 }
72 // blend in map 72 // blend in map
73 for (x = 0; x < map.Width; x++) 73 for (x = 0; x < map.Width; x++)
74 { 74 {
75 for (y = 0; y < map.Height; y++) 75 for (y = 0; y < map.Height; y++)
76 { 76 {
77 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 77 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
78 78
79 if (z > 0) // add in non-zero amount 79 if (z > 0) // add in non-zero amount
80 { 80 {
81 double da = z; 81 double da = z;
82 double a = (map[x, y] - tweak[x, y]) * da; 82 double a = (map[x, y] - tweak[x, y]) * da;
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
index 753d171..b3aa732 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
@@ -160,7 +160,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
160 { 160 {
161 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 161 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
162 162
163 if (z > 0) // add in non-zero amount 163 if (z > 0) // add in non-zero amount
164 { 164 {
165 const int NEIGHBOUR_ME = 4; 165 const int NEIGHBOUR_ME = 4;
166 const int NEIGHBOUR_MAX = 9; 166 const int NEIGHBOUR_MAX = 9;
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index 18a2851..4b6ca49 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Environment.Scenes
35{ 35{
36 [Serializable] 36 [Serializable]
37 public abstract class EntityBase : ISerializable 37 public abstract class EntityBase : ISerializable
38 { 38 {
39 /// <summary> 39 /// <summary>
40 /// The scene to which this entity belongs 40 /// The scene to which this entity belongs
41 /// </summary> 41 /// </summary>
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Environment.Scenes
56 protected string m_name; 56 protected string m_name;
57 57
58 /// <summary> 58 /// <summary>
59 /// 59 ///
60 /// </summary> 60 /// </summary>
61 public virtual string Name 61 public virtual string Name
62 { 62 {
@@ -67,7 +67,7 @@ namespace OpenSim.Region.Environment.Scenes
67 protected LLVector3 m_pos; 67 protected LLVector3 m_pos;
68 68
69 /// <summary> 69 /// <summary>
70 /// 70 ///
71 /// </summary> 71 /// </summary>
72 public virtual LLVector3 AbsolutePosition 72 public virtual LLVector3 AbsolutePosition
73 { 73 {
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Environment.Scenes
79 protected LLVector3 m_rotationalvelocity; 79 protected LLVector3 m_rotationalvelocity;
80 80
81 /// <summary> 81 /// <summary>
82 /// 82 ///
83 /// </summary> 83 /// </summary>
84 public virtual LLVector3 Velocity 84 public virtual LLVector3 Velocity
85 { 85 {
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes
118 } 118 }
119 119
120 /// <summary> 120 /// <summary>
121 /// 121 ///
122 /// </summary> 122 /// </summary>
123 public abstract void UpdateMovement(); 123 public abstract void UpdateMovement();
124 124
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index aa22740..352fdf9 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Environment.Scenes
93 set 93 set
94 { 94 {
95 // If we're not doing the initial set 95 // If we're not doing the initial set
96 // Then we've got to remove the previous 96 // Then we've got to remove the previous
97 // event handler 97 // event handler
98 try 98 try
99 { 99 {
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Scenes
104 // This occurs when storing to _PhyScene the first time. 104 // This occurs when storing to _PhyScene the first time.
105 // Is there a better way to check the event handler before 105 // Is there a better way to check the event handler before
106 // getting here 106 // getting here
107 // This can be safely ignored. We're setting the first inital 107 // This can be safely ignored. We're setting the first inital
108 // there are no event handler's registered. 108 // there are no event handler's registered.
109 } 109 }
110 110
@@ -120,7 +120,7 @@ namespace OpenSim.Region.Environment.Scenes
120 { 120 {
121 ScenePresences.Clear(); 121 ScenePresences.Clear();
122 } 122 }
123 123
124 //SceneObjects.Clear(); 124 //SceneObjects.Clear();
125 Entities.Clear(); 125 Entities.Clear();
126 } 126 }
@@ -235,7 +235,7 @@ namespace OpenSim.Region.Environment.Scenes
235 for (int i = 0; i < m_updateList.Count; i++) 235 for (int i = 0; i < m_updateList.Count; i++)
236 { 236 {
237 EntityBase entity = m_updateList[i]; 237 EntityBase entity = m_updateList[i];
238 238
239 // Don't abort the whole update if one entity happens to give us an exception. 239 // Don't abort the whole update if one entity happens to give us an exception.
240 try 240 try
241 { 241 {
@@ -327,7 +327,7 @@ namespace OpenSim.Region.Environment.Scenes
327 part.Undo(); 327 part.Undo();
328 328
329 } 329 }
330 330
331 331
332 } 332 }
333 333
@@ -341,7 +341,7 @@ namespace OpenSim.Region.Environment.Scenes
341 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) 341 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot)
342 { 342 {
343 // Calls attach with a Zero position 343 // Calls attach with a Zero position
344 344
345 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); 345 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero);
346 } 346 }
347 public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) 347 public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask)
@@ -364,8 +364,8 @@ namespace OpenSim.Region.Environment.Scenes
364 // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID?? 364 // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID??
365 public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient) 365 public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient)
366 { 366 {
367 367
368 if (itemID == LLUUID.Zero) // If this happened, someone made a mistake.... 368 if (itemID == LLUUID.Zero) // If this happened, someone made a mistake....
369 return; 369 return;
370 370
371 List<EntityBase> EntityList = GetEntities(); 371 List<EntityBase> EntityList = GetEntities();
@@ -443,14 +443,14 @@ namespace OpenSim.Region.Environment.Scenes
443 { 443 {
444 remoteClient.SendAgentAlertMessage("You don't have sufficient permissions to attach this object", false); 444 remoteClient.SendAgentAlertMessage("You don't have sufficient permissions to attach this object", false);
445 } 445 }
446 446
447 } 447 }
448 448
449 } 449 }
450 } 450 }
451 451
452 } 452 }
453 453
454 public ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child, AvatarAppearance appearance) 454 public ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child, AvatarAppearance appearance)
455 { 455 {
456 ScenePresence newAvatar = null; 456 ScenePresence newAvatar = null;
@@ -627,13 +627,13 @@ namespace OpenSim.Region.Environment.Scenes
627 627
628 return result; 628 return result;
629 } 629 }
630 630
631 /// <summary> 631 /// <summary>
632 /// Get the controlling client for the given avatar, if there is one. 632 /// Get the controlling client for the given avatar, if there is one.
633 /// 633 ///
634 /// FIXME: The only user of the method right now is Caps.cs, in order to resolve a client API since it can't 634 /// FIXME: The only user of the method right now is Caps.cs, in order to resolve a client API since it can't
635 /// use the ScenePresence. This could be better solved in a number of ways - we could establish an 635 /// use the ScenePresence. This could be better solved in a number of ways - we could establish an
636 /// OpenSim.Framework.IScenePresence, or move the caps code into a region package (which might be the more 636 /// OpenSim.Framework.IScenePresence, or move the caps code into a region package (which might be the more
637 /// suitable solution). 637 /// suitable solution).
638 /// </summary> 638 /// </summary>
639 /// <param name="agentId"></param> 639 /// <param name="agentId"></param>
@@ -641,12 +641,12 @@ namespace OpenSim.Region.Environment.Scenes
641 public IClientAPI GetControllingClient(LLUUID agentId) 641 public IClientAPI GetControllingClient(LLUUID agentId)
642 { 642 {
643 ScenePresence presence = GetScenePresence(agentId); 643 ScenePresence presence = GetScenePresence(agentId);
644 644
645 if (presence != null) 645 if (presence != null)
646 { 646 {
647 return presence.ControllingClient; 647 return presence.ControllingClient;
648 } 648 }
649 649
650 return null; 650 return null;
651 } 651 }
652 652
@@ -657,7 +657,7 @@ namespace OpenSim.Region.Environment.Scenes
657 public List<ScenePresence> GetScenePresences(FilterAvatarList filter) 657 public List<ScenePresence> GetScenePresences(FilterAvatarList filter)
658 { 658 {
659 // No locking of scene presences here since we're passing back a list... 659 // No locking of scene presences here since we're passing back a list...
660 660
661 List<ScenePresence> result = new List<ScenePresence>(); 661 List<ScenePresence> result = new List<ScenePresence>();
662 List<ScenePresence> ScenePresencesList = GetScenePresences(); 662 List<ScenePresence> ScenePresencesList = GetScenePresences();
663 663
@@ -681,7 +681,7 @@ namespace OpenSim.Region.Environment.Scenes
681 { 681 {
682 ScenePresence sp; 682 ScenePresence sp;
683 ScenePresences.TryGetValue(agentID, out sp); 683 ScenePresences.TryGetValue(agentID, out sp);
684 684
685 return sp; 685 return sp;
686 } 686 }
687 687
@@ -764,13 +764,13 @@ namespace OpenSim.Region.Environment.Scenes
764 { 764 {
765 if (!presence.IsChildAgent) 765 if (!presence.IsChildAgent)
766 { 766 {
767 avatar = presence; 767 avatar = presence;
768 return true; 768 return true;
769 } 769 }
770 else 770 else
771 { 771 {
772 m_log.WarnFormat( 772 m_log.WarnFormat(
773 "[INNER SCENE]: Requested avatar {0} could not be found in scene {1} since it is only registered as a child agent!", 773 "[INNER SCENE]: Requested avatar {0} could not be found in scene {1} since it is only registered as a child agent!",
774 avatarId, m_parentScene.RegionInfo.RegionName); 774 avatarId, m_parentScene.RegionInfo.RegionName);
775 } 775 }
776 } 776 }
@@ -846,8 +846,8 @@ namespace OpenSim.Region.Environment.Scenes
846 { 846 {
847 // Only send child agents stuff in their draw distance. 847 // Only send child agents stuff in their draw distance.
848 // This will need to be done for every agent once we figure out 848 // This will need to be done for every agent once we figure out
849 // what we're going to use to store prim that agents already got 849 // what we're going to use to store prim that agents already got
850 // the initial update for and what we'll use to limit the 850 // the initial update for and what we'll use to limit the
851 // space we check for new objects on movement. 851 // space we check for new objects on movement.
852 852
853 if (presence.IsChildAgent && m_parentScene.m_seeIntoRegionFromNeighbor) 853 if (presence.IsChildAgent && m_parentScene.m_seeIntoRegionFromNeighbor)
@@ -889,7 +889,7 @@ namespace OpenSim.Region.Environment.Scenes
889 #region Client Event handlers 889 #region Client Event handlers
890 890
891 /// <summary> 891 /// <summary>
892 /// 892 ///
893 /// </summary> 893 /// </summary>
894 /// <param name="localID"></param> 894 /// <param name="localID"></param>
895 /// <param name="scale"></param> 895 /// <param name="scale"></param>
@@ -918,7 +918,7 @@ namespace OpenSim.Region.Environment.Scenes
918 } 918 }
919 919
920 /// <summary> 920 /// <summary>
921 /// This handles the nifty little tool tip that you get when you drag your mouse over an object 921 /// This handles the nifty little tool tip that you get when you drag your mouse over an object
922 /// Send to the Object Group to process. We don't know enough to service the request 922 /// Send to the Object Group to process. We don't know enough to service the request
923 /// </summary> 923 /// </summary>
924 /// <param name="remoteClient"></param> 924 /// <param name="remoteClient"></param>
@@ -936,7 +936,7 @@ namespace OpenSim.Region.Environment.Scenes
936 } 936 }
937 937
938 /// <summary> 938 /// <summary>
939 /// 939 ///
940 /// </summary> 940 /// </summary>
941 /// <param name="localID"></param> 941 /// <param name="localID"></param>
942 /// <param name="rot"></param> 942 /// <param name="rot"></param>
@@ -954,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes
954 } 954 }
955 955
956 /// <summary> 956 /// <summary>
957 /// 957 ///
958 /// </summary> 958 /// </summary>
959 /// <param name="localID"></param> 959 /// <param name="localID"></param>
960 /// <param name="rot"></param> 960 /// <param name="rot"></param>
@@ -972,7 +972,7 @@ namespace OpenSim.Region.Environment.Scenes
972 } 972 }
973 973
974 /// <summary> 974 /// <summary>
975 /// 975 ///
976 /// </summary> 976 /// </summary>
977 /// <param name="localID"></param> 977 /// <param name="localID"></param>
978 /// <param name="pos"></param> 978 /// <param name="pos"></param>
@@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Environment.Scenes
1009 } 1009 }
1010 1010
1011 /// <summary> 1011 /// <summary>
1012 /// 1012 ///
1013 /// </summary> 1013 /// </summary>
1014 /// <param name="localID"></param> 1014 /// <param name="localID"></param>
1015 /// <param name="pos"></param> 1015 /// <param name="pos"></param>
@@ -1019,13 +1019,13 @@ namespace OpenSim.Region.Environment.Scenes
1019 SceneObjectGroup group = GetGroupByPrim(localID); 1019 SceneObjectGroup group = GetGroupByPrim(localID);
1020 if (group != null) 1020 if (group != null)
1021 { 1021 {
1022 1022
1023 LLVector3 oldPos = group.AbsolutePosition; 1023 LLVector3 oldPos = group.AbsolutePosition;
1024 if (group.RootPart.m_IsAttachment) 1024 if (group.RootPart.m_IsAttachment)
1025 { 1025 {
1026 group.UpdateGroupPosition(pos); 1026 group.UpdateGroupPosition(pos);
1027 } 1027 }
1028 else 1028 else
1029 { 1029 {
1030 if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.m_IsAttachment) 1030 if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.m_IsAttachment)
1031 { 1031 {
@@ -1041,7 +1041,7 @@ namespace OpenSim.Region.Environment.Scenes
1041 } 1041 }
1042 1042
1043 /// <summary> 1043 /// <summary>
1044 /// 1044 ///
1045 /// </summary> 1045 /// </summary>
1046 /// <param name="localID"></param> 1046 /// <param name="localID"></param>
1047 /// <param name="texture"></param> 1047 /// <param name="texture"></param>
@@ -1059,7 +1059,7 @@ namespace OpenSim.Region.Environment.Scenes
1059 } 1059 }
1060 1060
1061 /// <summary> 1061 /// <summary>
1062 /// 1062 ///
1063 /// </summary> 1063 /// </summary>
1064 /// <param name="localID"></param> 1064 /// <param name="localID"></param>
1065 /// <param name="packet"></param> 1065 /// <param name="packet"></param>
@@ -1094,7 +1094,7 @@ namespace OpenSim.Region.Environment.Scenes
1094 } 1094 }
1095 1095
1096 /// <summary> 1096 /// <summary>
1097 /// 1097 ///
1098 /// </summary> 1098 /// </summary>
1099 /// <param name="primLocalID"></param> 1099 /// <param name="primLocalID"></param>
1100 /// <param name="description"></param> 1100 /// <param name="description"></param>
@@ -1111,7 +1111,7 @@ namespace OpenSim.Region.Environment.Scenes
1111 } 1111 }
1112 1112
1113 /// <summary> 1113 /// <summary>
1114 /// 1114 ///
1115 /// </summary> 1115 /// </summary>
1116 /// <param name="primLocalID"></param> 1116 /// <param name="primLocalID"></param>
1117 /// <param name="description"></param> 1117 /// <param name="description"></param>
@@ -1141,7 +1141,7 @@ namespace OpenSim.Region.Environment.Scenes
1141 } 1141 }
1142 1142
1143 /// <summary> 1143 /// <summary>
1144 /// 1144 ///
1145 /// </summary> 1145 /// </summary>
1146 /// <param name="primLocalID"></param> 1146 /// <param name="primLocalID"></param>
1147 /// <param name="shapeBlock"></param> 1147 /// <param name="shapeBlock"></param>
@@ -1223,7 +1223,7 @@ namespace OpenSim.Region.Environment.Scenes
1223 { 1223 {
1224 parenPrim.LinkToGroup(sceneObj); 1224 parenPrim.LinkToGroup(sceneObj);
1225 } 1225 }
1226 1226
1227 // We need to explicitly resend the newly link prim's object properties since no other actions 1227 // We need to explicitly resend the newly link prim's object properties since no other actions
1228 // occur on link to invoke this elsewhere (such as object selection) 1228 // occur on link to invoke this elsewhere (such as object selection)
1229 parenPrim.GetProperties(client); 1229 parenPrim.GetProperties(client);
@@ -1232,7 +1232,7 @@ namespace OpenSim.Region.Environment.Scenes
1232 /// <summary> 1232 /// <summary>
1233 /// Delink a linkset 1233 /// Delink a linkset
1234 /// </summary> 1234 /// </summary>
1235 /// <param name="prims"></param> 1235 /// <param name="prims"></param>
1236 public void DelinkObjects(List<uint> primIds) 1236 public void DelinkObjects(List<uint> primIds)
1237 { 1237 {
1238 SceneObjectGroup parenPrim = null; 1238 SceneObjectGroup parenPrim = null;
@@ -1278,7 +1278,7 @@ namespace OpenSim.Region.Environment.Scenes
1278 else 1278 else
1279 { 1279 {
1280 // If the first scan failed, we need to do a /deep/ scan of the linkages. This is /really/ slow 1280 // If the first scan failed, we need to do a /deep/ scan of the linkages. This is /really/ slow
1281 // We know that this is not the root prim now essentially, so we don't have to worry about remapping 1281 // We know that this is not the root prim now essentially, so we don't have to worry about remapping
1282 // which one is the root prim 1282 // which one is the root prim
1283 bool delinkedSomething = false; 1283 bool delinkedSomething = false;
1284 for (int i = 0; i < primIds.Count; i++) 1284 for (int i = 0; i < primIds.Count; i++)
@@ -1324,7 +1324,7 @@ namespace OpenSim.Region.Environment.Scenes
1324 } 1324 }
1325 } 1325 }
1326 } 1326 }
1327 1327
1328 //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints 1328 //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints
1329 //aka ObjectFlags.JointWheel = IncludeInSearch 1329 //aka ObjectFlags.JointWheel = IncludeInSearch
1330 1330
@@ -1356,7 +1356,7 @@ namespace OpenSim.Region.Environment.Scenes
1356 public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID) 1356 public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID)
1357 { 1357 {
1358 m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); 1358 m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
1359 1359
1360 List<EntityBase> EntityList = GetEntities(); 1360 List<EntityBase> EntityList = GetEntities();
1361 1361
1362 SceneObjectGroup originPrim = null; 1362 SceneObjectGroup originPrim = null;
@@ -1405,7 +1405,7 @@ namespace OpenSim.Region.Environment.Scenes
1405 /// <returns></returns> 1405 /// <returns></returns>
1406 public float Vector3Distance(Vector3 v1, Vector3 v2) 1406 public float Vector3Distance(Vector3 v1, Vector3 v2)
1407 { 1407 {
1408 // We don't really need the double floating point precision... 1408 // We don't really need the double floating point precision...
1409 // so casting it to a single 1409 // so casting it to a single
1410 1410
1411 return 1411 return
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 6aef45e..5e2ccec 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Scenes
40{ 40{
41 public partial class Scene 41 public partial class Scene
42 { 42 {
43 private static readonly ILog m_log 43 private static readonly ILog m_log
44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 /// <summary> 46 /// <summary>
@@ -49,14 +49,14 @@ namespace OpenSim.Region.Environment.Scenes
49 public void StartScripts() 49 public void StartScripts()
50 { 50 {
51 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene"); 51 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
52 52
53 foreach (EntityBase group in Entities.Values) 53 foreach (EntityBase group in Entities.Values)
54 { 54 {
55 if (group is SceneObjectGroup) 55 if (group is SceneObjectGroup)
56 { 56 {
57 ((SceneObjectGroup) group).StartScripts(); 57 ((SceneObjectGroup) group).StartScripts();
58 } 58 }
59 } 59 }
60 } 60 }
61 61
62 /// <summary> 62 /// <summary>
@@ -67,9 +67,9 @@ namespace OpenSim.Region.Environment.Scenes
67 /// in which the item is to be placed.</param> 67 /// in which the item is to be placed.</param>
68 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) 68 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
69 { 69 {
70 CachedUserInfo userInfo 70 CachedUserInfo userInfo
71 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 71 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
72 72
73 if (userInfo != null) 73 if (userInfo != null)
74 { 74 {
75 userInfo.AddItem(item); 75 userInfo.AddItem(item);
@@ -91,17 +91,17 @@ namespace OpenSim.Region.Environment.Scenes
91 m_log.ErrorFormat( 91 m_log.ErrorFormat(
92 "[AGENT INVENTORY]: Agent {0} {1} was not found for add of item {2} {3}", 92 "[AGENT INVENTORY]: Agent {0} {1} was not found for add of item {2} {3}",
93 remoteClient.Name, remoteClient.AgentId, item.Name, item.ID); 93 remoteClient.Name, remoteClient.AgentId, item.Name, item.ID);
94 94
95 return; 95 return;
96 } 96 }
97 } 97 }
98 98
99 /// <summary> 99 /// <summary>
100 /// <see>AddInventoryItem(LLUUID, InventoryItemBase)</see> 100 /// <see>AddInventoryItem(LLUUID, InventoryItemBase)</see>
101 /// </summary> 101 /// </summary>
102 /// <param name="avatarId">The ID of the avatar</param> 102 /// <param name="avatarId">The ID of the avatar</param>
103 /// <param name="item">The item. This structure contains all the item metadata, including the folder 103 /// <param name="item">The item. This structure contains all the item metadata, including the folder
104 /// in which the item is to be placed.</param> 104 /// in which the item is to be placed.</param>
105 public void AddInventoryItem(LLUUID avatarId, InventoryItemBase item) 105 public void AddInventoryItem(LLUUID avatarId, InventoryItemBase item)
106 { 106 {
107 ScenePresence avatar; 107 ScenePresence avatar;
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Scenes
131 if (userInfo.RootFolder != null) 131 if (userInfo.RootFolder != null)
132 { 132 {
133 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 133 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
134 134
135 if (item != null) 135 if (item != null)
136 { 136 {
137 AssetBase asset = 137 AssetBase asset =
@@ -188,13 +188,13 @@ namespace OpenSim.Region.Environment.Scenes
188 /// <param name="itemID"></param> 188 /// <param name="itemID"></param>
189 /// <param name="primID">The prim which contains the item to update</param> 189 /// <param name="primID">The prim which contains the item to update</param>
190 /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param> 190 /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param>
191 /// <param name="data"></param> 191 /// <param name="data"></param>
192 public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, LLUUID itemId, 192 public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, LLUUID itemId,
193 LLUUID primId, bool isScriptRunning, byte[] data) 193 LLUUID primId, bool isScriptRunning, byte[] data)
194 { 194 {
195 // Retrieve group 195 // Retrieve group
196 SceneObjectPart part = GetSceneObjectPart(primId); 196 SceneObjectPart part = GetSceneObjectPart(primId);
197 SceneObjectGroup group = part.ParentGroup; 197 SceneObjectGroup group = part.ParentGroup;
198 if (null == group) 198 if (null == group)
199 { 199 {
200 m_log.ErrorFormat( 200 m_log.ErrorFormat(
@@ -204,36 +204,36 @@ namespace OpenSim.Region.Environment.Scenes
204 204
205 return; 205 return;
206 } 206 }
207 207
208 // Retrieve item 208 // Retrieve item
209 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); 209 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId);
210 if (null == item) 210 if (null == item)
211 { 211 {
212 return; 212 return;
213 } 213 }
214 214
215 // Create new asset 215 // Create new asset
216 // XXX Hardcoding the numbers is a temporary measure - need an enumeration for this 216 // XXX Hardcoding the numbers is a temporary measure - need an enumeration for this
217 // There may well be one in libsecondlife 217 // There may well be one in libsecondlife
218 AssetBase asset = CreateAsset(item.Name, item.Description, 10, 10, data); 218 AssetBase asset = CreateAsset(item.Name, item.Description, 10, 10, data);
219 AssetCache.AddAsset(asset); 219 AssetCache.AddAsset(asset);
220 220
221 // Update item with new asset 221 // Update item with new asset
222 item.AssetID = asset.FullID; 222 item.AssetID = asset.FullID;
223 group.UpdateInventoryItem(item); 223 group.UpdateInventoryItem(item);
224 group.GetProperties(remoteClient); 224 group.GetProperties(remoteClient);
225 225
226 // Trigger rerunning of script (use TriggerRezScript event, see RezScript) 226 // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
227 if (isScriptRunning) 227 if (isScriptRunning)
228 { 228 {
229 group.StopScript(part.LocalId, item.ItemID); 229 group.StopScript(part.LocalId, item.ItemID);
230 group.StartScript(part.LocalId, item.ItemID); 230 group.StartScript(part.LocalId, item.ItemID);
231 } 231 }
232 } 232 }
233 233
234 /// <summary> 234 /// <summary>
235 /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, LLUUID, LLUUID, bool, byte[])</see> 235 /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, LLUUID, LLUUID, bool, byte[])</see>
236 /// </summary> 236 /// </summary>
237 private void CapsUpdateTaskInventoryScriptAsset(LLUUID avatarId, LLUUID itemId, 237 private void CapsUpdateTaskInventoryScriptAsset(LLUUID avatarId, LLUUID itemId,
238 LLUUID primId, bool isScriptRunning, byte[] data) 238 LLUUID primId, bool isScriptRunning, byte[] data)
239 { 239 {
@@ -276,7 +276,7 @@ namespace OpenSim.Region.Environment.Scenes
276 if (userInfo != null && userInfo.RootFolder != null) 276 if (userInfo != null && userInfo.RootFolder != null)
277 { 277 {
278 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 278 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
279 279
280 if (item != null) 280 if (item != null)
281 { 281 {
282 if (LLUUID.Zero == transactionID) 282 if (LLUUID.Zero == transactionID)
@@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes
284 item.Name = itemUpd.Name; 284 item.Name = itemUpd.Name;
285 item.Description = itemUpd.Description; 285 item.Description = itemUpd.Description;
286 item.NextPermissions = itemUpd.NextPermissions; 286 item.NextPermissions = itemUpd.NextPermissions;
287 item.CurrentPermissions |= 8; // Slam! 287 item.CurrentPermissions |= 8; // Slam!
288 item.EveryOnePermissions = itemUpd.EveryOnePermissions; 288 item.EveryOnePermissions = itemUpd.EveryOnePermissions;
289 289
290 // TODO: Requires sanity checks 290 // TODO: Requires sanity checks
@@ -323,7 +323,7 @@ namespace OpenSim.Region.Environment.Scenes
323 "[AGENT INVENTORY]: Agent ID " + remoteClient.AgentId + " not found for an inventory item update."); 323 "[AGENT INVENTORY]: Agent ID " + remoteClient.AgentId + " not found for an inventory item update.");
324 } 324 }
325 } 325 }
326 326
327 /// <summary> 327 /// <summary>
328 /// Give an inventory item from one avatar to another 328 /// Give an inventory item from one avatar to another
329 /// </summary> 329 /// </summary>
@@ -333,35 +333,35 @@ namespace OpenSim.Region.Environment.Scenes
333 public void GiveInventoryItem(IClientAPI recipientClient, LLUUID senderId, LLUUID itemId) 333 public void GiveInventoryItem(IClientAPI recipientClient, LLUUID senderId, LLUUID itemId)
334 { 334 {
335 // Retrieve the item from the sender 335 // Retrieve the item from the sender
336 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId); 336 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId);
337 337
338 if (senderUserInfo == null) 338 if (senderUserInfo == null)
339 { 339 {
340 m_log.ErrorFormat( 340 m_log.ErrorFormat(
341 "[AGENT INVENTORY]: Failed to find sending user {0} for item {1}", senderId, itemId); 341 "[AGENT INVENTORY]: Failed to find sending user {0} for item {1}", senderId, itemId);
342 342
343 return; 343 return;
344 } 344 }
345 345
346 if (senderUserInfo.RootFolder != null) 346 if (senderUserInfo.RootFolder != null)
347 { 347 {
348 InventoryItemBase item = senderUserInfo.RootFolder.FindItem(itemId); 348 InventoryItemBase item = senderUserInfo.RootFolder.FindItem(itemId);
349 349
350 if (item != null) 350 if (item != null)
351 { 351 {
352 if (!ExternalChecks.ExternalChecksBypassPermissions()) 352 if (!ExternalChecks.ExternalChecksBypassPermissions())
353 { 353 {
354 if((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) 354 if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
355 return; 355 return;
356 } 356 }
357 357
358 // TODO get recipient's root folder 358 // TODO get recipient's root folder
359 CachedUserInfo recipientUserInfo 359 CachedUserInfo recipientUserInfo
360 = CommsManager.UserProfileCacheService.GetUserDetails(recipientClient.AgentId); 360 = CommsManager.UserProfileCacheService.GetUserDetails(recipientClient.AgentId);
361 361
362 if (recipientUserInfo != null) 362 if (recipientUserInfo != null)
363 { 363 {
364 // Insert a copy of the item into the recipient 364 // Insert a copy of the item into the recipient
365 InventoryItemBase itemCopy = new InventoryItemBase(); 365 InventoryItemBase itemCopy = new InventoryItemBase();
366 itemCopy.Owner = recipientClient.AgentId; 366 itemCopy.Owner = recipientClient.AgentId;
367 itemCopy.Creator = senderId; 367 itemCopy.Creator = senderId;
@@ -372,37 +372,37 @@ namespace OpenSim.Region.Environment.Scenes
372 itemCopy.AssetType = item.AssetType; 372 itemCopy.AssetType = item.AssetType;
373 itemCopy.InvType = item.InvType; 373 itemCopy.InvType = item.InvType;
374 itemCopy.Folder = recipientUserInfo.RootFolder.ID; 374 itemCopy.Folder = recipientUserInfo.RootFolder.ID;
375 if (ExternalChecks.ExternalChecksPropagatePermissions()) 375 if (ExternalChecks.ExternalChecksPropagatePermissions())
376 { 376 {
377 if(item.InvType == 6) 377 if (item.InvType == 6)
378 { 378 {
379 itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); 379 itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
380 itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; 380 itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13;
381 } 381 }
382 else 382 else
383 { 383 {
384 Console.WriteLine("Non-Prim item ==>"); 384 Console.WriteLine("Non-Prim item ==>");
385 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; 385 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
386 } 386 }
387 387
388 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 388 itemCopy.CurrentPermissions = itemCopy.BasePermissions;
389 if((item.CurrentPermissions & 8) != 0) // Propagate slam bit 389 if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit
390 { 390 {
391 itemCopy.CurrentPermissions = item.NextPermissions; 391 itemCopy.CurrentPermissions = item.NextPermissions;
392 itemCopy.BasePermissions=itemCopy.CurrentPermissions; 392 itemCopy.BasePermissions=itemCopy.CurrentPermissions;
393 itemCopy.CurrentPermissions |= 8; 393 itemCopy.CurrentPermissions |= 8;
394 } 394 }
395 395
396 itemCopy.NextPermissions = item.NextPermissions; 396 itemCopy.NextPermissions = item.NextPermissions;
397 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; 397 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
398 } 398 }
399 else 399 else
400 { 400 {
401 itemCopy.CurrentPermissions = item.CurrentPermissions; 401 itemCopy.CurrentPermissions = item.CurrentPermissions;
402 itemCopy.NextPermissions = item.NextPermissions; 402 itemCopy.NextPermissions = item.NextPermissions;
403 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; 403 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
404 itemCopy.BasePermissions = item.BasePermissions; 404 itemCopy.BasePermissions = item.BasePermissions;
405 } 405 }
406 itemCopy.GroupID = item.GroupID; 406 itemCopy.GroupID = item.GroupID;
407 itemCopy.GroupOwned = item.GroupOwned; 407 itemCopy.GroupOwned = item.GroupOwned;
408 itemCopy.Flags = item.Flags; 408 itemCopy.Flags = item.Flags;
@@ -410,21 +410,21 @@ namespace OpenSim.Region.Environment.Scenes
410 itemCopy.SaleType = item.SaleType; 410 itemCopy.SaleType = item.SaleType;
411 411
412 recipientUserInfo.AddItem(itemCopy); 412 recipientUserInfo.AddItem(itemCopy);
413 413
414 if (!ExternalChecks.ExternalChecksBypassPermissions()) 414 if (!ExternalChecks.ExternalChecksBypassPermissions())
415 { 415 {
416 if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 416 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
417 senderUserInfo.DeleteItem(itemId); 417 senderUserInfo.DeleteItem(itemId);
418 } 418 }
419 419
420 // Let the recipient client know about this new item 420 // Let the recipient client know about this new item
421 recipientClient.SendBulkUpdateInventory(itemCopy); 421 recipientClient.SendBulkUpdateInventory(itemCopy);
422 } 422 }
423 else 423 else
424 { 424 {
425 m_log.ErrorFormat( 425 m_log.ErrorFormat(
426 "[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}", 426 "[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}",
427 recipientClient.Name, recipientClient.AgentId, item.Name, 427 recipientClient.Name, recipientClient.AgentId, item.Name,
428 item.ID, senderId); 428 item.ID, senderId);
429 } 429 }
430 } 430 }
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes
432 { 432 {
433 m_log.ErrorFormat( 433 m_log.ErrorFormat(
434 "[AGENT INVENTORY]: Failed to find item {0} to give to {1}", itemId, senderId); 434 "[AGENT INVENTORY]: Failed to find item {0} to give to {1}", itemId, senderId);
435 435
436 return; 436 return;
437 } 437 }
438 } 438 }
@@ -440,7 +440,7 @@ namespace OpenSim.Region.Environment.Scenes
440 { 440 {
441 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder"); 441 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder");
442 return; 442 return;
443 } 443 }
444 } 444 }
445 445
446 public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, 446 public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID,
@@ -449,9 +449,9 @@ namespace OpenSim.Region.Environment.Scenes
449 m_log.DebugFormat( 449 m_log.DebugFormat(
450 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}", 450 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}",
451 remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName); 451 remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName);
452 452
453 InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(oldItemID); 453 InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(oldItemID);
454 454
455 if (item == null) 455 if (item == null)
456 { 456 {
457 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID); 457 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID);
@@ -464,7 +464,7 @@ namespace OpenSim.Region.Environment.Scenes
464 if (userInfo.RootFolder != null) 464 if (userInfo.RootFolder != null)
465 { 465 {
466 item = userInfo.RootFolder.FindItem(oldItemID); 466 item = userInfo.RootFolder.FindItem(oldItemID);
467 467
468 if (item == null) 468 if (item == null)
469 { 469 {
470 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString()); 470 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString());
@@ -477,29 +477,29 @@ namespace OpenSim.Region.Environment.Scenes
477 return; 477 return;
478 } 478 }
479 } 479 }
480 480
481 AssetBase asset 481 AssetBase asset
482 = AssetCache.GetAsset( 482 = AssetCache.GetAsset(
483 item.AssetID, (item.AssetType == (int)AssetType.Texture ? true : false)); 483 item.AssetID, (item.AssetType == (int)AssetType.Texture ? true : false));
484 484
485 if (asset != null) 485 if (asset != null)
486 { 486 {
487 if(remoteClient.AgentId == oldAgentID) 487 if (remoteClient.AgentId == oldAgentID)
488 { 488 {
489 CreateNewInventoryItem( 489 CreateNewInventoryItem(
490 remoteClient, newFolderID, callbackID, asset, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions); 490 remoteClient, newFolderID, callbackID, asset, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions);
491 } 491 }
492 else 492 else
493 { 493 {
494 CreateNewInventoryItem( 494 CreateNewInventoryItem(
495 remoteClient, newFolderID, callbackID, asset, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions); 495 remoteClient, newFolderID, callbackID, asset, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions);
496 } 496 }
497 } 497 }
498 else 498 else
499 { 499 {
500 m_log.ErrorFormat( 500 m_log.ErrorFormat(
501 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found", 501 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found",
502 item.Name, item.AssetID); 502 item.Name, item.AssetID);
503 } 503 }
504 } 504 }
505 505
@@ -530,18 +530,18 @@ namespace OpenSim.Region.Environment.Scenes
530 "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); 530 "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId);
531 531
532 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 532 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
533 533
534 if (userInfo == null) 534 if (userInfo == null)
535 { 535 {
536 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); 536 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
537 537
538 return; 538 return;
539 } 539 }
540 540
541 if (userInfo.RootFolder != null) 541 if (userInfo.RootFolder != null)
542 { 542 {
543 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 543 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
544 544
545 if (item != null) 545 if (item != null)
546 { 546 {
547 if (newName != String.Empty) 547 if (newName != String.Empty)
@@ -549,7 +549,7 @@ namespace OpenSim.Region.Environment.Scenes
549 item.Name = newName; 549 item.Name = newName;
550 } 550 }
551 item.Folder = folderID; 551 item.Folder = folderID;
552 552
553 userInfo.DeleteItem(item.ID); 553 userInfo.DeleteItem(item.ID);
554 554
555 AddInventoryItem(remoteClient, item); 555 AddInventoryItem(remoteClient, item);
@@ -557,23 +557,23 @@ namespace OpenSim.Region.Environment.Scenes
557 else 557 else
558 { 558 {
559 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString()); 559 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString());
560 560
561 return; 561 return;
562 } 562 }
563 } 563 }
564 else 564 else
565 { 565 {
566 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString() + ", no root folder"); 566 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString() + ", no root folder");
567 567
568 return; 568 return;
569 } 569 }
570 } 570 }
571 571
572 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, 572 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
573 AssetBase asset, uint nextOwnerMask) 573 AssetBase asset, uint nextOwnerMask)
574 { 574 {
575 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask); 575 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask);
576 } 576 }
577 577
578 /// <summary> 578 /// <summary>
579 /// Create a new inventory item. 579 /// Create a new inventory item.
@@ -586,9 +586,9 @@ namespace OpenSim.Region.Environment.Scenes
586 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, 586 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
587 AssetBase asset, uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask) 587 AssetBase asset, uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask)
588 { 588 {
589 CachedUserInfo userInfo 589 CachedUserInfo userInfo
590 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 590 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
591 591
592 if (userInfo != null) 592 if (userInfo != null)
593 { 593 {
594 InventoryItemBase item = new InventoryItemBase(); 594 InventoryItemBase item = new InventoryItemBase();
@@ -603,8 +603,8 @@ namespace OpenSim.Region.Environment.Scenes
603 item.Folder = folderID; 603 item.Folder = folderID;
604 item.CurrentPermissions = currentMask; 604 item.CurrentPermissions = currentMask;
605 item.NextPermissions = nextOwnerMask; 605 item.NextPermissions = nextOwnerMask;
606 item.EveryOnePermissions = everyoneMask; 606 item.EveryOnePermissions = everyoneMask;
607 item.BasePermissions = baseMask; 607 item.BasePermissions = baseMask;
608 608
609 userInfo.AddItem(item); 609 userInfo.AddItem(item);
610 remoteClient.SendInventoryItemCreateUpdate(item); 610 remoteClient.SendInventoryItemCreateUpdate(item);
@@ -612,7 +612,7 @@ namespace OpenSim.Region.Environment.Scenes
612 else 612 else
613 { 613 {
614 m_log.WarnFormat( 614 m_log.WarnFormat(
615 "No user details associated with client {0} uuid {1} in CreateNewInventoryItem!", 615 "No user details associated with client {0} uuid {1} in CreateNewInventoryItem!",
616 remoteClient.Name, remoteClient.AgentId); 616 remoteClient.Name, remoteClient.AgentId);
617 } 617 }
618 } 618 }
@@ -637,12 +637,12 @@ namespace OpenSim.Region.Environment.Scenes
637 byte wearableType, uint nextOwnerMask) 637 byte wearableType, uint nextOwnerMask)
638 { 638 {
639// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID); 639// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
640 640
641 if (transactionID == LLUUID.Zero) 641 if (transactionID == LLUUID.Zero)
642 { 642 {
643 CachedUserInfo userInfo 643 CachedUserInfo userInfo
644 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 644 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
645 645
646 if (userInfo != null) 646 if (userInfo != null)
647 { 647 {
648 ScenePresence presence; 648 ScenePresence presence;
@@ -666,7 +666,7 @@ namespace OpenSim.Region.Environment.Scenes
666 else 666 else
667 { 667 {
668 m_log.ErrorFormat( 668 m_log.ErrorFormat(
669 "userInfo for agent uuid {0} unexpectedly null in CreateNewInventoryItem", 669 "userInfo for agent uuid {0} unexpectedly null in CreateNewInventoryItem",
670 remoteClient.AgentId); 670 remoteClient.AgentId);
671 } 671 }
672 } 672 }
@@ -677,10 +677,10 @@ namespace OpenSim.Region.Environment.Scenes
677 { 677 {
678 agentTransactions.HandleItemCreationFromTransaction( 678 agentTransactions.HandleItemCreationFromTransaction(
679 remoteClient, transactionID, folderID, callbackID, description, 679 remoteClient, transactionID, folderID, callbackID, description,
680 name, invType, assetType, wearableType, nextOwnerMask); 680 name, invType, assetType, wearableType, nextOwnerMask);
681 } 681 }
682 682
683 683
684 } 684 }
685 } 685 }
686 686
@@ -693,13 +693,13 @@ namespace OpenSim.Region.Environment.Scenes
693 { 693 {
694 CachedUserInfo userInfo 694 CachedUserInfo userInfo
695 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 695 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
696 696
697 if (userInfo == null) 697 if (userInfo == null)
698 { 698 {
699 m_log.WarnFormat( 699 m_log.WarnFormat(
700 "[AGENT INVENTORY]: Failed to find user {0} {1} to delete inventory item {2}", 700 "[AGENT INVENTORY]: Failed to find user {0} {1} to delete inventory item {2}",
701 remoteClient.Name, remoteClient.AgentId, itemID); 701 remoteClient.Name, remoteClient.AgentId, itemID);
702 702
703 return; 703 return;
704 } 704 }
705 705
@@ -716,7 +716,7 @@ namespace OpenSim.Region.Environment.Scenes
716 { 716 {
717 CachedUserInfo userInfo 717 CachedUserInfo userInfo
718 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 718 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
719 719
720 if (userInfo == null) 720 if (userInfo == null)
721 { 721 {
722 m_log.Warn("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); 722 m_log.Warn("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
@@ -726,13 +726,13 @@ namespace OpenSim.Region.Environment.Scenes
726 if (userInfo.RootFolder != null) 726 if (userInfo.RootFolder != null)
727 { 727 {
728 InventoryItemBase folder = userInfo.RootFolder.FindItem(folderID); 728 InventoryItemBase folder = userInfo.RootFolder.FindItem(folderID);
729 729
730 if (folder != null) 730 if (folder != null)
731 { 731 {
732 m_log.WarnFormat( 732 m_log.WarnFormat(
733 "[AGENT INVENTORY]: Remove folder not implemented in request by {0} {1} for {2}", 733 "[AGENT INVENTORY]: Remove folder not implemented in request by {0} {1} for {2}",
734 remoteClient.Name, remoteClient.AgentId, folderID); 734 remoteClient.Name, remoteClient.AgentId, folderID);
735 735
736 // doesn't work just yet, commented out. will fix in next patch. 736 // doesn't work just yet, commented out. will fix in next patch.
737 // userInfo.DeleteItem(folder); 737 // userInfo.DeleteItem(folder);
738 } 738 }
@@ -760,7 +760,7 @@ namespace OpenSim.Region.Environment.Scenes
760 /// <param name="remoteClient"></param> 760 /// <param name="remoteClient"></param>
761 /// <param name="primLocalID"></param> 761 /// <param name="primLocalID"></param>
762 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID) 762 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
763 { 763 {
764 SceneObjectGroup group = GetGroupByPrim(primLocalID); 764 SceneObjectGroup group = GetGroupByPrim(primLocalID);
765 if (group != null) 765 if (group != null)
766 { 766 {
@@ -808,7 +808,7 @@ namespace OpenSim.Region.Environment.Scenes
808 localID); 808 localID);
809 } 809 }
810 } 810 }
811 811
812 /// <summary> 812 /// <summary>
813 /// Move the given item in the given prim to a folder in the client's inventory 813 /// Move the given item in the given prim to a folder in the client's inventory
814 /// </summary> 814 /// </summary>
@@ -819,33 +819,33 @@ namespace OpenSim.Region.Environment.Scenes
819 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) 819 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId)
820 { 820 {
821 SceneObjectPart part = GetSceneObjectPart(primLocalId); 821 SceneObjectPart part = GetSceneObjectPart(primLocalId);
822 822
823 if (null == part) 823 if (null == part)
824 { 824 {
825 m_log.WarnFormat( 825 m_log.WarnFormat(
826 "[PRIM INVENTORY]: " + 826 "[PRIM INVENTORY]: " +
827 "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found", 827 "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found",
828 itemId, primLocalId); 828 itemId, primLocalId);
829 829
830 return; 830 return;
831 } 831 }
832 832
833 TaskInventoryItem taskItem = part.GetInventoryItem(itemId); 833 TaskInventoryItem taskItem = part.GetInventoryItem(itemId);
834 834
835 if (null == taskItem) 835 if (null == taskItem)
836 { 836 {
837 // Console already notified of error in GetInventoryItem 837 // Console already notified of error in GetInventoryItem
838 return; 838 return;
839 } 839 }
840 840
841 // Only owner can copy 841 // Only owner can copy
842 if (remoteClient.AgentId != taskItem.OwnerID) 842 if (remoteClient.AgentId != taskItem.OwnerID)
843 { 843 {
844 return; 844 return;
845 } 845 }
846 846
847 InventoryItemBase agentItem = new InventoryItemBase(); 847 InventoryItemBase agentItem = new InventoryItemBase();
848 848
849 agentItem.ID = LLUUID.Random(); 849 agentItem.ID = LLUUID.Random();
850 agentItem.Creator = taskItem.CreatorID; 850 agentItem.Creator = taskItem.CreatorID;
851 agentItem.Owner = remoteClient.AgentId; 851 agentItem.Owner = remoteClient.AgentId;
@@ -855,33 +855,33 @@ namespace OpenSim.Region.Environment.Scenes
855 agentItem.AssetType = taskItem.Type; 855 agentItem.AssetType = taskItem.Type;
856 agentItem.InvType = taskItem.InvType; 856 agentItem.InvType = taskItem.InvType;
857 agentItem.Folder = folderId; 857 agentItem.Folder = folderId;
858 858
859 if ((remoteClient.AgentId != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) 859 if ((remoteClient.AgentId != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
860 { 860 {
861 agentItem.BasePermissions = taskItem.NextOwnerMask; 861 agentItem.BasePermissions = taskItem.NextOwnerMask;
862 agentItem.CurrentPermissions = taskItem.NextOwnerMask; 862 agentItem.CurrentPermissions = taskItem.NextOwnerMask;
863 agentItem.NextPermissions = taskItem.NextOwnerMask; 863 agentItem.NextPermissions = taskItem.NextOwnerMask;
864 agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask; 864 agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask;
865 } 865 }
866 else 866 else
867 { 867 {
868 agentItem.BasePermissions = taskItem.BaseMask; 868 agentItem.BasePermissions = taskItem.BaseMask;
869 agentItem.CurrentPermissions = taskItem.OwnerMask; 869 agentItem.CurrentPermissions = taskItem.OwnerMask;
870 agentItem.NextPermissions = taskItem.NextOwnerMask; 870 agentItem.NextPermissions = taskItem.NextOwnerMask;
871 agentItem.EveryOnePermissions = taskItem.EveryoneMask; 871 agentItem.EveryOnePermissions = taskItem.EveryoneMask;
872 } 872 }
873 873
874 AddInventoryItem(remoteClient, agentItem); 874 AddInventoryItem(remoteClient, agentItem);
875 if (!ExternalChecks.ExternalChecksBypassPermissions()) 875 if (!ExternalChecks.ExternalChecksBypassPermissions())
876 { 876 {
877 if((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0) 877 if ((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
878 part.RemoveInventoryItem(itemId); 878 part.RemoveInventoryItem(itemId);
879 } 879 }
880 880
881 } 881 }
882 882
883 /// <summary> 883 /// <summary>
884 /// Update an item in a prim (task) inventory. 884 /// Update an item in a prim (task) inventory.
885 /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> 885 /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see>
886 /// </summary> 886 /// </summary>
887 /// <param name="remoteClient"></param> 887 /// <param name="remoteClient"></param>
@@ -915,14 +915,14 @@ namespace OpenSim.Region.Environment.Scenes
915 { 915 {
916 part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID); 916 part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID);
917 m_log.InfoFormat( 917 m_log.InfoFormat(
918 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", 918 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
919 item.Name, primLocalID, remoteClient.Name); 919 item.Name, primLocalID, remoteClient.Name);
920 part.ParentGroup.GetProperties(remoteClient); 920 part.ParentGroup.GetProperties(remoteClient);
921 if (!ExternalChecks.ExternalChecksBypassPermissions()) 921 if (!ExternalChecks.ExternalChecksBypassPermissions())
922 { 922 {
923 if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 923 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
924 RemoveInventoryItem(remoteClient, itemID); 924 RemoveInventoryItem(remoteClient, itemID);
925 } 925 }
926 } 926 }
927 else 927 else
928 { 928 {
@@ -951,22 +951,22 @@ namespace OpenSim.Region.Environment.Scenes
951 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) 951 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID)
952 { 952 {
953 LLUUID copyID = LLUUID.Random(); 953 LLUUID copyID = LLUUID.Random();
954 954
955 if (itemID != LLUUID.Zero) 955 if (itemID != LLUUID.Zero)
956 { 956 {
957 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 957 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
958 958
959 if (userInfo != null && userInfo.RootFolder != null) 959 if (userInfo != null && userInfo.RootFolder != null)
960 { 960 {
961 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 961 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
962 962
963 // Try library 963 // Try library
964 // XXX clumsy, possibly should be one call 964 // XXX clumsy, possibly should be one call
965 if (null == item) 965 if (null == item)
966 { 966 {
967 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID); 967 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID);
968 } 968 }
969 969
970 if (item != null) 970 if (item != null)
971 { 971 {
972 SceneObjectPart part = GetSceneObjectPart(localID); 972 SceneObjectPart part = GetSceneObjectPart(localID);
@@ -975,7 +975,7 @@ namespace OpenSim.Region.Environment.Scenes
975 part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID); 975 part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
976 part.ParentGroup.StartScript(localID, copyID); 976 part.ParentGroup.StartScript(localID, copyID);
977 part.ParentGroup.GetProperties(remoteClient); 977 part.ParentGroup.GetProperties(remoteClient);
978 978
979 // m_log.InfoFormat("[PRIMINVENTORY]: " + 979 // m_log.InfoFormat("[PRIMINVENTORY]: " +
980 // "Rezzed script {0} into prim local ID {1} for user {2}", 980 // "Rezzed script {0} into prim local ID {1} for user {2}",
981 // item.inventoryName, localID, remoteClient.Name); 981 // item.inventoryName, localID, remoteClient.Name);
@@ -1000,10 +1000,10 @@ namespace OpenSim.Region.Environment.Scenes
1000 else // If the itemID is zero then the script has been rezzed directly in an object's inventory 1000 else // If the itemID is zero then the script has been rezzed directly in an object's inventory
1001 { 1001 {
1002 // not yet implemented 1002 // not yet implemented
1003 // TODO Need to get more details from original RezScript packet 1003 // TODO Need to get more details from original RezScript packet
1004 // XXX jc tmp 1004 // XXX jc tmp
1005// AssetBase asset = CreateAsset("chimney sweep", "sailor.lsl", 10, 10, null); 1005// AssetBase asset = CreateAsset("chimney sweep", "sailor.lsl", 10, 10, null);
1006// AssetCache.AddAsset(asset); 1006// AssetCache.AddAsset(asset);
1007 } 1007 }
1008 } 1008 }
1009 1009
@@ -1023,11 +1023,11 @@ namespace OpenSim.Region.Environment.Scenes
1023 else 1023 else
1024 { 1024 {
1025 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) 1025 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
1026 { 1026 {
1027// m_log.DebugFormat( 1027// m_log.DebugFormat(
1028// "[AGENT INVENTORY]: Received request to derez {0} into folder {1}", 1028// "[AGENT INVENTORY]: Received request to derez {0} into folder {1}",
1029// Data.ObjectLocalID, DeRezPacket.AgentBlock.DestinationID); 1029// Data.ObjectLocalID, DeRezPacket.AgentBlock.DestinationID);
1030 1030
1031 EntityBase selectedEnt = null; 1031 EntityBase selectedEnt = null;
1032 //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString()); 1032 //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString());
1033 1033
@@ -1046,9 +1046,9 @@ namespace OpenSim.Region.Environment.Scenes
1046 bool permissionToTake = false; 1046 bool permissionToTake = false;
1047 bool permissionToDelete = false; 1047 bool permissionToDelete = false;
1048 if (DeRezPacket.AgentBlock.Destination == 1)// Take Copy 1048 if (DeRezPacket.AgentBlock.Destination == 1)// Take Copy
1049 { 1049 {
1050 permissionToTake = ExternalChecks.ExternalChecksCanTakeCopyObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId); 1050 permissionToTake = ExternalChecks.ExternalChecksCanTakeCopyObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
1051 permissionToDelete = false; //Just taking copy! 1051 permissionToDelete = false; //Just taking copy!
1052 1052
1053 } 1053 }
1054 else if (DeRezPacket.AgentBlock.Destination == 4) //Take 1054 else if (DeRezPacket.AgentBlock.Destination == 4) //Take
@@ -1094,27 +1094,27 @@ namespace OpenSim.Region.Environment.Scenes
1094 item.Folder = DeRezPacket.AgentBlock.DestinationID; 1094 item.Folder = DeRezPacket.AgentBlock.DestinationID;
1095 if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) 1095 if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
1096 { 1096 {
1097 uint perms=objectGroup.GetEffectivePermissions(); 1097 uint perms=objectGroup.GetEffectivePermissions();
1098 uint nextPerms=(perms & 7) << 13; 1098 uint nextPerms=(perms & 7) << 13;
1099 if((nextPerms & (uint)PermissionMask.Copy) == 0) 1099 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
1100 perms &= ~(uint)PermissionMask.Copy; 1100 perms &= ~(uint)PermissionMask.Copy;
1101 if((nextPerms & (uint)PermissionMask.Transfer) == 0) 1101 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
1102 perms &= ~(uint)PermissionMask.Transfer; 1102 perms &= ~(uint)PermissionMask.Transfer;
1103 if((nextPerms & (uint)PermissionMask.Modify) == 0) 1103 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
1104 perms &= ~(uint)PermissionMask.Modify; 1104 perms &= ~(uint)PermissionMask.Modify;
1105 1105
1106 item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask; 1106 item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask;
1107 item.CurrentPermissions = item.BasePermissions; 1107 item.CurrentPermissions = item.BasePermissions;
1108 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1108 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1109 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; 1109 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1110 item.CurrentPermissions |= 8; // Slam! 1110 item.CurrentPermissions |= 8; // Slam!
1111 } 1111 }
1112 else 1112 else
1113 { 1113 {
1114 item.BasePermissions = objectGroup.GetEffectivePermissions(); 1114 item.BasePermissions = objectGroup.GetEffectivePermissions();
1115 item.CurrentPermissions = objectGroup.GetEffectivePermissions(); 1115 item.CurrentPermissions = objectGroup.GetEffectivePermissions();
1116 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1116 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1117 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1117 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1118 } 1118 }
1119 1119
1120 // TODO: add the new fields (Flags, Sale info, etc) 1120 // TODO: add the new fields (Flags, Sale info, etc)
@@ -1201,15 +1201,15 @@ namespace OpenSim.Region.Environment.Scenes
1201 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1201 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
1202 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1202 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
1203 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1203 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1204 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; 1204 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1205 } 1205 }
1206 else 1206 else
1207 { 1207 {
1208 item.BasePermissions = objectGroup.GetEffectivePermissions(); 1208 item.BasePermissions = objectGroup.GetEffectivePermissions();
1209 item.CurrentPermissions = objectGroup.GetEffectivePermissions(); 1209 item.CurrentPermissions = objectGroup.GetEffectivePermissions();
1210 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1210 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1211 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1211 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1212 } 1212 }
1213 1213
1214 userInfo.AddItem(item); 1214 userInfo.AddItem(item);
1215 1215
@@ -1218,7 +1218,7 @@ namespace OpenSim.Region.Environment.Scenes
1218 { 1218 {
1219 remoteClient.SendInventoryItemCreateUpdate(item); 1219 remoteClient.SendInventoryItemCreateUpdate(item);
1220 } 1220 }
1221 1221
1222 } 1222 }
1223 } 1223 }
1224 } 1224 }
@@ -1250,7 +1250,7 @@ namespace OpenSim.Region.Environment.Scenes
1250 item.Name = asset.Name; 1250 item.Name = asset.Name;
1251 item.AssetType = asset.Type; 1251 item.AssetType = asset.Type;
1252 item.InvType = asset.InvType; 1252 item.InvType = asset.InvType;
1253 1253
1254 // Sticking it in root folder for now.. objects folder later? 1254 // Sticking it in root folder for now.. objects folder later?
1255 1255
1256 item.Folder = userInfo.RootFolder.ID;// DeRezPacket.AgentBlock.DestinationID; 1256 item.Folder = userInfo.RootFolder.ID;// DeRezPacket.AgentBlock.DestinationID;
@@ -1259,14 +1259,14 @@ namespace OpenSim.Region.Environment.Scenes
1259 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1259 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
1260 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1260 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
1261 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1261 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1262 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; 1262 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1263 } 1263 }
1264 else 1264 else
1265 { 1265 {
1266 item.BasePermissions = objectGroup.RootPart.BaseMask; 1266 item.BasePermissions = objectGroup.RootPart.BaseMask;
1267 item.CurrentPermissions = objectGroup.RootPart.OwnerMask; 1267 item.CurrentPermissions = objectGroup.RootPart.OwnerMask;
1268 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1268 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1269 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1269 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1270 } 1270 }
1271 1271
1272 userInfo.AddItem(item); 1272 userInfo.AddItem(item);
@@ -1345,12 +1345,12 @@ namespace OpenSim.Region.Environment.Scenes
1345 1345
1346 LLVector3 scale = new LLVector3(0.5f, 0.5f, 0.5f); 1346 LLVector3 scale = new LLVector3(0.5f, 0.5f, 0.5f);
1347 1347
1348 1348
1349 LLVector3 pos = GetNewRezLocation( 1349 LLVector3 pos = GetNewRezLocation(
1350 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), 1350 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1),
1351 BypassRayCast, bRayEndIsIntersection,true,scale, false); 1351 BypassRayCast, bRayEndIsIntersection,true,scale, false);
1352 1352
1353 1353
1354 1354
1355 // Rez object 1355 // Rez object
1356 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 1356 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -1359,14 +1359,14 @@ namespace OpenSim.Region.Environment.Scenes
1359 if (userInfo.RootFolder != null) 1359 if (userInfo.RootFolder != null)
1360 { 1360 {
1361 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 1361 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
1362 1362
1363 if (item != null) 1363 if (item != null)
1364 { 1364 {
1365 AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false); 1365 AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false);
1366 1366
1367 if (rezAsset != null) 1367 if (rezAsset != null)
1368 { 1368 {
1369 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data); 1369 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data);
1370 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); 1370 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
1371 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count,remoteClient.AgentId, pos) && !attachment) 1371 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count,remoteClient.AgentId, pos) && !attachment)
1372 { 1372 {
@@ -1401,10 +1401,10 @@ namespace OpenSim.Region.Environment.Scenes
1401 1401
1402 if (attachment) 1402 if (attachment)
1403 isAttachment = " Object was an attachment"; 1403 isAttachment = " Object was an attachment";
1404 1404
1405 m_log.Error("[OJECTREZ]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment); 1405 m_log.Error("[OJECTREZ]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment);
1406 } 1406 }
1407 1407
1408 // Since renaming the item in the inventory does not affect the name stored 1408 // Since renaming the item in the inventory does not affect the name stored
1409 // in the serialization, transfer the correct name from the inventory to the 1409 // in the serialization, transfer the correct name from the inventory to the
1410 // object itself before we rez. 1410 // object itself before we rez.
@@ -1413,18 +1413,18 @@ namespace OpenSim.Region.Environment.Scenes
1413 1413
1414 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); 1414 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
1415 1415
1416 if(rootPart.OwnerID != item.Owner) 1416 if (rootPart.OwnerID != item.Owner)
1417 { 1417 {
1418 if((item.CurrentPermissions & 8) != 0) 1418 if ((item.CurrentPermissions & 8) != 0)
1419 { 1419 {
1420 foreach (SceneObjectPart part in partList) 1420 foreach (SceneObjectPart part in partList)
1421 { 1421 {
1422 part.EveryoneMask = item.EveryOnePermissions; 1422 part.EveryoneMask = item.EveryOnePermissions;
1423 part.NextOwnerMask = item.NextPermissions; 1423 part.NextOwnerMask = item.NextPermissions;
1424 } 1424 }
1425 } 1425 }
1426 group.ApplyNextOwnerPermissions(); 1426 group.ApplyNextOwnerPermissions();
1427 } 1427 }
1428 1428
1429 foreach (SceneObjectPart part in partList) 1429 foreach (SceneObjectPart part in partList)
1430 { 1430 {
@@ -1434,13 +1434,13 @@ namespace OpenSim.Region.Environment.Scenes
1434 part.OwnerID = item.Owner; 1434 part.OwnerID = item.Owner;
1435 part.ChangeInventoryOwner(item.Owner); 1435 part.ChangeInventoryOwner(item.Owner);
1436 } 1436 }
1437 else if(((item.CurrentPermissions & 8) != 0) && (!attachment)) // Slam! 1437 else if (((item.CurrentPermissions & 8) != 0) && (!attachment)) // Slam!
1438 { 1438 {
1439 part.EveryoneMask = item.EveryOnePermissions; 1439 part.EveryoneMask = item.EveryOnePermissions;
1440 part.NextOwnerMask = item.NextPermissions; 1440 part.NextOwnerMask = item.NextPermissions;
1441 } 1441 }
1442 } 1442 }
1443 1443
1444 rootPart.TrimPermissions(); 1444 rootPart.TrimPermissions();
1445 1445
1446 if (!attachment) 1446 if (!attachment)
@@ -1451,11 +1451,11 @@ namespace OpenSim.Region.Environment.Scenes
1451 } 1451 }
1452 group.ApplyPhysics(m_physicalPrim); 1452 group.ApplyPhysics(m_physicalPrim);
1453 } 1453 }
1454 1454
1455 1455
1456 group.StartScripts(); 1456 group.StartScripts();
1457 1457
1458 1458
1459 if (!attachment) 1459 if (!attachment)
1460 rootPart.ScheduleFullUpdate(); 1460 rootPart.ScheduleFullUpdate();
1461 1461
@@ -1505,18 +1505,18 @@ namespace OpenSim.Region.Environment.Scenes
1505 1505
1506 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); 1506 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
1507 1507
1508 if(rootPart.OwnerID != item.OwnerID) 1508 if (rootPart.OwnerID != item.OwnerID)
1509 { 1509 {
1510 if((item.OwnerMask & 8) != 0) 1510 if ((item.OwnerMask & 8) != 0)
1511 { 1511 {
1512 foreach (SceneObjectPart part in partList) 1512 foreach (SceneObjectPart part in partList)
1513 { 1513 {
1514 part.EveryoneMask = item.EveryoneMask; 1514 part.EveryoneMask = item.EveryoneMask;
1515 part.NextOwnerMask = item.NextOwnerMask; 1515 part.NextOwnerMask = item.NextOwnerMask;
1516 } 1516 }
1517 } 1517 }
1518 group.ApplyNextOwnerPermissions(); 1518 group.ApplyNextOwnerPermissions();
1519 } 1519 }
1520 1520
1521 foreach (SceneObjectPart part in partList) 1521 foreach (SceneObjectPart part in partList)
1522 { 1522 {
@@ -1526,11 +1526,11 @@ namespace OpenSim.Region.Environment.Scenes
1526 part.OwnerID = item.OwnerID; 1526 part.OwnerID = item.OwnerID;
1527 part.ChangeInventoryOwner(item.OwnerID); 1527 part.ChangeInventoryOwner(item.OwnerID);
1528 } 1528 }
1529 else if((item.OwnerMask & 8) != 0) // Slam! 1529 else if ((item.OwnerMask & 8) != 0) // Slam!
1530 { 1530 {
1531 part.EveryoneMask = item.EveryoneMask; 1531 part.EveryoneMask = item.EveryoneMask;
1532 part.NextOwnerMask = item.NextOwnerMask; 1532 part.NextOwnerMask = item.NextOwnerMask;
1533 } 1533 }
1534 } 1534 }
1535 rootPart.TrimPermissions(); 1535 rootPart.TrimPermissions();
1536 if (group.RootPart.Shape.PCode == (byte)PCode.Prim) 1536 if (group.RootPart.Shape.PCode == (byte)PCode.Prim)
@@ -1548,6 +1548,6 @@ namespace OpenSim.Region.Environment.Scenes
1548 } 1548 }
1549 return null; 1549 return null;
1550 } 1550 }
1551 1551
1552 } 1552 }
1553} 1553}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index f55d822..c486e28 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Environment.Scenes
35 public partial class Scene 35 public partial class Scene
36 { 36 {
37 /// <summary> 37 /// <summary>
38 /// 38 ///
39 /// </summary> 39 /// </summary>
40 /// <param name="message"></param> 40 /// <param name="message"></param>
41 /// <param name="type"></param> 41 /// <param name="type"></param>
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Scenes
81 foreach (EntityBase ent in EntitieList) 81 foreach (EntityBase ent in EntitieList)
82 { 82 {
83 if (ent is SceneObjectGroup) 83 if (ent is SceneObjectGroup)
84 { 84 {
85 if (((SceneObjectGroup) ent).LocalId == primLocalID) 85 if (((SceneObjectGroup) ent).LocalId == primLocalID)
86 { 86 {
87 // A prim is only tainted if it's allowed to be edited by the person clicking it. 87 // A prim is only tainted if it's allowed to be edited by the person clicking it.
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Scenes
98 } 98 }
99 99
100 /// <summary> 100 /// <summary>
101 /// 101 ///
102 /// </summary> 102 /// </summary>
103 /// <param name="primLocalID"></param> 103 /// <param name="primLocalID"></param>
104 /// <param name="remoteClient"></param> 104 /// <param name="remoteClient"></param>
@@ -139,10 +139,10 @@ namespace OpenSim.Region.Environment.Scenes
139 agentId, groupId, final, groupOwned, removeContribution, parcelLocalID, parcelArea, parcelPrice, authenticated); 139 agentId, groupId, final, groupOwned, removeContribution, parcelLocalID, parcelArea, parcelPrice, authenticated);
140 140
141 // First, allow all validators a stab at it 141 // First, allow all validators a stab at it
142 m_eventManager.TriggerValidateLandBuy(this, args); 142 m_eventManager.TriggerValidateLandBuy(this, args);
143 143
144 // Then, check validation and transfer 144 // Then, check validation and transfer
145 m_eventManager.TriggerLandBuy(this, args); 145 m_eventManager.TriggerLandBuy(this, args);
146 } 146 }
147 147
148 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) 148 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 1964ef4..32dc7d5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Scenes
98 /// Each agent has its own capabilities handler. 98 /// Each agent has its own capabilities handler.
99 /// </summary> 99 /// </summary>
100 protected Dictionary<LLUUID, Caps> m_capsHandlers = new Dictionary<LLUUID, Caps>(); 100 protected Dictionary<LLUUID, Caps> m_capsHandlers = new Dictionary<LLUUID, Caps>();
101 101
102 protected BaseHttpServer m_httpListener; 102 protected BaseHttpServer m_httpListener;
103 103
104 protected Dictionary<string, IRegionModule> Modules = new Dictionary<string, IRegionModule>(); 104 protected Dictionary<string, IRegionModule> Modules = new Dictionary<string, IRegionModule>();
@@ -135,7 +135,7 @@ namespace OpenSim.Region.Environment.Scenes
135 private int m_update_backup = 200; 135 private int m_update_backup = 200;
136 private int m_update_terrain = 50; 136 private int m_update_terrain = 50;
137 private int m_update_land = 1; 137 private int m_update_land = 1;
138 138
139 139
140 private int frameMS = 0; 140 private int frameMS = 0;
141 private int physicsMS2 = 0; 141 private int physicsMS2 = 0;
@@ -201,7 +201,7 @@ namespace OpenSim.Region.Environment.Scenes
201 get { return m_innerScene.Entities; } 201 get { return m_innerScene.Entities; }
202 set { m_innerScene.Entities = value; } 202 set { m_innerScene.Entities = value; }
203 } 203 }
204 204
205 public Dictionary<LLUUID, ScenePresence> m_restorePresences 205 public Dictionary<LLUUID, ScenePresence> m_restorePresences
206 { 206 {
207 get { return m_innerScene.RestorePresences; } 207 get { return m_innerScene.RestorePresences; }
@@ -324,14 +324,14 @@ namespace OpenSim.Region.Environment.Scenes
324 324
325 public override bool OtherRegionUp(RegionInfo otherRegion) 325 public override bool OtherRegionUp(RegionInfo otherRegion)
326 { 326 {
327 // Another region is up. 327 // Another region is up.
328 // Gets called from Grid Comms (SceneCommunicationService<---RegionListener<----LocalBackEnd<----OGS1) 328 // Gets called from Grid Comms (SceneCommunicationService<---RegionListener<----LocalBackEnd<----OGS1)
329 // We have to tell all our ScenePresences about it.. 329 // We have to tell all our ScenePresences about it..
330 // and add it to the neighbor list. 330 // and add it to the neighbor list.
331 331
332 // We only add it to the neighbor list if it's within 1 region from here. 332 // We only add it to the neighbor list if it's within 1 region from here.
333 // Agents may have draw distance values that cross two regions though, so 333 // Agents may have draw distance values that cross two regions though, so
334 // we add it to the notify list regardless of distance. 334 // we add it to the notify list regardless of distance.
335 // We'll check the agent's draw distance before notifying them though. 335 // We'll check the agent's draw distance before notifying them though.
336 336
337 337
@@ -339,9 +339,9 @@ namespace OpenSim.Region.Environment.Scenes
339 { 339 {
340 for (int i = 0; i < m_neighbours.Count; i++) 340 for (int i = 0; i < m_neighbours.Count; i++)
341 { 341 {
342 // The purpose of this loop is to re-update the known neighbors 342 // The purpose of this loop is to re-update the known neighbors
343 // when another region comes up on top of another one. 343 // when another region comes up on top of another one.
344 // The latest region in that location ends up in the 344 // The latest region in that location ends up in the
345 // 'known neighbors list' 345 // 'known neighbors list'
346 // Additionally, the commFailTF property gets reset to false. 346 // Additionally, the commFailTF property gets reset to false.
347 if (m_neighbours[i].RegionHandle == otherRegion.RegionHandle) 347 if (m_neighbours[i].RegionHandle == otherRegion.RegionHandle)
@@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Scenes
354 } 354 }
355 355
356 // If the value isn't in the neighbours, add it. 356 // If the value isn't in the neighbours, add it.
357 // If the RegionInfo isn't exact but is for the same XY World location, 357 // If the RegionInfo isn't exact but is for the same XY World location,
358 // then the above loop will fix that. 358 // then the above loop will fix that.
359 359
360 if (!(CheckNeighborRegion(otherRegion))) 360 if (!(CheckNeighborRegion(otherRegion)))
@@ -431,8 +431,8 @@ namespace OpenSim.Region.Environment.Scenes
431 } 431 }
432 } 432 }
433 return found; 433 return found;
434 434
435 435
436 } 436 }
437 public virtual void Restart(float seconds) 437 public virtual void Restart(float seconds)
438 { 438 {
@@ -461,8 +461,8 @@ namespace OpenSim.Region.Environment.Scenes
461 } 461 }
462 } 462 }
463 463
464 // The Restart timer has occured. 464 // The Restart timer has occured.
465 // We have to figure out if this is a notification or if the number of seconds specified in Restart 465 // We have to figure out if this is a notification or if the number of seconds specified in Restart
466 // have elapsed. 466 // have elapsed.
467 // If they have elapsed, call RestartNow() 467 // If they have elapsed, call RestartNow()
468 public void RestartTimer_Elapsed(object sender, ElapsedEventArgs e) 468 public void RestartTimer_Elapsed(object sender, ElapsedEventArgs e)
@@ -500,7 +500,7 @@ namespace OpenSim.Region.Environment.Scenes
500 } 500 }
501 501
502 // This is a helper function that notifies root agents in this region that a new sim near them has come up 502 // This is a helper function that notifies root agents in this region that a new sim near them has come up
503 // This is in the form of a timer because when an instance of OpenSim.exe is started, 503 // This is in the form of a timer because when an instance of OpenSim.exe is started,
504 // Even though the sims initialize, they don't listen until 'all of the sims are initialized' 504 // Even though the sims initialize, they don't listen until 'all of the sims are initialized'
505 // If we tell an agent about a sim that's not listening yet, the agent will not be able to connect to it. 505 // If we tell an agent about a sim that's not listening yet, the agent will not be able to connect to it.
506 // subsequently the agent will never see the region come back online. 506 // subsequently the agent will never see the region come back online.
@@ -730,7 +730,7 @@ namespace OpenSim.Region.Environment.Scenes
730 if (m_frame % m_update_entities == 0) 730 if (m_frame % m_update_entities == 0)
731 m_innerScene.UpdateEntities(); 731 m_innerScene.UpdateEntities();
732 732
733 // run through entities that have scheduled themselves for 733 // run through entities that have scheduled themselves for
734 // updates looking for updates(faster) 734 // updates looking for updates(faster)
735 if (m_frame % m_update_entitiesquick == 0) 735 if (m_frame % m_update_entitiesquick == 0)
736 m_innerScene.ProcessUpdates(); 736 m_innerScene.ProcessUpdates();
@@ -743,13 +743,13 @@ namespace OpenSim.Region.Environment.Scenes
743 { 743 {
744 if (m_frame % m_update_events == 0) 744 if (m_frame % m_update_events == 0)
745 UpdateEvents(); 745 UpdateEvents();
746 746
747 if (m_frame % m_update_backup == 0) 747 if (m_frame % m_update_backup == 0)
748 UpdateStorageBackup(); 748 UpdateStorageBackup();
749 749
750 if (m_frame % m_update_terrain == 0) 750 if (m_frame % m_update_terrain == 0)
751 UpdateTerrain(); 751 UpdateTerrain();
752 752
753 if (m_frame % m_update_land == 0) 753 if (m_frame % m_update_land == 0)
754 UpdateLand(); 754 UpdateLand();
755 otherMS = System.Environment.TickCount - otherMS; 755 otherMS = System.Environment.TickCount - otherMS;
@@ -800,14 +800,14 @@ namespace OpenSim.Region.Environment.Scenes
800 // Get actual time dilation 800 // Get actual time dilation
801 float tmpval = (m_timespan / (float)SinceLastFrame.TotalSeconds); 801 float tmpval = (m_timespan / (float)SinceLastFrame.TotalSeconds);
802 802
803 // If actual time dilation is greater then one, we're catching up, so subtract 803 // If actual time dilation is greater then one, we're catching up, so subtract
804 // the amount that's greater then 1 from the time dilation 804 // the amount that's greater then 1 from the time dilation
805 if (tmpval > 1.0) 805 if (tmpval > 1.0)
806 { 806 {
807 tmpval = tmpval - (tmpval - 1.0f); 807 tmpval = tmpval - (tmpval - 1.0f);
808 } 808 }
809 m_timedilation = tmpval; 809 m_timedilation = tmpval;
810 810
811 m_lastupdate = DateTime.Now; 811 m_lastupdate = DateTime.Now;
812 } 812 }
813 } 813 }
@@ -858,9 +858,9 @@ namespace OpenSim.Region.Environment.Scenes
858 { 858 {
859 ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); }); 859 ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); });
860 } 860 }
861 861
862 /// <summary> 862 /// <summary>
863 /// 863 ///
864 /// </summary> 864 /// </summary>
865 /// <returns></returns> 865 /// <returns></returns>
866 public bool Backup() 866 public bool Backup()
@@ -929,7 +929,7 @@ namespace OpenSim.Region.Environment.Scenes
929 /// <summary> 929 /// <summary>
930 /// Loads the World heightmap 930 /// Loads the World heightmap
931 /// </summary> 931 /// </summary>
932 /// 932 ///
933 public override void LoadWorldMap() 933 public override void LoadWorldMap()
934 { 934 {
935 try 935 try
@@ -946,7 +946,7 @@ namespace OpenSim.Region.Environment.Scenes
946 { 946 {
947 Heightmap = new TerrainChannel(map); 947 Heightmap = new TerrainChannel(map);
948 } 948 }
949 949
950 } 950 }
951 catch (Exception e) 951 catch (Exception e)
952 { 952 {
@@ -961,13 +961,13 @@ namespace OpenSim.Region.Environment.Scenes
961 public void RegisterRegionWithGrid() 961 public void RegisterRegionWithGrid()
962 { 962 {
963 RegisterCommsEvents(); 963 RegisterCommsEvents();
964 964
965 // These two 'commands' *must be* next to each other or sim rebooting fails. 965 // These two 'commands' *must be* next to each other or sim rebooting fails.
966 m_sceneGridService.RegisterRegion(RegionInfo); 966 m_sceneGridService.RegisterRegion(RegionInfo);
967 m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo); 967 m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo);
968 968
969 Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings(); 969 Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings();
970 970
971 if (dGridSettings.ContainsKey("allow_forceful_banlines")) 971 if (dGridSettings.ContainsKey("allow_forceful_banlines"))
972 { 972 {
973 if (dGridSettings["allow_forceful_banlines"] != "TRUE") 973 if (dGridSettings["allow_forceful_banlines"] != "TRUE")
@@ -984,11 +984,11 @@ namespace OpenSim.Region.Environment.Scenes
984 } 984 }
985 985
986 /// <summary> 986 /// <summary>
987 /// 987 ///
988 /// </summary> 988 /// </summary>
989 public void CreateTerrainTexture(bool temporary) 989 public void CreateTerrainTexture(bool temporary)
990 { 990 {
991 //create a texture asset of the terrain 991 //create a texture asset of the terrain
992 IMapImageGenerator terrain = RequestModuleInterface<IMapImageGenerator>(); 992 IMapImageGenerator terrain = RequestModuleInterface<IMapImageGenerator>();
993 993
994 // Cannot create a map for a nonexistant heightmap yet. 994 // Cannot create a map for a nonexistant heightmap yet.
@@ -1129,7 +1129,7 @@ namespace OpenSim.Region.Environment.Scenes
1129 AssetCache.AddAsset(asset); 1129 AssetCache.AddAsset(asset);
1130 } 1130 }
1131 } 1131 }
1132 1132
1133 } 1133 }
1134 1134
1135 #endregion 1135 #endregion
@@ -1211,7 +1211,7 @@ namespace OpenSim.Region.Environment.Scenes
1211 if (RayTargetID != LLUUID.Zero) 1211 if (RayTargetID != LLUUID.Zero)
1212 { 1212 {
1213 SceneObjectPart target = GetSceneObjectPart(RayTargetID); 1213 SceneObjectPart target = GetSceneObjectPart(RayTargetID);
1214 1214
1215 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); 1215 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart);
1216 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 1216 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
1217 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 1217 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
@@ -1220,9 +1220,9 @@ namespace OpenSim.Region.Environment.Scenes
1220 { 1220 {
1221 pos = target.AbsolutePosition; 1221 pos = target.AbsolutePosition;
1222 //m_log.Info("[OBJECT_REZ]: TargetPos: " + pos.ToString() + ", RayStart: " + RayStart.ToString() + ", RayEnd: " + RayEnd.ToString() + ", Volume: " + Util.GetDistanceTo(RayStart,RayEnd).ToString() + ", mag1: " + Util.GetMagnitude(RayStart).ToString() + ", mag2: " + Util.GetMagnitude(RayEnd).ToString()); 1222 //m_log.Info("[OBJECT_REZ]: TargetPos: " + pos.ToString() + ", RayStart: " + RayStart.ToString() + ", RayEnd: " + RayEnd.ToString() + ", Volume: " + Util.GetDistanceTo(RayStart,RayEnd).ToString() + ", mag1: " + Util.GetMagnitude(RayStart).ToString() + ", mag2: " + Util.GetMagnitude(RayEnd).ToString());
1223 1223
1224 // TODO: Raytrace better here 1224 // TODO: Raytrace better here
1225 1225
1226 //EntityIntersection ei = m_innerScene.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection)); 1226 //EntityIntersection ei = m_innerScene.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection));
1227 Ray NewRay = new Ray(AXOrigin, AXdirection); 1227 Ray NewRay = new Ray(AXOrigin, AXdirection);
1228 1228
@@ -1246,13 +1246,13 @@ namespace OpenSim.Region.Environment.Scenes
1246 // Set the position to the intersection point 1246 // Set the position to the intersection point
1247 LLVector3 offset = (normal * (ScaleOffset / 2f)); 1247 LLVector3 offset = (normal * (ScaleOffset / 2f));
1248 pos = (intersectionpoint + offset); 1248 pos = (intersectionpoint + offset);
1249 1249
1250 // Un-offset the prim (it gets offset later by the consumer method) 1250 // Un-offset the prim (it gets offset later by the consumer method)
1251 pos.Z -= 0.25F; 1251 pos.Z -= 0.25F;
1252 1252
1253 } 1253 }
1254 1254
1255 1255
1256 return pos; 1256 return pos;
1257 } 1257 }
1258 else 1258 else
@@ -1267,8 +1267,8 @@ namespace OpenSim.Region.Environment.Scenes
1267 if (ei.HitTF) 1267 if (ei.HitTF)
1268 { 1268 {
1269 pos = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); 1269 pos = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z);
1270 } 1270 }
1271 1271
1272 return pos; 1272 return pos;
1273 } 1273 }
1274 } 1274 }
@@ -1284,7 +1284,7 @@ namespace OpenSim.Region.Environment.Scenes
1284 byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, 1284 byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID,
1285 byte RayEndIsIntersection) 1285 byte RayEndIsIntersection)
1286 { 1286 {
1287 1287
1288 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false); 1288 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false);
1289 1289
1290 if ( ExternalChecks.ExternalChecksCanRezObject(1,ownerID,pos)) 1290 if ( ExternalChecks.ExternalChecksCanRezObject(1,ownerID,pos))
@@ -1386,11 +1386,11 @@ namespace OpenSim.Region.Environment.Scenes
1386 1386
1387 /// <summary> 1387 /// <summary>
1388 /// Locate New region Handle and offset the prim position for the new region 1388 /// Locate New region Handle and offset the prim position for the new region
1389 /// 1389 ///
1390 /// </summary> 1390 /// </summary>
1391 /// <param name="position">current position of Group</param> 1391 /// <param name="position">current position of Group</param>
1392 /// <param name="grp">Scene Object Group that we're crossing</param> 1392 /// <param name="grp">Scene Object Group that we're crossing</param>
1393 1393
1394 public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp) 1394 public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp)
1395 { 1395 {
1396 if (grp == null) 1396 if (grp == null)
@@ -1424,7 +1424,7 @@ namespace OpenSim.Region.Environment.Scenes
1424 pos.X = ((pos.X - Constants.RegionSize)); 1424 pos.X = ((pos.X - Constants.RegionSize));
1425 1425
1426 newRegionHandle = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize)); 1426 newRegionHandle = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize));
1427 1427
1428 // x + 1 1428 // x + 1
1429 } 1429 }
1430 else if (position.X < -0.1f) 1430 else if (position.X < -0.1f)
@@ -1449,7 +1449,7 @@ namespace OpenSim.Region.Environment.Scenes
1449 1449
1450 // Offset the positions for the new region across the border 1450 // Offset the positions for the new region across the border
1451 grp.OffsetForNewRegion(pos); 1451 grp.OffsetForNewRegion(pos);
1452 1452
1453 CrossPrimGroupIntoNewRegion(newRegionHandle, grp); 1453 CrossPrimGroupIntoNewRegion(newRegionHandle, grp);
1454 1454
1455 } 1455 }
@@ -1507,7 +1507,7 @@ namespace OpenSim.Region.Environment.Scenes
1507 if (sp != null) 1507 if (sp != null)
1508 { 1508 {
1509 // hack assetID until we get assetID into the XML format. 1509 // hack assetID until we get assetID into the XML format.
1510 // LastOwnerID is used for group deeding, so when you do stuff 1510 // LastOwnerID is used for group deeding, so when you do stuff
1511 // with the deeded object, it goes back to them 1511 // with the deeded object, it goes back to them
1512 1512
1513 grp.SetFromAssetID(grp.RootPart.LastOwnerID); 1513 grp.SetFromAssetID(grp.RootPart.LastOwnerID);
@@ -1515,7 +1515,7 @@ namespace OpenSim.Region.Environment.Scenes
1515 } 1515 }
1516 } 1516 }
1517 } 1517 }
1518 1518
1519 1519
1520 } 1520 }
1521 } 1521 }
@@ -1533,16 +1533,16 @@ namespace OpenSim.Region.Environment.Scenes
1533 #region Add/Remove Avatar Methods 1533 #region Add/Remove Avatar Methods
1534 1534
1535 /// <summary> 1535 /// <summary>
1536 /// 1536 ///
1537 /// </summary> 1537 /// </summary>
1538 /// <param name="client"></param 1538 /// <param name="client"></param
1539 /// <param name="child"></param> 1539 /// <param name="child"></param>
1540 public override void AddNewClient(IClientAPI client, bool child) 1540 public override void AddNewClient(IClientAPI client, bool child)
1541 { 1541 {
1542 m_log.DebugFormat( 1542 m_log.DebugFormat(
1543 "[CONNECTION DEBUGGING]: Creating new client for {0} at {1}", 1543 "[CONNECTION DEBUGGING]: Creating new client for {0} at {1}",
1544 client.AgentId, RegionInfo.RegionName); 1544 client.AgentId, RegionInfo.RegionName);
1545 1545
1546 SubscribeToClientEvents(client); 1546 SubscribeToClientEvents(client);
1547 ScenePresence presence; 1547 ScenePresence presence;
1548 1548
@@ -1618,7 +1618,7 @@ namespace OpenSim.Region.Environment.Scenes
1618 client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay; 1618 client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay;
1619 client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags; 1619 client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags;
1620 client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily; 1620 client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily;
1621 1621
1622 client.OnRequestGodlikePowers += handleRequestGodlikePowers; 1622 client.OnRequestGodlikePowers += handleRequestGodlikePowers;
1623 client.OnGodKickUser += HandleGodlikeKickUser; 1623 client.OnGodKickUser += HandleGodlikeKickUser;
1624 client.OnObjectPermissions += HandleObjectPermissionsUpdate; 1624 client.OnObjectPermissions += HandleObjectPermissionsUpdate;
@@ -1655,7 +1655,7 @@ namespace OpenSim.Region.Environment.Scenes
1655 1655
1656 client.OnSetStartLocationRequest += SetHomeRezPoint; 1656 client.OnSetStartLocationRequest += SetHomeRezPoint;
1657 client.OnUndo += m_innerScene.HandleUndo; 1657 client.OnUndo += m_innerScene.HandleUndo;
1658 1658
1659 EventManager.TriggerOnNewClient(client); 1659 EventManager.TriggerOnNewClient(client);
1660 } 1660 }
1661 public virtual void TeleportClientHome(LLUUID AgentId, IClientAPI client) 1661 public virtual void TeleportClientHome(LLUUID AgentId, IClientAPI client)
@@ -1669,14 +1669,14 @@ namespace OpenSim.Region.Environment.Scenes
1669 RequestTeleportLocation(client, homeRegion, homePostion,homeLookat,(uint)0); 1669 RequestTeleportLocation(client, homeRegion, homePostion,homeLookat,(uint)0);
1670 } 1670 }
1671 } 1671 }
1672 1672
1673 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, 1673 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID,
1674 LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, 1674 LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart,
1675 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) 1675 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates)
1676 { 1676 {
1677 LLVector3 pos; 1677 LLVector3 pos;
1678 const bool frontFacesOnly = true; 1678 const bool frontFacesOnly = true;
1679 1679
1680 SceneObjectPart target = GetSceneObjectPart(localID); 1680 SceneObjectPart target = GetSceneObjectPart(localID);
1681 SceneObjectPart target2 = GetSceneObjectPart(RayTargetObj); 1681 SceneObjectPart target2 = GetSceneObjectPart(RayTargetObj);
1682 1682
@@ -1685,8 +1685,8 @@ namespace OpenSim.Region.Environment.Scenes
1685 1685
1686 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); 1686 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart);
1687 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 1687 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
1688 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 1688 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
1689 1689
1690 if (target2.ParentGroup != null) 1690 if (target2.ParentGroup != null)
1691 { 1691 {
1692 pos = target2.AbsolutePosition; 1692 pos = target2.AbsolutePosition;
@@ -1717,7 +1717,7 @@ namespace OpenSim.Region.Environment.Scenes
1717 LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z); 1717 LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z);
1718 LLVector3 offset = (normal * (ScaleOffset / 2f)); 1718 LLVector3 offset = (normal * (ScaleOffset / 2f));
1719 pos = (intersectionpoint + offset); 1719 pos = (intersectionpoint + offset);
1720 1720
1721 if (CopyCenters) 1721 if (CopyCenters)
1722 { 1722 {
1723 // now we cast a ray from inside the prim(absolute position) to one of it's faces along the face normal. 1723 // now we cast a ray from inside the prim(absolute position) to one of it's faces along the face normal.
@@ -1735,7 +1735,7 @@ namespace OpenSim.Region.Environment.Scenes
1735 normal.Z = ei2.normal.z; 1735 normal.Z = ei2.normal.z;
1736 } 1736 }
1737 } 1737 }
1738 1738
1739 // Set the position to the intersection point 1739 // Set the position to the intersection point
1740 offset = (normal * (ScaleOffset / 2f)); 1740 offset = (normal * (ScaleOffset / 2f));
1741 pos = (intersectionpoint + offset); 1741 pos = (intersectionpoint + offset);
@@ -1749,8 +1749,8 @@ namespace OpenSim.Region.Environment.Scenes
1749 return; 1749 return;
1750 } 1750 }
1751 return; 1751 return;
1752 1752
1753 1753
1754 } 1754 }
1755 1755
1756 1756
@@ -1776,7 +1776,7 @@ namespace OpenSim.Region.Environment.Scenes
1776 UserProfile.HomeLookAtY = (int)lookAt.Y; 1776 UserProfile.HomeLookAtY = (int)lookAt.Y;
1777 UserProfile.HomeLookAtZ = (int)lookAt.Z; 1777 UserProfile.HomeLookAtZ = (int)lookAt.Z;
1778 CommsManager.UserService.UpdateUserProfileProperties(UserProfile); 1778 CommsManager.UserService.UpdateUserProfileProperties(UserProfile);
1779 1779
1780 remoteClient.SendAgentAlertMessage("Set home to here if supported by login service",false); 1780 remoteClient.SendAgentAlertMessage("Set home to here if supported by login service",false);
1781 } 1781 }
1782 else 1782 else
@@ -1784,7 +1784,7 @@ namespace OpenSim.Region.Environment.Scenes
1784 remoteClient.SendAgentAlertMessage("Set Home request Failed",false); 1784 remoteClient.SendAgentAlertMessage("Set Home request Failed",false);
1785 } 1785 }
1786 } 1786 }
1787 1787
1788 protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child) 1788 protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child)
1789 { 1789 {
1790 AvatarAppearance appearance; 1790 AvatarAppearance appearance;
@@ -1844,7 +1844,7 @@ namespace OpenSim.Region.Environment.Scenes
1844 m_sceneGridService.SendCloseChildAgentConnections(agentID, childknownRegions); 1844 m_sceneGridService.SendCloseChildAgentConnections(agentID, childknownRegions);
1845 1845
1846 RemoveCapsHandler(agentID); 1846 RemoveCapsHandler(agentID);
1847 1847
1848 CommsManager.UserProfileCacheService.RemoveUser(agentID); 1848 CommsManager.UserProfileCacheService.RemoveUser(agentID);
1849 } 1849 }
1850 1850
@@ -1870,7 +1870,7 @@ namespace OpenSim.Region.Environment.Scenes
1870 1870
1871 ForEachScenePresence( 1871 ForEachScenePresence(
1872 delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); 1872 delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
1873 1873
1874 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); 1874 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
1875 if (agentTransactions != null) 1875 if (agentTransactions != null)
1876 { 1876 {
@@ -1921,7 +1921,7 @@ namespace OpenSim.Region.Environment.Scenes
1921 } 1921 }
1922 1922
1923 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 1923 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
1924 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); 1924 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
1925 } 1925 }
1926 1926
1927 public void HandleRemoveKnownRegionsFromAvatar(LLUUID avatarID, List<ulong> regionslst) 1927 public void HandleRemoveKnownRegionsFromAvatar(LLUUID avatarID, List<ulong> regionslst)
@@ -1931,7 +1931,7 @@ namespace OpenSim.Region.Environment.Scenes
1931 { 1931 {
1932 lock (av) 1932 lock (av)
1933 { 1933 {
1934 1934
1935 for (int i = 0; i < regionslst.Count; i++) 1935 for (int i = 0; i < regionslst.Count; i++)
1936 { 1936 {
1937 av.KnownChildRegions.Remove(regionslst[i]); 1937 av.KnownChildRegions.Remove(regionslst[i]);
@@ -1957,7 +1957,7 @@ namespace OpenSim.Region.Environment.Scenes
1957 #region Entities 1957 #region Entities
1958 1958
1959 /// <summary> 1959 /// <summary>
1960 /// 1960 ///
1961 /// </summary> 1961 /// </summary>
1962 /// <param name="entID"></param> 1962 /// <param name="entID"></param>
1963 /// <returns></returns> 1963 /// <returns></returns>
@@ -1983,7 +1983,7 @@ namespace OpenSim.Region.Environment.Scenes
1983 #region RegionComms 1983 #region RegionComms
1984 1984
1985 /// <summary> 1985 /// <summary>
1986 /// 1986 ///
1987 /// </summary> 1987 /// </summary>
1988 public void RegisterCommsEvents() 1988 public void RegisterCommsEvents()
1989 { 1989 {
@@ -1999,7 +1999,7 @@ namespace OpenSim.Region.Environment.Scenes
1999 } 1999 }
2000 2000
2001 /// <summary> 2001 /// <summary>
2002 /// 2002 ///
2003 /// </summary> 2003 /// </summary>
2004 public void UnRegisterReginWithComms() 2004 public void UnRegisterReginWithComms()
2005 { 2005 {
@@ -2026,7 +2026,7 @@ namespace OpenSim.Region.Environment.Scenes
2026 if (regionHandle == m_regInfo.RegionHandle) 2026 if (regionHandle == m_regInfo.RegionHandle)
2027 { 2027 {
2028 capsPaths[agent.AgentID] = agent.CapsPath; 2028 capsPaths[agent.AgentID] = agent.CapsPath;
2029 2029
2030 if (!agent.child) 2030 if (!agent.child)
2031 { 2031 {
2032 AddCapsHandler(agent.AgentID); 2032 AddCapsHandler(agent.AgentID);
@@ -2041,44 +2041,44 @@ namespace OpenSim.Region.Environment.Scenes
2041 } 2041 }
2042 } 2042 }
2043 } 2043 }
2044 2044
2045 m_log.DebugFormat( 2045 m_log.DebugFormat(
2046 "[CONNECTION DEBUGGING]: Creating new circuit code ({0}) for avatar {1} at {2}", 2046 "[CONNECTION DEBUGGING]: Creating new circuit code ({0}) for avatar {1} at {2}",
2047 agent.circuitcode, agent.AgentID, RegionInfo.RegionName); 2047 agent.circuitcode, agent.AgentID, RegionInfo.RegionName);
2048 2048
2049 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 2049 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
2050 } 2050 }
2051 else 2051 else
2052 { 2052 {
2053 m_log.WarnFormat( 2053 m_log.WarnFormat(
2054 "[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}", 2054 "[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}",
2055 agent.AgentID, regionHandle, RegionInfo.RegionName); 2055 agent.AgentID, regionHandle, RegionInfo.RegionName);
2056 } 2056 }
2057 } 2057 }
2058 2058
2059 /// <summary> 2059 /// <summary>
2060 /// Add a caps handler for the given agent. If the CAPS handler already exists for this agent, 2060 /// Add a caps handler for the given agent. If the CAPS handler already exists for this agent,
2061 /// then it is replaced by a new CAPS handler. 2061 /// then it is replaced by a new CAPS handler.
2062 /// 2062 ///
2063 /// FIXME: On login this is called twice, once for the login and once when the connection is made. 2063 /// FIXME: On login this is called twice, once for the login and once when the connection is made.
2064 /// This is somewhat innefficient and should be fixed. The initial login creation is necessary 2064 /// This is somewhat innefficient and should be fixed. The initial login creation is necessary
2065 /// since the client asks for capabilities immediately after being informed of the seed. 2065 /// since the client asks for capabilities immediately after being informed of the seed.
2066 /// </summary> 2066 /// </summary>
2067 /// <param name="agentId"></param> 2067 /// <param name="agentId"></param>
2068 /// <param name="capsObjectPath"></param> 2068 /// <param name="capsObjectPath"></param>
2069 public void AddCapsHandler(LLUUID agentId) 2069 public void AddCapsHandler(LLUUID agentId)
2070 { 2070 {
2071 String capsObjectPath = GetCapsPath(agentId); 2071 String capsObjectPath = GetCapsPath(agentId);
2072 2072
2073 m_log.DebugFormat( 2073 m_log.DebugFormat(
2074 "[CAPS]: Setting up CAPS handler for root agent {0} in {1}", 2074 "[CAPS]: Setting up CAPS handler for root agent {0} in {1}",
2075 agentId, RegionInfo.RegionName); 2075 agentId, RegionInfo.RegionName);
2076 2076
2077 Caps cap = 2077 Caps cap =
2078 new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port, 2078 new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port,
2079 capsObjectPath, agentId, m_dumpAssetsToFile, RegionInfo.RegionName); 2079 capsObjectPath, agentId, m_dumpAssetsToFile, RegionInfo.RegionName);
2080 cap.RegisterHandlers(); 2080 cap.RegisterHandlers();
2081 2081
2082 EventManager.TriggerOnRegisterCaps(agentId, cap); 2082 EventManager.TriggerOnRegisterCaps(agentId, cap);
2083 2083
2084 cap.AddNewInventoryItem = AddInventoryItem; 2084 cap.AddNewInventoryItem = AddInventoryItem;
@@ -2087,7 +2087,7 @@ namespace OpenSim.Region.Environment.Scenes
2087 cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS; 2087 cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS;
2088 cap.GetClient = m_innerScene.GetControllingClient; 2088 cap.GetClient = m_innerScene.GetControllingClient;
2089 m_capsHandlers[agentId] = cap; 2089 m_capsHandlers[agentId] = cap;
2090 } 2090 }
2091 2091
2092 /// <summary> 2092 /// <summary>
2093 /// Remove the caps handler for a given agent. 2093 /// Remove the caps handler for a given agent.
@@ -2100,9 +2100,9 @@ namespace OpenSim.Region.Environment.Scenes
2100 if (m_capsHandlers.ContainsKey(agentId)) 2100 if (m_capsHandlers.ContainsKey(agentId))
2101 { 2101 {
2102 m_log.DebugFormat( 2102 m_log.DebugFormat(
2103 "[CAPS]: Removing CAPS handler for root agent {0} in {1}", 2103 "[CAPS]: Removing CAPS handler for root agent {0} in {1}",
2104 agentId, RegionInfo.RegionName); 2104 agentId, RegionInfo.RegionName);
2105 2105
2106 m_capsHandlers[agentId].DeregisterHandlers(); 2106 m_capsHandlers[agentId].DeregisterHandlers();
2107 EventManager.TriggerOnDeregisterCaps(agentId, m_capsHandlers[agentId]); 2107 EventManager.TriggerOnDeregisterCaps(agentId, m_capsHandlers[agentId]);
2108 2108
@@ -2118,7 +2118,7 @@ namespace OpenSim.Region.Environment.Scenes
2118 } 2118 }
2119 2119
2120 /// <summary> 2120 /// <summary>
2121 /// 2121 ///
2122 /// </summary> 2122 /// </summary>
2123 /// <param name="regionHandle"></param> 2123 /// <param name="regionHandle"></param>
2124 /// <param name="agentID"></param> 2124 /// <param name="agentID"></param>
@@ -2152,8 +2152,8 @@ namespace OpenSim.Region.Environment.Scenes
2152 ScenePresence childAgentUpdate = GetScenePresence(new LLUUID(cAgentData.AgentID)); 2152 ScenePresence childAgentUpdate = GetScenePresence(new LLUUID(cAgentData.AgentID));
2153 if (childAgentUpdate != null) 2153 if (childAgentUpdate != null)
2154 { 2154 {
2155 // I can't imagine *yet* why we would get an update if the agent is a root agent.. 2155 // I can't imagine *yet* why we would get an update if the agent is a root agent..
2156 // however to avoid a race condition crossing borders.. 2156 // however to avoid a race condition crossing borders..
2157 if (childAgentUpdate.IsChildAgent) 2157 if (childAgentUpdate.IsChildAgent)
2158 { 2158 {
2159 uint rRegionX = (uint)(cAgentData.regionHandle >> 40); 2159 uint rRegionX = (uint)(cAgentData.regionHandle >> 40);
@@ -2193,7 +2193,7 @@ namespace OpenSim.Region.Environment.Scenes
2193 } 2193 }
2194 // Tell a single agent to disconnect from the region. 2194 // Tell a single agent to disconnect from the region.
2195 presence.ControllingClient.SendShutdownConnectionNotice(); 2195 presence.ControllingClient.SendShutdownConnectionNotice();
2196 2196
2197 presence.ControllingClient.Close(true); 2197 presence.ControllingClient.Close(true);
2198 } 2198 }
2199 } 2199 }
@@ -2202,11 +2202,11 @@ namespace OpenSim.Region.Environment.Scenes
2202 2202
2203 /// <summary> 2203 /// <summary>
2204 /// Tell neighboring regions about this agent 2204 /// Tell neighboring regions about this agent
2205 /// When the regions respond with a true value, 2205 /// When the regions respond with a true value,
2206 /// tell the agents about the region. 2206 /// tell the agents about the region.
2207 /// 2207 ///
2208 /// We have to tell the regions about the agents first otherwise it'll deny them access 2208 /// We have to tell the regions about the agents first otherwise it'll deny them access
2209 /// 2209 ///
2210 /// </summary> 2210 /// </summary>
2211 /// <param name="presence"></param> 2211 /// <param name="presence"></param>
2212 public void InformClientOfNeighbours(ScenePresence presence) 2212 public void InformClientOfNeighbours(ScenePresence presence)
@@ -2309,7 +2309,7 @@ namespace OpenSim.Region.Environment.Scenes
2309 #region Module Methods 2309 #region Module Methods
2310 2310
2311 /// <summary> 2311 /// <summary>
2312 /// 2312 ///
2313 /// </summary> 2313 /// </summary>
2314 /// <param name="name"></param> 2314 /// <param name="name"></param>
2315 /// <param name="module"></param> 2315 /// <param name="module"></param>
@@ -2379,21 +2379,21 @@ namespace OpenSim.Region.Environment.Scenes
2379 m_statsReporter.SetObjectCapacity(objects); 2379 m_statsReporter.SetObjectCapacity(objects);
2380 } 2380 }
2381 objectCapacity = objects; 2381 objectCapacity = objects;
2382 2382
2383 } 2383 }
2384 2384
2385 public List<FriendListItem> GetFriendList(LLUUID avatarID) 2385 public List<FriendListItem> GetFriendList(LLUUID avatarID)
2386 { 2386 {
2387 return CommsManager.GetUserFriendList(avatarID); 2387 return CommsManager.GetUserFriendList(avatarID);
2388 } 2388 }
2389 2389
2390 2390
2391 #endregion 2391 #endregion
2392 2392
2393 #region Other Methods 2393 #region Other Methods
2394 2394
2395 /// <summary> 2395 /// <summary>
2396 /// 2396 ///
2397 /// </summary> 2397 /// </summary>
2398 /// <param name="phase"></param> 2398 /// <param name="phase"></param>
2399 public void SetTimePhase(int phase) 2399 public void SetTimePhase(int phase)
@@ -2402,7 +2402,7 @@ namespace OpenSim.Region.Environment.Scenes
2402 } 2402 }
2403 2403
2404 /// <summary> 2404 /// <summary>
2405 /// 2405 ///
2406 /// </summary> 2406 /// </summary>
2407 /// <param name="avatarID"></param> 2407 /// <param name="avatarID"></param>
2408 /// <param name="objectName"></param> 2408 /// <param name="objectName"></param>
@@ -2437,7 +2437,7 @@ namespace OpenSim.Region.Environment.Scenes
2437 } 2437 }
2438 2438
2439 /// <summary> 2439 /// <summary>
2440 /// 2440 ///
2441 /// </summary> 2441 /// </summary>
2442 /// <param name="url"></param> 2442 /// <param name="url"></param>
2443 /// <param name="type"></param> 2443 /// <param name="type"></param>
@@ -2451,14 +2451,14 @@ namespace OpenSim.Region.Environment.Scenes
2451 } 2451 }
2452 return LLUUID.Zero; 2452 return LLUUID.Zero;
2453 } 2453 }
2454 2454
2455 2455
2456 /// <summary> 2456 /// <summary>
2457 /// This method is a way for the Friends Module to create an instant 2457 /// This method is a way for the Friends Module to create an instant
2458 /// message to the avatar and for Instant Messages that travel across 2458 /// message to the avatar and for Instant Messages that travel across
2459 /// gridcomms to make it to the Instant Message Module. 2459 /// gridcomms to make it to the Instant Message Module.
2460 /// 2460 ///
2461 /// Friendship establishment and groups are unfortunately tied with instant messaging and 2461 /// Friendship establishment and groups are unfortunately tied with instant messaging and
2462 /// there's no way to separate them completely. 2462 /// there's no way to separate them completely.
2463 /// </summary> 2463 /// </summary>
2464 /// <param name="message">object containing the instant message data</param> 2464 /// <param name="message">object containing the instant message data</param>
@@ -2525,7 +2525,7 @@ namespace OpenSim.Region.Environment.Scenes
2525 } 2525 }
2526 2526
2527 /// <summary> 2527 /// <summary>
2528 /// 2528 ///
2529 /// </summary> 2529 /// </summary>
2530 /// <param name="message"></param> 2530 /// <param name="message"></param>
2531 public void SendGeneralAlert(string message) 2531 public void SendGeneralAlert(string message)
@@ -2539,7 +2539,7 @@ namespace OpenSim.Region.Environment.Scenes
2539 } 2539 }
2540 2540
2541 /// <summary> 2541 /// <summary>
2542 /// 2542 ///
2543 /// </summary> 2543 /// </summary>
2544 /// <param name="agentID"></param> 2544 /// <param name="agentID"></param>
2545 /// <param name="message"></param> 2545 /// <param name="message"></param>
@@ -2556,7 +2556,7 @@ namespace OpenSim.Region.Environment.Scenes
2556 } 2556 }
2557 2557
2558 /// <summary> 2558 /// <summary>
2559 /// 2559 ///
2560 /// </summary> 2560 /// </summary>
2561 /// <param name="agentID"></param> 2561 /// <param name="agentID"></param>
2562 /// <param name="sessionID"></param> 2562 /// <param name="sessionID"></param>
@@ -2569,7 +2569,7 @@ namespace OpenSim.Region.Environment.Scenes
2569 { 2569 {
2570 // User needs to be logged into this sim 2570 // User needs to be logged into this sim
2571 if (m_scenePresences.ContainsKey(agentID)) 2571 if (m_scenePresences.ContainsKey(agentID))
2572 { 2572 {
2573 // First check that this is the sim owner 2573 // First check that this is the sim owner
2574 if (ExternalChecks.ExternalChecksCanBeGodLike(agentID)) 2574 if (ExternalChecks.ExternalChecksCanBeGodLike(agentID))
2575 { 2575 {
@@ -2632,8 +2632,8 @@ namespace OpenSim.Region.Environment.Scenes
2632 2632
2633 /// <summary> 2633 /// <summary>
2634 /// Kicks User specified from the simulator. This logs them off of the grid 2634 /// Kicks User specified from the simulator. This logs them off of the grid
2635 /// If the client gets the UUID: 44e87126e7944ded05b37c42da3d5cdb it assumes 2635 /// If the client gets the UUID: 44e87126e7944ded05b37c42da3d5cdb it assumes
2636 /// that you're kicking it even if the avatar's UUID isn't the UUID that the 2636 /// that you're kicking it even if the avatar's UUID isn't the UUID that the
2637 /// agent is assigned 2637 /// agent is assigned
2638 /// </summary> 2638 /// </summary>
2639 /// <param name="godID">The person doing the kicking</param> 2639 /// <param name="godID">The person doing the kicking</param>
@@ -2662,7 +2662,7 @@ namespace OpenSim.Region.Environment.Scenes
2662 2662
2663 } 2663 }
2664 ); 2664 );
2665 2665
2666 // This is a bit crude. It seems the client will be null before it actually stops the thread 2666 // This is a bit crude. It seems the client will be null before it actually stops the thread
2667 // The thread will kill itself eventually :/ 2667 // The thread will kill itself eventually :/
2668 // Is there another way to make sure *all* clients get this 'inter region' message? 2668 // Is there another way to make sure *all* clients get this 'inter region' message?
@@ -2722,7 +2722,7 @@ namespace OpenSim.Region.Environment.Scenes
2722 } 2722 }
2723 2723
2724 /// <summary> 2724 /// <summary>
2725 /// 2725 ///
2726 /// </summary> 2726 /// </summary>
2727 /// <param name="firstName"></param> 2727 /// <param name="firstName"></param>
2728 /// <param name="lastName"></param> 2728 /// <param name="lastName"></param>
@@ -2743,7 +2743,7 @@ namespace OpenSim.Region.Environment.Scenes
2743 } 2743 }
2744 2744
2745 /// <summary> 2745 /// <summary>
2746 /// 2746 ///
2747 /// </summary> 2747 /// </summary>
2748 /// <param name="commandParams"></param> 2748 /// <param name="commandParams"></param>
2749 public void HandleAlertCommand(string[] commandParams) 2749 public void HandleAlertCommand(string[] commandParams)
@@ -2931,7 +2931,7 @@ namespace OpenSim.Region.Environment.Scenes
2931 private bool m_dumpAssetsToFile; 2931 private bool m_dumpAssetsToFile;
2932 2932
2933 /// <summary> 2933 /// <summary>
2934 /// 2934 ///
2935 /// </summary> 2935 /// </summary>
2936 /// <param name="scriptEngine"></param> 2936 /// <param name="scriptEngine"></param>
2937 public void AddScriptEngine(ScriptEngineInterface scriptEngine) 2937 public void AddScriptEngine(ScriptEngineInterface scriptEngine)
@@ -2978,7 +2978,7 @@ namespace OpenSim.Region.Environment.Scenes
2978 { 2978 {
2979 return false; 2979 return false;
2980 } 2980 }
2981 } 2981 }
2982 else 2982 else
2983 { 2983 {
2984 if (part.OwnerID == parcel.landData.ownerID) 2984 if (part.OwnerID == parcel.landData.ownerID)
@@ -2996,7 +2996,7 @@ namespace OpenSim.Region.Environment.Scenes
2996 2996
2997 if (pos.X > 0f && pos.X < Constants.RegionSize && pos.Y > 0f && pos.Y < Constants.RegionSize) 2997 if (pos.X > 0f && pos.X < Constants.RegionSize && pos.Y > 0f && pos.Y < Constants.RegionSize)
2998 { 2998 {
2999 // The only time parcel != null when an object is inside a region is when 2999 // The only time parcel != null when an object is inside a region is when
3000 // there is nothing behind the landchannel. IE, no land plugin loaded. 3000 // there is nothing behind the landchannel. IE, no land plugin loaded.
3001 return true; 3001 return true;
3002 } 3002 }
@@ -3027,7 +3027,7 @@ namespace OpenSim.Region.Environment.Scenes
3027 3027
3028 public bool pipeEventsForScript(uint localID) 3028 public bool pipeEventsForScript(uint localID)
3029 { 3029 {
3030 3030
3031 SceneObjectPart part = GetSceneObjectPart(localID); 3031 SceneObjectPart part = GetSceneObjectPart(localID);
3032 if (part != null) 3032 if (part != null)
3033 { 3033 {
@@ -3046,7 +3046,7 @@ namespace OpenSim.Region.Environment.Scenes
3046 #region InnerScene wrapper methods 3046 #region InnerScene wrapper methods
3047 3047
3048 /// <summary> 3048 /// <summary>
3049 /// 3049 ///
3050 /// </summary> 3050 /// </summary>
3051 /// <param name="localID"></param> 3051 /// <param name="localID"></param>
3052 /// <returns></returns> 3052 /// <returns></returns>
@@ -3071,7 +3071,7 @@ namespace OpenSim.Region.Environment.Scenes
3071 } 3071 }
3072 3072
3073 /// <summary> 3073 /// <summary>
3074 /// 3074 ///
3075 /// </summary> 3075 /// </summary>
3076 /// <param name="presence"></param> 3076 /// <param name="presence"></param>
3077 public void SendAllSceneObjectsToClient(ScenePresence presence) 3077 public void SendAllSceneObjectsToClient(ScenePresence presence)
@@ -3080,10 +3080,10 @@ namespace OpenSim.Region.Environment.Scenes
3080 } 3080 }
3081 3081
3082 //The idea is to have a group of method that return a list of avatars meeting some requirement 3082 //The idea is to have a group of method that return a list of avatars meeting some requirement
3083 // ie it could be all m_scenePresences within a certain range of the calling prim/avatar. 3083 // ie it could be all m_scenePresences within a certain range of the calling prim/avatar.
3084 3084
3085 /// <summary> 3085 /// <summary>
3086 /// 3086 ///
3087 /// </summary> 3087 /// </summary>
3088 /// <returns></returns> 3088 /// <returns></returns>
3089 public List<ScenePresence> GetAvatars() 3089 public List<ScenePresence> GetAvatars()
@@ -3132,7 +3132,7 @@ namespace OpenSim.Region.Environment.Scenes
3132 } 3132 }
3133 3133
3134 /// <summary> 3134 /// <summary>
3135 /// 3135 ///
3136 /// </summary> 3136 /// </summary>
3137 /// <param name="action"></param> 3137 /// <param name="action"></param>
3138 public void ForEachScenePresence(Action<ScenePresence> action) 3138 public void ForEachScenePresence(Action<ScenePresence> action)
@@ -3154,13 +3154,13 @@ namespace OpenSim.Region.Environment.Scenes
3154 } 3154 }
3155 } 3155 }
3156 } 3156 }
3157 3157
3158 /// <summary> 3158 /// <summary>
3159 /// Delete this object from the scene. 3159 /// Delete this object from the scene.
3160 /// </summary> 3160 /// </summary>
3161 /// <param name="group"></param> 3161 /// <param name="group"></param>
3162 public void DeleteSceneObjectGroup(SceneObjectGroup group) 3162 public void DeleteSceneObjectGroup(SceneObjectGroup group)
3163 { 3163 {
3164 SceneObjectPart rootPart = (group).GetChildPart(group.UUID); 3164 SceneObjectPart rootPart = (group).GetChildPart(group.UUID);
3165 if (rootPart.PhysActor != null) 3165 if (rootPart.PhysActor != null)
3166 { 3166 {
@@ -3177,18 +3177,18 @@ namespace OpenSim.Region.Environment.Scenes
3177 m_innerScene.RemoveAPrimCount(); 3177 m_innerScene.RemoveAPrimCount();
3178 } 3178 }
3179 group.DeleteParts(); 3179 group.DeleteParts();
3180 3180
3181 // In case anybody else retains a reference to this group, signal deletion by changing the name 3181 // In case anybody else retains a reference to this group, signal deletion by changing the name
3182 // to null. We can't zero out the UUID because this is taken from the root part, which has already 3182 // to null. We can't zero out the UUID because this is taken from the root part, which has already
3183 // been removed. 3183 // been removed.
3184 // FIXME: This is a really poor temporary solution, since it still leaves plenty of scope for race 3184 // FIXME: This is a really poor temporary solution, since it still leaves plenty of scope for race
3185 // conditions where a user deletes an entity while it is being stored. Really, the update 3185 // conditions where a user deletes an entity while it is being stored. Really, the update
3186 // code needs a redesign. 3186 // code needs a redesign.
3187 group.Name = null; 3187 group.Name = null;
3188 } 3188 }
3189 3189
3190 /// <summary> 3190 /// <summary>
3191 /// 3191 ///
3192 /// </summary> 3192 /// </summary>
3193 /// <param name="action"></param> 3193 /// <param name="action"></param>
3194 // public void ForEachObject(Action<SceneObjectGroup> action) 3194 // public void ForEachObject(Action<SceneObjectGroup> action)
@@ -3207,7 +3207,7 @@ namespace OpenSim.Region.Environment.Scenes
3207 // } 3207 // }
3208 3208
3209 /// <summary> 3209 /// <summary>
3210 /// 3210 ///
3211 /// </summary> 3211 /// </summary>
3212 /// <param name="localID"></param> 3212 /// <param name="localID"></param>
3213 /// <returns></returns> 3213 /// <returns></returns>
@@ -3217,7 +3217,7 @@ namespace OpenSim.Region.Environment.Scenes
3217 } 3217 }
3218 3218
3219 /// <summary> 3219 /// <summary>
3220 /// 3220 ///
3221 /// </summary> 3221 /// </summary>
3222 /// <param name="fullID"></param> 3222 /// <param name="fullID"></param>
3223 /// <returns></returns> 3223 /// <returns></returns>
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index dc67436..fbef367 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -77,11 +77,11 @@ namespace OpenSim.Region.Environment.Scenes
77 { 77 {
78 get { return m_externalChecks; } 78 get { return m_externalChecks; }
79 } 79 }
80 80
81 protected string m_datastore; 81 protected string m_datastore;
82 82
83 private uint m_nextLocalId = 8880000; 83 private uint m_nextLocalId = 8880000;
84 84
85 private AssetCache m_assetCache; 85 private AssetCache m_assetCache;
86 86
87 public AssetCache AssetCache 87 public AssetCache AssetCache
@@ -89,8 +89,8 @@ namespace OpenSim.Region.Environment.Scenes
89 get { return m_assetCache; } 89 get { return m_assetCache; }
90 set { m_assetCache = value; } 90 set { m_assetCache = value; }
91 } 91 }
92 92
93 protected RegionStatus m_regStatus; 93 protected RegionStatus m_regStatus;
94 94
95 public RegionStatus Region_Status 95 public RegionStatus Region_Status
96 { 96 {
@@ -130,7 +130,7 @@ namespace OpenSim.Region.Environment.Scenes
130 #region Add/Remove Agent/Avatar 130 #region Add/Remove Agent/Avatar
131 131
132 /// <summary> 132 /// <summary>
133 /// 133 ///
134 /// </summary> 134 /// </summary>
135 /// <param name="remoteClient"></param> 135 /// <param name="remoteClient"></param>
136 /// <param name="agentID"></param> 136 /// <param name="agentID"></param>
@@ -138,7 +138,7 @@ namespace OpenSim.Region.Environment.Scenes
138 public abstract void AddNewClient(IClientAPI client, bool child); 138 public abstract void AddNewClient(IClientAPI client, bool child);
139 139
140 /// <summary> 140 /// <summary>
141 /// 141 ///
142 /// </summary> 142 /// </summary>
143 /// <param name="agentID"></param> 143 /// <param name="agentID"></param>
144 public abstract void RemoveClient(LLUUID agentID); 144 public abstract void RemoveClient(LLUUID agentID);
@@ -148,7 +148,7 @@ namespace OpenSim.Region.Environment.Scenes
148 #endregion 148 #endregion
149 149
150 /// <summary> 150 /// <summary>
151 /// 151 ///
152 /// </summary> 152 /// </summary>
153 /// <returns></returns> 153 /// <returns></returns>
154 public virtual RegionInfo RegionInfo 154 public virtual RegionInfo RegionInfo
@@ -206,7 +206,7 @@ namespace OpenSim.Region.Environment.Scenes
206 } 206 }
207 207
208 #endregion 208 #endregion
209 209
210 /// <summary> 210 /// <summary>
211 /// XXX These two methods are very temporary 211 /// XXX These two methods are very temporary
212 /// </summary> 212 /// </summary>
@@ -217,7 +217,7 @@ namespace OpenSim.Region.Environment.Scenes
217 { 217 {
218 return capsPaths[agentId]; 218 return capsPaths[agentId];
219 } 219 }
220 220
221 return null; 221 return null;
222 } 222 }
223 } 223 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 18ce61a..885d1e9 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Scenes
104 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; 104 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
105 regionCommsHost.OnCloseAgentConnection += CloseConnection; 105 regionCommsHost.OnCloseAgentConnection += CloseConnection;
106 regionCommsHost.OnRegionUp += newRegionUp; 106 regionCommsHost.OnRegionUp += newRegionUp;
107 regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate; 107 regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate;
108 } 108 }
109 else 109 else
110 { 110 {
@@ -130,7 +130,7 @@ namespace OpenSim.Region.Environment.Scenes
130 #region CommsManager Event handlers 130 #region CommsManager Event handlers
131 131
132 /// <summary> 132 /// <summary>
133 /// 133 ///
134 /// </summary> 134 /// </summary>
135 /// <param name="regionHandle"></param> 135 /// <param name="regionHandle"></param>
136 /// <param name="agent"></param> 136 /// <param name="agent"></param>
@@ -289,7 +289,7 @@ namespace OpenSim.Region.Environment.Scenes
289 agent.child = true; 289 agent.child = true;
290 290
291 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; 291 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
292 292
293 try 293 try
294 { 294 {
295 d.BeginInvoke(avatar, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint, 295 d.BeginInvoke(avatar, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint,
@@ -299,20 +299,20 @@ namespace OpenSim.Region.Environment.Scenes
299 catch (Exception e) 299 catch (Exception e)
300 { 300 {
301 m_log.ErrorFormat( 301 m_log.ErrorFormat(
302 "[REGIONINFO]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}", 302 "[REGIONINFO]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}",
303 neighbours[i].ExternalHostName, 303 neighbours[i].ExternalHostName,
304 neighbours[i].RegionHandle, 304 neighbours[i].RegionHandle,
305 neighbours[i].RegionLocX, 305 neighbours[i].RegionLocX,
306 neighbours[i].RegionLocY, 306 neighbours[i].RegionLocY,
307 e); 307 e);
308 308
309 // FIXME: Okay, even though we've failed, we're still going to throw the exception on, 309 // FIXME: Okay, even though we've failed, we're still going to throw the exception on,
310 // since I don't know what will happen if we just let the client continue 310 // since I don't know what will happen if we just let the client continue
311 311
312 // XXX: Well, decided to swallow the exception instead for now. Let us see how that goes. 312 // XXX: Well, decided to swallow the exception instead for now. Let us see how that goes.
313 // throw e; 313 // throw e;
314 314
315 } 315 }
316 } 316 }
317 } 317 }
318 } 318 }
@@ -362,12 +362,12 @@ namespace OpenSim.Region.Environment.Scenes
362 { 362 {
363 m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here"); 363 m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here");
364 handlerRegionUp = OnRegionUp; 364 handlerRegionUp = OnRegionUp;
365 365
366 // yes, we're notifying ourselves. 366 // yes, we're notifying ourselves.
367 if (handlerRegionUp != null) 367 if (handlerRegionUp != null)
368 handlerRegionUp(region); 368 handlerRegionUp(region);
369 369
370 370
371 } 371 }
372 else 372 else
373 { 373 {
@@ -407,9 +407,9 @@ namespace OpenSim.Region.Environment.Scenes
407 /// <summary> 407 /// <summary>
408 /// This informs all neighboring regions about the settings of it's child agent. 408 /// This informs all neighboring regions about the settings of it's child agent.
409 /// Calls an asynchronous method to do so.. so it doesn't lag the sim. 409 /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
410 /// 410 ///
411 /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. 411 /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc.
412 /// 412 ///
413 /// </summary> 413 /// </summary>
414 private void SendChildAgentDataUpdateAsync(ChildAgentDataUpdate cAgentData, ScenePresence presence) 414 private void SendChildAgentDataUpdateAsync(ChildAgentDataUpdate cAgentData, ScenePresence presence)
415 { 415 {
@@ -468,14 +468,14 @@ namespace OpenSim.Region.Environment.Scenes
468 if (regionAccepted) 468 if (regionAccepted)
469 { 469 {
470 m_log.Info("[INTERGRID]: Completed sending agent Close agent Request to neighbor"); 470 m_log.Info("[INTERGRID]: Completed sending agent Close agent Request to neighbor");
471 471
472 } 472 }
473 else 473 else
474 { 474 {
475 m_log.Info("[INTERGRID]: Failed sending agent Close agent Request to neighbor"); 475 m_log.Info("[INTERGRID]: Failed sending agent Close agent Request to neighbor");
476 476
477 } 477 }
478 478
479 } 479 }
480 // We remove the list of known regions from the agent's known region list through an event 480 // We remove the list of known regions from the agent's known region list through an event
481 // to scene, because, if an agent logged of, it's likely that there will be no scene presence 481 // to scene, because, if an agent logged of, it's likely that there will be no scene presence
@@ -572,25 +572,25 @@ namespace OpenSim.Region.Environment.Scenes
572 if (destRegionUp) 572 if (destRegionUp)
573 { 573 {
574 avatar.Close(); 574 avatar.Close();
575 575
576 // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport 576 // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport
577 // failure at this point (unlike a border crossing failure). So perhaps this can never fail 577 // failure at this point (unlike a border crossing failure). So perhaps this can never fail
578 // once we reach here... 578 // once we reach here...
579 avatar.Scene.RemoveCapsHandler(avatar.UUID); 579 avatar.Scene.RemoveCapsHandler(avatar.UUID);
580 580
581 m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, agent); 581 m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, agent);
582 m_commsProvider.InterRegion.ExpectAvatarCrossing(regionHandle, avatar.ControllingClient.AgentId, 582 m_commsProvider.InterRegion.ExpectAvatarCrossing(regionHandle, avatar.ControllingClient.AgentId,
583 position, false); 583 position, false);
584 AgentCircuitData circuitdata = avatar.ControllingClient.RequestClientInfo(); 584 AgentCircuitData circuitdata = avatar.ControllingClient.RequestClientInfo();
585 585
586 // TODO Should construct this behind a method 586 // TODO Should construct this behind a method
587 string capsPath = 587 string capsPath =
588 "http://" + reg.ExternalHostName + ":" + reg.HttpPort 588 "http://" + reg.ExternalHostName + ":" + reg.HttpPort
589 + "/CAPS/" + circuitdata.CapsPath + "0000/"; 589 + "/CAPS/" + circuitdata.CapsPath + "0000/";
590 590
591 m_log.DebugFormat( 591 m_log.DebugFormat(
592 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID); 592 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID);
593 593
594 avatar.ControllingClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4), 594 avatar.ControllingClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4),
595 capsPath); 595 capsPath);
596 avatar.MakeChildAgent(); 596 avatar.MakeChildAgent();
@@ -618,7 +618,7 @@ namespace OpenSim.Region.Environment.Scenes
618 } 618 }
619 619
620 /// <summary> 620 /// <summary>
621 /// 621 ///
622 /// </summary> 622 /// </summary>
623 /// <param name="regionhandle"></param> 623 /// <param name="regionhandle"></param>
624 /// <param name="agentID"></param> 624 /// <param name="agentID"></param>
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index dacd609..7ff9213 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Environment.Scenes
183 public delegate void DeregisterCapsEvent(LLUUID agentID, Caps caps); 183 public delegate void DeregisterCapsEvent(LLUUID agentID, Caps caps);
184 public event DeregisterCapsEvent OnDeregisterCaps; 184 public event DeregisterCapsEvent OnDeregisterCaps;
185 185
186 public class MoneyTransferArgs : EventArgs 186 public class MoneyTransferArgs : EventArgs
187 { 187 {
188 public LLUUID sender; 188 public LLUUID sender;
189 public LLUUID receiver; 189 public LLUUID receiver;
@@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Scenes
208 public class LandBuyArgs : EventArgs 208 public class LandBuyArgs : EventArgs
209 { 209 {
210 public LLUUID agentId = LLUUID.Zero; 210 public LLUUID agentId = LLUUID.Zero;
211 211
212 public LLUUID groupId = LLUUID.Zero; 212 public LLUUID groupId = LLUUID.Zero;
213 213
214 public LLUUID parcelOwnerID = LLUUID.Zero; 214 public LLUUID parcelOwnerID = LLUUID.Zero;
@@ -225,9 +225,9 @@ namespace OpenSim.Region.Environment.Scenes
225 public int transactionID = 0; 225 public int transactionID = 0;
226 public int amountDebited = 0; 226 public int amountDebited = 0;
227 227
228 228
229 public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, 229 public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned,
230 bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, 230 bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice,
231 bool pauthenticated) 231 bool pauthenticated)
232 { 232 {
233 agentId = pagentId; 233 agentId = pagentId;
@@ -367,7 +367,7 @@ namespace OpenSim.Region.Environment.Scenes
367 if (handlerParcelPrimCountUpdate != null) 367 if (handlerParcelPrimCountUpdate != null)
368 { 368 {
369 handlerParcelPrimCountUpdate(); 369 handlerParcelPrimCountUpdate();
370 } 370 }
371 } 371 }
372 372
373 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e) 373 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e)
@@ -538,7 +538,7 @@ namespace OpenSim.Region.Environment.Scenes
538 } 538 }
539 } 539 }
540 540
541 public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps) 541 public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps)
542 { 542 {
543 handlerRegisterCaps = OnRegisterCaps; 543 handlerRegisterCaps = OnRegisterCaps;
544 if (handlerRegisterCaps != null) 544 if (handlerRegisterCaps != null)
@@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Scenes
547 } 547 }
548 } 548 }
549 549
550 public void TriggerOnDeregisterCaps(LLUUID agentID, Caps caps) 550 public void TriggerOnDeregisterCaps(LLUUID agentID, Caps caps)
551 { 551 {
552 handlerDeregisterCaps = OnDeregisterCaps; 552 handlerDeregisterCaps = OnDeregisterCaps;
553 if (handlerDeregisterCaps != null) 553 if (handlerDeregisterCaps != null)
@@ -580,7 +580,7 @@ namespace OpenSim.Region.Environment.Scenes
580 handlerValidateLandBuy(sender, e); 580 handlerValidateLandBuy(sender, e);
581 } 581 }
582 } 582 }
583 583
584 public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos) 584 public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos)
585 { 585 {
586 handlerScriptAtTargetEvent = OnScriptAtTargetEvent; 586 handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index 645c302..040ee70 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -61,19 +61,19 @@ namespace OpenSim.Region.Environment.Scenes
61 61
62 public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) 62 public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID)
63 { 63 {
64 SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); 64 SceneObjectPart part=m_scene.GetSceneObjectPart(objectID);
65 65
66 uint perms=part.GetEffectiveObjectFlags() | 66 uint perms=part.GetEffectiveObjectFlags() |
67 (uint)LLObject.ObjectFlags.ObjectModify | 67 (uint)LLObject.ObjectFlags.ObjectModify |
68 (uint)LLObject.ObjectFlags.ObjectCopy | 68 (uint)LLObject.ObjectFlags.ObjectCopy |
69 (uint)LLObject.ObjectFlags.ObjectMove | 69 (uint)LLObject.ObjectFlags.ObjectMove |
70 (uint)LLObject.ObjectFlags.ObjectTransfer | 70 (uint)LLObject.ObjectFlags.ObjectTransfer |
71 (uint)LLObject.ObjectFlags.ObjectYouOwner | 71 (uint)LLObject.ObjectFlags.ObjectYouOwner |
72 (uint)LLObject.ObjectFlags.ObjectYouOfficer; 72 (uint)LLObject.ObjectFlags.ObjectYouOfficer;
73 73
74 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) 74 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
75 { 75 {
76 perms &= check(userID, objectID); 76 perms &= check(userID, objectID);
77 } 77 }
78 return perms; 78 return perms;
79 } 79 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index 215ab75..8f3de51 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Scenes
180 [Obsolete("TODO: Remove this warning by 0.7")] 180 [Obsolete("TODO: Remove this warning by 0.7")]
181 public bool RunTerrainCmdOnCurrentScene(string[] cmdparams, ref string result) 181 public bool RunTerrainCmdOnCurrentScene(string[] cmdparams, ref string result)
182 { 182 {
183 m_log.Warn("DEPRECIATED: The terrain engine has been replaced with a new terrain plugin module. Please type 'plugin terrain help' for new commands."); 183 m_log.Warn("DEPRECIATED: The terrain engine has been replaced with a new terrain plugin module. Please type 'plugin terrain help' for new commands.");
184 return false; 184 return false;
185 } 185 }
186 186
@@ -253,7 +253,7 @@ namespace OpenSim.Region.Environment.Scenes
253 public bool TrySetCurrentScene(LLUUID regionID) 253 public bool TrySetCurrentScene(LLUUID regionID)
254 { 254 {
255 Console.WriteLine("Searching for Region: '{0}'", regionID.ToString()); 255 Console.WriteLine("Searching for Region: '{0}'", regionID.ToString());
256 256
257 foreach (Scene scene in m_localScenes) 257 foreach (Scene scene in m_localScenes)
258 { 258 {
259 if (scene.RegionInfo.RegionID == regionID) 259 if (scene.RegionInfo.RegionID == regionID)
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Scenes
262 return true; 262 return true;
263 } 263 }
264 } 264 }
265 265
266 return false; 266 return false;
267 } 267 }
268 268
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 8a7096f..1ac51a6 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes
50 if (part != null) 50 if (part != null)
51 { 51 {
52 part.StartScript(itemID); 52 part.StartScript(itemID);
53 53
54 } 54 }
55 else 55 else
56 { 56 {
@@ -58,9 +58,9 @@ namespace OpenSim.Region.Environment.Scenes
58 "[PRIM INVENTORY]: " + 58 "[PRIM INVENTORY]: " +
59 "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}", 59 "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
60 localID, Name, UUID, itemID); 60 localID, Name, UUID, itemID);
61 } 61 }
62 } 62 }
63 63
64// /// Start a given script. 64// /// Start a given script.
65// /// </summary> 65// /// </summary>
66// /// <param name="localID"> 66// /// <param name="localID">
@@ -79,9 +79,9 @@ namespace OpenSim.Region.Environment.Scenes
79// "[PRIM INVENTORY]: " + 79// "[PRIM INVENTORY]: " +
80// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}", 80// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
81// localID, Name, UUID, itemID); 81// localID, Name, UUID, itemID);
82// } 82// }
83// } 83// }
84 84
85 /// <summary> 85 /// <summary>
86 /// Start the scripts contained in all the prims in this group. 86 /// Start the scripts contained in all the prims in this group.
87 /// </summary> 87 /// </summary>
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Scenes
107 } 107 }
108 } 108 }
109 } 109 }
110 110
111 /// Start a given script. 111 /// Start a given script.
112 /// </summary> 112 /// </summary>
113 /// <param name="localID"> 113 /// <param name="localID">
@@ -127,11 +127,11 @@ namespace OpenSim.Region.Environment.Scenes
127 "[PRIM INVENTORY]: " + 127 "[PRIM INVENTORY]: " +
128 "Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}", 128 "Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}",
129 partID, Name, UUID, itemID); 129 partID, Name, UUID, itemID);
130 } 130 }
131 } 131 }
132 132
133 /// <summary> 133 /// <summary>
134 /// 134 ///
135 /// </summary> 135 /// </summary>
136 /// <param name="remoteClient"></param> 136 /// <param name="remoteClient"></param>
137 /// <param name="localID"></param> 137 /// <param name="localID"></param>
@@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Scenes
172 localID, Name, UUID); 172 localID, Name, UUID);
173 } 173 }
174 } 174 }
175 175
176 /// <summary> 176 /// <summary>
177 /// Add an inventory item to a prim in this group. 177 /// Add an inventory item to a prim in this group.
178 /// </summary> 178 /// </summary>
@@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Scenes
181 /// <param name="item"></param> 181 /// <param name="item"></param>
182 /// <param name="copyItemID">The item UUID that should be used by the new item.</param> 182 /// <param name="copyItemID">The item UUID that should be used by the new item.</param>
183 /// <returns></returns> 183 /// <returns></returns>
184 public bool AddInventoryItem(IClientAPI remoteClient, uint localID, 184 public bool AddInventoryItem(IClientAPI remoteClient, uint localID,
185 InventoryItemBase item, LLUUID copyItemID) 185 InventoryItemBase item, LLUUID copyItemID)
186 { 186 {
187 LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.ID; 187 LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.ID;
@@ -190,8 +190,8 @@ namespace OpenSim.Region.Environment.Scenes
190 if (part != null) 190 if (part != null)
191 { 191 {
192 TaskInventoryItem taskItem = new TaskInventoryItem(); 192 TaskInventoryItem taskItem = new TaskInventoryItem();
193 193
194 taskItem.ItemID = newItemId; 194 taskItem.ItemID = newItemId;
195 taskItem.AssetID = item.AssetID; 195 taskItem.AssetID = item.AssetID;
196 taskItem.Name = item.Name; 196 taskItem.Name = item.Name;
197 taskItem.Description = item.Description; 197 taskItem.Description = item.Description;
@@ -199,15 +199,15 @@ namespace OpenSim.Region.Environment.Scenes
199 taskItem.CreatorID = item.Creator; 199 taskItem.CreatorID = item.Creator;
200 taskItem.Type = item.AssetType; 200 taskItem.Type = item.AssetType;
201 taskItem.InvType = item.InvType; 201 taskItem.InvType = item.InvType;
202 202
203 taskItem.BaseMask = item.BasePermissions; 203 taskItem.BaseMask = item.BasePermissions;
204 taskItem.OwnerMask = item.CurrentPermissions; 204 taskItem.OwnerMask = item.CurrentPermissions;
205 // FIXME: ignoring group permissions for now as they aren't stored in item 205 // FIXME: ignoring group permissions for now as they aren't stored in item
206 taskItem.EveryoneMask = item.EveryOnePermissions; 206 taskItem.EveryoneMask = item.EveryOnePermissions;
207 taskItem.NextOwnerMask = item.NextPermissions; 207 taskItem.NextOwnerMask = item.NextPermissions;
208 208
209 part.AddInventoryItem(taskItem); 209 part.AddInventoryItem(taskItem);
210 210
211 return true; 211 return true;
212 } 212 }
213 else 213 else
@@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Scenes
220 220
221 return false; 221 return false;
222 } 222 }
223 223
224 /// <summary> 224 /// <summary>
225 /// Returns an existing inventory item. Returns the original, so any changes will be live. 225 /// Returns an existing inventory item. Returns the original, so any changes will be live.
226 /// </summary> 226 /// </summary>
@@ -240,11 +240,11 @@ namespace OpenSim.Region.Environment.Scenes
240 "[PRIM INVENTORY]: " + 240 "[PRIM INVENTORY]: " +
241 "Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}", 241 "Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}",
242 primID, part.Name, part.UUID, itemID); 242 primID, part.Name, part.UUID, itemID);
243 } 243 }
244 244
245 return null; 245 return null;
246 } 246 }
247 247
248 /// <summary> 248 /// <summary>
249 /// Update an existing inventory item. 249 /// Update an existing inventory item.
250 /// </summary> 250 /// </summary>
@@ -256,8 +256,8 @@ namespace OpenSim.Region.Environment.Scenes
256 SceneObjectPart part = GetChildPart(item.ParentPartID); 256 SceneObjectPart part = GetChildPart(item.ParentPartID);
257 if (part != null) 257 if (part != null)
258 { 258 {
259 part.UpdateInventoryItem(item); 259 part.UpdateInventoryItem(item);
260 260
261 return true; 261 return true;
262 } 262 }
263 else 263 else
@@ -266,55 +266,55 @@ namespace OpenSim.Region.Environment.Scenes
266 "[PRIM INVENTORY]: " + 266 "[PRIM INVENTORY]: " +
267 "Couldn't find prim ID {0} to update item {1}, {2}", 267 "Couldn't find prim ID {0} to update item {1}, {2}",
268 item.ParentPartID, item.Name, item.ItemID); 268 item.ParentPartID, item.Name, item.ItemID);
269 } 269 }
270 270
271 return false; 271 return false;
272 } 272 }
273 273
274 public int RemoveInventoryItem(uint localID, LLUUID itemID) 274 public int RemoveInventoryItem(uint localID, LLUUID itemID)
275 { 275 {
276 SceneObjectPart part = GetChildPart(localID); 276 SceneObjectPart part = GetChildPart(localID);
277 if (part != null) 277 if (part != null)
278 { 278 {
279 int type = part.RemoveInventoryItem(itemID); 279 int type = part.RemoveInventoryItem(itemID);
280 280
281 return type; 281 return type;
282 } 282 }
283 283
284 return -1; 284 return -1;
285 } 285 }
286 286
287 public uint GetEffectivePermissions() 287 public uint GetEffectivePermissions()
288 { 288 {
289 uint perms=(uint)(PermissionMask.Modify | 289 uint perms=(uint)(PermissionMask.Modify |
290 PermissionMask.Copy | 290 PermissionMask.Copy |
291 PermissionMask.Move | 291 PermissionMask.Move |
292 PermissionMask.Transfer) | 7; 292 PermissionMask.Transfer) | 7;
293 293
294 foreach (SceneObjectPart part in m_parts.Values) 294 foreach (SceneObjectPart part in m_parts.Values)
295 perms &= part.MaskEffectivePermissions(); 295 perms &= part.MaskEffectivePermissions();
296 296
297 if((RootPart.OwnerMask & (uint)PermissionMask.Modify) == 0) 297 if ((RootPart.OwnerMask & (uint)PermissionMask.Modify) == 0)
298 perms &= ~(uint)PermissionMask.Modify; 298 perms &= ~(uint)PermissionMask.Modify;
299 if((RootPart.OwnerMask & (uint)PermissionMask.Copy) == 0) 299 if ((RootPart.OwnerMask & (uint)PermissionMask.Copy) == 0)
300 perms &= ~(uint)PermissionMask.Copy; 300 perms &= ~(uint)PermissionMask.Copy;
301 if((RootPart.OwnerMask & (uint)PermissionMask.Transfer) == 0) 301 if ((RootPart.OwnerMask & (uint)PermissionMask.Transfer) == 0)
302 perms &= ~(uint)PermissionMask.Transfer; 302 perms &= ~(uint)PermissionMask.Transfer;
303 303
304 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0) 304 if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
305 perms &= ~((uint)PermissionMask.Modify >> 13); 305 perms &= ~((uint)PermissionMask.Modify >> 13);
306 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0) 306 if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
307 perms &= ~((uint)PermissionMask.Copy >> 13); 307 perms &= ~((uint)PermissionMask.Copy >> 13);
308 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) 308 if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
309 perms &= ~((uint)PermissionMask.Transfer >> 13); 309 perms &= ~((uint)PermissionMask.Transfer >> 13);
310 310
311 return perms; 311 return perms;
312 } 312 }
313 313
314 public void ApplyNextOwnerPermissions() 314 public void ApplyNextOwnerPermissions()
315 { 315 {
316 foreach (SceneObjectPart part in m_parts.Values) 316 foreach (SceneObjectPart part in m_parts.Values)
317 part.ApplyNextOwnerPermissions(); 317 part.ApplyNextOwnerPermissions();
318 } 318 }
319 } 319 }
320} 320}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 14bfde0..332d160 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -86,11 +86,11 @@ namespace OpenSim.Region.Environment.Scenes
86 private PrimCountTaintedDelegate handlerPrimCountTainted = null; 86 private PrimCountTaintedDelegate handlerPrimCountTainted = null;
87 87
88 /// <summary> 88 /// <summary>
89 /// Signal whether the non-inventory attributes of any prims in the group have changed 89 /// Signal whether the non-inventory attributes of any prims in the group have changed
90 /// since the group's last persistent backup 90 /// since the group's last persistent backup
91 /// </summary> 91 /// </summary>
92 public bool HasGroupChanged = false; 92 public bool HasGroupChanged = false;
93 93
94 94
95 95
96 private LLVector3 lastPhysGroupPos; 96 private LLVector3 lastPhysGroupPos;
@@ -119,7 +119,7 @@ namespace OpenSim.Region.Environment.Scenes
119 /// but not sure a object should have this 119 /// but not sure a object should have this
120 /// as what does it tell us? that some avatar has selected it (but not what Avatar/user) 120 /// as what does it tell us? that some avatar has selected it (but not what Avatar/user)
121 /// think really there should be a list (or whatever) in each scenepresence 121 /// think really there should be a list (or whatever) in each scenepresence
122 /// saying what prim(s) that user has selected. 122 /// saying what prim(s) that user has selected.
123 /// </summary> 123 /// </summary>
124 protected bool m_isSelected = false; 124 protected bool m_isSelected = false;
125 125
@@ -134,7 +134,7 @@ namespace OpenSim.Region.Environment.Scenes
134 } 134 }
135 135
136 /// <summary> 136 /// <summary>
137 /// 137 ///
138 /// </summary> 138 /// </summary>
139 public int PrimCount 139 public int PrimCount
140 { 140 {
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Scenes
153 } 153 }
154 154
155 /// <summary> 155 /// <summary>
156 /// 156 ///
157 /// </summary> 157 /// </summary>
158 public LLVector3 GroupCentrePoint 158 public LLVector3 GroupCentrePoint
159 { 159 {
@@ -215,7 +215,7 @@ namespace OpenSim.Region.Environment.Scenes
215 part.GroupPosition = val; 215 part.GroupPosition = val;
216 } 216 }
217 } 217 }
218 218
219 //if (m_rootPart.PhysActor != null) 219 //if (m_rootPart.PhysActor != null)
220 //{ 220 //{
221 //m_rootPart.PhysActor.Position = 221 //m_rootPart.PhysActor.Position =
@@ -225,7 +225,7 @@ namespace OpenSim.Region.Environment.Scenes
225 //} 225 //}
226 } 226 }
227 } 227 }
228 228
229 public override uint LocalId 229 public override uint LocalId
230 { 230 {
231 get 231 get
@@ -316,17 +316,17 @@ namespace OpenSim.Region.Environment.Scenes
316 #region Constructors 316 #region Constructors
317 317
318 /// <summary> 318 /// <summary>
319 /// 319 ///
320 /// </summary> 320 /// </summary>
321 public SceneObjectGroup() 321 public SceneObjectGroup()
322 { 322 {
323 } 323 }
324 324
325 /// <summary> 325 /// <summary>
326 /// This constructor creates a SceneObjectGroup using a pre-existing SceneObjectPart. 326 /// This constructor creates a SceneObjectGroup using a pre-existing SceneObjectPart.
327 /// The original SceneObjectPart will be used rather than a copy, preserving 327 /// The original SceneObjectPart will be used rather than a copy, preserving
328 /// its existing localID and UUID. 328 /// its existing localID and UUID.
329 /// </summary> 329 /// </summary>
330 public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part) 330 public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part)
331 { 331 {
332 m_scene = scene; 332 m_scene = scene;
@@ -416,7 +416,7 @@ namespace OpenSim.Region.Environment.Scenes
416 } 416 }
417 417
418 /// <summary> 418 /// <summary>
419 /// 419 ///
420 /// </summary> 420 /// </summary>
421 public SceneObjectGroup(string xmlData) 421 public SceneObjectGroup(string xmlData)
422 { 422 {
@@ -464,7 +464,7 @@ namespace OpenSim.Region.Environment.Scenes
464 } 464 }
465 465
466 /// <summary> 466 /// <summary>
467 /// 467 ///
468 /// </summary> 468 /// </summary>
469 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, 469 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
470 LLQuaternion rot, PrimitiveBaseShape shape) 470 LLQuaternion rot, PrimitiveBaseShape shape)
@@ -486,7 +486,7 @@ namespace OpenSim.Region.Environment.Scenes
486 } 486 }
487 487
488 /// <summary> 488 /// <summary>
489 /// 489 ///
490 /// </summary> 490 /// </summary>
491 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, 491 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
492 PrimitiveBaseShape shape) 492 PrimitiveBaseShape shape)
@@ -576,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes
576 576
577 EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation,frontFacesOnly, faceCenters); 577 EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation,frontFacesOnly, faceCenters);
578 578
579 // This may need to be updated to the maximum draw distance possible.. 579 // This may need to be updated to the maximum draw distance possible..
580 // We might (and probably will) be checking for prim creation from other sims 580 // We might (and probably will) be checking for prim creation from other sims
581 // when the camera crosses the border. 581 // when the camera crosses the border.
582 float idist = Constants.RegionSize; 582 float idist = Constants.RegionSize;
@@ -676,7 +676,7 @@ namespace OpenSim.Region.Environment.Scenes
676 } 676 }
677 677
678 /// <summary> 678 /// <summary>
679 /// 679 ///
680 /// </summary> 680 /// </summary>
681 /// <param name="part"></param> 681 /// <param name="part"></param>
682 private void SetPartAsRoot(SceneObjectPart part) 682 private void SetPartAsRoot(SceneObjectPart part)
@@ -693,7 +693,7 @@ namespace OpenSim.Region.Environment.Scenes
693 DetachFromBackup(this); 693 DetachFromBackup(this);
694 m_rootPart.m_attachedAvatar = agentID; 694 m_rootPart.m_attachedAvatar = agentID;
695 695
696 696
697 if (m_rootPart.PhysActor != null) 697 if (m_rootPart.PhysActor != null)
698 { 698 {
699 m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor); 699 m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor);
@@ -753,7 +753,7 @@ namespace OpenSim.Region.Environment.Scenes
753 AttachToBackup(); 753 AttachToBackup();
754 m_rootPart.ScheduleFullUpdate(); 754 m_rootPart.ScheduleFullUpdate();
755 m_rootPart.ClearUndoState(); 755 m_rootPart.ClearUndoState();
756 756
757 } 757 }
758 public void DetachToInventoryPrep() 758 public void DetachToInventoryPrep()
759 { 759 {
@@ -764,7 +764,7 @@ namespace OpenSim.Region.Environment.Scenes
764 //detachedpos = avatar.AbsolutePosition; 764 //detachedpos = avatar.AbsolutePosition;
765 avatar.RemoveAttachment(this); 765 avatar.RemoveAttachment(this);
766 } 766 }
767 767
768 m_rootPart.m_attachedAvatar = LLUUID.Zero; 768 m_rootPart.m_attachedAvatar = LLUUID.Zero;
769 m_rootPart.SetParentLocalId(0); 769 m_rootPart.SetParentLocalId(0);
770 //m_rootPart.SetAttachmentPoint((byte)0); 770 //m_rootPart.SetAttachmentPoint((byte)0);
@@ -773,10 +773,10 @@ namespace OpenSim.Region.Environment.Scenes
773 //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); 773 //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
774 //AttachToBackup(); 774 //AttachToBackup();
775 //m_rootPart.ScheduleFullUpdate(); 775 //m_rootPart.ScheduleFullUpdate();
776 776
777 } 777 }
778 /// <summary> 778 /// <summary>
779 /// 779 ///
780 /// </summary> 780 /// </summary>
781 /// <param name="part"></param> 781 /// <param name="part"></param>
782 private void SetPartAsNonRoot(SceneObjectPart part) 782 private void SetPartAsNonRoot(SceneObjectPart part)
@@ -802,7 +802,7 @@ namespace OpenSim.Region.Environment.Scenes
802 } 802 }
803 803
804 /// <summary> 804 /// <summary>
805 /// Added as a way for the storage provider to reset the scene, 805 /// Added as a way for the storage provider to reset the scene,
806 /// most likely a better way to do this sort of thing but for now... 806 /// most likely a better way to do this sort of thing but for now...
807 /// </summary> 807 /// </summary>
808 /// <param name="scene"></param> 808 /// <param name="scene"></param>
@@ -813,7 +813,7 @@ namespace OpenSim.Region.Environment.Scenes
813 } 813 }
814 814
815 /// <summary> 815 /// <summary>
816 /// 816 ///
817 /// </summary> 817 /// </summary>
818 /// <param name="part"></param> 818 /// <param name="part"></param>
819 public void AddPart(SceneObjectPart part) 819 public void AddPart(SceneObjectPart part)
@@ -826,7 +826,7 @@ namespace OpenSim.Region.Environment.Scenes
826 try 826 try
827 { 827 {
828 m_parts.Add(part.UUID, part); 828 m_parts.Add(part.UUID, part);
829 829
830 } 830 }
831 catch (Exception e) 831 catch (Exception e)
832 { 832 {
@@ -836,7 +836,7 @@ namespace OpenSim.Region.Environment.Scenes
836 } 836 }
837 837
838 /// <summary> 838 /// <summary>
839 /// 839 ///
840 /// </summary> 840 /// </summary>
841 public void UpdateParentIDs() 841 public void UpdateParentIDs()
842 { 842 {
@@ -847,7 +847,7 @@ namespace OpenSim.Region.Environment.Scenes
847 if (part.UUID != m_rootPart.UUID) 847 if (part.UUID != m_rootPart.UUID)
848 { 848 {
849 part.ParentID = m_rootPart.LocalId; 849 part.ParentID = m_rootPart.LocalId;
850 850
851 } 851 }
852 } 852 }
853 } 853 }
@@ -860,7 +860,7 @@ namespace OpenSim.Region.Environment.Scenes
860 foreach (SceneObjectPart part in m_parts.Values) 860 foreach (SceneObjectPart part in m_parts.Values)
861 { 861 {
862 part.UUID = LLUUID.Random(); 862 part.UUID = LLUUID.Random();
863 863
864 } 864 }
865 } 865 }
866 } 866 }
@@ -897,7 +897,7 @@ namespace OpenSim.Region.Environment.Scenes
897 { 897 {
898 SceneObjectPart part = GetChildPart(localId); 898 SceneObjectPart part = GetChildPart(localId);
899 OnGrabPart(part, offsetPos, remoteClient); 899 OnGrabPart(part, offsetPos, remoteClient);
900 900
901 } 901 }
902 } 902 }
903 903
@@ -905,7 +905,7 @@ namespace OpenSim.Region.Environment.Scenes
905 { 905 {
906 part.StoreUndoState(); 906 part.StoreUndoState();
907 part.OnGrab(offsetPos, remoteClient); 907 part.OnGrab(offsetPos, remoteClient);
908 908
909 } 909 }
910 910
911 public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) 911 public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient)
@@ -1068,7 +1068,7 @@ namespace OpenSim.Region.Environment.Scenes
1068 #region Events 1068 #region Events
1069 1069
1070 /// <summary> 1070 /// <summary>
1071 /// 1071 ///
1072 /// </summary> 1072 /// </summary>
1073 public void TriggerTainted() 1073 public void TriggerTainted()
1074 { 1074 {
@@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Environment.Scenes
1198 1198
1199 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); 1199 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
1200 } 1200 }
1201 // Now we've made a copy that replaces this one, we need to 1201 // Now we've made a copy that replaces this one, we need to
1202 // switch the owner to the person who did the copying 1202 // switch the owner to the person who did the copying
1203 // Second Life copies an object and duplicates the first one in it's place 1203 // Second Life copies an object and duplicates the first one in it's place
1204 // So, we have to make a copy of this one, set it in it's place then set the owner on this one 1204 // So, we have to make a copy of this one, set it in it's place then set the owner on this one
@@ -1227,7 +1227,7 @@ namespace OpenSim.Region.Environment.Scenes
1227 } 1227 }
1228 1228
1229 /// <summary> 1229 /// <summary>
1230 /// 1230 ///
1231 /// </summary> 1231 /// </summary>
1232 /// <param name="part"></param> 1232 /// <param name="part"></param>
1233 /// <param name="cAgentID"></param> 1233 /// <param name="cAgentID"></param>
@@ -1359,7 +1359,7 @@ namespace OpenSim.Region.Environment.Scenes
1359 } 1359 }
1360 1360
1361 /// <summary> 1361 /// <summary>
1362 /// 1362 ///
1363 /// </summary> 1363 /// </summary>
1364 /// <param name="part"></param> 1364 /// <param name="part"></param>
1365 /// <param name="cAgentID"></param> 1365 /// <param name="cAgentID"></param>
@@ -1373,14 +1373,14 @@ namespace OpenSim.Region.Environment.Scenes
1373 { 1373 {
1374 m_parts.Add(newPart.UUID, newPart); 1374 m_parts.Add(newPart.UUID, newPart);
1375 } 1375 }
1376 1376
1377 SetPartAsNonRoot(newPart); 1377 SetPartAsNonRoot(newPart);
1378 1378
1379 } 1379 }
1380 1380
1381 /// <summary> 1381 /// <summary>
1382 /// Reset the LLUUIDs for all the prims that make up this group. 1382 /// Reset the LLUUIDs for all the prims that make up this group.
1383 /// 1383 ///
1384 /// This is called by methods which want to add a new group to an existing scene, in order 1384 /// This is called by methods which want to add a new group to an existing scene, in order
1385 /// to ensure that there are no clashes with groups already present. 1385 /// to ensure that there are no clashes with groups already present.
1386 /// </summary> 1386 /// </summary>
@@ -1398,7 +1398,7 @@ namespace OpenSim.Region.Environment.Scenes
1398 } 1398 }
1399 1399
1400 /// <summary> 1400 /// <summary>
1401 /// 1401 ///
1402 /// </summary> 1402 /// </summary>
1403 /// <param name="part"></param> 1403 /// <param name="part"></param>
1404 public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags) 1404 public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags)
@@ -1425,7 +1425,7 @@ namespace OpenSim.Region.Environment.Scenes
1425 /// </summary> 1425 /// </summary>
1426 public override void Update() 1426 public override void Update()
1427 { 1427 {
1428 1428
1429 lock (m_parts) 1429 lock (m_parts)
1430 { 1430 {
1431 //if (m_rootPart.m_IsAttachment) 1431 //if (m_rootPart.m_IsAttachment)
@@ -1436,7 +1436,7 @@ namespace OpenSim.Region.Environment.Scenes
1436 //} 1436 //}
1437 //return; 1437 //return;
1438 //} 1438 //}
1439 1439
1440 if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) 1440 if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02)
1441 { 1441 {
1442 m_rootPart.UpdateFlag = 1; 1442 m_rootPart.UpdateFlag = 1;
@@ -1447,10 +1447,10 @@ namespace OpenSim.Region.Environment.Scenes
1447 //if (part.UpdateFlag == 0) part.UpdateFlag = 1; 1447 //if (part.UpdateFlag == 0) part.UpdateFlag = 1;
1448 //} 1448 //}
1449 1449
1450 1450
1451 1451
1452 checkAtTargets(); 1452 checkAtTargets();
1453 1453
1454 1454
1455 if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) 1455 if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
1456 || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) 1456 || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1)
@@ -1508,7 +1508,7 @@ namespace OpenSim.Region.Environment.Scenes
1508 } 1508 }
1509 1509
1510 /// <summary> 1510 /// <summary>
1511 /// 1511 ///
1512 /// </summary> 1512 /// </summary>
1513 public void ScheduleGroupForTerseUpdate() 1513 public void ScheduleGroupForTerseUpdate()
1514 { 1514 {
@@ -1524,7 +1524,7 @@ namespace OpenSim.Region.Environment.Scenes
1524 } 1524 }
1525 1525
1526 /// <summary> 1526 /// <summary>
1527 /// 1527 ///
1528 /// </summary> 1528 /// </summary>
1529 public void SendGroupFullUpdate() 1529 public void SendGroupFullUpdate()
1530 { 1530 {
@@ -1545,7 +1545,7 @@ namespace OpenSim.Region.Environment.Scenes
1545 } 1545 }
1546 1546
1547 /// <summary> 1547 /// <summary>
1548 /// 1548 ///
1549 /// </summary> 1549 /// </summary>
1550 public void SendGroupTerseUpdate() 1550 public void SendGroupTerseUpdate()
1551 { 1551 {
@@ -1669,7 +1669,7 @@ namespace OpenSim.Region.Environment.Scenes
1669 { 1669 {
1670 if (objectGroup.RootPart.UpdateFlag > 0) 1670 if (objectGroup.RootPart.UpdateFlag > 0)
1671 { 1671 {
1672 // I've never actually seen this happen, though I think it's theoretically possible 1672 // I've never actually seen this happen, though I think it's theoretically possible
1673 m_log.WarnFormat( 1673 m_log.WarnFormat(
1674 "[SCENE OBJECT GROUP]: Aborted linking {0}, {1} to {2}, {3} as it has yet to finish delinking", 1674 "[SCENE OBJECT GROUP]: Aborted linking {0}, {1} to {2}, {3} as it has yet to finish delinking",
1675 objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); 1675 objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
@@ -1678,7 +1678,7 @@ namespace OpenSim.Region.Environment.Scenes
1678 } 1678 }
1679 1679
1680// m_log.DebugFormat( 1680// m_log.DebugFormat(
1681// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", 1681// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
1682// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); 1682// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
1683 1683
1684 SceneObjectPart linkPart = objectGroup.m_rootPart; 1684 SceneObjectPart linkPart = objectGroup.m_rootPart;
@@ -1747,19 +1747,19 @@ namespace OpenSim.Region.Environment.Scenes
1747 } 1747 }
1748 1748
1749 /// <summary> 1749 /// <summary>
1750 /// Delink the given prim from this group. The delinked prim is established as 1750 /// Delink the given prim from this group. The delinked prim is established as
1751 /// an independent SceneObjectGroup. 1751 /// an independent SceneObjectGroup.
1752 /// </summary> 1752 /// </summary>
1753 /// <param name="partID"></param> 1753 /// <param name="partID"></param>
1754 public void DelinkFromGroup(uint partID) 1754 public void DelinkFromGroup(uint partID)
1755 { 1755 {
1756 SceneObjectPart linkPart = GetChildPart(partID); 1756 SceneObjectPart linkPart = GetChildPart(partID);
1757 1757
1758 if (null != linkPart) 1758 if (null != linkPart)
1759 { 1759 {
1760 linkPart.ClearUndoState(); 1760 linkPart.ClearUndoState();
1761// m_log.DebugFormat( 1761// m_log.DebugFormat(
1762// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", 1762// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
1763// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); 1763// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
1764 1764
1765 LLQuaternion worldRot = linkPart.GetWorldRotation(); 1765 LLQuaternion worldRot = linkPart.GetWorldRotation();
@@ -1777,8 +1777,8 @@ namespace OpenSim.Region.Environment.Scenes
1777 m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor); 1777 m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
1778 } 1778 }
1779 1779
1780 // We need to reset the child part's position 1780 // We need to reset the child part's position
1781 // ready for life as a separate object after being a part of another object 1781 // ready for life as a separate object after being a part of another object
1782 Quaternion parentRot 1782 Quaternion parentRot
1783 = new Quaternion( 1783 = new Quaternion(
1784 m_rootPart.RotationOffset.W, 1784 m_rootPart.RotationOffset.W,
@@ -1933,7 +1933,7 @@ namespace OpenSim.Region.Environment.Scenes
1933 m_rootPart.TouchName, new byte[0], m_rootPart.SitName, m_rootPart.Name, m_rootPart.Description, 1933 m_rootPart.TouchName, new byte[0], m_rootPart.SitName, m_rootPart.Name, m_rootPart.Description,
1934 m_rootPart.OwnerMask, m_rootPart.NextOwnerMask, m_rootPart.GroupMask, m_rootPart.EveryoneMask, 1934 m_rootPart.OwnerMask, m_rootPart.NextOwnerMask, m_rootPart.GroupMask, m_rootPart.EveryoneMask,
1935 m_rootPart.BaseMask); 1935 m_rootPart.BaseMask);
1936 1936
1937 } 1937 }
1938 1938
1939 /// <summary> 1939 /// <summary>
@@ -1998,13 +1998,13 @@ namespace OpenSim.Region.Environment.Scenes
1998 } 1998 }
1999 1999
2000 /// <summary> 2000 /// <summary>
2001 /// 2001 ///
2002 /// </summary> 2002 /// </summary>
2003 /// <param name="localID"></param> 2003 /// <param name="localID"></param>
2004 /// <param name="type"></param> 2004 /// <param name="type"></param>
2005 /// <param name="inUse"></param> 2005 /// <param name="inUse"></param>
2006 /// <param name="data"></param> 2006 /// <param name="data"></param>
2007 /// 2007 ///
2008 public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) 2008 public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data)
2009 { 2009 {
2010 SceneObjectPart part = GetChildPart(localID); 2010 SceneObjectPart part = GetChildPart(localID);
@@ -2046,7 +2046,7 @@ namespace OpenSim.Region.Environment.Scenes
2046 } 2046 }
2047 2047
2048 /// <summary> 2048 /// <summary>
2049 /// 2049 ///
2050 /// </summary> 2050 /// </summary>
2051 /// <param name="localID"></param> 2051 /// <param name="localID"></param>
2052 /// <param name="textureEntry"></param> 2052 /// <param name="textureEntry"></param>
@@ -2071,7 +2071,7 @@ namespace OpenSim.Region.Environment.Scenes
2071 #region Shape 2071 #region Shape
2072 2072
2073 /// <summary> 2073 /// <summary>
2074 /// 2074 ///
2075 /// </summary> 2075 /// </summary>
2076 /// <param name="shapeBlock"></param> 2076 /// <param name="shapeBlock"></param>
2077 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID) 2077 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
@@ -2091,7 +2091,7 @@ namespace OpenSim.Region.Environment.Scenes
2091 #region Resize 2091 #region Resize
2092 2092
2093 /// <summary> 2093 /// <summary>
2094 /// 2094 ///
2095 /// </summary> 2095 /// </summary>
2096 /// <param name="scale"></param> 2096 /// <param name="scale"></param>
2097 /// <param name="localID"></param> 2097 /// <param name="localID"></param>
@@ -2169,7 +2169,7 @@ namespace OpenSim.Region.Environment.Scenes
2169 #region Position 2169 #region Position
2170 2170
2171 /// <summary> 2171 /// <summary>
2172 /// 2172 ///
2173 /// </summary> 2173 /// </summary>
2174 /// <param name="pos"></param> 2174 /// <param name="pos"></param>
2175 public void UpdateGroupPosition(LLVector3 pos) 2175 public void UpdateGroupPosition(LLVector3 pos)
@@ -2189,7 +2189,7 @@ namespace OpenSim.Region.Environment.Scenes
2189 } 2189 }
2190 2190
2191 /// <summary> 2191 /// <summary>
2192 /// 2192 ///
2193 /// </summary> 2193 /// </summary>
2194 /// <param name="pos"></param> 2194 /// <param name="pos"></param>
2195 /// <param name="localID"></param> 2195 /// <param name="localID"></param>
@@ -2210,7 +2210,7 @@ namespace OpenSim.Region.Environment.Scenes
2210 } 2210 }
2211 2211
2212 /// <summary> 2212 /// <summary>
2213 /// 2213 ///
2214 /// </summary> 2214 /// </summary>
2215 /// <param name="pos"></param> 2215 /// <param name="pos"></param>
2216 private void UpdateRootPosition(LLVector3 pos) 2216 private void UpdateRootPosition(LLVector3 pos)
@@ -2255,7 +2255,7 @@ namespace OpenSim.Region.Environment.Scenes
2255 #region Rotation 2255 #region Rotation
2256 2256
2257 /// <summary> 2257 /// <summary>
2258 /// 2258 ///
2259 /// </summary> 2259 /// </summary>
2260 /// <param name="rot"></param> 2260 /// <param name="rot"></param>
2261 public void UpdateGroupRotation(LLQuaternion rot) 2261 public void UpdateGroupRotation(LLQuaternion rot)
@@ -2272,7 +2272,7 @@ namespace OpenSim.Region.Environment.Scenes
2272 } 2272 }
2273 2273
2274 /// <summary> 2274 /// <summary>
2275 /// 2275 ///
2276 /// </summary> 2276 /// </summary>
2277 /// <param name="pos"></param> 2277 /// <param name="pos"></param>
2278 /// <param name="rot"></param> 2278 /// <param name="rot"></param>
@@ -2291,7 +2291,7 @@ namespace OpenSim.Region.Environment.Scenes
2291 } 2291 }
2292 2292
2293 /// <summary> 2293 /// <summary>
2294 /// 2294 ///
2295 /// </summary> 2295 /// </summary>
2296 /// <param name="rot"></param> 2296 /// <param name="rot"></param>
2297 /// <param name="localID"></param> 2297 /// <param name="localID"></param>
@@ -2312,7 +2312,7 @@ namespace OpenSim.Region.Environment.Scenes
2312 } 2312 }
2313 2313
2314 /// <summary> 2314 /// <summary>
2315 /// 2315 ///
2316 /// </summary> 2316 /// </summary>
2317 /// <param name="rot"></param> 2317 /// <param name="rot"></param>
2318 private void UpdateRootRotation(LLQuaternion rot) 2318 private void UpdateRootRotation(LLQuaternion rot)
@@ -2463,7 +2463,7 @@ namespace OpenSim.Region.Environment.Scenes
2463 // Reusing att.tolerance to hold the index of the target in the targets dictionary 2463 // Reusing att.tolerance to hold the index of the target in the targets dictionary
2464 // to avoid deadlocking the sim. 2464 // to avoid deadlocking the sim.
2465 m_scene.TriggerAtTargetEvent(localids[ctr], (uint)att.tolerance, att.targetPos, m_rootPart.GroupPosition); 2465 m_scene.TriggerAtTargetEvent(localids[ctr], (uint)att.tolerance, att.targetPos, m_rootPart.GroupPosition);
2466 2466
2467 2467
2468 } 2468 }
2469 } 2469 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index e1be8ff..cce263c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.Environment.Scenes
67 67
68 /// <summary> 68 /// <summary>
69 /// Holds in memory prim inventory 69 /// Holds in memory prim inventory
70 /// </summary> 70 /// </summary>
71 protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); 71 protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary();
72 72
73 public TaskInventoryDictionary TaskInventory 73 public TaskInventoryDictionary TaskInventory
@@ -84,21 +84,21 @@ namespace OpenSim.Region.Environment.Scenes
84 /// <summary> 84 /// <summary>
85 /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating 85 /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating
86 /// new ones or setting existing UUIDs to the correct parent UUIDs. 86 /// new ones or setting existing UUIDs to the correct parent UUIDs.
87 /// 87 ///
88 /// If this method is called and there are inventory items, then we regard the inventory as having changed. 88 /// If this method is called and there are inventory items, then we regard the inventory as having changed.
89 /// </summary> 89 /// </summary>
90 /// <param name="linkNum">Link number for the part</param> 90 /// <param name="linkNum">Link number for the part</param>
91 public void ResetInventoryIDs() 91 public void ResetInventoryIDs()
92 { 92 {
93 lock (TaskInventory) 93 lock (TaskInventory)
94 { 94 {
95 if (0 == TaskInventory.Count) 95 if (0 == TaskInventory.Count)
96 { 96 {
97 return; 97 return;
98 } 98 }
99 99
100 HasInventoryChanged = true; 100 HasInventoryChanged = true;
101 101
102 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(TaskInventory.Values); 102 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(TaskInventory.Values);
103 TaskInventory.Clear(); 103 TaskInventory.Clear();
104 104
@@ -127,7 +127,7 @@ namespace OpenSim.Region.Environment.Scenes
127 if (ownerId != item.OwnerID) 127 if (ownerId != item.OwnerID)
128 { 128 {
129 item.LastOwnerID = item.OwnerID; 129 item.LastOwnerID = item.OwnerID;
130 item.OwnerID = ownerId; 130 item.OwnerID = ownerId;
131 } 131 }
132 } 132 }
133 } 133 }
@@ -178,7 +178,7 @@ namespace OpenSim.Region.Environment.Scenes
178 { 178 {
179 // m_log.InfoFormat( 179 // m_log.InfoFormat(
180 // "[PRIM INVENTORY]: " + 180 // "[PRIM INVENTORY]: " +
181 // "Starting script {0}, {1} in prim {2}, {3}", 181 // "Starting script {0}, {1} in prim {2}, {3}",
182 // item.Name, item.ItemID, Name, UUID); 182 // item.Name, item.ItemID, Name, UUID);
183 AddFlag(LLObject.ObjectFlags.Scripted); 183 AddFlag(LLObject.ObjectFlags.Scripted);
184 184
@@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Scenes
211 /// </summary> 211 /// </summary>
212 /// <param name="itemId"> 212 /// <param name="itemId">
213 /// A <see cref="LLUUID"/> 213 /// A <see cref="LLUUID"/>
214 /// </param> 214 /// </param>
215 public void StartScript(LLUUID itemId) 215 public void StartScript(LLUUID itemId)
216 { 216 {
217 lock (m_taskInventory) 217 lock (m_taskInventory)
@@ -234,7 +234,7 @@ namespace OpenSim.Region.Environment.Scenes
234 /// <summary> 234 /// <summary>
235 /// Stop a script which is in this prim's inventory. 235 /// Stop a script which is in this prim's inventory.
236 /// </summary> 236 /// </summary>
237 /// <param name="itemId"></param> 237 /// <param name="itemId"></param>
238 public void StopScript(LLUUID itemId) 238 public void StopScript(LLUUID itemId)
239 { 239 {
240 if (m_taskInventory.ContainsKey(itemId)) 240 if (m_taskInventory.ContainsKey(itemId))
@@ -306,9 +306,9 @@ namespace OpenSim.Region.Environment.Scenes
306 } 306 }
307 307
308 /// <summary> 308 /// <summary>
309 /// Restore a whole collection of items to the prim's inventory at once. 309 /// Restore a whole collection of items to the prim's inventory at once.
310 /// We assume that the items already have all their fields correctly filled out. 310 /// We assume that the items already have all their fields correctly filled out.
311 /// The items are not flagged for persistence to the database, since they are being restored 311 /// The items are not flagged for persistence to the database, since they are being restored
312 /// from persistence rather than being newly added. 312 /// from persistence rather than being newly added.
313 /// </summary> 313 /// </summary>
314 /// <param name="items"></param> 314 /// <param name="items"></param>
@@ -338,9 +338,9 @@ namespace OpenSim.Region.Environment.Scenes
338 if (m_taskInventory.ContainsKey(itemID)) 338 if (m_taskInventory.ContainsKey(itemID))
339 { 339 {
340// m_log.DebugFormat( 340// m_log.DebugFormat(
341// "[PRIM INVENTORY]: Retrieved task inventory item {0}, {1} from prim {2}, {3}", 341// "[PRIM INVENTORY]: Retrieved task inventory item {0}, {1} from prim {2}, {3}",
342// m_taskInventory[itemID].Name, itemID, Name, UUID); 342// m_taskInventory[itemID].Name, itemID, Name, UUID);
343 343
344 return m_taskInventory[itemID]; 344 return m_taskInventory[itemID];
345 } 345 }
346 else 346 else
@@ -450,11 +450,11 @@ namespace OpenSim.Region.Environment.Scenes
450 /// <param name="client"></param> 450 /// <param name="client"></param>
451 /// <param name="localID"></param> 451 /// <param name="localID"></param>
452 public bool GetInventoryFileName(IClientAPI client, uint localID) 452 public bool GetInventoryFileName(IClientAPI client, uint localID)
453 { 453 {
454// m_log.DebugFormat( 454// m_log.DebugFormat(
455// "[PRIM INVENTORY]: Received request from client {0} for inventory file name of {1}, {2}", 455// "[PRIM INVENTORY]: Received request from client {0} for inventory file name of {1}, {2}",
456// client.AgentId, Name, UUID); 456// client.AgentId, Name, UUID);
457 457
458 if (m_inventorySerial > 0) 458 if (m_inventorySerial > 0)
459 { 459 {
460 client.SendTaskInventory(m_uuid, (short)m_inventorySerial, 460 client.SendTaskInventory(m_uuid, (short)m_inventorySerial,
@@ -473,9 +473,9 @@ namespace OpenSim.Region.Environment.Scenes
473 /// </summary> 473 /// </summary>
474 /// <param name="xferManager"></param> 474 /// <param name="xferManager"></param>
475 public void RequestInventoryFile(IXfer xferManager) 475 public void RequestInventoryFile(IXfer xferManager)
476 { 476 {
477 byte[] fileData = new byte[0]; 477 byte[] fileData = new byte[0];
478 478
479 // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches 479 // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches
480 // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality 480 // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality
481 // isn't available (such as drag from prim inventory to agent inventory) 481 // isn't available (such as drag from prim inventory to agent inventory)
@@ -486,39 +486,39 @@ namespace OpenSim.Region.Environment.Scenes
486 foreach (TaskInventoryItem item in m_taskInventory.Values) 486 foreach (TaskInventoryItem item in m_taskInventory.Values)
487 { 487 {
488 invString.AddItemStart(); 488 invString.AddItemStart();
489 invString.AddNameValueLine("item_id", item.ItemID.ToString()); 489 invString.AddNameValueLine("item_id", item.ItemID.ToString());
490 invString.AddNameValueLine("parent_id", UUID.ToString()); 490 invString.AddNameValueLine("parent_id", UUID.ToString());
491 491
492 invString.AddPermissionsStart(); 492 invString.AddPermissionsStart();
493 493
494 invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask)); 494 invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask));
495 invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask)); 495 invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask));
496 invString.AddNameValueLine("group_mask", "00000000"); 496 invString.AddNameValueLine("group_mask", "00000000");
497 invString.AddNameValueLine("everyone_mask", "00000000"); 497 invString.AddNameValueLine("everyone_mask", "00000000");
498 invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask)); 498 invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask));
499 499
500 invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); 500 invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
501 invString.AddNameValueLine("owner_id", item.OwnerID.ToString()); 501 invString.AddNameValueLine("owner_id", item.OwnerID.ToString());
502 502
503 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); 503 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
504// invString.AddNameValueLine("last_owner_id", item.OwnerID.ToString()); 504// invString.AddNameValueLine("last_owner_id", item.OwnerID.ToString());
505 505
506 invString.AddNameValueLine("group_id", item.GroupID.ToString()); 506 invString.AddNameValueLine("group_id", item.GroupID.ToString());
507 invString.AddSectionEnd(); 507 invString.AddSectionEnd();
508 508
509 invString.AddNameValueLine("asset_id", item.AssetID.ToString()); 509 invString.AddNameValueLine("asset_id", item.AssetID.ToString());
510 invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); 510 invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
511 invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); 511 invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
512 invString.AddNameValueLine("flags", "00000000"); 512 invString.AddNameValueLine("flags", "00000000");
513 513
514 invString.AddSaleStart(); 514 invString.AddSaleStart();
515 invString.AddNameValueLine("sale_type", "not"); 515 invString.AddNameValueLine("sale_type", "not");
516 invString.AddNameValueLine("sale_price", "0"); 516 invString.AddNameValueLine("sale_price", "0");
517 invString.AddSectionEnd(); 517 invString.AddSectionEnd();
518 518
519 invString.AddNameValueLine("name", item.Name + "|"); 519 invString.AddNameValueLine("name", item.Name + "|");
520 invString.AddNameValueLine("desc", item.Description + "|"); 520 invString.AddNameValueLine("desc", item.Description + "|");
521 521
522 invString.AddNameValueLine("creation_date", item.CreationDate.ToString()); 522 invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
523 invString.AddSectionEnd(); 523 invString.AddSectionEnd();
524 } 524 }
@@ -576,13 +576,13 @@ namespace OpenSim.Region.Environment.Scenes
576 BuildString += "\tpermissions 0\n"; 576 BuildString += "\tpermissions 0\n";
577 AddSectionStart(); 577 AddSectionStart();
578 } 578 }
579 579
580 public void AddSaleStart() 580 public void AddSaleStart()
581 { 581 {
582 BuildString += "\tsale_info\t0\n"; 582 BuildString += "\tsale_info\t0\n";
583 AddSectionStart(); 583 AddSectionStart();
584 } 584 }
585 585
586 protected void AddSectionStart() 586 protected void AddSectionStart()
587 { 587 {
588 BuildString += "\t{\n"; 588 BuildString += "\t{\n";
@@ -610,64 +610,64 @@ namespace OpenSim.Region.Environment.Scenes
610 } 610 }
611 } 611 }
612 612
613 public uint MaskEffectivePermissions() 613 public uint MaskEffectivePermissions()
614 { 614 {
615 uint mask=0x7fffffff; 615 uint mask=0x7fffffff;
616 616
617 foreach (TaskInventoryItem item in m_taskInventory.Values) 617 foreach (TaskInventoryItem item in m_taskInventory.Values)
618 { 618 {
619 if(item.InvType != 6) 619 if (item.InvType != 6)
620 { 620 {
621 if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0) 621 if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
622 mask &= ~((uint)PermissionMask.Copy >> 13); 622 mask &= ~((uint)PermissionMask.Copy >> 13);
623 if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) 623 if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
624 mask &= ~((uint)PermissionMask.Transfer >> 13); 624 mask &= ~((uint)PermissionMask.Transfer >> 13);
625 if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0) 625 if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
626 mask &= ~((uint)PermissionMask.Modify >> 13); 626 mask &= ~((uint)PermissionMask.Modify >> 13);
627 } 627 }
628 else 628 else
629 { 629 {
630 if((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) 630 if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
631 mask &= ~((uint)PermissionMask.Copy >> 13); 631 mask &= ~((uint)PermissionMask.Copy >> 13);
632 if((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) 632 if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
633 mask &= ~((uint)PermissionMask.Transfer >> 13); 633 mask &= ~((uint)PermissionMask.Transfer >> 13);
634 if((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) 634 if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
635 mask &= ~((uint)PermissionMask.Modify >> 13); 635 mask &= ~((uint)PermissionMask.Modify >> 13);
636 } 636 }
637 637
638 if((item.OwnerMask & (uint)PermissionMask.Copy) == 0) 638 if ((item.OwnerMask & (uint)PermissionMask.Copy) == 0)
639 mask &= ~(uint)PermissionMask.Copy; 639 mask &= ~(uint)PermissionMask.Copy;
640 if((item.OwnerMask & (uint)PermissionMask.Transfer) == 0) 640 if ((item.OwnerMask & (uint)PermissionMask.Transfer) == 0)
641 mask &= ~(uint)PermissionMask.Transfer; 641 mask &= ~(uint)PermissionMask.Transfer;
642 if((item.OwnerMask & (uint)PermissionMask.Modify) == 0) 642 if ((item.OwnerMask & (uint)PermissionMask.Modify) == 0)
643 mask &= ~(uint)PermissionMask.Modify; 643 mask &= ~(uint)PermissionMask.Modify;
644 } 644 }
645 return mask; 645 return mask;
646 } 646 }
647 647
648 public void ApplyNextOwnerPermissions() 648 public void ApplyNextOwnerPermissions()
649 { 649 {
650 BaseMask &= NextOwnerMask; 650 BaseMask &= NextOwnerMask;
651 OwnerMask &= NextOwnerMask; 651 OwnerMask &= NextOwnerMask;
652 EveryoneMask &= NextOwnerMask; 652 EveryoneMask &= NextOwnerMask;
653 653
654 foreach (TaskInventoryItem item in m_taskInventory.Values) 654 foreach (TaskInventoryItem item in m_taskInventory.Values)
655 { 655 {
656 if(item.InvType == 6) 656 if (item.InvType == 6)
657 { 657 {
658 if((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) 658 if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
659 item.OwnerMask &= ~(uint)PermissionMask.Copy; 659 item.OwnerMask &= ~(uint)PermissionMask.Copy;
660 if((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) 660 if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
661 item.OwnerMask &= ~(uint)PermissionMask.Transfer; 661 item.OwnerMask &= ~(uint)PermissionMask.Transfer;
662 if((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) 662 if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
663 item.OwnerMask &= ~(uint)PermissionMask.Modify; 663 item.OwnerMask &= ~(uint)PermissionMask.Modify;
664 } 664 }
665 item.OwnerMask &= item.NextOwnerMask; 665 item.OwnerMask &= item.NextOwnerMask;
666 item.BaseMask &= item.NextOwnerMask; 666 item.BaseMask &= item.NextOwnerMask;
667 item.EveryoneMask &= item.NextOwnerMask; 667 item.EveryoneMask &= item.NextOwnerMask;
668 } 668 }
669 669
670 TriggerScriptChangedEvent(Changed.OWNER); 670 TriggerScriptChangedEvent(Changed.OWNER);
671 } 671 }
672 } 672 }
673} 673}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 0196b91..a52d5f9 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -41,7 +41,7 @@ using OpenSim.Region.Physics.Manager;
41 41
42namespace OpenSim.Region.Environment.Scenes 42namespace OpenSim.Region.Environment.Scenes
43{ 43{
44 // I don't really know where to put this except here. 44 // I don't really know where to put this except here.
45 // Can't access the OpenSim.Region.ScriptEngine.Common.LSL_BaseClass.Changed constants 45 // Can't access the OpenSim.Region.ScriptEngine.Common.LSL_BaseClass.Changed constants
46 [Flags] 46 [Flags]
47 public enum ExtraParamType 47 public enum ExtraParamType
@@ -81,13 +81,13 @@ namespace OpenSim.Region.Environment.Scenes
81 SCALE = 0x40 81 SCALE = 0x40
82 } 82 }
83 83
84 84
85 [Serializable] 85 [Serializable]
86 public partial class SceneObjectPart : IScriptHost, ISerializable 86 public partial class SceneObjectPart : IScriptHost, ISerializable
87 { 87 {
88 88
89 [XmlIgnore] public PhysicsActor PhysActor = null; 89 [XmlIgnore] public PhysicsActor PhysActor = null;
90 90
91 public LLUUID LastOwnerID; 91 public LLUUID LastOwnerID;
92 public LLUUID OwnerID; 92 public LLUUID OwnerID;
93 public LLUUID GroupID; 93 public LLUUID GroupID;
@@ -95,7 +95,7 @@ namespace OpenSim.Region.Environment.Scenes
95 public byte ObjectSaleType; 95 public byte ObjectSaleType;
96 public int SalePrice; 96 public int SalePrice;
97 public uint Category; 97 public uint Category;
98 98
99 // TODO: This needs to be persisted in next XML version update! 99 // TODO: This needs to be persisted in next XML version update!
100 [XmlIgnore] public int[] PayPrice = {-2,-2,-2,-2,-2}; 100 [XmlIgnore] public int[] PayPrice = {-2,-2,-2,-2,-2};
101 [XmlIgnore] private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>(); 101 [XmlIgnore] private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>();
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
139 set { Flags = (LLObject.ObjectFlags)value; } 139 set { Flags = (LLObject.ObjectFlags)value; }
140 } 140 }
141 141
142 #endregion 142 #endregion
143 143
144 protected byte[] m_particleSystem = new byte[0]; 144 protected byte[] m_particleSystem = new byte[0];
145 145
@@ -152,13 +152,13 @@ namespace OpenSim.Region.Environment.Scenes
152 /// 0 - no update is scheduled 152 /// 0 - no update is scheduled
153 /// 1 - terse update scheduled 153 /// 1 - terse update scheduled
154 /// 2 - full update scheduled 154 /// 2 - full update scheduled
155 /// 155 ///
156 /// TODO - This should be an enumeration 156 /// TODO - This should be an enumeration
157 /// </summary> 157 /// </summary>
158 private byte m_updateFlag; 158 private byte m_updateFlag;
159 159
160 #region Properties 160 #region Properties
161 161
162 public LLUUID CreatorID; 162 public LLUUID CreatorID;
163 163
164 public LLUUID ObjectCreator 164 public LLUUID ObjectCreator
@@ -230,7 +230,7 @@ namespace OpenSim.Region.Environment.Scenes
230 /// <returns>A Linked Child Prim objects position in world</returns> 230 /// <returns>A Linked Child Prim objects position in world</returns>
231 public LLVector3 GetWorldPosition() 231 public LLVector3 GetWorldPosition()
232 { 232 {
233 233
234 Quaternion parentRot = new Quaternion( 234 Quaternion parentRot = new Quaternion(
235 ParentGroup.RootPart.RotationOffset.W, 235 ParentGroup.RootPart.RotationOffset.W,
236 ParentGroup.RootPart.RotationOffset.X, 236 ParentGroup.RootPart.RotationOffset.X,
@@ -256,13 +256,13 @@ namespace OpenSim.Region.Environment.Scenes
256 /// <returns></returns> 256 /// <returns></returns>
257 public LLQuaternion GetWorldRotation() 257 public LLQuaternion GetWorldRotation()
258 { 258 {
259 259
260 Quaternion newRot; 260 Quaternion newRot;
261 261
262 if (this.LinkNum == 0) 262 if (this.LinkNum == 0)
263 { 263 {
264 newRot = new Quaternion(RotationOffset.W,RotationOffset.X,RotationOffset.Y,RotationOffset.Z); 264 newRot = new Quaternion(RotationOffset.W,RotationOffset.X,RotationOffset.Y,RotationOffset.Z);
265 265
266 } 266 }
267 else 267 else
268 { 268 {
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Environment.Scenes
286 //return new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w); 286 //return new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w);
287 287
288 } 288 }
289 289
290 public void StoreUndoState() 290 public void StoreUndoState()
291 { 291 {
292 if (!m_undoing) 292 if (!m_undoing)
@@ -307,7 +307,7 @@ namespace OpenSim.Region.Environment.Scenes
307 if (m_parentGroup.GetSceneMaxUndo() > 0) 307 if (m_parentGroup.GetSceneMaxUndo() > 0)
308 { 308 {
309 UndoState nUndo = new UndoState(this); 309 UndoState nUndo = new UndoState(this);
310 310
311 m_undo.Push(nUndo); 311 m_undo.Push(nUndo);
312 312
313 } 313 }
@@ -362,7 +362,7 @@ namespace OpenSim.Region.Environment.Scenes
362 } 362 }
363 else 363 else
364 { 364 {
365 365
366 // To move the child prim in respect to the group position and rotation we have to calculate 366 // To move the child prim in respect to the group position and rotation we have to calculate
367 367
368 LLVector3 resultingposition = GetWorldPosition(); 368 LLVector3 resultingposition = GetWorldPosition();
@@ -370,7 +370,7 @@ namespace OpenSim.Region.Environment.Scenes
370 LLQuaternion resultingrot = GetWorldRotation(); 370 LLQuaternion resultingrot = GetWorldRotation();
371 PhysActor.Orientation = new Quaternion(resultingrot.W, resultingrot.X, resultingrot.Y, resultingrot.Z); 371 PhysActor.Orientation = new Quaternion(resultingrot.W, resultingrot.X, resultingrot.Y, resultingrot.Z);
372 } 372 }
373 373
374 // Tell the physics engines that this prim changed. 374 // Tell the physics engines that this prim changed.
375 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 375 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
376 } 376 }
@@ -379,12 +379,12 @@ namespace OpenSim.Region.Environment.Scenes
379 Console.WriteLine(e.Message); 379 Console.WriteLine(e.Message);
380 } 380 }
381 } 381 }
382 382
383 } 383 }
384 } 384 }
385 385
386 private byte[] m_TextureAnimation; 386 private byte[] m_TextureAnimation;
387 387
388 protected LLVector3 m_offsetPosition; 388 protected LLVector3 m_offsetPosition;
389 389
390 public LLVector3 OffsetPosition 390 public LLVector3 OffsetPosition
@@ -398,7 +398,7 @@ namespace OpenSim.Region.Environment.Scenes
398 { 398 {
399 // Hack to get the child prim to update world positions in the physics engine 399 // Hack to get the child prim to update world positions in the physics engine
400 ParentGroup.ResetChildPrimPhysicsPositions(); 400 ParentGroup.ResetChildPrimPhysicsPositions();
401 401
402 } 402 }
403 catch (NullReferenceException) 403 catch (NullReferenceException)
404 { 404 {
@@ -467,7 +467,7 @@ namespace OpenSim.Region.Environment.Scenes
467 Console.WriteLine(ex.Message); 467 Console.WriteLine(ex.Message);
468 } 468 }
469 } 469 }
470 470
471 } 471 }
472 } 472 }
473 473
@@ -494,8 +494,8 @@ namespace OpenSim.Region.Environment.Scenes
494 494
495 return m_velocity; 495 return m_velocity;
496 } 496 }
497 set { 497 set {
498 498
499 m_velocity = value; 499 m_velocity = value;
500 if (PhysActor != null) 500 if (PhysActor != null)
501 { 501 {
@@ -505,7 +505,7 @@ namespace OpenSim.Region.Environment.Scenes
505 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 505 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
506 } 506 }
507 } 507 }
508 508
509 } 509 }
510 } 510 }
511 511
@@ -565,7 +565,7 @@ namespace OpenSim.Region.Environment.Scenes
565 { 565 {
566 m_color = value; 566 m_color = value;
567 TriggerScriptChangedEvent(Changed.COLOR); 567 TriggerScriptChangedEvent(Changed.COLOR);
568 568
569 /* ScheduleFullUpdate() need not be called b/c after 569 /* ScheduleFullUpdate() need not be called b/c after
570 * setting the color, the text will be set, so then 570 * setting the color, the text will be set, so then
571 * ScheduleFullUpdate() will be called. */ 571 * ScheduleFullUpdate() will be called. */
@@ -615,11 +615,11 @@ namespace OpenSim.Region.Environment.Scenes
615 public int LinkNum 615 public int LinkNum
616 { 616 {
617 get { return m_linkNum; } 617 get { return m_linkNum; }
618 set 618 set
619 { 619 {
620 m_linkNum = value; 620 m_linkNum = value;
621 TriggerScriptChangedEvent(Changed.LINK); 621 TriggerScriptChangedEvent(Changed.LINK);
622 622
623 } 623 }
624 } 624 }
625 625
@@ -646,7 +646,7 @@ namespace OpenSim.Region.Environment.Scenes
646 public void ApplyImpulse(LLVector3 impulsei, bool localGlobalTF) 646 public void ApplyImpulse(LLVector3 impulsei, bool localGlobalTF)
647 { 647 {
648 PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z); 648 PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z);
649 649
650 if (localGlobalTF) 650 if (localGlobalTF)
651 { 651 {
652 652
@@ -659,7 +659,7 @@ namespace OpenSim.Region.Environment.Scenes
659 } 659 }
660 else 660 else
661 { 661 {
662 662
663 if (m_parentGroup != null) 663 if (m_parentGroup != null)
664 { 664 {
665 m_parentGroup.applyImpulse(impulse); 665 m_parentGroup.applyImpulse(impulse);
@@ -698,9 +698,9 @@ namespace OpenSim.Region.Environment.Scenes
698 public PrimitiveBaseShape Shape 698 public PrimitiveBaseShape Shape
699 { 699 {
700 get { return m_shape; } 700 get { return m_shape; }
701 set 701 set
702 { 702 {
703 703
704 m_shape = value; 704 m_shape = value;
705 TriggerScriptChangedEvent(Changed.SHAPE); 705 TriggerScriptChangedEvent(Changed.SHAPE);
706 } 706 }
@@ -709,7 +709,7 @@ namespace OpenSim.Region.Environment.Scenes
709 public LLVector3 Scale 709 public LLVector3 Scale
710 { 710 {
711 get { return m_shape.Scale; } 711 get { return m_shape.Scale; }
712 set 712 set
713 { 713 {
714 StoreUndoState(); 714 StoreUndoState();
715 m_shape.Scale = value; 715 m_shape.Scale = value;
@@ -731,7 +731,7 @@ namespace OpenSim.Region.Environment.Scenes
731 } 731 }
732 732
733 #endregion 733 #endregion
734 734
735 public LLUUID ObjectOwner 735 public LLUUID ObjectOwner
736 { 736 {
737 get { return OwnerID; } 737 get { return OwnerID; }
@@ -809,9 +809,9 @@ namespace OpenSim.Region.Environment.Scenes
809 Acceleration = new LLVector3(0, 0, 0); 809 Acceleration = new LLVector3(0, 0, 0);
810 m_TextureAnimation = new byte[0]; 810 m_TextureAnimation = new byte[0];
811 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; 811 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp";
812 812
813 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, 813 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
814 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from 814 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
815 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log 815 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
816 816
817 Flags = 0; 817 Flags = 0;
@@ -819,7 +819,7 @@ namespace OpenSim.Region.Environment.Scenes
819 819
820 TrimPermissions(); 820 TrimPermissions();
821 //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo()); 821 //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo());
822 822
823 ScheduleFullUpdate(); 823 ScheduleFullUpdate();
824 } 824 }
825 825
@@ -855,14 +855,14 @@ namespace OpenSim.Region.Environment.Scenes
855 OffsetPosition = position; 855 OffsetPosition = position;
856 RotationOffset = rotation; 856 RotationOffset = rotation;
857 ObjectFlags = flags; 857 ObjectFlags = flags;
858 858
859 // Since we don't store script state, this is only a 'temporary' objectflag now 859 // Since we don't store script state, this is only a 'temporary' objectflag now
860 // If the object is scripted, the script will get loaded and this will be set again 860 // If the object is scripted, the script will get loaded and this will be set again
861 ObjectFlags &= ~(uint)(LLObject.ObjectFlags.Scripted | LLObject.ObjectFlags.Touch); 861 ObjectFlags &= ~(uint)(LLObject.ObjectFlags.Scripted | LLObject.ObjectFlags.Touch);
862 862
863 TrimPermissions(); 863 TrimPermissions();
864 // ApplyPhysics(); 864 // ApplyPhysics();
865 865
866 ScheduleFullUpdate(); 866 ScheduleFullUpdate();
867 } 867 }
868 868
@@ -881,7 +881,7 @@ namespace OpenSim.Region.Environment.Scenes
881 SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader); 881 SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader);
882 return newobject; 882 return newobject;
883 } 883 }
884 884
885 public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim) 885 public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim)
886 { 886 {
887 887
@@ -902,7 +902,7 @@ namespace OpenSim.Region.Environment.Scenes
902 new PhysicsVector(Scale.X, Scale.Y, Scale.Z), 902 new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
903 new Quaternion(RotationOffset.W, RotationOffset.X, 903 new Quaternion(RotationOffset.W, RotationOffset.X,
904 RotationOffset.Y, RotationOffset.Z), RigidBody); 904 RotationOffset.Y, RotationOffset.Z), RigidBody);
905 905
906 // Basic Physics returns null.. joy joy joy. 906 // Basic Physics returns null.. joy joy joy.
907 if (PhysActor != null) 907 if (PhysActor != null)
908 { 908 {
@@ -954,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes
954 Vector3 rOrigin = iray.Origin; 954 Vector3 rOrigin = iray.Origin;
955 Vector3 rDirection = iray.Direction; 955 Vector3 rDirection = iray.Direction;
956 956
957 957
958 958
959 //rDirection = rDirection.Normalize(); 959 //rDirection = rDirection.Normalize();
960 // Buidling the first part of the Quadratic equation 960 // Buidling the first part of the Quadratic equation
@@ -985,7 +985,7 @@ namespace OpenSim.Region.Environment.Scenes
985 radius = vScale.z; 985 radius = vScale.z;
986 986
987 // the second part of this is the default prim size 987 // the second part of this is the default prim size
988 // once we factor in the aabb of the prim we're adding we can 988 // once we factor in the aabb of the prim we're adding we can
989 // change this to; 989 // change this to;
990 // radius = (radius / 2) - 0.01f; 990 // radius = (radius / 2) - 0.01f;
991 // 991 //
@@ -1018,7 +1018,7 @@ namespace OpenSim.Region.Environment.Scenes
1018 } 1018 }
1019 } 1019 }
1020 1020
1021 // We got an intersection. putting together an EntityIntersection object with the 1021 // We got an intersection. putting together an EntityIntersection object with the
1022 // intersection information 1022 // intersection information
1023 Vector3 ipoint = 1023 Vector3 ipoint =
1024 new Vector3(iray.Origin.x + (iray.Direction.x*root), iray.Origin.y + (iray.Direction.y*root), 1024 new Vector3(iray.Origin.x + (iray.Direction.x*root), iray.Origin.y + (iray.Direction.y*root),
@@ -1089,16 +1089,16 @@ namespace OpenSim.Region.Environment.Scenes
1089 Vector3 AXpos = new Vector3(pos.X, pos.Y, pos.Z); 1089 Vector3 AXpos = new Vector3(pos.X, pos.Y, pos.Z);
1090 1090
1091 // tScale is the offset to derive the vertex based on the scale. 1091 // tScale is the offset to derive the vertex based on the scale.
1092 // it's different for each vertex because we've got to rotate it 1092 // it's different for each vertex because we've got to rotate it
1093 // to get the world position of the vertex to produce the Oriented Bounding Box 1093 // to get the world position of the vertex to produce the Oriented Bounding Box
1094 1094
1095 Vector3 tScale = new Vector3(); 1095 Vector3 tScale = new Vector3();
1096 1096
1097 Vector3 AXscale = new Vector3(m_shape.Scale.X * 0.5f, m_shape.Scale.Y * 0.5f, m_shape.Scale.Z * 0.5f); 1097 Vector3 AXscale = new Vector3(m_shape.Scale.X * 0.5f, m_shape.Scale.Y * 0.5f, m_shape.Scale.Z * 0.5f);
1098 1098
1099 //Vector3 pScale = (AXscale) - (AXrot.Inverse() * (AXscale)); 1099 //Vector3 pScale = (AXscale) - (AXrot.Inverse() * (AXscale));
1100 //Vector3 nScale = (AXscale * -1) - (AXrot.Inverse() * (AXscale * -1)); 1100 //Vector3 nScale = (AXscale * -1) - (AXrot.Inverse() * (AXscale * -1));
1101 1101
1102 // rScale is the rotated offset to find a vertex based on the scale and the world rotation. 1102 // rScale is the rotated offset to find a vertex based on the scale and the world rotation.
1103 Vector3 rScale = new Vector3(); 1103 Vector3 rScale = new Vector3();
1104 1104
@@ -1109,14 +1109,14 @@ namespace OpenSim.Region.Environment.Scenes
1109 // | | 1109 // | |
1110 // | 4 top | 1110 // | 4 top |
1111 // |_________| 1111 // |_________|
1112 // C D 1112 // C D
1113 1113
1114 // A _________ B 1114 // A _________ B
1115 // | Back | 1115 // | Back |
1116 // | 3 | 1116 // | 3 |
1117 // |_________| 1117 // |_________|
1118 // C D 1118 // C D
1119 1119
1120 // A _________ B B _________ A 1120 // A _________ B B _________ A
1121 // | Left | | Right | 1121 // | Left | | Right |
1122 // | 0 | | 2 | 1122 // | 0 | | 2 |
@@ -1127,13 +1127,13 @@ namespace OpenSim.Region.Environment.Scenes
1127 // | Front | 1127 // | Front |
1128 // | 1 | 1128 // | 1 |
1129 // |_________| 1129 // |_________|
1130 // C D 1130 // C D
1131 1131
1132 // C _________ D 1132 // C _________ D
1133 // | | 1133 // | |
1134 // | 5 bot | 1134 // | 5 bot |
1135 // |_________| 1135 // |_________|
1136 // A B 1136 // A B
1137 #endregion 1137 #endregion
1138 1138
1139 #region Plane Decomposition of Oriented Bounding Box 1139 #region Plane Decomposition of Oriented Bounding Box
@@ -1238,22 +1238,22 @@ namespace OpenSim.Region.Environment.Scenes
1238 for (int i = 0; i < 6; i++) 1238 for (int i = 0; i < 6; i++)
1239 { 1239 {
1240 //m_log.Info("[FACECALCULATION]: FaceA[" + i + "]=" + FaceA[i] + " FaceB[" + i + "]=" + FaceB[i] + " FaceC[" + i + "]=" + FaceC[i] + " FaceD[" + i + "]=" + FaceD[i]); 1240 //m_log.Info("[FACECALCULATION]: FaceA[" + i + "]=" + FaceA[i] + " FaceB[" + i + "]=" + FaceB[i] + " FaceC[" + i + "]=" + FaceC[i] + " FaceD[" + i + "]=" + FaceD[i]);
1241 1241
1242 // Our Plane direction 1242 // Our Plane direction
1243 AmBa = FaceA[i] - FaceB[i]; 1243 AmBa = FaceA[i] - FaceB[i];
1244 AmBb = FaceB[i] - FaceC[i]; 1244 AmBb = FaceB[i] - FaceC[i];
1245 1245
1246 cross = AmBb.Cross(AmBa); 1246 cross = AmBb.Cross(AmBa);
1247 1247
1248 // normalize the cross product to get the normal. 1248 // normalize the cross product to get the normal.
1249 normals[i] = cross / cross.Length; 1249 normals[i] = cross / cross.Length;
1250 1250
1251 //m_log.Info("[NORMALS]: normals[ " + i + "]" + normals[i].ToString()); 1251 //m_log.Info("[NORMALS]: normals[ " + i + "]" + normals[i].ToString());
1252 //distance[i] = (normals[i].x * AmBa.x + normals[i].y * AmBa.y + normals[i].z * AmBa.z) * -1; 1252 //distance[i] = (normals[i].x * AmBa.x + normals[i].y * AmBa.y + normals[i].z * AmBa.z) * -1;
1253 } 1253 }
1254 1254
1255 EntityIntersection returnresult = new EntityIntersection(); 1255 EntityIntersection returnresult = new EntityIntersection();
1256 1256
1257 returnresult.distance = 1024; 1257 returnresult.distance = 1024;
1258 float c = 0; 1258 float c = 0;
1259 float a = 0; 1259 float a = 0;
@@ -1276,7 +1276,7 @@ namespace OpenSim.Region.Environment.Scenes
1276 //{ 1276 //{
1277 //return returnresult; 1277 //return returnresult;
1278 //} 1278 //}
1279 // else 1279 // else
1280 //{ 1280 //{
1281 //continue; 1281 //continue;
1282 //} 1282 //}
@@ -1294,9 +1294,9 @@ namespace OpenSim.Region.Environment.Scenes
1294 //} 1294 //}
1295 1295
1296 //} 1296 //}
1297 //else 1297 //else
1298 //{ 1298 //{
1299 //if (a < fmin) 1299 //if (a < fmin)
1300 //{ 1300 //{
1301 //if (a < 0 || a < fmax) 1301 //if (a < 0 || a < fmax)
1302 //{ 1302 //{
@@ -1339,7 +1339,7 @@ namespace OpenSim.Region.Environment.Scenes
1339 1339
1340 // If the normal is pointing outside the object 1340 // If the normal is pointing outside the object
1341 1341
1342 1342
1343 1343
1344 if (iray.Direction.Dot(normals[i]) < 0 || !frontFacesOnly) 1344 if (iray.Direction.Dot(normals[i]) < 0 || !frontFacesOnly)
1345 { 1345 {
@@ -1359,7 +1359,7 @@ namespace OpenSim.Region.Environment.Scenes
1359 { 1359 {
1360 distance2 = (float)GetDistanceTo(q, iray.Origin); 1360 distance2 = (float)GetDistanceTo(q, iray.Origin);
1361 } 1361 }
1362 1362
1363 1363
1364 if (distance2 < returnresult.distance) 1364 if (distance2 < returnresult.distance)
1365 { 1365 {
@@ -1378,7 +1378,7 @@ namespace OpenSim.Region.Environment.Scenes
1378 } 1378 }
1379 return returnresult; 1379 return returnresult;
1380 } 1380 }
1381 1381
1382 // Use this for attachments! LocalID should be avatar's localid 1382 // Use this for attachments! LocalID should be avatar's localid
1383 public void SetParentLocalId(uint localID) 1383 public void SetParentLocalId(uint localID)
1384 { 1384 {
@@ -1388,16 +1388,16 @@ namespace OpenSim.Region.Environment.Scenes
1388 public void SetAttachmentPoint(uint AttachmentPoint) 1388 public void SetAttachmentPoint(uint AttachmentPoint)
1389 { 1389 {
1390 m_attachmentPoint = AttachmentPoint; 1390 m_attachmentPoint = AttachmentPoint;
1391 1391
1392 // save the attachment point. 1392 // save the attachment point.
1393 //if (AttachmentPoint != 0) 1393 //if (AttachmentPoint != 0)
1394 //{ 1394 //{
1395 m_shape.State = (byte)AttachmentPoint; 1395 m_shape.State = (byte)AttachmentPoint;
1396 //} 1396 //}
1397 1397
1398 } 1398 }
1399 /// <summary> 1399 /// <summary>
1400 /// 1400 ///
1401 /// </summary> 1401 /// </summary>
1402 public void SetParent(SceneObjectGroup parent) 1402 public void SetParent(SceneObjectGroup parent)
1403 { 1403 {
@@ -1417,7 +1417,7 @@ namespace OpenSim.Region.Environment.Scenes
1417 PhysActor.Buoyancy = fvalue; 1417 PhysActor.Buoyancy = fvalue;
1418 } 1418 }
1419 } 1419 }
1420 1420
1421 public void SetAxisRotation(int axis, int rotate) 1421 public void SetAxisRotation(int axis, int rotate)
1422 { 1422 {
1423 if (m_parentGroup != null) 1423 if (m_parentGroup != null)
@@ -1448,7 +1448,7 @@ namespace OpenSim.Region.Environment.Scenes
1448 1448
1449 } 1449 }
1450 } 1450 }
1451 1451
1452 1452
1453 public LLVector3 GetSitTargetPositionLL() 1453 public LLVector3 GetSitTargetPositionLL()
1454 { 1454 {
@@ -1547,9 +1547,9 @@ namespace OpenSim.Region.Environment.Scenes
1547 dupe.ObjectSaleType = ObjectSaleType; 1547 dupe.ObjectSaleType = ObjectSaleType;
1548 dupe.SalePrice = SalePrice; 1548 dupe.SalePrice = SalePrice;
1549 dupe.Category = Category; 1549 dupe.Category = Category;
1550 1550
1551 dupe.TaskInventory = (TaskInventoryDictionary)dupe.TaskInventory.Clone(); 1551 dupe.TaskInventory = (TaskInventoryDictionary)dupe.TaskInventory.Clone();
1552 1552
1553 dupe.ResetIDs(linkNum); 1553 dupe.ResetIDs(linkNum);
1554 1554
1555 // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. 1555 // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated.
@@ -1569,7 +1569,7 @@ namespace OpenSim.Region.Environment.Scenes
1569 } 1569 }
1570 1570
1571 #endregion 1571 #endregion
1572 1572
1573 /// <summary> 1573 /// <summary>
1574 /// Reset LLUUIDs for this part. This involves generate this part's own LLUUID and 1574 /// Reset LLUUIDs for this part. This involves generate this part's own LLUUID and
1575 /// generating new LLUUIDs for all the items in the inventory. 1575 /// generating new LLUUIDs for all the items in the inventory.
@@ -1578,8 +1578,8 @@ namespace OpenSim.Region.Environment.Scenes
1578 public void ResetIDs(int linkNum) 1578 public void ResetIDs(int linkNum)
1579 { 1579 {
1580 UUID = LLUUID.Random(); 1580 UUID = LLUUID.Random();
1581 LinkNum = linkNum; 1581 LinkNum = linkNum;
1582 1582
1583 ResetInventoryIDs(); 1583 ResetInventoryIDs();
1584 } 1584 }
1585 1585
@@ -1603,9 +1603,9 @@ namespace OpenSim.Region.Environment.Scenes
1603 m_parentGroup.HasGroupChanged = true; 1603 m_parentGroup.HasGroupChanged = true;
1604 m_parentGroup.QueueForUpdateCheck(); 1604 m_parentGroup.QueueForUpdateCheck();
1605 } 1605 }
1606 1606
1607 int timeNow = Util.UnixTimeSinceEpoch(); 1607 int timeNow = Util.UnixTimeSinceEpoch();
1608 1608
1609 // If multiple updates are scheduled on the same second, we still need to perform all of them 1609 // If multiple updates are scheduled on the same second, we still need to perform all of them
1610 // So we'll force the issue by bumping up the timestamp so that later processing sees these need 1610 // So we'll force the issue by bumping up the timestamp so that later processing sees these need
1611 // to be performed. 1611 // to be performed.
@@ -1617,11 +1617,11 @@ namespace OpenSim.Region.Environment.Scenes
1617 { 1617 {
1618 TimeStampFull = (uint)timeNow; 1618 TimeStampFull = (uint)timeNow;
1619 } 1619 }
1620 1620
1621 m_updateFlag = 2; 1621 m_updateFlag = 2;
1622 1622
1623// m_log.DebugFormat( 1623// m_log.DebugFormat(
1624// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", 1624// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}",
1625// UUID, Name, TimeStampFull); 1625// UUID, Name, TimeStampFull);
1626 } 1626 }
1627 1627
@@ -1668,13 +1668,13 @@ namespace OpenSim.Region.Environment.Scenes
1668 m_updateFlag = 1; 1668 m_updateFlag = 1;
1669 1669
1670// m_log.DebugFormat( 1670// m_log.DebugFormat(
1671// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", 1671// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
1672// UUID, Name, TimeStampTerse); 1672// UUID, Name, TimeStampTerse);
1673 } 1673 }
1674 } 1674 }
1675 1675
1676 /// <summary> 1676 /// <summary>
1677 /// Tell all the prims which have had updates scheduled 1677 /// Tell all the prims which have had updates scheduled
1678 /// </summary> 1678 /// </summary>
1679 public void SendScheduledUpdates() 1679 public void SendScheduledUpdates()
1680 { 1680 {
@@ -1687,7 +1687,7 @@ namespace OpenSim.Region.Environment.Scenes
1687 // bad, so it's been replaced by an event driven method. 1687 // bad, so it's been replaced by an event driven method.
1688 //if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0) 1688 //if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0)
1689 //{ 1689 //{
1690 // Only send the constant terse updates on physical objects! 1690 // Only send the constant terse updates on physical objects!
1691 //ScheduleTerseUpdate(); 1691 //ScheduleTerseUpdate();
1692 //} 1692 //}
1693 } 1693 }
@@ -1706,7 +1706,7 @@ namespace OpenSim.Region.Environment.Scenes
1706 #region Shape 1706 #region Shape
1707 1707
1708 /// <summary> 1708 /// <summary>
1709 /// 1709 ///
1710 /// </summary> 1710 /// </summary>
1711 /// <param name="shapeBlock"></param> 1711 /// <param name="shapeBlock"></param>
1712 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock) 1712 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
@@ -1750,7 +1750,7 @@ namespace OpenSim.Region.Environment.Scenes
1750 //m_log.Info("TSomething4:" + ((type & (ushort)ExtraParamType.Something4) == (ushort)ExtraParamType.Something4)); 1750 //m_log.Info("TSomething4:" + ((type & (ushort)ExtraParamType.Something4) == (ushort)ExtraParamType.Something4));
1751 //m_log.Info("TSomething5:" + ((type & (ushort)ExtraParamType.Something5) == (ushort)ExtraParamType.Something5)); 1751 //m_log.Info("TSomething5:" + ((type & (ushort)ExtraParamType.Something5) == (ushort)ExtraParamType.Something5));
1752 //m_log.Info("TSomething6:" + ((type & (ushort)ExtraParamType.Something6) == (ushort)ExtraParamType.Something6)); 1752 //m_log.Info("TSomething6:" + ((type & (ushort)ExtraParamType.Something6) == (ushort)ExtraParamType.Something6));
1753 1753
1754 bool usePhysics = false; 1754 bool usePhysics = false;
1755 bool IsTemporary = false; 1755 bool IsTemporary = false;
1756 bool IsPhantom = false; 1756 bool IsPhantom = false;
@@ -1758,7 +1758,7 @@ namespace OpenSim.Region.Environment.Scenes
1758 bool wasUsingPhysics = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0); 1758 bool wasUsingPhysics = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0);
1759 //bool IsLocked = false; 1759 //bool IsLocked = false;
1760 int i = 0; 1760 int i = 0;
1761 1761
1762 1762
1763 try 1763 try
1764 { 1764 {
@@ -1975,7 +1975,7 @@ namespace OpenSim.Region.Environment.Scenes
1975 #region Texture 1975 #region Texture
1976 1976
1977 /// <summary> 1977 /// <summary>
1978 /// 1978 ///
1979 /// </summary> 1979 /// </summary>
1980 /// <param name="textureEntry"></param> 1980 /// <param name="textureEntry"></param>
1981 public void UpdateTextureEntry(byte[] textureEntry) 1981 public void UpdateTextureEntry(byte[] textureEntry)
@@ -1985,7 +1985,7 @@ namespace OpenSim.Region.Environment.Scenes
1985 ScheduleFullUpdate(); 1985 ScheduleFullUpdate();
1986 } 1986 }
1987 1987
1988 // Added to handle bug in libsecondlife's TextureEntry.ToBytes() 1988 // Added to handle bug in libsecondlife's TextureEntry.ToBytes()
1989 // not handling RGBA properly. Cycles through, and "fixes" the color 1989 // not handling RGBA properly. Cycles through, and "fixes" the color
1990 // info 1990 // info
1991 public void UpdateTexture(LLObject.TextureEntry tex) 1991 public void UpdateTexture(LLObject.TextureEntry tex)
@@ -2030,7 +2030,7 @@ namespace OpenSim.Region.Environment.Scenes
2030 byte[] data = new byte[16]; 2030 byte[] data = new byte[16];
2031 int pos = 0; 2031 int pos = 0;
2032 2032
2033 // The flags don't like conversion from uint to byte, so we have to do 2033 // The flags don't like conversion from uint to byte, so we have to do
2034 // it the crappy way. See the above function :( 2034 // it the crappy way. See the above function :(
2035 2035
2036 data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++; 2036 data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++;
@@ -2059,7 +2059,7 @@ namespace OpenSim.Region.Environment.Scenes
2059 #region Position 2059 #region Position
2060 2060
2061 /// <summary> 2061 /// <summary>
2062 /// 2062 ///
2063 /// </summary> 2063 /// </summary>
2064 /// <param name="pos"></param> 2064 /// <param name="pos"></param>
2065 public void UpdateOffSet(LLVector3 pos) 2065 public void UpdateOffSet(LLVector3 pos)
@@ -2115,7 +2115,7 @@ namespace OpenSim.Region.Environment.Scenes
2115 foreach (ScenePresence p in avatarts) 2115 foreach (ScenePresence p in avatarts)
2116 { 2116 {
2117 // TODO: some filtering by distance of avatar 2117 // TODO: some filtering by distance of avatar
2118 2118
2119 p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); 2119 p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
2120 } 2120 }
2121 } 2121 }
@@ -2193,14 +2193,14 @@ namespace OpenSim.Region.Environment.Scenes
2193 #region Resizing/Scale 2193 #region Resizing/Scale
2194 2194
2195 /// <summary> 2195 /// <summary>
2196 /// 2196 ///
2197 /// </summary> 2197 /// </summary>
2198 /// <param name="scale"></param> 2198 /// <param name="scale"></param>
2199 public void Resize(LLVector3 scale) 2199 public void Resize(LLVector3 scale)
2200 { 2200 {
2201 StoreUndoState(); 2201 StoreUndoState();
2202 m_shape.Scale = scale; 2202 m_shape.Scale = scale;
2203 2203
2204 ScheduleFullUpdate(); 2204 ScheduleFullUpdate();
2205 } 2205 }
2206 2206
@@ -2261,7 +2261,7 @@ namespace OpenSim.Region.Environment.Scenes
2261 } 2261 }
2262 2262
2263 #region Client Update Methods 2263 #region Client Update Methods
2264 2264
2265 /// <summary> 2265 /// <summary>
2266 /// Tell all scene presences that they should send updates for this part to their clients 2266 /// Tell all scene presences that they should send updates for this part to their clients
2267 /// </summary> 2267 /// </summary>
@@ -2287,7 +2287,7 @@ namespace OpenSim.Region.Environment.Scenes
2287 } 2287 }
2288 } 2288 }
2289 } 2289 }
2290 2290
2291 2291
2292 public void AddFullUpdateToAvatar(ScenePresence presence) 2292 public void AddFullUpdateToAvatar(ScenePresence presence)
2293 { 2293 {
@@ -2295,7 +2295,7 @@ namespace OpenSim.Region.Environment.Scenes
2295 } 2295 }
2296 2296
2297 /// <summary> 2297 /// <summary>
2298 /// 2298 ///
2299 /// </summary> 2299 /// </summary>
2300 public void SendFullUpdateToAllClients() 2300 public void SendFullUpdateToAllClients()
2301 { 2301 {
@@ -2309,7 +2309,7 @@ namespace OpenSim.Region.Environment.Scenes
2309 } 2309 }
2310 2310
2311 /// <summary> 2311 /// <summary>
2312 /// 2312 ///
2313 /// </summary> 2313 /// </summary>
2314 /// <param name="remoteClient"></param> 2314 /// <param name="remoteClient"></param>
2315 public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) 2315 public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
@@ -2328,7 +2328,7 @@ namespace OpenSim.Region.Environment.Scenes
2328 lPos = OffsetPosition; 2328 lPos = OffsetPosition;
2329 SendFullUpdateToClient(remoteClient, lPos, clientflags); 2329 SendFullUpdateToClient(remoteClient, lPos, clientflags);
2330 } 2330 }
2331 2331
2332 /// <summary> 2332 /// <summary>
2333 /// Sends a full update to the client 2333 /// Sends a full update to the client
2334 /// </summary> 2334 /// </summary>
@@ -2338,7 +2338,7 @@ namespace OpenSim.Region.Environment.Scenes
2338 public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos, uint clientFlags) 2338 public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos, uint clientFlags)
2339 { 2339 {
2340 clientFlags &= ~(uint) LLObject.ObjectFlags.CreateSelected; 2340 clientFlags &= ~(uint) LLObject.ObjectFlags.CreateSelected;
2341 2341
2342 if (remoteClient.AgentId == OwnerID) 2342 if (remoteClient.AgentId == OwnerID)
2343 { 2343 {
2344 if ((uint) (Flags & LLObject.ObjectFlags.CreateSelected) != 0) 2344 if ((uint) (Flags & LLObject.ObjectFlags.CreateSelected) != 0)
@@ -2351,7 +2351,7 @@ namespace OpenSim.Region.Environment.Scenes
2351 2351
2352 byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; 2352 byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A};
2353 remoteClient.SendPrimitiveToClient( 2353 remoteClient.SendPrimitiveToClient(
2354 m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, 2354 m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape,
2355 lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, 2355 lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid,
2356 OwnerID, 2356 OwnerID,
2357 m_text, color, ParentID, m_particleSystem, m_clickAction, m_TextureAnimation, m_IsAttachment, m_attachmentPoint,fromAssetID); 2357 m_text, color, ParentID, m_particleSystem, m_clickAction, m_TextureAnimation, m_IsAttachment, m_attachmentPoint,fromAssetID);
@@ -2373,7 +2373,7 @@ namespace OpenSim.Region.Environment.Scenes
2373 } 2373 }
2374 2374
2375 /// <summary> 2375 /// <summary>
2376 /// 2376 ///
2377 /// </summary> 2377 /// </summary>
2378 public void SendTerseUpdateToAllClients() 2378 public void SendTerseUpdateToAllClients()
2379 { 2379 {
@@ -2451,7 +2451,7 @@ namespace OpenSim.Region.Environment.Scenes
2451 m_parentGroup.AbsolutePosition = newpos; 2451 m_parentGroup.AbsolutePosition = newpos;
2452 return; 2452 return;
2453 } 2453 }
2454 2454
2455 } 2455 }
2456 ScheduleTerseUpdate(); 2456 ScheduleTerseUpdate();
2457 2457
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 28507cd..ba8bbd9 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -40,7 +40,7 @@ using OpenSim.Region.Physics.Manager;
40 40
41namespace OpenSim.Region.Environment.Scenes 41namespace OpenSim.Region.Environment.Scenes
42{ 42{
43 enum ScriptControlled : int 43 enum ScriptControlled : int
44 { 44 {
45 CONTROL_ZERO = 0, 45 CONTROL_ZERO = 0,
46 CONTROL_FWD = 1, 46 CONTROL_FWD = 1,
@@ -63,14 +63,14 @@ namespace OpenSim.Region.Environment.Scenes
63 public ScriptControlled eventControls; 63 public ScriptControlled eventControls;
64 } 64 }
65 65
66 [Serializable] 66 [Serializable]
67 public class ScenePresence : EntityBase, ISerializable 67 public class ScenePresence : EntityBase, ISerializable
68 { 68 {
69// ~ScenePresence() 69// ~ScenePresence()
70// { 70// {
71// System.Console.WriteLine("[ScenePresence] Destructor called"); 71// System.Console.WriteLine("[ScenePresence] Destructor called");
72// } 72// }
73 73
74 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 74 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
75 75
76 public static byte[] DefaultTexture; 76 public static byte[] DefaultTexture;
@@ -92,7 +92,7 @@ namespace OpenSim.Region.Environment.Scenes
92 private LLVector3 m_requestedSitOffset = new LLVector3(); 92 private LLVector3 m_requestedSitOffset = new LLVector3();
93 private float m_sitAvatarHeight = 2.0f; 93 private float m_sitAvatarHeight = 2.0f;
94 private float m_godlevel = 0; 94 private float m_godlevel = 0;
95 95
96 private bool m_invulnerable = true; 96 private bool m_invulnerable = true;
97 97
98 private LLVector3 m_LastChildAgentUpdatePosition = new LLVector3(); 98 private LLVector3 m_LastChildAgentUpdatePosition = new LLVector3();
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes
114 private float m_health = 100f; 114 private float m_health = 100f;
115 115
116 private LLVector3 m_lastVelocity = LLVector3.Zero; 116 private LLVector3 m_lastVelocity = LLVector3.Zero;
117 117
118 // Default AV Height 118 // Default AV Height
119 private float m_avHeight = 127.0f; 119 private float m_avHeight = 127.0f;
120 120
@@ -213,10 +213,10 @@ namespace OpenSim.Region.Environment.Scenes
213 get { return m_invulnerable; } 213 get { return m_invulnerable; }
214 } 214 }
215 215
216 public float GodLevel 216 public float GodLevel
217 { 217 {
218 get { return m_godlevel; } 218 get { return m_godlevel; }
219 } 219 }
220 220
221 private readonly ulong m_regionHandle; 221 private readonly ulong m_regionHandle;
222 222
@@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Scenes
260 /// <summary> 260 /// <summary>
261 /// This works out to be the ClientView object associated with this avatar, or it's client connection manager 261 /// This works out to be the ClientView object associated with this avatar, or it's client connection manager
262 /// </summary> 262 /// </summary>
263 private IClientAPI m_controllingClient; 263 private IClientAPI m_controllingClient;
264 264
265 protected PhysicsActor m_physicsActor; 265 protected PhysicsActor m_physicsActor;
266 266
@@ -350,7 +350,7 @@ namespace OpenSim.Region.Environment.Scenes
350 /// <summary> 350 /// <summary>
351 /// If this is true, agent doesn't have a representation in this scene. 351 /// If this is true, agent doesn't have a representation in this scene.
352 /// this is an agent 'looking into' this scene from a nearby scene(region) 352 /// this is an agent 'looking into' this scene from a nearby scene(region)
353 /// 353 ///
354 /// if False, this agent has a representation in this scene 354 /// if False, this agent has a representation in this scene
355 /// </summary> 355 /// </summary>
356 private bool m_isChildAgent = true; 356 private bool m_isChildAgent = true;
@@ -482,7 +482,7 @@ namespace OpenSim.Region.Environment.Scenes
482 } 482 }
483 483
484 /// <summary> 484 /// <summary>
485 /// Send updates to the client about prims which have been placed on the update queue. We don't 485 /// Send updates to the client about prims which have been placed on the update queue. We don't
486 /// necessarily send updates for all the parts on the queue, e.g. if an updates with a more recent 486 /// necessarily send updates for all the parts on the queue, e.g. if an updates with a more recent
487 /// timestamp has already been sent. 487 /// timestamp has already been sent.
488 /// </summary> 488 /// </summary>
@@ -498,12 +498,12 @@ namespace OpenSim.Region.Environment.Scenes
498 if (!m_gotAllObjectsInScene) 498 if (!m_gotAllObjectsInScene)
499 { 499 {
500 if (!m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor) 500 if (!m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor)
501 { 501 {
502 m_scene.SendAllSceneObjectsToClient(this); 502 m_scene.SendAllSceneObjectsToClient(this);
503 m_gotAllObjectsInScene = true; 503 m_gotAllObjectsInScene = true;
504 } 504 }
505 } 505 }
506 506
507 if (m_partsUpdateQueue.Count > 0) 507 if (m_partsUpdateQueue.Count > 0)
508 { 508 {
509 bool runUpdate = true; 509 bool runUpdate = true;
@@ -520,12 +520,12 @@ namespace OpenSim.Region.Environment.Scenes
520 if (update.LastFullUpdateTime < part.TimeStampFull) 520 if (update.LastFullUpdateTime < part.TimeStampFull)
521 { 521 {
522// m_log.DebugFormat( 522// m_log.DebugFormat(
523// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}", 523// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
524// part.Name, part.UUID, part.TimeStampFull); 524// part.Name, part.UUID, part.TimeStampFull);
525 525
526 part.SendFullUpdate(ControllingClient, GenerateClientFlags(part.UUID)); 526 part.SendFullUpdate(ControllingClient, GenerateClientFlags(part.UUID));
527 527
528 // We'll update to the part's timestamp rather than the current time to 528 // We'll update to the part's timestamp rather than the current time to
529 // avoid the race condition whereby the next tick occurs while we are 529 // avoid the race condition whereby the next tick occurs while we are
530 // doing this update. If this happened, then subsequent updates which occurred 530 // doing this update. If this happened, then subsequent updates which occurred
531 // on the same tick or the next tick of the last update would be ignored. 531 // on the same tick or the next tick of the last update would be ignored.
@@ -536,9 +536,9 @@ namespace OpenSim.Region.Environment.Scenes
536 else if (update.LastTerseUpdateTime <= part.TimeStampTerse) 536 else if (update.LastTerseUpdateTime <= part.TimeStampTerse)
537 { 537 {
538// m_log.DebugFormat( 538// m_log.DebugFormat(
539// "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}", 539// "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}",
540// part.Name, part.UUID, part.TimeStampTerse); 540// part.Name, part.UUID, part.TimeStampTerse);
541 541
542 part.SendTerseUpdate(ControllingClient); 542 part.SendTerseUpdate(ControllingClient);
543 543
544 update.LastTerseUpdateTime = part.TimeStampTerse; 544 update.LastTerseUpdateTime = part.TimeStampTerse;
@@ -575,15 +575,15 @@ namespace OpenSim.Region.Environment.Scenes
575 575
576 /// <summary> 576 /// <summary>
577 /// This turns a child agent, into a root agent 577 /// This turns a child agent, into a root agent
578 /// This is called when an agent teleports into a region, or if an 578 /// This is called when an agent teleports into a region, or if an
579 /// agent crosses into this region from a neighbor over the border 579 /// agent crosses into this region from a neighbor over the border
580 /// </summary> 580 /// </summary>
581 public void MakeRootAgent(LLVector3 pos, bool isFlying) 581 public void MakeRootAgent(LLVector3 pos, bool isFlying)
582 { 582 {
583// m_log.DebugFormat( 583// m_log.DebugFormat(
584// "[SCENEPRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2}", 584// "[SCENEPRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2}",
585// Name, UUID, m_scene.RegionInfo.RegionName); 585// Name, UUID, m_scene.RegionInfo.RegionName);
586 586
587 m_isChildAgent = false; 587 m_isChildAgent = false;
588 588
589 AbsolutePosition = pos; 589 AbsolutePosition = pos;
@@ -599,7 +599,7 @@ namespace OpenSim.Region.Environment.Scenes
599 //{ 599 //{
600 m_scene.SendAllSceneObjectsToClient(this); 600 m_scene.SendAllSceneObjectsToClient(this);
601 m_scene.LandChannel.SendLandUpdate(this, true); 601 m_scene.LandChannel.SendLandUpdate(this, true);
602 602
603 //m_gotAllObjectsInScene = true; 603 //m_gotAllObjectsInScene = true;
604 //} 604 //}
605 } 605 }
@@ -607,8 +607,8 @@ namespace OpenSim.Region.Environment.Scenes
607 /// <summary> 607 /// <summary>
608 /// This turns a root agent into a child agent 608 /// This turns a root agent into a child agent
609 /// when an agent departs this region for a neighbor, this gets called. 609 /// when an agent departs this region for a neighbor, this gets called.
610 /// 610 ///
611 /// It doesn't get called for a teleport. Reason being, an agent that 611 /// It doesn't get called for a teleport. Reason being, an agent that
612 /// teleports out may not be anywhere near this region 612 /// teleports out may not be anywhere near this region
613 /// </summary> 613 /// </summary>
614 public void MakeChildAgent() 614 public void MakeChildAgent()
@@ -616,15 +616,15 @@ namespace OpenSim.Region.Environment.Scenes
616 m_animations.Clear(); 616 m_animations.Clear();
617 617
618// m_log.DebugFormat( 618// m_log.DebugFormat(
619// "[SCENEPRESENCE]: Downgrading child agent {0}, {1} to a root agent in {2}", 619// "[SCENEPRESENCE]: Downgrading child agent {0}, {1} to a root agent in {2}",
620// Name, UUID, m_scene.RegionInfo.RegionName); 620// Name, UUID, m_scene.RegionInfo.RegionName);
621 621
622 Velocity = new LLVector3(0, 0, 0); 622 Velocity = new LLVector3(0, 0, 0);
623 m_isChildAgent = true; 623 m_isChildAgent = true;
624 m_scene.SwapRootAgentCount(true); 624 m_scene.SwapRootAgentCount(true);
625 RemoveFromPhysicalScene(); 625 RemoveFromPhysicalScene();
626 m_scene.EventManager.TriggerOnMakeChildAgent(this); 626 m_scene.EventManager.TriggerOnMakeChildAgent(this);
627 //this.Pos = new LLVector3(128, 128, 70); 627 //this.Pos = new LLVector3(128, 128, 70);
628 } 628 }
629 629
630 /// <summary> 630 /// <summary>
@@ -643,7 +643,7 @@ namespace OpenSim.Region.Environment.Scenes
643 } 643 }
644 644
645 /// <summary> 645 /// <summary>
646 /// 646 ///
647 /// </summary> 647 /// </summary>
648 /// <param name="pos"></param> 648 /// <param name="pos"></param>
649 public void Teleport(LLVector3 pos) 649 public void Teleport(LLVector3 pos)
@@ -656,7 +656,7 @@ namespace OpenSim.Region.Environment.Scenes
656 } 656 }
657 657
658 /// <summary> 658 /// <summary>
659 /// 659 ///
660 /// </summary> 660 /// </summary>
661 public void StopMovement() 661 public void StopMovement()
662 { 662 {
@@ -762,7 +762,7 @@ namespace OpenSim.Region.Environment.Scenes
762 uint flags = agentData.ControlFlags; 762 uint flags = agentData.ControlFlags;
763 LLQuaternion bodyRotation = agentData.BodyRotation; 763 LLQuaternion bodyRotation = agentData.BodyRotation;
764 764
765 // Camera location in world. We'll need to raytrace 765 // Camera location in world. We'll need to raytrace
766 // from this location from time to time. 766 // from this location from time to time.
767 m_CameraCenter.x = agentData.CameraCenter.X; 767 m_CameraCenter.x = agentData.CameraCenter.X;
768 m_CameraCenter.y = agentData.CameraCenter.Y; 768 m_CameraCenter.y = agentData.CameraCenter.Y;
@@ -815,7 +815,7 @@ namespace OpenSim.Region.Environment.Scenes
815 // m_AgentControlFlags = flags; 815 // m_AgentControlFlags = flags;
816 // m_headrotation = agentData.AgentData.HeadRotation; 816 // m_headrotation = agentData.AgentData.HeadRotation;
817 // m_state = agentData.AgentData.State; 817 // m_state = agentData.AgentData.State;
818 818
819 if (m_allowMovement) 819 if (m_allowMovement)
820 { 820 {
821 int i = 0; 821 int i = 0;
@@ -870,7 +870,7 @@ namespace OpenSim.Region.Environment.Scenes
870 i++; 870 i++;
871 } 871 }
872 } 872 }
873 // Cause the avatar to stop flying if it's colliding 873 // Cause the avatar to stop flying if it's colliding
874 // with something with the down arrow pressed. 874 // with something with the down arrow pressed.
875 875
876 // Skip if there's no physicsactor 876 // Skip if there's no physicsactor
@@ -886,7 +886,7 @@ namespace OpenSim.Region.Environment.Scenes
886 // Are the collision requirements fulfilled? 886 // Are the collision requirements fulfilled?
887 bool colliding = (m_physicsActor.IsColliding == true); 887 bool colliding = (m_physicsActor.IsColliding == true);
888 888
889 889
890 890
891 if (m_physicsActor.Flying && colliding && controlland) 891 if (m_physicsActor.Flying && colliding && controlland)
892 { 892 {
@@ -903,9 +903,9 @@ namespace OpenSim.Region.Environment.Scenes
903 UpdateMovementAnimations(); 903 UpdateMovementAnimations();
904 } 904 }
905 } 905 }
906 906
907 m_scene.EventManager.TriggerOnClientMovement(this); 907 m_scene.EventManager.TriggerOnClientMovement(this);
908 908
909 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 909 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
910 } 910 }
911 911
@@ -934,7 +934,7 @@ namespace OpenSim.Region.Environment.Scenes
934 934
935 m_pos += m_parentPosition + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight); 935 m_pos += m_parentPosition + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight);
936 m_parentPosition = new LLVector3(); 936 m_parentPosition = new LLVector3();
937 937
938 m_parentID = 0; 938 m_parentID = 0;
939 SendFullUpdateToAllClients(); 939 SendFullUpdateToAllClients();
940 940
@@ -949,10 +949,10 @@ namespace OpenSim.Region.Environment.Scenes
949 949
950 private void SendSitResponse(IClientAPI remoteClient, LLUUID targetID, LLVector3 offset) 950 private void SendSitResponse(IClientAPI remoteClient, LLUUID targetID, LLVector3 offset)
951 { 951 {
952
953 952
954 953
955 954
955
956 bool autopilot = true; 956 bool autopilot = true;
957 LLVector3 pos = new LLVector3(); 957 LLVector3 pos = new LLVector3();
958 LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1); 958 LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1);
@@ -1008,10 +1008,10 @@ namespace OpenSim.Region.Environment.Scenes
1008 } 1008 }
1009 1009
1010 ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, LLVector3.Zero, LLVector3.Zero, false); 1010 ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, LLVector3.Zero, LLVector3.Zero, false);
1011 1011
1012 // This calls HandleAgentSit twice, once from here, and the client calls 1012 // This calls HandleAgentSit twice, once from here, and the client calls
1013 // HandleAgentSit itself after it gets to the location 1013 // HandleAgentSit itself after it gets to the location
1014 // It doesn't get to the location until we've moved them there though 1014 // It doesn't get to the location until we've moved them there though
1015 // which happens in HandleAgentSit :P 1015 // which happens in HandleAgentSit :P
1016 if (!autopilot) 1016 if (!autopilot)
1017 HandleAgentSit(remoteClient, UUID); 1017 HandleAgentSit(remoteClient, UUID);
@@ -1256,7 +1256,7 @@ namespace OpenSim.Region.Environment.Scenes
1256 } 1256 }
1257 1257
1258 m_perfMonMS = System.Environment.TickCount; 1258 m_perfMonMS = System.Environment.TickCount;
1259 1259
1260 m_rotation = rotation; 1260 m_rotation = rotation;
1261 NewForce newVelocity = new NewForce(); 1261 NewForce newVelocity = new NewForce();
1262 Vector3 direc = rotation*vec; 1262 Vector3 direc = rotation*vec;
@@ -1268,9 +1268,9 @@ namespace OpenSim.Region.Environment.Scenes
1268 direc *= 4; 1268 direc *= 4;
1269 //bool controlland = (((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0)); 1269 //bool controlland = (((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
1270 //bool colliding = (m_physicsActor.IsColliding==true); 1270 //bool colliding = (m_physicsActor.IsColliding==true);
1271 //if (controlland) 1271 //if (controlland)
1272 // m_log.Info("[AGENT]: landCommand"); 1272 // m_log.Info("[AGENT]: landCommand");
1273 //if (colliding) 1273 //if (colliding)
1274 // m_log.Info("[AGENT]: colliding"); 1274 // m_log.Info("[AGENT]: colliding");
1275 //if (m_physicsActor.Flying && colliding && controlland) 1275 //if (m_physicsActor.Flying && colliding && controlland)
1276 //{ 1276 //{
@@ -1306,7 +1306,7 @@ namespace OpenSim.Region.Environment.Scenes
1306 #region Overridden Methods 1306 #region Overridden Methods
1307 1307
1308 /// <summary> 1308 /// <summary>
1309 /// 1309 ///
1310 /// </summary> 1310 /// </summary>
1311 public override void Update() 1311 public override void Update()
1312 { 1312 {
@@ -1383,7 +1383,7 @@ namespace OpenSim.Region.Environment.Scenes
1383 lastPhysPos = AbsolutePosition; 1383 lastPhysPos = AbsolutePosition;
1384 1384
1385 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 1385 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1386 1386
1387 } 1387 }
1388 1388
1389 public void SendCoarseLocations() 1389 public void SendCoarseLocations()
@@ -1433,7 +1433,7 @@ namespace OpenSim.Region.Environment.Scenes
1433 foreach (ScenePresence avatar in avatars) 1433 foreach (ScenePresence avatar in avatars)
1434 { 1434 {
1435 SendFullUpdateToOtherClient(avatar); 1435 SendFullUpdateToOtherClient(avatar);
1436 1436
1437 if (avatar.LocalId != LocalId) 1437 if (avatar.LocalId != LocalId)
1438 { 1438 {
1439 if (!avatar.m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor) 1439 if (!avatar.m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor)
@@ -1448,7 +1448,7 @@ namespace OpenSim.Region.Environment.Scenes
1448 } 1448 }
1449 1449
1450 /// <summary> 1450 /// <summary>
1451 /// 1451 ///
1452 /// </summary> 1452 /// </summary>
1453 public void SendInitialData() 1453 public void SendInitialData()
1454 { 1454 {
@@ -1472,7 +1472,7 @@ namespace OpenSim.Region.Environment.Scenes
1472 } 1472 }
1473 1473
1474 /// <summary> 1474 /// <summary>
1475 /// 1475 ///
1476 /// </summary> 1476 /// </summary>
1477 /// <param name="client"></param> 1477 /// <param name="client"></param>
1478 public void SendOwnAppearance() 1478 public void SendOwnAppearance()
@@ -1481,7 +1481,7 @@ namespace OpenSim.Region.Environment.Scenes
1481 } 1481 }
1482 1482
1483 /// <summary> 1483 /// <summary>
1484 /// 1484 ///
1485 /// </summary> 1485 /// </summary>
1486 public void SendAppearanceToAllOtherAgents() 1486 public void SendAppearanceToAllOtherAgents()
1487 { 1487 {
@@ -1498,7 +1498,7 @@ namespace OpenSim.Region.Environment.Scenes
1498 } 1498 }
1499 1499
1500 public void SendAppearanceToOtherAgent(ScenePresence avatar) 1500 public void SendAppearanceToOtherAgent(ScenePresence avatar)
1501 { 1501 {
1502 avatar.ControllingClient.SendAppearance( 1502 avatar.ControllingClient.SendAppearance(
1503 m_appearance.Owner, 1503 m_appearance.Owner,
1504 m_appearance.VisualParams, 1504 m_appearance.VisualParams,
@@ -1522,7 +1522,7 @@ namespace OpenSim.Region.Environment.Scenes
1522 } 1522 }
1523 1523
1524 /// <summary> 1524 /// <summary>
1525 /// 1525 ///
1526 /// </summary> 1526 /// </summary>
1527 /// <param name="animations"></param> 1527 /// <param name="animations"></param>
1528 /// <param name="seqs"></param> 1528 /// <param name="seqs"></param>
@@ -1536,7 +1536,7 @@ namespace OpenSim.Region.Environment.Scenes
1536 } 1536 }
1537 1537
1538 /// <summary> 1538 /// <summary>
1539 /// 1539 ///
1540 /// </summary> 1540 /// </summary>
1541 public void SendAnimPack() 1541 public void SendAnimPack()
1542 { 1542 {
@@ -1568,7 +1568,7 @@ namespace OpenSim.Region.Environment.Scenes
1568 } 1568 }
1569 1569
1570 // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m 1570 // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m
1571 if (Util.GetDistanceTo(AbsolutePosition,m_LastChildAgentUpdatePosition) > 32) 1571 if (Util.GetDistanceTo(AbsolutePosition,m_LastChildAgentUpdatePosition) > 32)
1572 { 1572 {
1573 ChildAgentDataUpdate cadu = new ChildAgentDataUpdate(); 1573 ChildAgentDataUpdate cadu = new ChildAgentDataUpdate();
1574 cadu.ActiveGroupID=LLUUID.Zero.UUID; 1574 cadu.ActiveGroupID=LLUUID.Zero.UUID;
@@ -1593,14 +1593,14 @@ namespace OpenSim.Region.Environment.Scenes
1593 multiplier = 0.25f; 1593 multiplier = 0.25f;
1594 } 1594 }
1595 1595
1596 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); 1596 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
1597 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); 1597 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier);
1598
1599 1598
1600
1601 1599
1602 1600
1603 cadu.Velocity = new sLLVector3(Velocity); 1601
1602
1603 cadu.Velocity = new sLLVector3(Velocity);
1604 m_scene.SendOutChildAgentUpdates(cadu,this); 1604 m_scene.SendOutChildAgentUpdates(cadu,this);
1605 m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; 1605 m_LastChildAgentUpdatePosition.X = AbsolutePosition.X;
1606 m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y; 1606 m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y;
@@ -1681,9 +1681,9 @@ namespace OpenSim.Region.Environment.Scenes
1681 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); 1681 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
1682 SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); 1682 SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
1683 if (neighbourRegion != null) 1683 if (neighbourRegion != null)
1684 { 1684 {
1685 // When the neighbour is informed of the border crossing, it will set up CAPS handlers for the avatar 1685 // When the neighbour is informed of the border crossing, it will set up CAPS handlers for the avatar
1686 // This means we need to remove the current caps handler here and possibly compensate later, 1686 // This means we need to remove the current caps handler here and possibly compensate later,
1687 // in case both scenes are being hosted on the same region server. Messy 1687 // in case both scenes are being hosted on the same region server. Messy
1688 m_scene.RemoveCapsHandler(UUID); 1688 m_scene.RemoveCapsHandler(UUID);
1689 newpos = newpos + (vel); 1689 newpos = newpos + (vel);
@@ -1691,17 +1691,17 @@ namespace OpenSim.Region.Environment.Scenes
1691 m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, 1691 m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos,
1692 m_physicsActor.Flying); 1692 m_physicsActor.Flying);
1693 if (res) 1693 if (res)
1694 { 1694 {
1695 AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); 1695 AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
1696 1696
1697 // TODO Should construct this behind a method 1697 // TODO Should construct this behind a method
1698 string capsPath = 1698 string capsPath =
1699 "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort 1699 "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort
1700 + "/CAPS/" + circuitdata.CapsPath + "0000/"; 1700 + "/CAPS/" + circuitdata.CapsPath + "0000/";
1701 1701
1702 m_log.DebugFormat( 1702 m_log.DebugFormat(
1703 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, m_uuid); 1703 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, m_uuid);
1704 1704
1705 m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, 1705 m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint,
1706 capsPath); 1706 capsPath);
1707 MakeChildAgent(); 1707 MakeChildAgent();
@@ -1742,17 +1742,17 @@ namespace OpenSim.Region.Environment.Scenes
1742 /// </summary> 1742 /// </summary>
1743 public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) 1743 public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY)
1744 { 1744 {
1745 // 1745 //
1746 int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; 1746 int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize;
1747 int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; 1747 int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize;
1748 1748
1749 m_DrawDistance = cAgentData.drawdistance; 1749 m_DrawDistance = cAgentData.drawdistance;
1750 m_pos = new LLVector3(cAgentData.Position.x + shiftx, cAgentData.Position.y + shifty, cAgentData.Position.z); 1750 m_pos = new LLVector3(cAgentData.Position.x + shiftx, cAgentData.Position.y + shifty, cAgentData.Position.z);
1751 1751
1752 // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region 1752 // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region
1753 m_CameraCenter = 1753 m_CameraCenter =
1754 new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); 1754 new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z);
1755 1755
1756 1756
1757 m_godlevel = cAgentData.godlevel; 1757 m_godlevel = cAgentData.godlevel;
1758 SetHeight(cAgentData.AVHeight); 1758 SetHeight(cAgentData.AVHeight);
@@ -1793,8 +1793,8 @@ namespace OpenSim.Region.Environment.Scenes
1793 } 1793 }
1794 catch (NullReferenceException) 1794 catch (NullReferenceException)
1795 { 1795 {
1796 // Under extreme load, this returns a NullReference Exception that we can ignore. 1796 // Under extreme load, this returns a NullReference Exception that we can ignore.
1797 // Ignoring this causes no movement to be sent to the physics engine... 1797 // Ignoring this causes no movement to be sent to the physics engine...
1798 // which when the scene is moving at 1 frame every 10 seconds, it doesn't really matter! 1798 // which when the scene is moving at 1 frame every 10 seconds, it doesn't really matter!
1799 } 1799 }
1800 m_newForce = true; 1800 m_newForce = true;
@@ -1809,12 +1809,12 @@ namespace OpenSim.Region.Environment.Scenes
1809 1809
1810 static ScenePresence() 1810 static ScenePresence()
1811 { 1811 {
1812 1812
1813 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); 1813 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
1814 DefaultTexture = textu.ToBytes(); 1814 DefaultTexture = textu.ToBytes();
1815 } 1815 }
1816 1816
1817 [Serializable] 1817 [Serializable]
1818 public class NewForce 1818 public class NewForce
1819 { 1819 {
1820 public float X; 1820 public float X;
@@ -1826,8 +1826,8 @@ namespace OpenSim.Region.Environment.Scenes
1826 } 1826 }
1827 } 1827 }
1828 1828
1829 [Serializable] 1829 [Serializable]
1830 public class ScenePartUpdate : ISerializable 1830 public class ScenePartUpdate : ISerializable
1831 { 1831 {
1832 public LLUUID FullID; 1832 public LLUUID FullID;
1833 public uint LastFullUpdateTime; 1833 public uint LastFullUpdateTime;
@@ -1883,7 +1883,7 @@ namespace OpenSim.Region.Environment.Scenes
1883 public void AddToPhysicalScene() 1883 public void AddToPhysicalScene()
1884 { 1884 {
1885 PhysicsScene scene = m_scene.PhysicsScene; 1885 PhysicsScene scene = m_scene.PhysicsScene;
1886 1886
1887 PhysicsVector pVec = 1887 PhysicsVector pVec =
1888 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, 1888 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
1889 AbsolutePosition.Z); 1889 AbsolutePosition.Z);
@@ -1936,7 +1936,7 @@ namespace OpenSim.Region.Environment.Scenes
1936 if (m_health <= 0) 1936 if (m_health <= 0)
1937 m_scene.EventManager.TriggerAvatarKill(killerObj, this); 1937 m_scene.EventManager.TriggerAvatarKill(killerObj, this);
1938 } 1938 }
1939 1939
1940 if (Velocity.X > 0 || Velocity.Y > 0) 1940 if (Velocity.X > 0 || Velocity.Y > 0)
1941 UpdateMovementAnimations(); 1941 UpdateMovementAnimations();
1942 } 1942 }
@@ -2161,7 +2161,7 @@ namespace OpenSim.Region.Environment.Scenes
2161 // m_partsUpdateQueue = (UpdateQueue)info.GetValue("m_partsUpdateQueue", typeof(UpdateQueue)); 2161 // m_partsUpdateQueue = (UpdateQueue)info.GetValue("m_partsUpdateQueue", typeof(UpdateQueue));
2162 2162
2163 /* 2163 /*
2164 Dictionary<Guid, ScenePartUpdate> updateTimes_work 2164 Dictionary<Guid, ScenePartUpdate> updateTimes_work
2165 = (Dictionary<Guid, ScenePartUpdate>)info.GetValue("m_updateTimes", typeof(Dictionary<Guid, ScenePartUpdate>)); 2165 = (Dictionary<Guid, ScenePartUpdate>)info.GetValue("m_updateTimes", typeof(Dictionary<Guid, ScenePartUpdate>));
2166 2166
2167 foreach (Guid id in updateTimes_work.Keys) 2167 foreach (Guid id in updateTimes_work.Keys)
@@ -2188,7 +2188,7 @@ namespace OpenSim.Region.Environment.Scenes
2188 (float)info.GetValue("lastKnownAllowedPosition.X", typeof(float)), 2188 (float)info.GetValue("lastKnownAllowedPosition.X", typeof(float)),
2189 (float)info.GetValue("lastKnownAllowedPosition.Y", typeof(float)), 2189 (float)info.GetValue("lastKnownAllowedPosition.Y", typeof(float)),
2190 (float)info.GetValue("lastKnownAllowedPosition.Z", typeof(float))); 2190 (float)info.GetValue("lastKnownAllowedPosition.Z", typeof(float)));
2191 2191
2192 sentMessageAboutRestrictedParcelFlyingDown = (bool)info.GetValue("sentMessageAboutRestrictedParcelFlyingDown", typeof(bool)); 2192 sentMessageAboutRestrictedParcelFlyingDown = (bool)info.GetValue("sentMessageAboutRestrictedParcelFlyingDown", typeof(bool));
2193 2193
2194 m_LastChildAgentUpdatePosition 2194 m_LastChildAgentUpdatePosition
@@ -2196,7 +2196,7 @@ namespace OpenSim.Region.Environment.Scenes
2196 (float)info.GetValue("m_LastChildAgentUpdatePosition.X", typeof(float)), 2196 (float)info.GetValue("m_LastChildAgentUpdatePosition.X", typeof(float)),
2197 (float)info.GetValue("m_LastChildAgentUpdatePosition.Y", typeof(float)), 2197 (float)info.GetValue("m_LastChildAgentUpdatePosition.Y", typeof(float)),
2198 (float)info.GetValue("m_LastChildAgentUpdatePosition.Z", typeof(float))); 2198 (float)info.GetValue("m_LastChildAgentUpdatePosition.Z", typeof(float)));
2199 2199
2200 m_perfMonMS = (int)info.GetValue("m_perfMonMS", typeof(int)); 2200 m_perfMonMS = (int)info.GetValue("m_perfMonMS", typeof(int));
2201 m_AgentControlFlags = (uint)info.GetValue("m_AgentControlFlags", typeof(uint)); 2201 m_AgentControlFlags = (uint)info.GetValue("m_AgentControlFlags", typeof(uint));
2202 2202
@@ -2246,7 +2246,7 @@ namespace OpenSim.Region.Environment.Scenes
2246 info.AddValue("m_sitAvatarHeight", m_sitAvatarHeight); 2246 info.AddValue("m_sitAvatarHeight", m_sitAvatarHeight);
2247 info.AddValue("m_godlevel", m_godlevel); 2247 info.AddValue("m_godlevel", m_godlevel);
2248 info.AddValue("m_setAlwaysRun", m_setAlwaysRun); 2248 info.AddValue("m_setAlwaysRun", m_setAlwaysRun);
2249 2249
2250 // Quaternion 2250 // Quaternion
2251 info.AddValue("m_bodyRot.w", m_bodyRot.w); 2251 info.AddValue("m_bodyRot.w", m_bodyRot.w);
2252 info.AddValue("m_bodyRot.x", m_bodyRot.x); 2252 info.AddValue("m_bodyRot.x", m_bodyRot.x);
@@ -2374,7 +2374,7 @@ namespace OpenSim.Region.Environment.Scenes
2374 2374
2375 public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, LLUUID Script_item_LLUUID) 2375 public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, LLUUID Script_item_LLUUID)
2376 { 2376 {
2377 2377
2378 ScriptControllers obj = new ScriptControllers(); 2378 ScriptControllers obj = new ScriptControllers();
2379 obj.ignoreControls = ScriptControlled.CONTROL_ZERO; 2379 obj.ignoreControls = ScriptControlled.CONTROL_ZERO;
2380 obj.eventControls = ScriptControlled.CONTROL_ZERO; 2380 obj.eventControls = ScriptControlled.CONTROL_ZERO;
@@ -2386,7 +2386,7 @@ namespace OpenSim.Region.Environment.Scenes
2386 IgnoredControls |= (ScriptControlled)controls; 2386 IgnoredControls |= (ScriptControlled)controls;
2387 obj.ignoreControls = (ScriptControlled)controls; 2387 obj.ignoreControls = (ScriptControlled)controls;
2388 } 2388 }
2389 2389
2390 if (pass_on == 0 && accept == 1) 2390 if (pass_on == 0 && accept == 1)
2391 { 2391 {
2392 IgnoredControls |= (ScriptControlled)controls; 2392 IgnoredControls |= (ScriptControlled)controls;
@@ -2432,7 +2432,7 @@ namespace OpenSim.Region.Environment.Scenes
2432 lock (scriptedcontrols) 2432 lock (scriptedcontrols)
2433 { 2433 {
2434 scriptedcontrols.Clear(); 2434 scriptedcontrols.Clear();
2435 } 2435 }
2436 ControllingClient.SendTakeControls(int.MaxValue, false, false); 2436 ControllingClient.SendTakeControls(int.MaxValue, false, false);
2437 } 2437 }
2438 2438
@@ -2454,7 +2454,7 @@ namespace OpenSim.Region.Environment.Scenes
2454 2454
2455 internal void SendControlToScripts(uint flags, ScriptControlled lastFlags) 2455 internal void SendControlToScripts(uint flags, ScriptControlled lastFlags)
2456 { 2456 {
2457 2457
2458 ScriptControlled allflags = ScriptControlled.CONTROL_ZERO; 2458 ScriptControlled allflags = ScriptControlled.CONTROL_ZERO;
2459 2459
2460 if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0) 2460 if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0)
@@ -2497,10 +2497,10 @@ namespace OpenSim.Region.Environment.Scenes
2497 { 2497 {
2498 allflags |= ScriptControlled.CONTROL_LBUTTON; 2498 allflags |= ScriptControlled.CONTROL_LBUTTON;
2499 } 2499 }
2500 2500
2501 ScriptControlled held = ScriptControlled.CONTROL_ZERO; 2501 ScriptControlled held = ScriptControlled.CONTROL_ZERO;
2502 ScriptControlled change = ScriptControlled.CONTROL_ZERO; 2502 ScriptControlled change = ScriptControlled.CONTROL_ZERO;
2503 2503
2504 foreach (ScriptControlled DCF in Enum.GetValues(typeof (ScriptControlled))) 2504 foreach (ScriptControlled DCF in Enum.GetValues(typeof (ScriptControlled)))
2505 { 2505 {
2506 // Held 2506 // Held
@@ -2539,7 +2539,7 @@ namespace OpenSim.Region.Environment.Scenes
2539 } 2539 }
2540 } 2540 }
2541 LastCommands = allflags; 2541 LastCommands = allflags;
2542 2542
2543 } 2543 }
2544 internal uint RemoveIgnoredControls(uint flags, ScriptControlled Ignored) 2544 internal uint RemoveIgnoredControls(uint flags, ScriptControlled Ignored)
2545 { 2545 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
index 8390f64..7d048a3 100644
--- a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes
70 obj.ResetIDs(); 70 obj.ResetIDs();
71 } 71 }
72 //if we want this to be a import method then we need new uuids for the object to avoid any clashes 72 //if we want this to be a import method then we need new uuids for the object to avoid any clashes
73 //obj.RegenerateFullIDs(); 73 //obj.RegenerateFullIDs();
74 m_innerScene.AddEntity(obj); 74 m_innerScene.AddEntity(obj);
75 75
76 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); 76 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
@@ -143,7 +143,7 @@ namespace OpenSim.Region.Environment.Scenes
143 { 143 {
144 XmlDocument doc = new XmlDocument(); 144 XmlDocument doc = new XmlDocument();
145 XmlNode rootNode; 145 XmlNode rootNode;
146 146
147 XmlTextReader reader = new XmlTextReader(new StringReader(xmlString)); 147 XmlTextReader reader = new XmlTextReader(new StringReader(xmlString));
148 reader.WhitespaceHandling = WhitespaceHandling.None; 148 reader.WhitespaceHandling = WhitespaceHandling.None;
149 doc.Load(reader); 149 doc.Load(reader);
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Scenes
153 { 153 {
154 CreatePrimFromXml(aPrimNode.OuterXml); 154 CreatePrimFromXml(aPrimNode.OuterXml);
155 } 155 }
156 156
157 } 157 }
158 158
159 public void LoadPrimsFromXml2(string fileName) 159 public void LoadPrimsFromXml2(string fileName)
@@ -206,7 +206,7 @@ namespace OpenSim.Region.Environment.Scenes
206 rootPart.PhysActor.LocalID = rootPart.LocalId; 206 rootPart.PhysActor.LocalID = rootPart.LocalId;
207 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); 207 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
208 } 208 }
209 rootPart.Velocity = receivedVelocity; 209 rootPart.Velocity = receivedVelocity;
210 } 210 }
211 211
212 obj.ScheduleGroupForFullUpdate(); 212 obj.ScheduleGroupForFullUpdate();
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
index a150164..90a971f 100644
--- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
@@ -97,12 +97,12 @@ namespace OpenSim.Region.Environment.Scenes
97 private int m_scriptLinesPerSecond = 0; 97 private int m_scriptLinesPerSecond = 0;
98 98
99 private int objectCapacity = 45000; 99 private int objectCapacity = 45000;
100 100
101 101
102 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[21]; 102 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[21];
103 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock(); 103 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock();
104 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats); 104 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats);
105 105
106 106
107 private RegionInfo ReportingRegion; 107 private RegionInfo ReportingRegion;
108 108
@@ -138,8 +138,8 @@ namespace OpenSim.Region.Environment.Scenes
138 lock (m_report) 138 lock (m_report)
139 { 139 {
140 // Packet is already initialized and ready for data insert 140 // Packet is already initialized and ready for data insert
141 141
142 142
143 statpack.Region = rb; 143 statpack.Region = rb;
144 statpack.Region.RegionX = ReportingRegion.RegionLocX; 144 statpack.Region.RegionX = ReportingRegion.RegionLocX;
145 statpack.Region.RegionY = ReportingRegion.RegionLocY; 145 statpack.Region.RegionY = ReportingRegion.RegionLocY;
@@ -152,99 +152,99 @@ namespace OpenSim.Region.Environment.Scenes
152 statpack.Region.RegionFlags = (uint) 0; 152 statpack.Region.RegionFlags = (uint) 0;
153 } 153 }
154 statpack.Region.ObjectCapacity = (uint) objectCapacity; 154 statpack.Region.ObjectCapacity = (uint) objectCapacity;
155 155
156#region various statistic googly moogly 156#region various statistic googly moogly
157 157
158 // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there 158 // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there
159 // 0-50 is pretty close to 0-45 159 // 0-50 is pretty close to 0-45
160 float simfps = (int) ((m_fps * 5)); 160 float simfps = (int) ((m_fps * 5));
161 161
162 //if (simfps > 45) 162 //if (simfps > 45)
163 //simfps = simfps - (simfps - 45); 163 //simfps = simfps - (simfps - 45);
164 //if (simfps < 0) 164 //if (simfps < 0)
165 //simfps = 0; 165 //simfps = 0;
166 166
167 // 167 //
168 float physfps = ((m_pfps / 1000)); 168 float physfps = ((m_pfps / 1000));
169 169
170 //if (physfps > 600) 170 //if (physfps > 600)
171 //physfps = physfps - (physfps - 600); 171 //physfps = physfps - (physfps - 600);
172 172
173 if (physfps < 0) 173 if (physfps < 0)
174 physfps = 0; 174 physfps = 0;
175 175
176#endregion 176#endregion
177 177
178 //Our time dilation is 0.91 when we're running a full speed, 178 //Our time dilation is 0.91 when we're running a full speed,
179 // therefore to make sure we get an appropriate range, 179 // therefore to make sure we get an appropriate range,
180 // we have to factor in our error. (0.10f * statsUpdateFactor) 180 // we have to factor in our error. (0.10f * statsUpdateFactor)
181 // multiplies the fix for the error times the amount of times it'll occur a second 181 // multiplies the fix for the error times the amount of times it'll occur a second
182 // / 10 divides the value by the number of times the sim heartbeat runs (10fps) 182 // / 10 divides the value by the number of times the sim heartbeat runs (10fps)
183 // Then we divide the whole amount by the amount of seconds pass in between stats updates. 183 // Then we divide the whole amount by the amount of seconds pass in between stats updates.
184 184
185 sb[0].StatID = (uint) Stats.TimeDilation; 185 sb[0].StatID = (uint) Stats.TimeDilation;
186 sb[0].StatValue = m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor)); 186 sb[0].StatValue = m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
187 187
188 sb[1].StatID = (uint) Stats.SimFPS; 188 sb[1].StatID = (uint) Stats.SimFPS;
189 sb[1].StatValue = simfps/statsUpdateFactor; 189 sb[1].StatValue = simfps/statsUpdateFactor;
190 190
191 sb[2].StatID = (uint) Stats.PhysicsFPS; 191 sb[2].StatID = (uint) Stats.PhysicsFPS;
192 sb[2].StatValue = physfps / statsUpdateFactor; 192 sb[2].StatValue = physfps / statsUpdateFactor;
193 193
194 sb[3].StatID = (uint) Stats.AgentUpdates; 194 sb[3].StatID = (uint) Stats.AgentUpdates;
195 sb[3].StatValue = (m_agentUpdates / statsUpdateFactor); 195 sb[3].StatValue = (m_agentUpdates / statsUpdateFactor);
196 196
197 sb[4].StatID = (uint) Stats.Agents; 197 sb[4].StatID = (uint) Stats.Agents;
198 sb[4].StatValue = m_rootAgents; 198 sb[4].StatValue = m_rootAgents;
199 199
200 sb[5].StatID = (uint) Stats.ChildAgents; 200 sb[5].StatID = (uint) Stats.ChildAgents;
201 sb[5].StatValue = m_childAgents; 201 sb[5].StatValue = m_childAgents;
202 202
203 sb[6].StatID = (uint) Stats.TotalPrim; 203 sb[6].StatID = (uint) Stats.TotalPrim;
204 sb[6].StatValue = m_numPrim; 204 sb[6].StatValue = m_numPrim;
205 205
206 sb[7].StatID = (uint) Stats.ActivePrim; 206 sb[7].StatID = (uint) Stats.ActivePrim;
207 sb[7].StatValue = m_activePrim; 207 sb[7].StatValue = m_activePrim;
208 208
209 sb[8].StatID = (uint)Stats.FrameMS; 209 sb[8].StatID = (uint)Stats.FrameMS;
210 sb[8].StatValue = m_frameMS / statsUpdateFactor; 210 sb[8].StatValue = m_frameMS / statsUpdateFactor;
211 211
212 sb[9].StatID = (uint)Stats.NetMS; 212 sb[9].StatID = (uint)Stats.NetMS;
213 sb[9].StatValue = m_netMS / statsUpdateFactor; 213 sb[9].StatValue = m_netMS / statsUpdateFactor;
214 214
215 sb[10].StatID = (uint)Stats.PhysicsMS; 215 sb[10].StatID = (uint)Stats.PhysicsMS;
216 sb[10].StatValue = m_physicsMS / statsUpdateFactor; 216 sb[10].StatValue = m_physicsMS / statsUpdateFactor;
217 217
218 sb[11].StatID = (uint)Stats.ImageMS ; 218 sb[11].StatID = (uint)Stats.ImageMS ;
219 sb[11].StatValue = m_imageMS / statsUpdateFactor; 219 sb[11].StatValue = m_imageMS / statsUpdateFactor;
220 220
221 sb[12].StatID = (uint)Stats.OtherMS; 221 sb[12].StatID = (uint)Stats.OtherMS;
222 sb[12].StatValue = m_otherMS / statsUpdateFactor; 222 sb[12].StatValue = m_otherMS / statsUpdateFactor;
223 223
224 sb[13].StatID = (uint)Stats.InPacketsPerSecond; 224 sb[13].StatID = (uint)Stats.InPacketsPerSecond;
225 sb[13].StatValue = (m_inPacketsPerSecond); 225 sb[13].StatValue = (m_inPacketsPerSecond);
226 226
227 sb[14].StatID = (uint)Stats.OutPacketsPerSecond; 227 sb[14].StatID = (uint)Stats.OutPacketsPerSecond;
228 sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor); 228 sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor);
229 229
230 sb[15].StatID = (uint)Stats.UnAckedBytes; 230 sb[15].StatID = (uint)Stats.UnAckedBytes;
231 sb[15].StatValue = m_unAckedBytes; 231 sb[15].StatValue = m_unAckedBytes;
232 232
233 sb[16].StatID = (uint)Stats.AgentMS; 233 sb[16].StatID = (uint)Stats.AgentMS;
234 sb[16].StatValue = m_agentMS / statsUpdateFactor; 234 sb[16].StatValue = m_agentMS / statsUpdateFactor;
235 235
236 sb[17].StatID = (uint)Stats.PendingDownloads; 236 sb[17].StatID = (uint)Stats.PendingDownloads;
237 sb[17].StatValue = m_pendingDownloads; 237 sb[17].StatValue = m_pendingDownloads;
238 238
239 sb[18].StatID = (uint)Stats.PendingUploads; 239 sb[18].StatID = (uint)Stats.PendingUploads;
240 sb[18].StatValue = m_pendingUploads; 240 sb[18].StatValue = m_pendingUploads;
241 241
242 sb[19].StatID = (uint)Stats.ActiveScripts; 242 sb[19].StatID = (uint)Stats.ActiveScripts;
243 sb[19].StatValue = m_activeScripts; 243 sb[19].StatValue = m_activeScripts;
244 244
245 sb[20].StatID = (uint)Stats.ScriptLinesPerSecond; 245 sb[20].StatID = (uint)Stats.ScriptLinesPerSecond;
246 sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor; 246 sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor;
247 247
248 statpack.Stat = sb; 248 statpack.Stat = sb;
249 249
250 handlerSendStatResult = OnSendStatsResult; 250 handlerSendStatResult = OnSendStatsResult;
@@ -255,7 +255,7 @@ namespace OpenSim.Region.Environment.Scenes
255 resetvalues(); 255 resetvalues();
256 } 256 }
257 } 257 }
258 258
259 private void resetvalues() 259 private void resetvalues()
260 { 260 {
261 m_timeDilation = 0; 261 m_timeDilation = 0;
@@ -274,13 +274,13 @@ namespace OpenSim.Region.Environment.Scenes
274 m_imageMS = 0; 274 m_imageMS = 0;
275 m_otherMS = 0; 275 m_otherMS = 0;
276 276
277//Ckrinke This variable is not used, so comment to remove compiler warning until it is used. 277//Ckrinke This variable is not used, so comment to remove compiler warning until it is used.
278//Ckrinke m_scriptMS = 0; 278//Ckrinke m_scriptMS = 0;
279 } 279 }
280 280
281 # region methods called from Scene 281 # region methods called from Scene
282 // The majority of these functions are additive 282 // The majority of these functions are additive
283 // so that you can easily change the amount of 283 // so that you can easily change the amount of
284 // seconds in between sim stats updates 284 // seconds in between sim stats updates
285 285
286 public void AddTimeDilation(float td) 286 public void AddTimeDilation(float td)
@@ -368,14 +368,14 @@ namespace OpenSim.Region.Environment.Scenes
368 { 368 {
369 m_otherMS += ms; 369 m_otherMS += ms;
370 } 370 }
371 371
372// private static readonly log4net.ILog m_log 372// private static readonly log4net.ILog m_log
373// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 373// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
374 374
375 public void addPendingDownload(int count) 375 public void addPendingDownload(int count)
376 { 376 {
377 m_pendingDownloads += count; 377 m_pendingDownloads += count;
378 //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads); 378 //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads);
379 } 379 }
380 380
381 public void addScriptLines(int count) 381 public void addScriptLines(int count)
diff --git a/OpenSim/Region/Environment/Types/UpdateQueue.cs b/OpenSim/Region/Environment/Types/UpdateQueue.cs
index ec1ffd2..e9133ac 100644
--- a/OpenSim/Region/Environment/Types/UpdateQueue.cs
+++ b/OpenSim/Region/Environment/Types/UpdateQueue.cs
@@ -34,8 +34,8 @@ using OpenSim.Region.Environment.Scenes;
34 34
35namespace OpenSim.Region.Environment.Types 35namespace OpenSim.Region.Environment.Types
36{ 36{
37 [Serializable] 37 [Serializable]
38 public class UpdateQueue : ISerializable 38 public class UpdateQueue : ISerializable
39 { 39 {
40 private Queue<SceneObjectPart> m_queue; 40 private Queue<SceneObjectPart> m_queue;
41 41
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 6087857..78b5d1f 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -292,7 +292,7 @@ namespace OpenSim.Region.Examples.SimpleModule
292 return new byte[0]; 292 return new byte[0];
293 } 293 }
294 294
295 295
296 public virtual void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) 296 public virtual void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId)
297 { 297 {
298 } 298 }
@@ -311,12 +311,12 @@ namespace OpenSim.Region.Examples.SimpleModule
311 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) 311 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp)
312 { 312 {
313 } 313 }
314 314
315 public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, 315 public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent,
316 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp, 316 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp,
317 byte[] binaryBucket) 317 byte[] binaryBucket)
318 { 318 {
319 } 319 }
320 320
321 public virtual void SendLayerData(float[] map) 321 public virtual void SendLayerData(float[] map)
322 { 322 {
@@ -396,7 +396,7 @@ namespace OpenSim.Region.Examples.SimpleModule
396 } 396 }
397 397
398 public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, 398 public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID,
399 PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel, 399 PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel,
400 LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags, 400 LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags,
401 LLUUID objectID, LLUUID ownerID, string text, byte[] color, 401 LLUUID objectID, LLUUID ownerID, string text, byte[] color,
402 uint parentID, 402 uint parentID,
@@ -404,7 +404,7 @@ namespace OpenSim.Region.Examples.SimpleModule
404 { 404 {
405 } 405 }
406 public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, 406 public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID,
407 PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel, 407 PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel,
408 LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags, 408 LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags,
409 LLUUID objectID, LLUUID ownerID, string text, byte[] color, 409 LLUUID objectID, LLUUID ownerID, string text, byte[] color,
410 uint parentID, 410 uint parentID,
@@ -443,10 +443,10 @@ namespace OpenSim.Region.Examples.SimpleModule
443 public virtual void SendRemoveInventoryItem(LLUUID itemID) 443 public virtual void SendRemoveInventoryItem(LLUUID itemID)
444 { 444 {
445 } 445 }
446 446
447 /// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see> 447 /// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see>
448 public virtual void SendBulkUpdateInventory(InventoryItemBase item) 448 public virtual void SendBulkUpdateInventory(InventoryItemBase item)
449 { 449 {
450 } 450 }
451 451
452 public LLUUID GetDefaultAnimation(string name) 452 public LLUUID GetDefaultAnimation(string name)
@@ -550,7 +550,7 @@ namespace OpenSim.Region.Examples.SimpleModule
550 550
551 public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID, 551 public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID,
552 uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, 552 uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask,
553 uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category, 553 uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category,
554 LLUUID LastOwnerID, string ObjectName, string Description) 554 LLUUID LastOwnerID, string ObjectName, string Description)
555 { 555 {
556 } 556 }
diff --git a/OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs b/OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs
index e0e8fd9..4c0c0a0 100644
--- a/OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30 30
31// General Information about an assembly is controlled through the following 31// General information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information 32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly. 33// associated with an assembly.
34[assembly: AssemblyTitle("OpenSim.Region.Examples.SimpleModule")] 34[assembly: AssemblyTitle("OpenSim.Region.Examples.SimpleModule")]
@@ -40,8 +40,8 @@ using System.Runtime.InteropServices;
40[assembly: AssemblyTrademark("")] 40[assembly: AssemblyTrademark("")]
41[assembly: AssemblyCulture("")] 41[assembly: AssemblyCulture("")]
42 42
43// Setting ComVisible to false makes the types in this assembly not visible 43// Setting ComVisible to false makes the types in this assembly not visible
44// to COM components. If you need to access a type in this assembly from 44// to COM components. If you need to access a type in this assembly from
45// COM, set the ComVisible attribute to true on that type. 45// COM, set the ComVisible attribute to true on that type.
46[assembly: ComVisible(false)] 46[assembly: ComVisible(false)]
47 47
@@ -51,11 +51,11 @@ using System.Runtime.InteropServices;
51// Version information for an assembly consists of the following four values: 51// Version information for an assembly consists of the following four values:
52// 52//
53// Major Version 53// Major Version
54// Minor Version 54// Minor Version
55// Build Number 55// Build Number
56// Revision 56// Revision
57// 57//
58// You can specify all the values or you can default the Build and Revision Numbers 58// You can specify all the values or you can default the Build and Revision Numbers
59// by using the '*' as shown below: 59// by using the '*' as shown below:
60// [assembly: AssemblyVersion("1.0.*")] 60// [assembly: AssemblyVersion("1.0.*")]
61[assembly: AssemblyVersion("1.0.0.0")] 61[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
index 4c933d6..bac2252 100644
--- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
101 else 101 else
102 { 102 {
103 // BUG: !? (Reduced from 5000 to 500 by Adam) 103 // BUG: !? (Reduced from 5000 to 500 by Adam)
104 Thread.Sleep(500); //why is this here? 104 Thread.Sleep(500); //why is this here?
105 105
106 //this is the first thread to request this appearance 106 //this is the first thread to request this appearance
107 //so let it check the db and if not found then create a default appearance 107 //so let it check the db and if not found then create a default appearance
@@ -279,7 +279,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
279 { 279 {
280 if (profile.RootFolder != null) 280 if (profile.RootFolder != null)
281 { 281 {
282 282
283 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) 283 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
284 { 284 {
285 if (wear.Type < 13) 285 if (wear.Type < 13)
@@ -292,9 +292,9 @@ namespace OpenSim.Region.Modules.AvatarFactory
292 else 292 else
293 { 293 {
294 LLUUID assetId; 294 LLUUID assetId;
295 295
296 InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID); 296 InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID);
297 297
298 if (baseItem != null) 298 if (baseItem != null)
299 { 299 {
300 assetId = baseItem.AssetID; 300 assetId = baseItem.AssetID;
diff --git a/OpenSim/Region/Modules/AvatarFactory/Properties/AssemblyInfo.cs b/OpenSim/Region/Modules/AvatarFactory/Properties/AssemblyInfo.cs
index a9fe53e..640b0b0 100644
--- a/OpenSim/Region/Modules/AvatarFactory/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Modules/AvatarFactory/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30 30
31// General Information about an assembly is controlled through the following 31// General information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information 32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly. 33// associated with an assembly.
34[assembly: AssemblyTitle("OpenSim.Region.Modules.AvatarFactory")] 34[assembly: AssemblyTitle("OpenSim.Region.Modules.AvatarFactory")]
@@ -40,8 +40,8 @@ using System.Runtime.InteropServices;
40[assembly: AssemblyTrademark("")] 40[assembly: AssemblyTrademark("")]
41[assembly: AssemblyCulture("")] 41[assembly: AssemblyCulture("")]
42 42
43// Setting ComVisible to false makes the types in this assembly not visible 43// Setting ComVisible to false makes the types in this assembly not visible
44// to COM components. If you need to access a type in this assembly from 44// to COM components. If you need to access a type in this assembly from
45// COM, set the ComVisible attribute to true on that type. 45// COM, set the ComVisible attribute to true on that type.
46[assembly: ComVisible(false)] 46[assembly: ComVisible(false)]
47 47
@@ -51,11 +51,11 @@ using System.Runtime.InteropServices;
51// Version information for an assembly consists of the following four values: 51// Version information for an assembly consists of the following four values:
52// 52//
53// Major Version 53// Major Version
54// Minor Version 54// Minor Version
55// Build Number 55// Build Number
56// Revision 56// Revision
57// 57//
58// You can specify all the values or you can default the Build and Revision Numbers 58// You can specify all the values or you can default the Build and Revision Numbers
59// by using the '*' as shown below: 59// by using the '*' as shown below:
60// [assembly: AssemblyVersion("1.0.*")] 60// [assembly: AssemblyVersion("1.0.*")]
61[assembly: AssemblyVersion("1.0.0.0")] 61[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs b/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs
index 0839267..a54ddda 100644
--- a/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs
@@ -2,7 +2,7 @@
2using System.Runtime.CompilerServices; 2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices; 3using System.Runtime.InteropServices;
4 4
5// General Information about an assembly is controlled through the following 5// General information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information 6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly. 7// associated with an assembly.
8[assembly: AssemblyTitle("Python")] 8[assembly: AssemblyTitle("Python")]
@@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
14[assembly: AssemblyTrademark("")] 14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")] 15[assembly: AssemblyCulture("")]
16 16
17// Setting ComVisible to false makes the types in this assembly not visible 17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from 18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type. 19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)] 20[assembly: ComVisible(false)]
21 21
@@ -25,11 +25,11 @@ using System.Runtime.InteropServices;
25// Version information for an assembly consists of the following four values: 25// Version information for an assembly consists of the following four values:
26// 26//
27// Major Version 27// Major Version
28// Minor Version 28// Minor Version
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32// You can specify all the values or you can default the Build and Revision Numbers 32// You can specify all the values or you can default the Build and Revision Numbers
33// by using the '*' as shown below: 33// by using the '*' as shown below:
34// [assembly: AssemblyVersion("1.0.*")] 34// [assembly: AssemblyVersion("1.0.*")]
35[assembly: AssemblyVersion("1.0.0.0")] 35[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/OpenSim/Region/Modules/SvnSerialiser/Properties/AssemblyInfo.cs b/OpenSim/Region/Modules/SvnSerialiser/Properties/AssemblyInfo.cs
index c9f8423..165fcea 100644
--- a/OpenSim/Region/Modules/SvnSerialiser/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Modules/SvnSerialiser/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30 30
31// General Information about an assembly is controlled through the following 31// General information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information 32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly. 33// associated with an assembly.
34[assembly: AssemblyTitle("SvnSerialiser")] 34[assembly: AssemblyTitle("SvnSerialiser")]
@@ -40,8 +40,8 @@ using System.Runtime.InteropServices;
40[assembly: AssemblyTrademark("")] 40[assembly: AssemblyTrademark("")]
41[assembly: AssemblyCulture("")] 41[assembly: AssemblyCulture("")]
42 42
43// Setting ComVisible to false makes the types in this assembly not visible 43// Setting ComVisible to false makes the types in this assembly not visible
44// to COM components. If you need to access a type in this assembly from 44// to COM components. If you need to access a type in this assembly from
45// COM, set the ComVisible attribute to true on that type. 45// COM, set the ComVisible attribute to true on that type.
46[assembly: ComVisible(false)] 46[assembly: ComVisible(false)]
47 47
@@ -51,11 +51,11 @@ using System.Runtime.InteropServices;
51// Version information for an assembly consists of the following four values: 51// Version information for an assembly consists of the following four values:
52// 52//
53// Major Version 53// Major Version
54// Minor Version 54// Minor Version
55// Build Number 55// Build Number
56// Revision 56// Revision
57// 57//
58// You can specify all the values or you can default the Build and Revision Numbers 58// You can specify all the values or you can default the Build and Revision Numbers
59// by using the '*' as shown below: 59// by using the '*' as shown below:
60// [assembly: AssemblyVersion("1.0.*")] 60// [assembly: AssemblyVersion("1.0.*")]
61[assembly: AssemblyVersion("1.0.0.0")] 61[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index 9415fff..5ced2d1 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -282,9 +282,9 @@ namespace OpenSim.Region.Physics.BulletXPlugin
282 bool needsCollision;// = base.NeedsCollision(bodyA, bodyB); 282 bool needsCollision;// = base.NeedsCollision(bodyA, bodyB);
283 int c1 = 3; 283 int c1 = 3;
284 int c2 = 3; 284 int c2 = 3;
285 285
286 //////////////////////////////////////////////////////// 286 ////////////////////////////////////////////////////////
287 //BulletX Mesh Collisions 287 //BulletX Mesh Collisions
288 //added by Jed zhu 288 //added by Jed zhu
289 //data: May 07,2005 289 //data: May 07,2005
290 //////////////////////////////////////////////////////// 290 ////////////////////////////////////////////////////////
@@ -302,9 +302,9 @@ namespace OpenSim.Region.Physics.BulletXPlugin
302 else 302 else
303 needsCollision = base.NeedsCollision(bodyA, bodyB); 303 needsCollision = base.NeedsCollision(bodyA, bodyB);
304 304
305 305
306 #endregion 306 #endregion
307 307
308 308
309 //m_log.DebugFormat("[BulletX]: A collision was detected between {0} and {1} --> {2}", nameA, nameB, 309 //m_log.DebugFormat("[BulletX]: A collision was detected between {0} and {1} --> {2}", nameA, nameB,
310 //needsCollision); 310 //needsCollision);
@@ -705,7 +705,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
705 } 705 }
706 foreach (BulletXPrim prim in _prims.Values) 706 foreach (BulletXPrim prim in _prims.Values)
707 { 707 {
708 //_height = HeightValue(prim.RigidBodyPosition); 708 //_height = HeightValue(prim.RigidBodyPosition);
709 _height = _simFlatPlanet.HeightValue(prim.RigidBodyPosition); 709 _height = _simFlatPlanet.HeightValue(prim.RigidBodyPosition);
710 prim.ValidateHeight(_height); 710 prim.ValidateHeight(_height);
711 //if (_simFlatPlanet.heightIsNotValid(prim.RigidBodyPosition, out _height)) prim.ValidateHeight(_height); 711 //if (_simFlatPlanet.heightIsNotValid(prim.RigidBodyPosition, out _height)) prim.ValidateHeight(_height);
@@ -741,8 +741,8 @@ namespace OpenSim.Region.Physics.BulletXPlugin
741 741
742 public override bool IsThreaded 742 public override bool IsThreaded
743 { 743 {
744 get 744 get
745 { 745 {
746 return (false); // for now we won't be multithreaded 746 return (false); // for now we won't be multithreaded
747 } 747 }
748 } 748 }
@@ -1380,17 +1380,17 @@ namespace OpenSim.Region.Physics.BulletXPlugin
1380 /// </summary> 1380 /// </summary>
1381 public class BulletXPrim : BulletXActor 1381 public class BulletXPrim : BulletXActor
1382 { 1382 {
1383 //Density it will depends of material. 1383 //Density it will depends of material.
1384 //For now all prims have the same density, all prims are made of water. Be water my friend! :D 1384 //For now all prims have the same density, all prims are made of water. Be water my friend! :D
1385 private const float _density = 1000.0f; 1385 private const float _density = 1000.0f;
1386 private BulletXScene _parent_scene; 1386 private BulletXScene _parent_scene;
1387 private PhysicsVector m_prev_position = new PhysicsVector(0, 0, 0); 1387 private PhysicsVector m_prev_position = new PhysicsVector(0, 0, 0);
1388 private bool m_lastUpdateSent = false; 1388 private bool m_lastUpdateSent = false;
1389 //added by jed zhu 1389 //added by jed zhu
1390 private IMesh _mesh; 1390 private IMesh _mesh;
1391 public IMesh GetMesh() { return _mesh; } 1391 public IMesh GetMesh() { return _mesh; }
1392 1392
1393 1393
1394 1394
1395 public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector size, 1395 public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector size,
1396 AxiomQuaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical) 1396 AxiomQuaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical)
diff --git a/OpenSim/Region/Physics/BulletXPlugin/TriangleIndexVertexArray.cs b/OpenSim/Region/Physics/BulletXPlugin/TriangleIndexVertexArray.cs
index 0902077..637cf6e 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/TriangleIndexVertexArray.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/TriangleIndexVertexArray.cs
@@ -20,8 +20,8 @@
20*/ 20*/
21 21
22/* 22/*
23 This file contains a class TriangleIndexVertexArray. I tried using the class with the same name 23 This file contains a class TriangleIndexVertexArray. I tried using the class with the same name
24 from the BulletX implementation and found it unusable for the purpose of using triangle meshes 24 from the BulletX implementation and found it unusable for the purpose of using triangle meshes
25 within BulletX as the implementation was painfully incomplete. 25 within BulletX as the implementation was painfully incomplete.
26 The attempt to derive from the original class failed as viable members were hidden. 26 The attempt to derive from the original class failed as viable members were hidden.
27 Fiddling around with BulletX itself was not my intention. 27 Fiddling around with BulletX itself was not my intention.
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
index c1dc91b..3cf2646 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -140,7 +140,7 @@ namespace OpenSim.Region.Physics.Manager
140 // a race condition if the last subscriber unsubscribes 140 // a race condition if the last subscriber unsubscribes
141 // immediately after the null check and before the event is raised. 141 // immediately after the null check and before the event is raised.
142 RequestTerseUpdate handler = OnRequestTerseUpdate; 142 RequestTerseUpdate handler = OnRequestTerseUpdate;
143 143
144 if (handler != null) 144 if (handler != null)
145 { 145 {
146 handler(); 146 handler();
@@ -163,9 +163,9 @@ namespace OpenSim.Region.Physics.Manager
163 public virtual void SendCollisionUpdate(EventArgs e) 163 public virtual void SendCollisionUpdate(EventArgs e)
164 { 164 {
165 CollisionUpdate handler = OnCollisionUpdate; 165 CollisionUpdate handler = OnCollisionUpdate;
166 166
167 if (handler != null) 167 if (handler != null)
168 { 168 {
169 handler(e); 169 handler(e);
170 } 170 }
171 } 171 }
@@ -205,9 +205,9 @@ namespace OpenSim.Region.Physics.Manager
205 205
206 public class NullPhysicsActor : PhysicsActor 206 public class NullPhysicsActor : PhysicsActor
207 { 207 {
208 public override bool Stopped 208 public override bool Stopped
209 { 209 {
210 get{ return false; } 210 get{ return false; }
211 } 211 }
212 212
213 public override PhysicsVector Position 213 public override PhysicsVector Position
@@ -222,7 +222,7 @@ namespace OpenSim.Region.Physics.Manager
222 set { return; } 222 set { return; }
223 } 223 }
224 224
225 public override uint LocalID 225 public override uint LocalID
226 { 226 {
227 set { return; } 227 set { return; }
228 } 228 }
@@ -240,14 +240,14 @@ namespace OpenSim.Region.Physics.Manager
240 public override float Buoyancy 240 public override float Buoyancy
241 { 241 {
242 get { return 0f; } 242 get { return 0f; }
243 set { return; } 243 set { return; }
244 } 244 }
245 245
246 public override bool FloatOnWater 246 public override bool FloatOnWater
247 { 247 {
248 set { return; } 248 set { return; }
249 } 249 }
250 250
251 public override bool CollidingGround 251 public override bool CollidingGround
252 { 252 {
253 get { return false; } 253 get { return false; }
@@ -297,7 +297,7 @@ namespace OpenSim.Region.Physics.Manager
297 set { return; } 297 set { return; }
298 } 298 }
299 299
300 public override float CollisionScore 300 public override float CollisionScore
301 { 301 {
302 get { return 0f; } 302 get { return 0f; }
303 } 303 }
@@ -385,7 +385,7 @@ namespace OpenSim.Region.Physics.Manager
385 385
386 public override void SubscribeEvents(int ms) 386 public override void SubscribeEvents(int ms)
387 { 387 {
388 388
389 } 389 }
390 public override void UnSubscribeEvents() 390 public override void UnSubscribeEvents()
391 { 391 {
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index b8ca180..6a71581 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Physics.Manager
94 _MeshPlugins.Add(plugHard.GetName(), plugHard); 94 _MeshPlugins.Add(plugHard.GetName(), plugHard);
95 m_log.Info("[PHYSICS]: Added meshing engine: " + plugHard.GetName()); 95 m_log.Info("[PHYSICS]: Added meshing engine: " + plugHard.GetName());
96 96
97 // And now walk all assemblies (DLLs effectively) and see if they are home 97 // And now walk all assemblies (DLLs effectively) and see if they are home
98 // of a plugin that is of interest for us 98 // of a plugin that is of interest for us
99 string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Physics"); 99 string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Physics");
100 string[] pluginFiles = Directory.GetFiles(path, "*.dll"); 100 string[] pluginFiles = Directory.GetFiles(path, "*.dll");
@@ -108,11 +108,11 @@ namespace OpenSim.Region.Physics.Manager
108 private void AddPlugin(string FileName) 108 private void AddPlugin(string FileName)
109 { 109 {
110 // TODO / NOTE 110 // TODO / NOTE
111 // The assembly named 'OpenSim.Region.Physics.BasicPhysicsPlugin' was loaded from 111 // The assembly named 'OpenSim.Region.Physics.BasicPhysicsPlugin' was loaded from
112 // 'file:///C:/OpenSim/trunk2/bin/Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll' 112 // 'file:///C:/OpenSim/trunk2/bin/Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll'
113 // using the LoadFrom context. The use of this context can result in unexpected behavior 113 // using the LoadFrom context. The use of this context can result in unexpected behavior
114 // for serialization, casting and dependency resolution. In almost all cases, it is recommended 114 // for serialization, casting and dependency resolution. In almost all cases, it is recommended
115 // that the LoadFrom context be avoided. This can be done by installing assemblies in the 115 // that the LoadFrom context be avoided. This can be done by installing assemblies in the
116 // Global Assembly Cache or in the ApplicationBase directory and using Assembly. 116 // Global Assembly Cache or in the ApplicationBase directory and using Assembly.
117 // Load when explicitly loading assemblies. 117 // Load when explicitly loading assemblies.
118 Assembly pluginAssembly = Assembly.LoadFrom(FileName); 118 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
diff --git a/OpenSim/Region/Physics/Manager/PhysicsSensor.cs b/OpenSim/Region/Physics/Manager/PhysicsSensor.cs
index ce53108..add741b 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsSensor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsSensor.cs
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Physics.Manager
35 { 35 {
36 NONE = 0, 36 NONE = 0,
37 AGENT = 1, 37 AGENT = 1,
38 ACTIVE = 2, 38 ACTIVE = 2,
39 PASSIVE = 3, 39 PASSIVE = 3,
40 SCRIPTED = 4 40 SCRIPTED = 4
41 } 41 }
diff --git a/OpenSim/Region/Physics/Manager/ZeroMesher.cs b/OpenSim/Region/Physics/Manager/ZeroMesher.cs
index b98cb35..b759213 100644
--- a/OpenSim/Region/Physics/Manager/ZeroMesher.cs
+++ b/OpenSim/Region/Physics/Manager/ZeroMesher.cs
@@ -31,9 +31,9 @@ using OpenSim.Framework;
31/* 31/*
32 * This is the zero mesher. 32 * This is the zero mesher.
33 * Whatever you want him to mesh, he can't, telling you that by responding with a null pointer. 33 * Whatever you want him to mesh, he can't, telling you that by responding with a null pointer.
34 * Effectivly this is for switching off meshing and for testing as each physics machine should deal 34 * Effectivly this is for switching off meshing and for testing as each physics machine should deal
35 * with the null pointer situation. 35 * with the null pointer situation.
36 * But it's also a convenience thing, as physics machines can rely on having a mesher in any situation, even 36 * But it's also a convenience thing, as physics machines can rely on having a mesher in any situation, even
37 * if it's a dump one like this. 37 * if it's a dump one like this.
38 * Note, that this mesher is *not* living in a module but in the manager itself, so 38 * Note, that this mesher is *not* living in a module but in the manager itself, so
39 * it's always availabe and thus the default in case of configuration errors 39 * it's always availabe and thus the default in case of configuration errors
diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/Meshing/HelperTypes.cs
index efc5968..584133c 100644
--- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs
+++ b/OpenSim/Region/Physics/Meshing/HelperTypes.cs
@@ -49,7 +49,7 @@ public class Quaternion
49 } 49 }
50 public Quaternion(Vertex axis, float angle) 50 public Quaternion(Vertex axis, float angle)
51 { 51 {
52 // using (* 0.5) instead of (/2) 52 // using (* 0.5) instead of (/2)
53 w = (float)Math.Cos(angle * 0.5f); 53 w = (float)Math.Cos(angle * 0.5f);
54 x = axis.X * (float)Math.Sin(angle * 0.5f); 54 x = axis.X * (float)Math.Sin(angle * 0.5f);
55 y = axis.Y * (float)Math.Sin(angle * 0.5f); 55 y = axis.Y * (float)Math.Sin(angle * 0.5f);
@@ -65,8 +65,8 @@ public class Quaternion
65 c.w = a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z; 65 c.w = a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z;
66 return c; 66 return c;
67 } 67 }
68 68
69 69
70 public Matrix4 computeMatrix() 70 public Matrix4 computeMatrix()
71 { 71 {
72 return new Matrix4(this); 72 return new Matrix4(this);
@@ -74,7 +74,7 @@ public class Quaternion
74 public void normalize() 74 public void normalize()
75 { 75 {
76 float mag = length(); 76 float mag = length();
77 77
78 w /= mag; 78 w /= mag;
79 x /= mag; 79 x /= mag;
80 y /= mag; 80 y /= mag;
@@ -367,7 +367,7 @@ public class Triangle
367 // It is assumed, that the triangles vertices are already set correctly 367 // It is assumed, that the triangles vertices are already set correctly
368 double p1x, p2x, p1y, p2y, p3x, p3y; 368 double p1x, p2x, p1y, p2y, p3x, p3y;
369 369
370 // Deviation of this routine: 370 // Deviation of this routine:
371 // A circle has the general equation (M-p)^2=r^2, where M and p are vectors 371 // A circle has the general equation (M-p)^2=r^2, where M and p are vectors
372 // this gives us three equations f(p)=r^2, each for one point p1, p2, p3 372 // this gives us three equations f(p)=r^2, each for one point p1, p2, p3
373 // putting respectively two equations together gives two equations 373 // putting respectively two equations together gives two equations
@@ -378,7 +378,7 @@ public class Triangle
378 // Now using the equations that are formed by the components of the vectors 378 // Now using the equations that are formed by the components of the vectors
379 // and isolate Mx lets you make one equation that only holds My 379 // and isolate Mx lets you make one equation that only holds My
380 // The rest is straight forward and eaasy :-) 380 // The rest is straight forward and eaasy :-)
381 // 381 //
382 382
383 /* helping variables for temporary results */ 383 /* helping variables for temporary results */
384 double c1, c2; 384 double c1, c2;
@@ -496,7 +496,7 @@ public class Triangle
496 v2 = vt; 496 v2 = vt;
497 } 497 }
498 498
499 // Dumps a triangle in the "raw faces" format, blender can import. This is for visualisation and 499 // Dumps a triangle in the "raw faces" format, blender can import. This is for visualisation and
500 // debugging purposes 500 // debugging purposes
501 public String ToStringRaw() 501 public String ToStringRaw()
502 { 502 {
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 2e7ec15..4bf12c9 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Physics.Meshing
115 for (iCurrentVertex = usedForSeed; iCurrentVertex < iMaxVertex; iCurrentVertex++) 115 for (iCurrentVertex = usedForSeed; iCurrentVertex < iMaxVertex; iCurrentVertex++)
116 { 116 {
117 // Background: A triangle mesh fulfills the delaunay condition if (iff!) 117 // Background: A triangle mesh fulfills the delaunay condition if (iff!)
118 // each circumlocutory circle (i.e. the circle that touches all three corners) 118 // each circumlocutory circle (i.e. the circle that touches all three corners)
119 // of each triangle is empty of other vertices. 119 // of each triangle is empty of other vertices.
120 // Obviously a single (seeding) triangle fulfills this condition. 120 // Obviously a single (seeding) triangle fulfills this condition.
121 // If we now add one vertex, we need to reconstruct all triangles, that 121 // If we now add one vertex, we need to reconstruct all triangles, that
@@ -132,7 +132,7 @@ namespace OpenSim.Region.Physics.Meshing
132 // Reconstruction phase. First step, dissolve each triangle into it's simplices, 132 // Reconstruction phase. First step, dissolve each triangle into it's simplices,
133 // i.e. it's "border lines" 133 // i.e. it's "border lines"
134 // Goal is to find "inner" borders and delete them, while the hull gets conserved. 134 // Goal is to find "inner" borders and delete them, while the hull gets conserved.
135 // Inner borders are special in the way that they always come twice, which is how we detect them 135 // Inner borders are special in the way that they always come twice, which is how we detect them
136 foreach (Triangle t in influencedTriangles) 136 foreach (Triangle t in influencedTriangles)
137 { 137 {
138 List<Simplex> newSimplices = t.GetSimplices(); 138 List<Simplex> newSimplices = t.GetSimplices();
@@ -142,8 +142,8 @@ namespace OpenSim.Region.Physics.Meshing
142 // Now sort the simplices. That will make identical ones reside side by side in the list 142 // Now sort the simplices. That will make identical ones reside side by side in the list
143 simplices.Sort(); 143 simplices.Sort();
144 144
145 // Look for duplicate simplices here. 145 // Look for duplicate simplices here.
146 // Remember, they are directly side by side in the list right now, 146 // Remember, they are directly side by side in the list right now,
147 // So we only check directly neighbours 147 // So we only check directly neighbours
148 int iSimplex; 148 int iSimplex;
149 List<Simplex> innerSimplices = new List<Simplex>(); 149 List<Simplex> innerSimplices = new List<Simplex>();
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Physics.Meshing
162 } 162 }
163 163
164 // each simplex still in the list belongs to the hull of the region in question 164 // each simplex still in the list belongs to the hull of the region in question
165 // The new vertex (yes, we still deal with verices here :-)) forms a triangle 165 // The new vertex (yes, we still deal with verices here :-)) forms a triangle
166 // with each of these simplices. Build the new triangles and add them to the list 166 // with each of these simplices. Build the new triangles and add them to the list
167 foreach (Simplex s in simplices) 167 foreach (Simplex s in simplices)
168 { 168 {
@@ -206,14 +206,14 @@ namespace OpenSim.Region.Physics.Meshing
206 } 206 }
207 break; 207 break;
208 208
209 209
210 default: 210 default:
211 if (hshape == HollowShape.Same) 211 if (hshape == HollowShape.Same)
212 hshape= HollowShape.Square; 212 hshape= HollowShape.Square;
213 break; 213 break;
214 } 214 }
215 215
216 216
217 SimpleHull holeHull = null; 217 SimpleHull holeHull = null;
218 218
219 if (hshape == HollowShape.Square) 219 if (hshape == HollowShape.Square)
@@ -428,13 +428,13 @@ namespace OpenSim.Region.Physics.Meshing
428 UInt16 pathShearY = primShape.PathShearY; 428 UInt16 pathShearY = primShape.PathShearY;
429 Int16 twistTop = primShape.PathTwistBegin; 429 Int16 twistTop = primShape.PathTwistBegin;
430 Int16 twistBot = primShape.PathTwist; 430 Int16 twistBot = primShape.PathTwist;
431 431
432 432
433 //m_log.Error("pathShear:" + primShape.PathShearX.ToString() + "," + primShape.PathShearY.ToString()); 433 //m_log.Error("pathShear:" + primShape.PathShearX.ToString() + "," + primShape.PathShearY.ToString());
434 //m_log.Error("pathTaper:" + primShape.PathTaperX.ToString() + "," + primShape.PathTaperY.ToString()); 434 //m_log.Error("pathTaper:" + primShape.PathTaperX.ToString() + "," + primShape.PathTaperY.ToString());
435 //m_log.Error("ProfileBegin:" + primShape.ProfileBegin.ToString() + "," + primShape.ProfileBegin.ToString()); 435 //m_log.Error("ProfileBegin:" + primShape.ProfileBegin.ToString() + "," + primShape.ProfileBegin.ToString());
436 //m_log.Error("PathScale:" + primShape.PathScaleX.ToString() + "," + primShape.PathScaleY.ToString()); 436 //m_log.Error("PathScale:" + primShape.PathScaleX.ToString() + "," + primShape.PathScaleY.ToString());
437 437
438 // Procedure: This is based on the fact that the upper (plus) and lower (minus) Z-surface 438 // Procedure: This is based on the fact that the upper (plus) and lower (minus) Z-surface
439 // of a block are basically the same 439 // of a block are basically the same
440 // They may be warped differently but the shape is identical 440 // They may be warped differently but the shape is identical
@@ -469,7 +469,7 @@ namespace OpenSim.Region.Physics.Meshing
469 if (fProfileBeginAngle < fProfileEndAngle) 469 if (fProfileBeginAngle < fProfileEndAngle)
470 fProfileEndAngle -= 360.0; 470 fProfileEndAngle -= 360.0;
471 471
472 // Note, that we don't want to cut out a triangle, even if this is a 472 // Note, that we don't want to cut out a triangle, even if this is a
473 // good approximation for small cuts. Indeed we want to cut out an arc 473 // good approximation for small cuts. Indeed we want to cut out an arc
474 // and we approximate this arc by a polygon chain 474 // and we approximate this arc by a polygon chain
475 // Also note, that these vectors are of length 1.0 and thus their endpoints lay outside the model space 475 // Also note, that these vectors are of length 1.0 and thus their endpoints lay outside the model space
@@ -559,7 +559,7 @@ namespace OpenSim.Region.Physics.Meshing
559 extr.taperBotFactorX = 1.0f - ((100 - (float)taperX) / 100); 559 extr.taperBotFactorX = 1.0f - ((100 - (float)taperX) / 100);
560 //m_log.Warn("taperBotFactorX: " + extr.taperBotFactorX.ToString()); 560 //m_log.Warn("taperBotFactorX: " + extr.taperBotFactorX.ToString());
561 } 561 }
562 562
563 } 563 }
564 564
565 if (taperY != 100) 565 if (taperY != 100)
@@ -575,8 +575,8 @@ namespace OpenSim.Region.Physics.Meshing
575 //m_log.Warn("taperBotFactorY: " + extr.taperBotFactorY.ToString()); 575 //m_log.Warn("taperBotFactorY: " + extr.taperBotFactorY.ToString());
576 } 576 }
577 } 577 }
578 578
579 579
580 if (pathShearX != 0) 580 if (pathShearX != 0)
581 { 581 {
582 if (pathShearX > 50) 582 if (pathShearX > 50)
@@ -585,7 +585,7 @@ namespace OpenSim.Region.Physics.Meshing
585 extr.pushX = (((float)(256 - pathShearX) / 100) * -1f); 585 extr.pushX = (((float)(256 - pathShearX) / 100) * -1f);
586 // m_log.Warn("pushX: " + extr.pushX); 586 // m_log.Warn("pushX: " + extr.pushX);
587 } 587 }
588 else 588 else
589 { 589 {
590 extr.pushX = (float)pathShearX / 100; 590 extr.pushX = (float)pathShearX / 100;
591 // m_log.Warn("pushX: " + extr.pushX); 591 // m_log.Warn("pushX: " + extr.pushX);
@@ -600,7 +600,7 @@ namespace OpenSim.Region.Physics.Meshing
600 extr.pushY = (((float)(256 - pathShearY) / 100) * -1f); 600 extr.pushY = (((float)(256 - pathShearY) / 100) * -1f);
601 //m_log.Warn("pushY: " + extr.pushY); 601 //m_log.Warn("pushY: " + extr.pushY);
602 } 602 }
603 else 603 else
604 { 604 {
605 extr.pushY = (float)pathShearY / 100; 605 extr.pushY = (float)pathShearY / 100;
606 //m_log.Warn("pushY: " + extr.pushY); 606 //m_log.Warn("pushY: " + extr.pushY);
@@ -615,7 +615,7 @@ namespace OpenSim.Region.Physics.Meshing
615 extr.twistTop = 360 - (-1 * extr.twistTop); 615 extr.twistTop = 360 - (-1 * extr.twistTop);
616 616
617 } 617 }
618 618
619 619
620 extr.twistTop = (float)(extr.twistTop * DEG_TO_RAD); 620 extr.twistTop = (float)(extr.twistTop * DEG_TO_RAD);
621 } 621 }
@@ -660,7 +660,7 @@ namespace OpenSim.Region.Physics.Meshing
660 UInt16 pathShearY = primShape.PathShearY; 660 UInt16 pathShearY = primShape.PathShearY;
661 Int16 twistBot = primShape.PathTwist; 661 Int16 twistBot = primShape.PathTwist;
662 Int16 twistTop = primShape.PathTwistBegin; 662 Int16 twistTop = primShape.PathTwistBegin;
663 663
664 664
665 // Procedure: This is based on the fact that the upper (plus) and lower (minus) Z-surface 665 // Procedure: This is based on the fact that the upper (plus) and lower (minus) Z-surface
666 // of a block are basically the same 666 // of a block are basically the same
@@ -715,7 +715,7 @@ namespace OpenSim.Region.Physics.Meshing
715 //Vertex Q1Q12 = new Vertex(-0.46f, -0.18f, 0.0f); 715 //Vertex Q1Q12 = new Vertex(-0.46f, -0.18f, 0.0f);
716 //Vertex Q1Q13 = new Vertex(-0.43f, -0.24f, 0.0f); 716 //Vertex Q1Q13 = new Vertex(-0.43f, -0.24f, 0.0f);
717 //Vertex Q1Q14 = new Vertex(-0.40f, -0.30f, 0.0f); 717 //Vertex Q1Q14 = new Vertex(-0.40f, -0.30f, 0.0f);
718 718
719 SimpleHull outerHull = new SimpleHull(); 719 SimpleHull outerHull = new SimpleHull();
720 //Clockwise around the quadrants 720 //Clockwise around the quadrants
721 //outerHull.AddVertex(Q1Q15); 721 //outerHull.AddVertex(Q1Q15);
@@ -803,7 +803,7 @@ namespace OpenSim.Region.Physics.Meshing
803 if (fProfileBeginAngle < fProfileEndAngle) 803 if (fProfileBeginAngle < fProfileEndAngle)
804 fProfileEndAngle -= 360.0; 804 fProfileEndAngle -= 360.0;
805 805
806 // Note, that we don't want to cut out a triangle, even if this is a 806 // Note, that we don't want to cut out a triangle, even if this is a
807 // good approximation for small cuts. Indeed we want to cut out an arc 807 // good approximation for small cuts. Indeed we want to cut out an arc
808 // and we approximate this arc by a polygon chain 808 // and we approximate this arc by a polygon chain
809 // Also note, that these vectors are of length 1.0 and thus their endpoints lay outside the model space 809 // Also note, that these vectors are of length 1.0 and thus their endpoints lay outside the model space
@@ -940,7 +940,7 @@ namespace OpenSim.Region.Physics.Meshing
940 extr.pushY = (float)pathShearY / 100; 940 extr.pushY = (float)pathShearY / 100;
941 //m_log.Warn("pushY: " + extr.pushY); 941 //m_log.Warn("pushY: " + extr.pushY);
942 } 942 }
943 943
944 } 944 }
945 945
946 if (twistTop != 0) 946 if (twistTop != 0)
@@ -949,9 +949,9 @@ namespace OpenSim.Region.Physics.Meshing
949 if (extr.twistTop > 0) 949 if (extr.twistTop > 0)
950 { 950 {
951 extr.twistTop = 360 - (-1 * extr.twistTop); 951 extr.twistTop = 360 - (-1 * extr.twistTop);
952 952
953 } 953 }
954 954
955 955
956 extr.twistTop = (float)(extr.twistTop * DEG_TO_RAD); 956 extr.twistTop = (float)(extr.twistTop * DEG_TO_RAD);
957 } 957 }
@@ -967,7 +967,7 @@ namespace OpenSim.Region.Physics.Meshing
967 } 967 }
968 extr.twistMid = (float)(extr.twistMid * DEG_TO_RAD); 968 extr.twistMid = (float)(extr.twistMid * DEG_TO_RAD);
969 } 969 }
970 970
971 if (twistBot != 0) 971 if (twistBot != 0)
972 { 972 {
973 extr.twistBot = 180 * ((float)twistBot / 100); 973 extr.twistBot = 180 * ((float)twistBot / 100);
@@ -1013,7 +1013,7 @@ namespace OpenSim.Region.Physics.Meshing
1013 Vertex MM = new Vertex(-0.25f, -0.45f, 0.0f); 1013 Vertex MM = new Vertex(-0.25f, -0.45f, 0.0f);
1014 Vertex PM = new Vertex(+0.5f, 0f, 0.0f); 1014 Vertex PM = new Vertex(+0.5f, 0f, 0.0f);
1015 Vertex PP = new Vertex(-0.25f, +0.45f, 0.0f); 1015 Vertex PP = new Vertex(-0.25f, +0.45f, 0.0f);
1016 1016
1017 1017
1018 SimpleHull outerHull = new SimpleHull(); 1018 SimpleHull outerHull = new SimpleHull();
1019 //outerHull.AddVertex(MM); 1019 //outerHull.AddVertex(MM);
@@ -1022,7 +1022,7 @@ namespace OpenSim.Region.Physics.Meshing
1022 outerHull.AddVertex(PP); 1022 outerHull.AddVertex(PP);
1023 outerHull.AddVertex(MM); 1023 outerHull.AddVertex(MM);
1024 outerHull.AddVertex(PM); 1024 outerHull.AddVertex(PM);
1025 1025
1026 // Deal with cuts now 1026 // Deal with cuts now
1027 if ((profileBegin != 0) || (profileEnd != 0)) 1027 if ((profileBegin != 0) || (profileEnd != 0))
1028 { 1028 {
@@ -1034,7 +1034,7 @@ namespace OpenSim.Region.Physics.Meshing
1034 if (fProfileBeginAngle < fProfileEndAngle) 1034 if (fProfileBeginAngle < fProfileEndAngle)
1035 fProfileEndAngle -= 360.0; 1035 fProfileEndAngle -= 360.0;
1036 1036
1037 // Note, that we don't want to cut out a triangle, even if this is a 1037 // Note, that we don't want to cut out a triangle, even if this is a
1038 // good approximation for small cuts. Indeed we want to cut out an arc 1038 // good approximation for small cuts. Indeed we want to cut out an arc
1039 // and we approximate this arc by a polygon chain 1039 // and we approximate this arc by a polygon chain
1040 // Also note, that these vectors are of length 1.0 and thus their endpoints lay outside the model space 1040 // Also note, that these vectors are of length 1.0 and thus their endpoints lay outside the model space
@@ -1177,7 +1177,7 @@ namespace OpenSim.Region.Physics.Meshing
1177 extr.twistTop = 360 - (-1 * extr.twistTop); 1177 extr.twistTop = 360 - (-1 * extr.twistTop);
1178 1178
1179 } 1179 }
1180 1180
1181 1181
1182 extr.twistTop = (float)(extr.twistTop * DEG_TO_RAD); 1182 extr.twistTop = (float)(extr.twistTop * DEG_TO_RAD);
1183 } 1183 }
@@ -1255,7 +1255,7 @@ namespace OpenSim.Region.Physics.Meshing
1255 1255
1256 1256
1257 // Base Faces of the Icosahedron (20) 1257 // Base Faces of the Icosahedron (20)
1258 SphereLODTriangle(v1, v2, v3, diameter, LOD, m); 1258 SphereLODTriangle(v1, v2, v3, diameter, LOD, m);
1259 SphereLODTriangle(v4, v3, v2, diameter, LOD, m); 1259 SphereLODTriangle(v4, v3, v2, diameter, LOD, m);
1260 SphereLODTriangle(v4, v5, v6, diameter, LOD, m); 1260 SphereLODTriangle(v4, v5, v6, diameter, LOD, m);
1261 SphereLODTriangle(v4, v9, v5, diameter, LOD, m); 1261 SphereLODTriangle(v4, v9, v5, diameter, LOD, m);
@@ -1284,7 +1284,7 @@ namespace OpenSim.Region.Physics.Meshing
1284 v.Z *= size.Z; 1284 v.Z *= size.Z;
1285 } 1285 }
1286 1286
1287 // This was built with the normals pointing inside.. 1287 // This was built with the normals pointing inside..
1288 // therefore we have to invert the normals 1288 // therefore we have to invert the normals
1289 foreach (Triangle t in m.triangles) 1289 foreach (Triangle t in m.triangles)
1290 { 1290 {
@@ -1308,7 +1308,7 @@ namespace OpenSim.Region.Physics.Meshing
1308 v.Y *= size.Y; 1308 v.Y *= size.Y;
1309 v.Z *= size.Z; 1309 v.Z *= size.Z;
1310 } 1310 }
1311 // This was built with the normals pointing inside.. 1311 // This was built with the normals pointing inside..
1312 // therefore we have to invert the normals 1312 // therefore we have to invert the normals
1313 foreach (Triangle t in sm.triangles) 1313 foreach (Triangle t in sm.triangles)
1314 { 1314 {
@@ -1462,7 +1462,7 @@ namespace OpenSim.Region.Physics.Meshing
1462 default: 1462 default:
1463 mesh = CreateBoxMesh(primName, primShape, size); 1463 mesh = CreateBoxMesh(primName, primShape, size);
1464 CalcNormals(mesh); 1464 CalcNormals(mesh);
1465 //Set default mesh to cube otherwise it'll return 1465 //Set default mesh to cube otherwise it'll return
1466 // null and crash on the 'setMesh' method in the physics plugins. 1466 // null and crash on the 'setMesh' method in the physics plugins.
1467 //mesh = null; 1467 //mesh = null;
1468 break; 1468 break;
@@ -1472,6 +1472,6 @@ namespace OpenSim.Region.Physics.Meshing
1472 return mesh; 1472 return mesh;
1473 } 1473 }
1474 1474
1475 1475
1476 } 1476 }
1477} 1477}
diff --git a/OpenSim/Region/Physics/Meshing/SimpleHull.cs b/OpenSim/Region/Physics/Meshing/SimpleHull.cs
index 2896d3b..5eeadae 100644
--- a/OpenSim/Region/Physics/Meshing/SimpleHull.cs
+++ b/OpenSim/Region/Physics/Meshing/SimpleHull.cs
@@ -337,7 +337,7 @@ namespace OpenSim.Region.Physics.Meshing
337 } 337 }
338 338
339 339
340 if (baseStartVertex == null) // i.e. no simplex fulfilled the "outside" condition. 340 if (baseStartVertex == null) // i.e. no simplex fulfilled the "outside" condition.
341 // In otherwords, subtractHull completely embraces baseHull 341 // In otherwords, subtractHull completely embraces baseHull
342 { 342 {
343 return result; 343 return result;
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 4165484..5024b5d 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Region.Physics.OdePlugin
36 /// <summary> 36 /// <summary>
37 /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. 37 /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves.
38 /// </summary> 38 /// </summary>
39 39
40 public enum dParam : int 40 public enum dParam : int
41 { 41 {
42 LowStop = 0, 42 LowStop = 0,
@@ -106,7 +106,7 @@ namespace OpenSim.Region.Physics.OdePlugin
106 private CollisionCategories m_collisionFlags = (CollisionCategories.Geom 106 private CollisionCategories m_collisionFlags = (CollisionCategories.Geom
107 | CollisionCategories.Space 107 | CollisionCategories.Space
108 | CollisionCategories.Body 108 | CollisionCategories.Body
109 | CollisionCategories.Character 109 | CollisionCategories.Character
110 | CollisionCategories.Land); 110 | CollisionCategories.Land);
111 public IntPtr Body; 111 public IntPtr Body;
112 private OdeScene _parent_scene; 112 private OdeScene _parent_scene;
@@ -145,7 +145,7 @@ namespace OpenSim.Region.Physics.OdePlugin
145 { 145 {
146 m_colliderarr[i] = false; 146 m_colliderarr[i] = false;
147 } 147 }
148 CAPSULE_LENGTH = (size.Z - ((size.Z * height_fudge_factor))); 148 CAPSULE_LENGTH = (size.Z - ((size.Z * height_fudge_factor)));
149 149
150 lock (OdeScene.OdeLock) 150 lock (OdeScene.OdeLock)
151 { 151 {
@@ -338,7 +338,7 @@ namespace OpenSim.Region.Physics.OdePlugin
338 } 338 }
339 339
340 /// <summary> 340 /// <summary>
341 /// turn the PID controller on or off. 341 /// turn the PID controller on or off.
342 /// The PID Controller will turn on all by itself in many situations 342 /// The PID Controller will turn on all by itself in many situations
343 /// </summary> 343 /// </summary>
344 /// <param name="status"></param> 344 /// <param name="status"></param>
@@ -354,7 +354,7 @@ namespace OpenSim.Region.Physics.OdePlugin
354 354
355 /// <summary> 355 /// <summary>
356 /// This 'puts' an avatar somewhere in the physics space. 356 /// This 'puts' an avatar somewhere in the physics space.
357 /// Not really a good choice unless you 'know' it's a good 357 /// Not really a good choice unless you 'know' it's a good
358 /// spot otherwise you're likely to orbit the avatar. 358 /// spot otherwise you're likely to orbit the avatar.
359 /// </summary> 359 /// </summary>
360 public override PhysicsVector Position 360 public override PhysicsVector Position
@@ -389,7 +389,7 @@ namespace OpenSim.Region.Physics.OdePlugin
389 lock (OdeScene.OdeLock) 389 lock (OdeScene.OdeLock)
390 { 390 {
391 d.JointDestroy(Amotor); 391 d.JointDestroy(Amotor);
392 392
393 PhysicsVector SetSize = value; 393 PhysicsVector SetSize = value;
394 float prevCapsule = CAPSULE_LENGTH; 394 float prevCapsule = CAPSULE_LENGTH;
395 float capsuleradius = CAPSULE_RADIUS; 395 float capsuleradius = CAPSULE_RADIUS;
@@ -405,7 +405,7 @@ namespace OpenSim.Region.Physics.OdePlugin
405 AvatarGeomAndBodyCreation(_position.X, _position.Y, 405 AvatarGeomAndBodyCreation(_position.X, _position.Y,
406 _position.Z + (Math.Abs(CAPSULE_LENGTH - prevCapsule) * 2), m_tensor); 406 _position.Z + (Math.Abs(CAPSULE_LENGTH - prevCapsule) * 2), m_tensor);
407 Velocity = new PhysicsVector(0f, 0f, 0f); 407 Velocity = new PhysicsVector(0f, 0f, 0f);
408 408
409 } 409 }
410 _parent_scene.geom_name_map[Shell] = m_name; 410 _parent_scene.geom_name_map[Shell] = m_name;
411 _parent_scene.actor_name_map[Shell] = (PhysicsActor) this; 411 _parent_scene.actor_name_map[Shell] = (PhysicsActor) this;
@@ -423,7 +423,7 @@ namespace OpenSim.Region.Physics.OdePlugin
423 int dAMotorEuler = 1; 423 int dAMotorEuler = 1;
424 _parent_scene.waitForSpaceUnlock(_parent_scene.space); 424 _parent_scene.waitForSpaceUnlock(_parent_scene.space);
425 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); 425 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
426 426
427 d.GeomSetCategoryBits(Shell, (int)m_collisionCategories); 427 d.GeomSetCategoryBits(Shell, (int)m_collisionCategories);
428 d.GeomSetCollideBits(Shell, (int)m_collisionFlags); 428 d.GeomSetCollideBits(Shell, (int)m_collisionFlags);
429 429
@@ -442,8 +442,8 @@ namespace OpenSim.Region.Physics.OdePlugin
442 442
443 d.GeomSetBody(Shell, Body); 443 d.GeomSetBody(Shell, Body);
444 444
445 445
446 // The purpose of the AMotor here is to keep the avatar's physical 446 // The purpose of the AMotor here is to keep the avatar's physical
447 // surrogate from rotating while moving 447 // surrogate from rotating while moving
448 Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); 448 Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero);
449 d.JointAttach(Amotor, Body, IntPtr.Zero); 449 d.JointAttach(Amotor, Body, IntPtr.Zero);
@@ -455,7 +455,7 @@ namespace OpenSim.Region.Physics.OdePlugin
455 d.JointSetAMotorAngle(Amotor, 0, 0); 455 d.JointSetAMotorAngle(Amotor, 0, 0);
456 d.JointSetAMotorAngle(Amotor, 1, 0); 456 d.JointSetAMotorAngle(Amotor, 1, 0);
457 d.JointSetAMotorAngle(Amotor, 2, 0); 457 d.JointSetAMotorAngle(Amotor, 2, 0);
458 458
459 // These lowstops and high stops are effectively (no wiggle room) 459 // These lowstops and high stops are effectively (no wiggle room)
460 d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -0.000000000001f); 460 d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -0.000000000001f);
461 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0.000000000001f); 461 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0.000000000001f);
@@ -464,23 +464,23 @@ namespace OpenSim.Region.Physics.OdePlugin
464 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f); 464 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f);
465 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f); 465 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f);
466 466
467 // Fudge factor is 1f by default, we're setting it to 0. We don't want it to Fudge or the 467 // Fudge factor is 1f by default, we're setting it to 0. We don't want it to Fudge or the
468 // capped cyllinder will fall over 468 // capped cyllinder will fall over
469 d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); 469 d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f);
470 d.JointSetAMotorParam(Amotor, (int)dParam.FMax, tensor); 470 d.JointSetAMotorParam(Amotor, (int)dParam.FMax, tensor);
471 471
472 //d.Matrix3 bodyrotation = d.BodyGetRotation(Body); 472 //d.Matrix3 bodyrotation = d.BodyGetRotation(Body);
473 //d.QfromR( 473 //d.QfromR(
474 //d.Matrix3 checkrotation = new d.Matrix3(0.7071068,0.5, -0.7071068, 474 //d.Matrix3 checkrotation = new d.Matrix3(0.7071068,0.5, -0.7071068,
475 // 475 //
476 //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22); 476 //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
477 //standupStraight(); 477 //standupStraight();
478 478
479 479
480 480
481 } 481 }
482 482
483 // 483 //
484 /// <summary> 484 /// <summary>
485 /// Uses the capped cyllinder volume formula to calculate the avatar's mass. 485 /// Uses the capped cyllinder volume formula to calculate the avatar's mass.
486 /// This may be used in calculations in the scene/scenepresence 486 /// This may be used in calculations in the scene/scenepresence
@@ -508,13 +508,13 @@ namespace OpenSim.Region.Physics.OdePlugin
508 508
509 } 509 }
510 510
511// This code is very useful. Written by DanX0r. We're just not using it right now. 511// This code is very useful. Written by DanX0r. We're just not using it right now.
512// Commented out to prevent a warning. 512// Commented out to prevent a warning.
513// 513//
514// private void standupStraight() 514// private void standupStraight()
515// { 515// {
516// // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air. 516// // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air.
517// // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you 517// // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you
518// // change appearance and when you enter the simulator 518// // change appearance and when you enter the simulator
519// // After this routine is done, the amotor stabilizes much quicker 519// // After this routine is done, the amotor stabilizes much quicker
520// d.Vector3 feet; 520// d.Vector3 feet;
@@ -558,7 +558,7 @@ namespace OpenSim.Region.Physics.OdePlugin
558 if (_zeroFlag) 558 if (_zeroFlag)
559 return new PhysicsVector(0f, 0f, 0f); 559 return new PhysicsVector(0f, 0f, 0f);
560 m_lastUpdateSent = false; 560 m_lastUpdateSent = false;
561 return _velocity; 561 return _velocity;
562 } 562 }
563 set 563 set
564 { 564 {
@@ -601,7 +601,7 @@ namespace OpenSim.Region.Physics.OdePlugin
601 } 601 }
602 602
603 /// <summary> 603 /// <summary>
604 /// Adds the force supplied to the Target Velocity 604 /// Adds the force supplied to the Target Velocity
605 /// The PID controller takes this target velocity and tries to make it a reality 605 /// The PID controller takes this target velocity and tries to make it a reality
606 /// </summary> 606 /// </summary>
607 /// <param name="force"></param> 607 /// <param name="force"></param>
@@ -616,7 +616,7 @@ namespace OpenSim.Region.Physics.OdePlugin
616 // _target_velocity.Y += force.Y; 616 // _target_velocity.Y += force.Y;
617 //_target_velocity.Z += force.Z; 617 //_target_velocity.Z += force.Z;
618 } 618 }
619 else 619 else
620 { 620 {
621 m_pidControllerActive = true; 621 m_pidControllerActive = true;
622 _target_velocity.X += force.X; 622 _target_velocity.X += force.X;
@@ -637,7 +637,7 @@ namespace OpenSim.Region.Physics.OdePlugin
637 d.BodyAddForce(Body, force.X, force.Y, force.Z); 637 d.BodyAddForce(Body, force.X, force.Y, force.Z);
638 //d.BodySetRotation(Body, ref m_StandUpRotation); 638 //d.BodySetRotation(Body, ref m_StandUpRotation);
639 //standupStraight(); 639 //standupStraight();
640 640
641 } 641 }
642 } 642 }
643 643
@@ -655,16 +655,16 @@ namespace OpenSim.Region.Physics.OdePlugin
655 { 655 {
656 // no lock; for now it's only called from within Simulate() 656 // no lock; for now it's only called from within Simulate()
657 657
658 // If the PID Controller isn't active then we set our force 658 // If the PID Controller isn't active then we set our force
659 // calculating base velocity to the current position 659 // calculating base velocity to the current position
660 660
661 661
662 if (m_pidControllerActive == false) 662 if (m_pidControllerActive == false)
663 { 663 {
664 _zeroPosition = d.BodyGetPosition(Body); 664 _zeroPosition = d.BodyGetPosition(Body);
665 } 665 }
666 //PidStatus = true; 666 //PidStatus = true;
667 667
668 PhysicsVector vec = new PhysicsVector(); 668 PhysicsVector vec = new PhysicsVector();
669 d.Vector3 vel = d.BodyGetLinearVel(Body); 669 d.Vector3 vel = d.BodyGetLinearVel(Body);
670 float movementdivisor = 1f; 670 float movementdivisor = 1f;
@@ -798,13 +798,13 @@ namespace OpenSim.Region.Physics.OdePlugin
798 _velocity.X = 0.0f; 798 _velocity.X = 0.0f;
799 _velocity.Y = 0.0f; 799 _velocity.Y = 0.0f;
800 _velocity.Z = 0.0f; 800 _velocity.Z = 0.0f;
801 801
802 // Did we send out the 'stopped' message? 802 // Did we send out the 'stopped' message?
803 if (!m_lastUpdateSent) 803 if (!m_lastUpdateSent)
804 { 804 {
805 m_lastUpdateSent = true; 805 m_lastUpdateSent = true;
806 //base.RequestPhysicsterseUpdate(); 806 //base.RequestPhysicsterseUpdate();
807 807
808 } 808 }
809 } 809 }
810 else 810 else
@@ -815,7 +815,7 @@ namespace OpenSim.Region.Physics.OdePlugin
815 _velocity.Y = (vec.Y); 815 _velocity.Y = (vec.Y);
816 816
817 _velocity.Z = (vec.Z); 817 _velocity.Z = (vec.Z);
818 818
819 if (_velocity.Z < -6 && !m_hackSentFall) 819 if (_velocity.Z < -6 && !m_hackSentFall)
820 { 820 {
821 m_hackSentFall = true; 821 m_hackSentFall = true;
@@ -849,7 +849,7 @@ namespace OpenSim.Region.Physics.OdePlugin
849 849
850 d.GeomDestroy(Shell); 850 d.GeomDestroy(Shell);
851 _parent_scene.geom_name_map.Remove(Shell); 851 _parent_scene.geom_name_map.Remove(Shell);
852 852
853 //kill the body 853 //kill the body
854 d.BodyDestroy(Body); 854 d.BodyDestroy(Body);
855 } 855 }
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 37a8b77..f1886e4 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -111,7 +111,7 @@ namespace OpenSim.Region.Physics.OdePlugin
111 private IntPtr _linkJointGroup = (IntPtr)0; 111 private IntPtr _linkJointGroup = (IntPtr)0;
112 private PhysicsActor _parent = null; 112 private PhysicsActor _parent = null;
113 private PhysicsActor m_taintparent = null; 113 private PhysicsActor m_taintparent = null;
114 114
115 private bool iscolliding = false; 115 private bool iscolliding = false;
116 private bool m_isphysical = false; 116 private bool m_isphysical = false;
117 private bool m_isSelected = false; 117 private bool m_isSelected = false;
@@ -202,7 +202,7 @@ namespace OpenSim.Region.Physics.OdePlugin
202 m_taintadd = true; 202 m_taintadd = true;
203 _parent_scene.AddPhysicsActorTaint(this); 203 _parent_scene.AddPhysicsActorTaint(this);
204 // don't do .add() here; old geoms get recycled with the same hash 204 // don't do .add() here; old geoms get recycled with the same hash
205 205
206 } 206 }
207 207
208 public override int PhysicsActorType 208 public override int PhysicsActorType
@@ -232,9 +232,9 @@ namespace OpenSim.Region.Physics.OdePlugin
232 public override bool Selected 232 public override bool Selected
233 { 233 {
234 set { 234 set {
235 // This only makes the object not collidable if the object 235 // This only makes the object not collidable if the object
236 // is physical or the object is modified somehow *IN THE FUTURE* 236 // is physical or the object is modified somehow *IN THE FUTURE*
237 // without this, if an avatar selects prim, they can walk right 237 // without this, if an avatar selects prim, they can walk right
238 // through it while it's selected 238 // through it while it's selected
239 239
240 if ((m_isphysical && !_zeroFlag) || !value) 240 if ((m_isphysical && !_zeroFlag) || !value)
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Physics.OdePlugin
262 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 262 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
263 } 263 }
264 //m_log.Warn("Setting Geom to: " + prim_geom); 264 //m_log.Warn("Setting Geom to: " + prim_geom);
265 265
266 } 266 }
267 267
268 public void enableBodySoft() 268 public void enableBodySoft()
@@ -277,7 +277,7 @@ namespace OpenSim.Region.Physics.OdePlugin
277 public void disableBodySoft() 277 public void disableBodySoft()
278 { 278 {
279 m_disabled = true; 279 m_disabled = true;
280 280
281 if (m_isphysical) 281 if (m_isphysical)
282 if (Body != (IntPtr)0) 282 if (Body != (IntPtr)0)
283 d.BodyDisable(Body); 283 d.BodyDisable(Body);
@@ -307,7 +307,7 @@ namespace OpenSim.Region.Physics.OdePlugin
307 307
308 d.BodySetAutoDisableFlag(Body, true); 308 d.BodySetAutoDisableFlag(Body, true);
309 d.BodySetAutoDisableSteps(Body, 20); 309 d.BodySetAutoDisableSteps(Body, 20);
310 310
311 m_interpenetrationcount = 0; 311 m_interpenetrationcount = 0;
312 m_collisionscore = 0; 312 m_collisionscore = 0;
313 m_disabled = false; 313 m_disabled = false;
@@ -327,7 +327,7 @@ namespace OpenSim.Region.Physics.OdePlugin
327 { 327 {
328 float volume = 0; 328 float volume = 0;
329 329
330 // No material is passed to the physics engines yet.. soo.. 330 // No material is passed to the physics engines yet.. soo..
331 // we're using the m_density constant in the class definition 331 // we're using the m_density constant in the class definition
332 332
333 333
@@ -340,7 +340,7 @@ namespace OpenSim.Region.Physics.OdePlugin
340 340
341 volume = _size.X*_size.Y*_size.Z; 341 volume = _size.X*_size.Y*_size.Z;
342 342
343 // If the user has 'hollowed out' 343 // If the user has 'hollowed out'
344 // ProfileHollow is one of those 0 to 50000 values :P 344 // ProfileHollow is one of those 0 to 50000 values :P
345 // we like percentages better.. so turning into a percentage 345 // we like percentages better.. so turning into a percentage
346 346
@@ -415,7 +415,7 @@ namespace OpenSim.Region.Physics.OdePlugin
415 // We don't know what the shape is yet, so use default 415 // We don't know what the shape is yet, so use default
416 volume = _size.X * _size.Y * _size.Z; 416 volume = _size.X * _size.Y * _size.Z;
417 } 417 }
418 // If the user has 'hollowed out' 418 // If the user has 'hollowed out'
419 // ProfileHollow is one of those 0 to 50000 values :P 419 // ProfileHollow is one of those 0 to 50000 values :P
420 // we like percentages better.. so turning into a percentage 420 // we like percentages better.. so turning into a percentage
421 421
@@ -427,8 +427,8 @@ namespace OpenSim.Region.Physics.OdePlugin
427 float hollowVolume = 0; 427 float hollowVolume = 0;
428 switch (_pbs.HollowShape) 428 switch (_pbs.HollowShape)
429 { 429 {
430 430
431 case HollowShape.Same: 431 case HollowShape.Same:
432 case HollowShape.Circle: 432 case HollowShape.Circle:
433 // Hollow shape is a perfect cyllinder in respect to the cube's scale 433 // Hollow shape is a perfect cyllinder in respect to the cube's scale
434 // Cyllinder hollow volume calculation 434 // Cyllinder hollow volume calculation
@@ -447,7 +447,7 @@ namespace OpenSim.Region.Physics.OdePlugin
447 hollowVolume = hollowsizex * hollowsizey * hollowsizez; 447 hollowVolume = hollowsizex * hollowsizey * hollowsizez;
448 break; 448 break;
449 449
450 450
451 451
452 case HollowShape.Triangle: 452 case HollowShape.Triangle:
453 // Equilateral Triangular Prism volume hollow calculation 453 // Equilateral Triangular Prism volume hollow calculation
@@ -465,7 +465,7 @@ namespace OpenSim.Region.Physics.OdePlugin
465 volume = volume - hollowVolume; 465 volume = volume - hollowVolume;
466 } 466 }
467 break; 467 break;
468 468
469 case ProfileShape.HalfCircle: 469 case ProfileShape.HalfCircle:
470 if (_pbs.PathCurve == (byte)Extrusion.Curve1) 470 if (_pbs.PathCurve == (byte)Extrusion.Curve1)
471 { 471 {
@@ -490,13 +490,13 @@ namespace OpenSim.Region.Physics.OdePlugin
490 } 490 }
491 break; 491 break;
492 case ProfileShape.EquilateralTriangle: 492 case ProfileShape.EquilateralTriangle:
493 /* 493 /*
494 v = (abs((xB*yA-xA*yB)+(xC*yB-xB*yC)+(xA*yC-xC*yA))/2) * h 494 v = (abs((xB*yA-xA*yB)+(xC*yB-xB*yC)+(xA*yC-xC*yA))/2) * h
495 495
496 // seed mesh 496 // seed mesh
497 Vertex MM = new Vertex(-0.25f, -0.45f, 0.0f); 497 Vertex MM = new Vertex(-0.25f, -0.45f, 0.0f);
498 Vertex PM = new Vertex(+0.5f, 0f, 0.0f); 498 Vertex PM = new Vertex(+0.5f, 0f, 0.0f);
499 Vertex PP = new Vertex(-0.25f, +0.45f, 0.0f); 499 Vertex PP = new Vertex(-0.25f, +0.45f, 0.0f);
500 */ 500 */
501 float xA = -0.25f * _size.X; 501 float xA = -0.25f * _size.X;
502 float yA = -0.45f * _size.Y; 502 float yA = -0.45f * _size.Y;
@@ -509,7 +509,7 @@ namespace OpenSim.Region.Physics.OdePlugin
509 509
510 volume = (float)((Math.Abs((xB * yA - xA * yB) + (xC * yB - xB * yC) + (xA * yC - xC * yA)) / 2) * _size.Z); 510 volume = (float)((Math.Abs((xB * yA - xA * yB) + (xC * yB - xB * yC) + (xA * yC - xC * yA)) / 2) * _size.Z);
511 511
512 // If the user has 'hollowed out' 512 // If the user has 'hollowed out'
513 // ProfileHollow is one of those 0 to 50000 values :P 513 // ProfileHollow is one of those 0 to 50000 values :P
514 // we like percentages better.. so turning into a percentage 514 // we like percentages better.. so turning into a percentage
515 float fhollowFactor = ((float)_pbs.ProfileHollow / 1.9f); 515 float fhollowFactor = ((float)_pbs.ProfileHollow / 1.9f);
@@ -521,7 +521,7 @@ namespace OpenSim.Region.Physics.OdePlugin
521 float hollowVolume = 0; 521 float hollowVolume = 0;
522 switch (_pbs.HollowShape) 522 switch (_pbs.HollowShape)
523 { 523 {
524 524
525 case HollowShape.Same: 525 case HollowShape.Same:
526 case HollowShape.Triangle: 526 case HollowShape.Triangle:
527 // Equilateral Triangular Prism volume hollow calculation 527 // Equilateral Triangular Prism volume hollow calculation
@@ -550,7 +550,7 @@ namespace OpenSim.Region.Physics.OdePlugin
550 hollowVolume = ((float)((Math.PI * Math.Pow(hRadius, 2) * hLength)/2) * hollowAmount); 550 hollowVolume = ((float)((Math.PI * Math.Pow(hRadius, 2) * hLength)/2) * hollowAmount);
551 break; 551 break;
552 552
553 553
554 default: 554 default:
555 hollowVolume = 0; 555 hollowVolume = 0;
556 break; 556 break;
@@ -560,7 +560,7 @@ namespace OpenSim.Region.Physics.OdePlugin
560 break; 560 break;
561 561
562 default: 562 default:
563 // we don't have all of the volume formulas yet so 563 // we don't have all of the volume formulas yet so
564 // use the common volume formula for all 564 // use the common volume formula for all
565 volume = _size.X*_size.Y*_size.Z; 565 volume = _size.X*_size.Y*_size.Z;
566 break; 566 break;
@@ -568,7 +568,7 @@ namespace OpenSim.Region.Physics.OdePlugin
568 568
569 // Calculate Path cut effect on volume 569 // Calculate Path cut effect on volume
570 // Not exact, in the triangle hollow example 570 // Not exact, in the triangle hollow example
571 // They should never be zero or less then zero.. 571 // They should never be zero or less then zero..
572 // we'll ignore it if it's less then zero 572 // we'll ignore it if it's less then zero
573 573
574 // ProfileEnd and ProfileBegin are values 574 // ProfileEnd and ProfileBegin are values
@@ -672,11 +672,11 @@ namespace OpenSim.Region.Physics.OdePlugin
672 672
673 public void setMesh(OdeScene parent_scene, IMesh mesh) 673 public void setMesh(OdeScene parent_scene, IMesh mesh)
674 { 674 {
675 // This sleeper is there to moderate how long it takes between 675 // This sleeper is there to moderate how long it takes between
676 // setting up the mesh and pre-processing it when we get rapid fire mesh requests on a single object 676 // setting up the mesh and pre-processing it when we get rapid fire mesh requests on a single object
677 677
678 Thread.Sleep(10); 678 Thread.Sleep(10);
679 679
680 //Kill Body so that mesh can re-make the geom 680 //Kill Body so that mesh can re-make the geom
681 if (IsPhysical && Body != (IntPtr) 0) 681 if (IsPhysical && Body != (IntPtr) 0)
682 { 682 {
@@ -694,9 +694,9 @@ namespace OpenSim.Region.Physics.OdePlugin
694 3*sizeof (int)); 694 3*sizeof (int));
695 d.GeomTriMeshDataPreprocess(_triMeshData); 695 d.GeomTriMeshDataPreprocess(_triMeshData);
696 696
697 697
698 _parent_scene.waitForSpaceUnlock(m_targetSpace); 698 _parent_scene.waitForSpaceUnlock(m_targetSpace);
699 699
700 try 700 try
701 { 701 {
702 if (prim_geom == (IntPtr)0) 702 if (prim_geom == (IntPtr)0)
@@ -706,7 +706,7 @@ namespace OpenSim.Region.Physics.OdePlugin
706 } 706 }
707 catch (AccessViolationException) 707 catch (AccessViolationException)
708 { 708 {
709 709
710 m_log.Error("[PHYSICS]: MESH LOCKED"); 710 m_log.Error("[PHYSICS]: MESH LOCKED");
711 return; 711 return;
712 } 712 }
@@ -715,7 +715,7 @@ namespace OpenSim.Region.Physics.OdePlugin
715 // Recreate the body 715 // Recreate the body
716 m_interpenetrationcount = 0; 716 m_interpenetrationcount = 0;
717 m_collisionscore = 0; 717 m_collisionscore = 0;
718 718
719 enableBody(); 719 enableBody();
720 720
721 } 721 }
@@ -724,7 +724,7 @@ namespace OpenSim.Region.Physics.OdePlugin
724 public void ProcessTaints(float timestep) 724 public void ProcessTaints(float timestep)
725 { 725 {
726 726
727 727
728 if (m_taintadd) 728 if (m_taintadd)
729 { 729 {
730 changeadd(timestep); 730 changeadd(timestep);
@@ -779,7 +779,7 @@ namespace OpenSim.Region.Physics.OdePlugin
779 } 779 }
780 780
781 private void changeAngularLock(float timestep) 781 private void changeAngularLock(float timestep)
782 { 782 {
783 // do we have a Physical object? 783 // do we have a Physical object?
784 if (Body != IntPtr.Zero) 784 if (Body != IntPtr.Zero)
785 { 785 {
@@ -809,7 +809,7 @@ namespace OpenSim.Region.Physics.OdePlugin
809 809
810 private void changelink(float timestep) 810 private void changelink(float timestep)
811 { 811 {
812 812
813 if (_parent == null && m_taintparent != null) 813 if (_parent == null && m_taintparent != null)
814 { 814 {
815 if (m_taintparent.PhysicsActorType == (int)ActorTypes.Prim) 815 if (m_taintparent.PhysicsActorType == (int)ActorTypes.Prim)
@@ -834,14 +834,14 @@ namespace OpenSim.Region.Physics.OdePlugin
834 m_linkJoint = (IntPtr)0; 834 m_linkJoint = (IntPtr)0;
835 835
836 } 836 }
837 837
838 838
839 _parent = m_taintparent; 839 _parent = m_taintparent;
840 } 840 }
841 841
842 private void changeSelectedStatus(float timestep) 842 private void changeSelectedStatus(float timestep)
843 { 843 {
844 844
845 if (m_taintselected) 845 if (m_taintselected)
846 { 846 {
847 847
@@ -849,9 +849,9 @@ namespace OpenSim.Region.Physics.OdePlugin
849 m_collisionCategories = CollisionCategories.Selected; 849 m_collisionCategories = CollisionCategories.Selected;
850 m_collisionFlags = (CollisionCategories.Sensor | CollisionCategories.Space); 850 m_collisionFlags = (CollisionCategories.Sensor | CollisionCategories.Space);
851 851
852 // We do the body disable soft twice because 'in theory' a collision could have happened 852 // We do the body disable soft twice because 'in theory' a collision could have happened
853 // in between the disabling and the collision properties setting 853 // in between the disabling and the collision properties setting
854 // which would wake the physical body up from a soft disabling and potentially cause it to fall 854 // which would wake the physical body up from a soft disabling and potentially cause it to fall
855 // through the ground. 855 // through the ground.
856 856
857 if (m_isphysical) 857 if (m_isphysical)
@@ -873,9 +873,9 @@ namespace OpenSim.Region.Physics.OdePlugin
873 } 873 }
874 else 874 else
875 { 875 {
876 876
877 m_collisionCategories = CollisionCategories.Geom; 877 m_collisionCategories = CollisionCategories.Geom;
878 878
879 if (m_isphysical) 879 if (m_isphysical)
880 m_collisionCategories |= CollisionCategories.Body; 880 m_collisionCategories |= CollisionCategories.Body;
881 881
@@ -898,10 +898,10 @@ namespace OpenSim.Region.Physics.OdePlugin
898 enableBodySoft(); 898 enableBodySoft();
899 } 899 }
900 900
901 901
902 } 902 }
903 903
904 904
905 resetCollisionAccounting(); 905 resetCollisionAccounting();
906 m_isSelected = m_taintselected; 906 m_isSelected = m_taintselected;
907 } 907 }
@@ -918,21 +918,21 @@ namespace OpenSim.Region.Physics.OdePlugin
918 m_taintselected = m_isSelected; 918 m_taintselected = m_isSelected;
919 919
920 m_taintsize = _size; 920 m_taintsize = _size;
921 921
922 922
923 m_taintshape = false; 923 m_taintshape = false;
924 924
925 m_taintforce = false; 925 m_taintforce = false;
926 926
927 m_taintdisable = false; 927 m_taintdisable = false;
928 928
929 m_taintVelocity = PhysicsVector.Zero; 929 m_taintVelocity = PhysicsVector.Zero;
930 } 930 }
931 public void changeadd(float timestep) 931 public void changeadd(float timestep)
932 { 932 {
933 933
934 934
935 935
936 int[] iprimspaceArrItem = _parent_scene.calculateSpaceArrayItemFromPos(_position); 936 int[] iprimspaceArrItem = _parent_scene.calculateSpaceArrayItemFromPos(_position);
937 IntPtr targetspace = _parent_scene.calculateSpaceForGeom(_position); 937 IntPtr targetspace = _parent_scene.calculateSpaceForGeom(_position);
938 938
@@ -941,7 +941,7 @@ namespace OpenSim.Region.Physics.OdePlugin
941 941
942 m_targetSpace = targetspace; 942 m_targetSpace = targetspace;
943 943
944 944
945 945
946 if (_mesh != null) 946 if (_mesh != null)
947 { 947 {
@@ -1010,7 +1010,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1010 { 1010 {
1011 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); 1011 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object");
1012 ode.dunlock(_parent_scene.world); 1012 ode.dunlock(_parent_scene.world);
1013 return; 1013 return;
1014 } 1014 }
1015 } 1015 }
1016 } 1016 }
@@ -1060,7 +1060,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1060 1060
1061 1061
1062 } 1062 }
1063 1063
1064 _parent_scene.geom_name_map[prim_geom] = this.m_primName; 1064 _parent_scene.geom_name_map[prim_geom] = this.m_primName;
1065 _parent_scene.actor_name_map[prim_geom] = (PhysicsActor)this; 1065 _parent_scene.actor_name_map[prim_geom] = (PhysicsActor)this;
1066 1066
@@ -1072,7 +1072,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1072 } 1072 }
1073 public void changemove(float timestep) 1073 public void changemove(float timestep)
1074 { 1074 {
1075 1075
1076 1076
1077 1077
1078 if (m_isphysical) 1078 if (m_isphysical)
@@ -1080,7 +1080,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1080 // This is a fallback.. May no longer be necessary. 1080 // This is a fallback.. May no longer be necessary.
1081 if (Body == (IntPtr) 0) 1081 if (Body == (IntPtr) 0)
1082 enableBody(); 1082 enableBody();
1083 //Prim auto disable after 20 frames, 1083 //Prim auto disable after 20 frames,
1084 //if you move it, re-enable the prim manually. 1084 //if you move it, re-enable the prim manually.
1085 if (_parent != null) 1085 if (_parent != null)
1086 { 1086 {
@@ -1102,7 +1102,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1102 } 1102 }
1103 } 1103 }
1104 d.BodyEnable(Body); 1104 d.BodyEnable(Body);
1105 1105
1106 } 1106 }
1107 else 1107 else
1108 { 1108 {
@@ -1122,10 +1122,10 @@ namespace OpenSim.Region.Physics.OdePlugin
1122 d.SpaceAdd(m_targetSpace, prim_geom); 1122 d.SpaceAdd(m_targetSpace, prim_geom);
1123 } 1123 }
1124 } 1124 }
1125 1125
1126 1126
1127 changeSelectedStatus(timestep); 1127 changeSelectedStatus(timestep);
1128 1128
1129 resetCollisionAccounting(); 1129 resetCollisionAccounting();
1130 m_taintposition = _position; 1130 m_taintposition = _position;
1131 } 1131 }
@@ -1140,42 +1140,42 @@ namespace OpenSim.Region.Physics.OdePlugin
1140 { 1140 {
1141 float PID_D = 2200.0f; 1141 float PID_D = 2200.0f;
1142 //float PID_P = 900.0f; 1142 //float PID_P = 900.0f;
1143 1143
1144 1144
1145 float m_mass = CalculateMass(); 1145 float m_mass = CalculateMass();
1146 1146
1147 fz = 0f; 1147 fz = 0f;
1148 //m_log.Info(m_collisionFlags.ToString()); 1148 //m_log.Info(m_collisionFlags.ToString());
1149 1149
1150 1150
1151 1151
1152 1152
1153 if (m_buoyancy != 0) 1153 if (m_buoyancy != 0)
1154 { 1154 {
1155 1155
1156 if (m_buoyancy > 0) 1156 if (m_buoyancy > 0)
1157 { 1157 {
1158 fz = (((-1 * _parent_scene.gravityz) * m_buoyancy) * m_mass); 1158 fz = (((-1 * _parent_scene.gravityz) * m_buoyancy) * m_mass);
1159 1159
1160 //d.Vector3 l_velocity = d.BodyGetLinearVel(Body); 1160 //d.Vector3 l_velocity = d.BodyGetLinearVel(Body);
1161 //m_log.Info("Using Buoyancy: " + buoyancy + " G: " + (_parent_scene.gravityz * m_buoyancy) + "mass:" + m_mass + " Pos: " + Position.ToString()); 1161 //m_log.Info("Using Buoyancy: " + buoyancy + " G: " + (_parent_scene.gravityz * m_buoyancy) + "mass:" + m_mass + " Pos: " + Position.ToString());
1162 } 1162 }
1163 else 1163 else
1164 { 1164 {
1165 fz = (-1 * (((-1 * _parent_scene.gravityz) * (-1 * m_buoyancy)) * m_mass)); 1165 fz = (-1 * (((-1 * _parent_scene.gravityz) * (-1 * m_buoyancy)) * m_mass));
1166 } 1166 }
1167 1167
1168 1168
1169 } 1169 }
1170 1170
1171 if (m_usePID) 1171 if (m_usePID)
1172 { 1172 {
1173 // If we're using the PID controller, then we have no gravity 1173 // If we're using the PID controller, then we have no gravity
1174 fz = (-1 * _parent_scene.gravityz) * this.Mass; 1174 fz = (-1 * _parent_scene.gravityz) * this.Mass;
1175 1175
1176 // no lock; for now it's only called from within Simulate() 1176 // no lock; for now it's only called from within Simulate()
1177 1177
1178 // If the PID Controller isn't active then we set our force 1178 // If the PID Controller isn't active then we set our force
1179 // calculating base velocity to the current position 1179 // calculating base velocity to the current position
1180 if (Environment.OSVersion.Platform == PlatformID.Unix) 1180 if (Environment.OSVersion.Platform == PlatformID.Unix)
1181 { 1181 {
@@ -1189,7 +1189,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1189 } 1189 }
1190 PID_D = 35f; 1190 PID_D = 35f;
1191 1191
1192 1192
1193 //PID_P = 1.0f; 1193 //PID_P = 1.0f;
1194 float PID_G = 25; 1194 float PID_G = 25;
1195 1195
@@ -1197,7 +1197,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1197 { 1197 {
1198 PID_G = PID_G / m_PIDTau; 1198 PID_G = PID_G / m_PIDTau;
1199 } 1199 }
1200 1200
1201 1201
1202 if ((PID_G - m_PIDTau) <= 0) 1202 if ((PID_G - m_PIDTau) <= 0)
1203 { 1203 {
@@ -1205,15 +1205,15 @@ namespace OpenSim.Region.Physics.OdePlugin
1205 } 1205 }
1206 //PidStatus = true; 1206 //PidStatus = true;
1207 1207
1208 1208
1209 1209
1210 1210
1211 PhysicsVector vec = new PhysicsVector(); 1211 PhysicsVector vec = new PhysicsVector();
1212 d.Vector3 vel = d.BodyGetLinearVel(Body); 1212 d.Vector3 vel = d.BodyGetLinearVel(Body);
1213 1213
1214 1214
1215 d.Vector3 pos = d.BodyGetPosition(Body); 1215 d.Vector3 pos = d.BodyGetPosition(Body);
1216 _target_velocity = 1216 _target_velocity =
1217 new PhysicsVector( 1217 new PhysicsVector(
1218 (m_PIDTarget.X - pos.X) * ((PID_G - m_PIDTau) * timestep), 1218 (m_PIDTarget.X - pos.X) * ((PID_G - m_PIDTau) * timestep),
1219 (m_PIDTarget.Y - pos.Y) * ((PID_G - m_PIDTau) * timestep), 1219 (m_PIDTarget.Y - pos.Y) * ((PID_G - m_PIDTau) * timestep),
@@ -1222,18 +1222,18 @@ namespace OpenSim.Region.Physics.OdePlugin
1222 1222
1223 1223
1224 // if velocity is zero, use position control; otherwise, velocity control 1224 // if velocity is zero, use position control; otherwise, velocity control
1225 1225
1226 if (_target_velocity.IsIdentical(PhysicsVector.Zero,0.1f)) 1226 if (_target_velocity.IsIdentical(PhysicsVector.Zero,0.1f))
1227 { 1227 {
1228 // keep track of where we stopped. No more slippin' & slidin' 1228 // keep track of where we stopped. No more slippin' & slidin'
1229 1229
1230 1230
1231 // We only want to deactivate the PID Controller if we think we want to have our surrogate 1231 // We only want to deactivate the PID Controller if we think we want to have our surrogate
1232 // react to the physics scene by moving it's position. 1232 // react to the physics scene by moving it's position.
1233 // Avatar to Avatar collisions 1233 // Avatar to Avatar collisions
1234 // Prim to avatar collisions 1234 // Prim to avatar collisions
1235 1235
1236 1236
1237 //fx = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); 1237 //fx = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2);
1238 //fy = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y) * (PID_P * 2); 1238 //fy = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y) * (PID_P * 2);
1239 //fz = fz + (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P; 1239 //fz = fz + (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P;
@@ -1245,27 +1245,27 @@ namespace OpenSim.Region.Physics.OdePlugin
1245 } 1245 }
1246 else 1246 else
1247 { 1247 {
1248 1248
1249 _zeroFlag = false; 1249 _zeroFlag = false;
1250 1250
1251 // We're flying and colliding with something 1251 // We're flying and colliding with something
1252 fx = ((_target_velocity.X) - vel.X) * (PID_D); 1252 fx = ((_target_velocity.X) - vel.X) * (PID_D);
1253 fy = ((_target_velocity.Y) - vel.Y) * (PID_D); 1253 fy = ((_target_velocity.Y) - vel.Y) * (PID_D);
1254
1255 1254
1256 1255
1257 1256
1257
1258 // vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P; 1258 // vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P;
1259 1259
1260 fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass); 1260 fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass);
1261 } 1261 }
1262 1262
1263 } 1263 }
1264 1264
1265 fx *= m_mass; 1265 fx *= m_mass;
1266 fy *= m_mass; 1266 fy *= m_mass;
1267 //fz *= m_mass; 1267 //fz *= m_mass;
1268 1268
1269 //m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString()); 1269 //m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString());
1270 if (fx != 0 || fy != 0 || fz != 0) 1270 if (fx != 0 || fy != 0 || fz != 0)
1271 { 1271 {
@@ -1285,7 +1285,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1285 1285
1286 public void rotate(float timestep) 1286 public void rotate(float timestep)
1287 { 1287 {
1288 1288
1289 1289
1290 d.Quaternion myrot = new d.Quaternion(); 1290 d.Quaternion myrot = new d.Quaternion();
1291 myrot.W = _orientation.w; 1291 myrot.W = _orientation.w;
@@ -1299,7 +1299,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1299 if (!m_angularlock.IsIdentical(new PhysicsVector(1, 1, 1), 0)) 1299 if (!m_angularlock.IsIdentical(new PhysicsVector(1, 1, 1), 0))
1300 createAMotor(m_angularlock); 1300 createAMotor(m_angularlock);
1301 } 1301 }
1302 1302
1303 resetCollisionAccounting(); 1303 resetCollisionAccounting();
1304 m_taintrot = _orientation; 1304 m_taintrot = _orientation;
1305 } 1305 }
@@ -1313,21 +1313,21 @@ namespace OpenSim.Region.Physics.OdePlugin
1313 1313
1314 public void changedisable(float timestep) 1314 public void changedisable(float timestep)
1315 { 1315 {
1316 1316
1317 m_disabled = true; 1317 m_disabled = true;
1318 if (Body != (IntPtr)0) 1318 if (Body != (IntPtr)0)
1319 { 1319 {
1320 d.BodyDisable(Body); 1320 d.BodyDisable(Body);
1321 Body = (IntPtr)0; 1321 Body = (IntPtr)0;
1322 } 1322 }
1323 1323
1324 1324
1325 m_taintdisable = false; 1325 m_taintdisable = false;
1326 } 1326 }
1327 1327
1328 public void changePhysicsStatus(float timestep) 1328 public void changePhysicsStatus(float timestep)
1329 { 1329 {
1330 1330
1331 1331
1332 if (m_isphysical == true) 1332 if (m_isphysical == true)
1333 { 1333 {
@@ -1352,7 +1352,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1352 1352
1353 public void changesize(float timestamp) 1353 public void changesize(float timestamp)
1354 { 1354 {
1355 1355
1356 //if (!_parent_scene.geom_name_map.ContainsKey(prim_geom)) 1356 //if (!_parent_scene.geom_name_map.ContainsKey(prim_geom))
1357 //{ 1357 //{
1358 // m_taintsize = _size; 1358 // m_taintsize = _size;
@@ -1369,7 +1369,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1369 { 1369 {
1370 // Cleanup meshing here 1370 // Cleanup meshing here
1371 } 1371 }
1372 //kill body to rebuild 1372 //kill body to rebuild
1373 if (IsPhysical && Body != (IntPtr) 0) 1373 if (IsPhysical && Body != (IntPtr) 0)
1374 { 1374 {
1375 disableBody(); 1375 disableBody();
@@ -1531,7 +1531,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1531 { 1531 {
1532 m_collisionFlags |= CollisionCategories.Water; 1532 m_collisionFlags |= CollisionCategories.Water;
1533 } 1533 }
1534 else 1534 else
1535 { 1535 {
1536 m_collisionFlags &= ~CollisionCategories.Water; 1536 m_collisionFlags &= ~CollisionCategories.Water;
1537 } 1537 }
@@ -1541,7 +1541,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1541 1541
1542 public void changeshape(float timestamp) 1542 public void changeshape(float timestamp)
1543 { 1543 {
1544 1544
1545 string oldname = _parent_scene.geom_name_map[prim_geom]; 1545 string oldname = _parent_scene.geom_name_map[prim_geom];
1546 1546
1547 // Cleanup of old prim geometry and Bodies 1547 // Cleanup of old prim geometry and Bodies
@@ -1579,7 +1579,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1579 // Re creates body on size. 1579 // Re creates body on size.
1580 // EnableBody also does setMass() 1580 // EnableBody also does setMass()
1581 enableBody(); 1581 enableBody();
1582 1582
1583 } 1583 }
1584 } 1584 }
1585 else 1585 else
@@ -1684,7 +1684,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1684 d.BodyEnable(Body); 1684 d.BodyEnable(Body);
1685 } 1685 }
1686 } 1686 }
1687 1687
1688 1688
1689 _parent_scene.geom_name_map[prim_geom] = oldname; 1689 _parent_scene.geom_name_map[prim_geom] = oldname;
1690 1690
@@ -1698,7 +1698,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1698 { 1698 {
1699 if (!m_isSelected) 1699 if (!m_isSelected)
1700 { 1700 {
1701 1701
1702 1702
1703 1703
1704 lock (m_forcelist) 1704 lock (m_forcelist)
@@ -1728,7 +1728,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1728 { 1728 {
1729 if (!m_isSelected) 1729 if (!m_isSelected)
1730 { 1730 {
1731 1731
1732 1732
1733 Thread.Sleep(20); 1733 Thread.Sleep(20);
1734 if (IsPhysical) 1734 if (IsPhysical)
@@ -1737,8 +1737,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1737 { 1737 {
1738 d.BodySetLinearVel(Body, m_taintVelocity.X, m_taintVelocity.Y, m_taintVelocity.Z); 1738 d.BodySetLinearVel(Body, m_taintVelocity.X, m_taintVelocity.Y, m_taintVelocity.Z);
1739 } 1739 }
1740 } 1740 }
1741 1741
1742 //resetCollisionAccounting(); 1742 //resetCollisionAccounting();
1743 } 1743 }
1744 m_taintVelocity = PhysicsVector.Zero; 1744 m_taintVelocity = PhysicsVector.Zero;
@@ -1794,7 +1794,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1794 { 1794 {
1795 get { return _position; } 1795 get { return _position; }
1796 1796
1797 set { _position = value; 1797 set { _position = value;
1798 //m_log.Info("[PHYSICS]: " + _position.ToString()); 1798 //m_log.Info("[PHYSICS]: " + _position.ToString());
1799 } 1799 }
1800 } 1800 }
@@ -1838,7 +1838,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1838 { 1838 {
1839 get 1839 get
1840 { 1840 {
1841 // Averate previous velocity with the new one so 1841 // Averate previous velocity with the new one so
1842 // client object interpolation works a 'little' better 1842 // client object interpolation works a 'little' better
1843 PhysicsVector returnVelocity = new PhysicsVector(); 1843 PhysicsVector returnVelocity = new PhysicsVector();
1844 returnVelocity.X = (m_lastVelocity.X + _velocity.X)/2; 1844 returnVelocity.X = (m_lastVelocity.X + _velocity.X)/2;
@@ -1849,7 +1849,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1849 set 1849 set
1850 { 1850 {
1851 _velocity = value; 1851 _velocity = value;
1852 1852
1853 m_taintVelocity = value; 1853 m_taintVelocity = value;
1854 _parent_scene.AddPhysicsActorTaint(this); 1854 _parent_scene.AddPhysicsActorTaint(this);
1855 } 1855 }
@@ -1898,11 +1898,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1898 if (_zeroFlag) 1898 if (_zeroFlag)
1899 return pv; 1899 return pv;
1900 m_lastUpdateSent = false; 1900 m_lastUpdateSent = false;
1901 1901
1902 if (m_rotationalVelocity.IsIdentical(pv, 0.2f)) 1902 if (m_rotationalVelocity.IsIdentical(pv, 0.2f))
1903 return pv; 1903 return pv;
1904 1904
1905 return m_rotationalVelocity; 1905 return m_rotationalVelocity;
1906 } 1906 }
1907 set { m_rotationalVelocity = value; } 1907 set { m_rotationalVelocity = value; }
1908 } 1908 }
@@ -1948,7 +1948,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1948 } 1948 }
1949 1949
1950 public void UpdatePositionAndVelocity() 1950 public void UpdatePositionAndVelocity()
1951 { 1951 {
1952 // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! 1952 // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit!
1953 if (_parent != null) 1953 if (_parent != null)
1954 { 1954 {
@@ -1963,7 +1963,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1963 d.Quaternion ori = d.BodyGetQuaternion(Body); 1963 d.Quaternion ori = d.BodyGetQuaternion(Body);
1964 d.Vector3 vel = d.BodyGetLinearVel(Body); 1964 d.Vector3 vel = d.BodyGetLinearVel(Body);
1965 d.Vector3 rotvel = d.BodyGetAngularVel(Body); 1965 d.Vector3 rotvel = d.BodyGetAngularVel(Body);
1966 1966
1967 PhysicsVector l_position = new PhysicsVector(); 1967 PhysicsVector l_position = new PhysicsVector();
1968 1968
1969 // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) 1969 // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!)
@@ -2000,16 +2000,16 @@ namespace OpenSim.Region.Physics.OdePlugin
2000 2000
2001 if (l_position.Z < 0) 2001 if (l_position.Z < 0)
2002 { 2002 {
2003 // This is so prim that get lost underground don't fall forever and suck up 2003 // This is so prim that get lost underground don't fall forever and suck up
2004 // 2004 //
2005 // Sim resources and memory. 2005 // Sim resources and memory.
2006 // Disables the prim's movement physics.... 2006 // Disables the prim's movement physics....
2007 // It's a hack and will generate a console message if it fails. 2007 // It's a hack and will generate a console message if it fails.
2008 2008
2009 //IsPhysical = false; 2009 //IsPhysical = false;
2010 if (_parent == null) 2010 if (_parent == null)
2011 base.RaiseOutOfBounds(_position); 2011 base.RaiseOutOfBounds(_position);
2012 2012
2013 _acceleration.X = 0; 2013 _acceleration.X = 0;
2014 _acceleration.Y = 0; 2014 _acceleration.Y = 0;
2015 _acceleration.Z = 0; 2015 _acceleration.Z = 0;
@@ -2020,10 +2020,10 @@ namespace OpenSim.Region.Physics.OdePlugin
2020 m_rotationalVelocity.X = 0; 2020 m_rotationalVelocity.X = 0;
2021 m_rotationalVelocity.Y = 0; 2021 m_rotationalVelocity.Y = 0;
2022 m_rotationalVelocity.Z = 0; 2022 m_rotationalVelocity.Z = 0;
2023 2023
2024 if (_parent == null) 2024 if (_parent == null)
2025 base.RequestPhysicsterseUpdate(); 2025 base.RequestPhysicsterseUpdate();
2026 2026
2027 m_throttleUpdates = false; 2027 m_throttleUpdates = false;
2028 throttleCounter = 0; 2028 throttleCounter = 0;
2029 _zeroFlag = true; 2029 _zeroFlag = true;
@@ -2065,10 +2065,10 @@ namespace OpenSim.Region.Physics.OdePlugin
2065 m_throttleUpdates = false; 2065 m_throttleUpdates = false;
2066 throttleCounter = 0; 2066 throttleCounter = 0;
2067 m_rotationalVelocity = pv; 2067 m_rotationalVelocity = pv;
2068 2068
2069 if (_parent == null) 2069 if (_parent == null)
2070 base.RequestPhysicsterseUpdate(); 2070 base.RequestPhysicsterseUpdate();
2071 2071
2072 m_lastUpdateSent = true; 2072 m_lastUpdateSent = true;
2073 } 2073 }
2074 } 2074 }
@@ -2087,11 +2087,11 @@ namespace OpenSim.Region.Physics.OdePlugin
2087 _velocity.X = vel.X; 2087 _velocity.X = vel.X;
2088 _velocity.Y = vel.Y; 2088 _velocity.Y = vel.Y;
2089 _velocity.Z = vel.Z; 2089 _velocity.Z = vel.Z;
2090 2090
2091 _acceleration = ((_velocity - m_lastVelocity) / 0.1f); 2091 _acceleration = ((_velocity - m_lastVelocity) / 0.1f);
2092 _acceleration = new PhysicsVector(_velocity.X - m_lastVelocity.X / 0.1f, _velocity.Y - m_lastVelocity.Y / 0.1f, _velocity.Z - m_lastVelocity.Z / 0.1f); 2092 _acceleration = new PhysicsVector(_velocity.X - m_lastVelocity.X / 0.1f, _velocity.Y - m_lastVelocity.Y / 0.1f, _velocity.Z - m_lastVelocity.Z / 0.1f);
2093 //m_log.Info("[PHYSICS]: V1: " + _velocity + " V2: " + m_lastVelocity + " Acceleration: " + _acceleration.ToString()); 2093 //m_log.Info("[PHYSICS]: V1: " + _velocity + " V2: " + m_lastVelocity + " Acceleration: " + _acceleration.ToString());
2094 2094
2095 if (_velocity.IsIdentical(pv, 0.5f)) 2095 if (_velocity.IsIdentical(pv, 0.5f))
2096 { 2096 {
2097 m_rotationalVelocity = pv; 2097 m_rotationalVelocity = pv;
@@ -2173,7 +2173,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2173 { 2173 {
2174 m_tensor = 5f; 2174 m_tensor = 5f;
2175 } 2175 }
2176 2176
2177 float axisnum = 3; 2177 float axisnum = 3;
2178 2178
2179 axisnum = (axisnum - (axis.X + axis.Y + axis.Z)); 2179 axisnum = (axisnum - (axis.X + axis.Y + axis.Z));
@@ -2222,7 +2222,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2222 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.000000000001f); 2222 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.000000000001f);
2223 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f); 2223 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f);
2224 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f); 2224 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f);
2225 2225
2226 d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); 2226 d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f);
2227 d.JointSetAMotorParam(Amotor, (int)dParam.FMax, m_tensor); 2227 d.JointSetAMotorParam(Amotor, (int)dParam.FMax, m_tensor);
2228 } 2228 }
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index d795e45..c663fb0 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -42,7 +42,7 @@ using OpenSim.Region.Physics.Manager;
42namespace OpenSim.Region.Physics.OdePlugin 42namespace OpenSim.Region.Physics.OdePlugin
43{ 43{
44 /// <summary> 44 /// <summary>
45 /// ODE plugin 45 /// ODE plugin
46 /// </summary> 46 /// </summary>
47 public class OdePlugin : IPhysicsPlugin 47 public class OdePlugin : IPhysicsPlugin
48 { 48 {
@@ -51,7 +51,6 @@ namespace OpenSim.Region.Physics.OdePlugin
51 private CollisionLocker ode; 51 private CollisionLocker ode;
52 private OdeScene _mScene; 52 private OdeScene _mScene;
53 53
54
55 public OdePlugin() 54 public OdePlugin()
56 { 55 {
57 ode = new CollisionLocker(); 56 ode = new CollisionLocker();
@@ -81,15 +80,13 @@ namespace OpenSim.Region.Physics.OdePlugin
81 } 80 }
82 } 81 }
83 82
84 83 public enum StatusIndicators : int
85 public enum StatusIndicators : int
86 { 84 {
87 Generic = 0, 85 Generic = 0,
88 Start = 1, 86 Start = 1,
89 End = 2 87 End = 2
90 } 88 }
91 89
92
93 public struct sCollisionData 90 public struct sCollisionData
94 { 91 {
95 public uint ColliderLocalId; 92 public uint ColliderLocalId;
@@ -165,7 +162,6 @@ namespace OpenSim.Region.Physics.OdePlugin
165 private float mAvatarObjectContactFriction = 75f; 162 private float mAvatarObjectContactFriction = 75f;
166 private float mAvatarObjectContactBounce = 0.1f; 163 private float mAvatarObjectContactBounce = 0.1f;
167 164
168
169 private float avPIDD = 3200f; 165 private float avPIDD = 3200f;
170 private float avPIDP = 1400f; 166 private float avPIDP = 1400f;
171 private float avCapRadius = 0.37f; 167 private float avCapRadius = 0.37f;
@@ -175,13 +171,12 @@ namespace OpenSim.Region.Physics.OdePlugin
175 private float avMovementDivisorWalk = 1.3f; 171 private float avMovementDivisorWalk = 1.3f;
176 private float avMovementDivisorRun = 0.8f; 172 private float avMovementDivisorRun = 0.8f;
177 173
178
179 private float[] _heightmap; 174 private float[] _heightmap;
180 175
181 private float[] _watermap; 176 private float[] _watermap;
182 177
183 private float[] _origheightmap; 178 private float[] _origheightmap;
184 179
185 private d.NearCallback nearCallback; 180 private d.NearCallback nearCallback;
186 public d.TriCallback triCallback; 181 public d.TriCallback triCallback;
187 public d.TriArrayCallback triArrayCallback; 182 public d.TriArrayCallback triArrayCallback;
@@ -200,7 +195,6 @@ namespace OpenSim.Region.Physics.OdePlugin
200 private d.Contact AvatarMovementTerrainContact; 195 private d.Contact AvatarMovementTerrainContact;
201 private d.Contact WaterContact; 196 private d.Contact WaterContact;
202 197
203
204//Ckrinke: Comment out until used. We declare it, initialize it, but do not use it 198//Ckrinke: Comment out until used. We declare it, initialize it, but do not use it
205//Ckrinke private int m_randomizeWater = 200; 199//Ckrinke private int m_randomizeWater = 200;
206 private int m_physicsiterations = 10; 200 private int m_physicsiterations = 10;
@@ -233,7 +227,6 @@ namespace OpenSim.Region.Physics.OdePlugin
233 227
234 private IConfigSource m_config; 228 private IConfigSource m_config;
235 229
236
237 /// <summary> 230 /// <summary>
238 /// Initiailizes the scene 231 /// Initiailizes the scene
239 /// Sets many properties that ODE requires to be stable 232 /// Sets many properties that ODE requires to be stable
@@ -245,44 +238,34 @@ namespace OpenSim.Region.Physics.OdePlugin
245 nearCallback = near; 238 nearCallback = near;
246 triCallback = TriCallback; 239 triCallback = TriCallback;
247 triArrayCallback = TriArrayCallback; 240 triArrayCallback = TriArrayCallback;
248
249
250
251 241
252 lock (OdeLock) 242 lock (OdeLock)
253 { 243 {
254 244 // Create the world and the first space
255 // Creat the world and the first space
256 world = d.WorldCreate(); 245 world = d.WorldCreate();
257 space = d.HashSpaceCreate(IntPtr.Zero); 246 space = d.HashSpaceCreate(IntPtr.Zero);
258 247
259 contactgroup = d.JointGroupCreate(0); 248 contactgroup = d.JointGroupCreate(0);
260 //contactgroup 249 //contactgroup
261 250
262
263
264
265 d.WorldSetAutoDisableFlag(world, false); 251 d.WorldSetAutoDisableFlag(world, false);
266
267 } 252 }
268 253
269 // zero out a heightmap array float array (single dimention [flattened])) 254 // zero out a heightmap array float array (single dimention [flattened]))
270 _heightmap = new float[514*514]; 255 _heightmap = new float[514*514];
271 _watermap = new float[258 * 258]; 256 _watermap = new float[258 * 258];
272 257
273 // Zero out the prim spaces array (we split our space into smaller spaces so 258 // Zero out the prim spaces array (we split our space into smaller spaces so
274 // we can hit test less. 259 // we can hit test less.
275
276 } 260 }
277 261
278
279 // Initialize the mesh plugin 262 // Initialize the mesh plugin
280 public override void Initialise(IMesher meshmerizer, IConfigSource config) 263 public override void Initialise(IMesher meshmerizer, IConfigSource config)
281 { 264 {
282 mesher = meshmerizer; 265 mesher = meshmerizer;
283 m_config = config; 266 m_config = config;
284 // Defaults 267 // Defaults
285 268
286 if (Environment.OSVersion.Platform == PlatformID.Unix) 269 if (Environment.OSVersion.Platform == PlatformID.Unix)
287 { 270 {
288 avPIDD = 3200.0f; 271 avPIDD = 3200.0f;
@@ -349,10 +332,7 @@ namespace OpenSim.Region.Physics.OdePlugin
349 avPIDP = physicsconfig.GetFloat("av_pid_proportional_win", 900.0f); 332 avPIDP = physicsconfig.GetFloat("av_pid_proportional_win", 900.0f);
350 avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_win", 550000f); 333 avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_win", 550000f);
351 } 334 }
352
353
354 } 335 }
355
356 } 336 }
357 337
358 staticPrimspace = new IntPtr[(int)(300 / metersInSpace), (int)(300 / metersInSpace)]; 338 staticPrimspace = new IntPtr[(int)(300 / metersInSpace), (int)(300 / metersInSpace)];
@@ -361,8 +341,8 @@ namespace OpenSim.Region.Physics.OdePlugin
361 contact.surface.mu = nmAvatarObjectContactFriction; 341 contact.surface.mu = nmAvatarObjectContactFriction;
362 contact.surface.bounce = nmAvatarObjectContactBounce; 342 contact.surface.bounce = nmAvatarObjectContactBounce;
363 343
364 // Terrain contact friction and Bounce 344 // Terrain contact friction and Bounce
365 // This is the *non* moving version. Use this when an avatar 345 // This is the *non* moving version. Use this when an avatar
366 // isn't moving to keep it in place better 346 // isn't moving to keep it in place better
367 TerrainContact.surface.mode |= d.ContactFlags.SoftERP; 347 TerrainContact.surface.mode |= d.ContactFlags.SoftERP;
368 TerrainContact.surface.mu = nmTerrainContactFriction; 348 TerrainContact.surface.mu = nmTerrainContactFriction;
@@ -376,7 +356,7 @@ namespace OpenSim.Region.Physics.OdePlugin
376 WaterContact.surface.soft_erp = 0.010f; 356 WaterContact.surface.soft_erp = 0.010f;
377 357
378 // Prim contact friction and bounce 358 // Prim contact friction and bounce
379 // THis is the *non* moving version of friction and bounce 359 // THis is the *non* moving version of friction and bounce
380 // Use this when an avatar comes in contact with a prim 360 // Use this when an avatar comes in contact with a prim
381 // and is moving 361 // and is moving
382 AvatarMovementprimContact.surface.mu = mAvatarObjectContactFriction; 362 AvatarMovementprimContact.surface.mu = mAvatarObjectContactFriction;
@@ -409,7 +389,6 @@ namespace OpenSim.Region.Physics.OdePlugin
409 staticPrimspace[i, j] = IntPtr.Zero; 389 staticPrimspace[i, j] = IntPtr.Zero;
410 } 390 }
411 } 391 }
412
413 } 392 }
414 393
415 internal void waitForSpaceUnlock(IntPtr space) 394 internal void waitForSpaceUnlock(IntPtr space)
@@ -439,17 +418,17 @@ namespace OpenSim.Region.Physics.OdePlugin
439 private void near(IntPtr space, IntPtr g1, IntPtr g2) 418 private void near(IntPtr space, IntPtr g1, IntPtr g2)
440 { 419 {
441 // no lock here! It's invoked from within Simulate(), which is thread-locked 420 // no lock here! It's invoked from within Simulate(), which is thread-locked
442 421
443 // Test if we're collidng a geom with a space. 422 // Test if we're colliding a geom with a space.
444 // If so we have to drill down into the space recursively 423 // If so we have to drill down into the space recursively
445 424
446 if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2)) 425 if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2))
447 { 426 {
448 if (g1 == (IntPtr)0 || g2 == (IntPtr)0) 427 if (g1 == (IntPtr)0 || g2 == (IntPtr)0)
449 return; 428 return;
450 // Separating static prim geometry spaces. 429 // Separating static prim geometry spaces.
451 // We'll be calling near recursivly if one 430 // We'll be calling near recursivly if one
452 // of them is a space to find all of the 431 // of them is a space to find all of the
453 // contact points in the space 432 // contact points in the space
454 try 433 try
455 { 434 {
@@ -462,13 +441,12 @@ namespace OpenSim.Region.Physics.OdePlugin
462 } 441 }
463 //Colliding a space or a geom with a space or a geom. so drill down 442 //Colliding a space or a geom with a space or a geom. so drill down
464 443
465 //Collide all geoms in each space.. 444 //Collide all geoms in each space..
466 //if (d.GeomIsSpace(g1)) d.SpaceCollide(g1, IntPtr.Zero, nearCallback); 445 //if (d.GeomIsSpace(g1)) d.SpaceCollide(g1, IntPtr.Zero, nearCallback);
467 //if (d.GeomIsSpace(g2)) d.SpaceCollide(g2, IntPtr.Zero, nearCallback); 446 //if (d.GeomIsSpace(g2)) d.SpaceCollide(g2, IntPtr.Zero, nearCallback);
468 return; 447 return;
469 } 448 }
470 449
471
472 if (g1 == (IntPtr)0 || g2 == (IntPtr)0) 450 if (g1 == (IntPtr)0 || g2 == (IntPtr)0)
473 return; 451 return;
474 452
@@ -499,23 +477,17 @@ namespace OpenSim.Region.Physics.OdePlugin
499 int count = 0; 477 int count = 0;
500 try 478 try
501 { 479 {
502
503 // Colliding Geom To Geom 480 // Colliding Geom To Geom
504 // This portion of the function 'was' blatantly ripped off from BoxStack.cs 481 // This portion of the function 'was' blatantly ripped off from BoxStack.cs
505
506
507
508 482
509 if (g1 == g2) 483 if (g1 == g2)
510 return; // Can't collide with yourself 484 return; // Can't collide with yourself
511 485
512 if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact)) 486 if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact))
513 return; 487 return;
514 488
515 lock (contacts) 489 lock (contacts)
516 { 490 {
517
518
519 count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.SizeOf); 491 count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.SizeOf);
520 } 492 }
521 } 493 }
@@ -527,7 +499,7 @@ namespace OpenSim.Region.Physics.OdePlugin
527 } 499 }
528 catch (AccessViolationException) 500 catch (AccessViolationException)
529 { 501 {
530 502
531 m_log.Warn("[PHYSICS]: Unable to collide test an object"); 503 m_log.Warn("[PHYSICS]: Unable to collide test an object");
532 return; 504 return;
533 } 505 }
@@ -539,6 +511,7 @@ namespace OpenSim.Region.Physics.OdePlugin
539 { 511 {
540 p1 = PANull; 512 p1 = PANull;
541 } 513 }
514
542 if (!actor_name_map.TryGetValue(g2, out p2)) 515 if (!actor_name_map.TryGetValue(g2, out p2))
543 { 516 {
544 p2 = PANull; 517 p2 = PANull;
@@ -554,14 +527,10 @@ namespace OpenSim.Region.Physics.OdePlugin
554 // If we're colliding with terrain, use 'TerrainContact' instead of contact. 527 // If we're colliding with terrain, use 'TerrainContact' instead of contact.
555 // allows us to have different settings 528 // allows us to have different settings
556 529
557
558
559 // We only need to test p2 for 'jump crouch purposes' 530 // We only need to test p2 for 'jump crouch purposes'
560 p2.IsColliding = true; 531 p2.IsColliding = true;
561 532
562 //if ((framecount % m_returncollisions) == 0) 533 //if ((framecount % m_returncollisions) == 0)
563
564
565 534
566 switch (p1.PhysicsActorType) 535 switch (p1.PhysicsActorType)
567 { 536 {
@@ -588,41 +557,39 @@ namespace OpenSim.Region.Physics.OdePlugin
588 { 557 {
589 //This is disabled at the moment only because it needs more tweaking 558 //This is disabled at the moment only because it needs more tweaking
590 //It will eventually be uncommented 559 //It will eventually be uncommented
591 560
592 if (contacts[i].depth >= 1.00f) 561 if (contacts[i].depth >= 1.00f)
593 { 562 {
594 //m_log.Debug("[PHYSICS]: " + contacts[i].depth.ToString()); 563 //m_log.Debug("[PHYSICS]: " + contacts[i].depth.ToString());
595 } 564 }
596 565
597 //If you interpenetrate a prim with an agent 566 //If you interpenetrate a prim with an agent
598 if ((p2.PhysicsActorType == (int) ActorTypes.Agent && 567 if ((p2.PhysicsActorType == (int) ActorTypes.Agent &&
599 p1.PhysicsActorType == (int) ActorTypes.Prim) || 568 p1.PhysicsActorType == (int) ActorTypes.Prim) ||
600 (p1.PhysicsActorType == (int) ActorTypes.Agent && 569 (p1.PhysicsActorType == (int) ActorTypes.Agent &&
601 p2.PhysicsActorType == (int) ActorTypes.Prim)) 570 p2.PhysicsActorType == (int) ActorTypes.Prim))
602 { 571 {
603
604
605 # region disabled code1 572 # region disabled code1
606 //contacts[i].depth = contacts[i].depth * 4.15f; 573 //contacts[i].depth = contacts[i].depth * 4.15f;
607 /* 574 /*
608 if (p2.PhysicsActorType == (int) ActorTypes.Agent) 575 if (p2.PhysicsActorType == (int) ActorTypes.Agent)
609 { 576 {
610 p2.CollidingObj = true; 577 p2.CollidingObj = true;
611 contacts[i].depth = 0.003f; 578 contacts[i].depth = 0.003f;
612 p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 2.5f); 579 p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 2.5f);
613 OdeCharacter character = (OdeCharacter) p2; 580 OdeCharacter character = (OdeCharacter) p2;
614 character.SetPidStatus(true); 581 character.SetPidStatus(true);
615 contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p1.Size.X / 2), contacts[i].pos.Y + (p1.Size.Y / 2), contacts[i].pos.Z + (p1.Size.Z / 2)); 582 contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p1.Size.X / 2), contacts[i].pos.Y + (p1.Size.Y / 2), contacts[i].pos.Z + (p1.Size.Z / 2));
616 583
617 } 584 }
618 else 585 else
619 { 586 {
620 587
621 //contacts[i].depth = 0.0000000f; 588 //contacts[i].depth = 0.0000000f;
622 } 589 }
623 if (p1.PhysicsActorType == (int) ActorTypes.Agent) 590 if (p1.PhysicsActorType == (int) ActorTypes.Agent)
624 { 591 {
625 592
626 p1.CollidingObj = true; 593 p1.CollidingObj = true;
627 contacts[i].depth = 0.003f; 594 contacts[i].depth = 0.003f;
628 p1.Velocity = p1.Velocity + new PhysicsVector(0, 0, 2.5f); 595 p1.Velocity = p1.Velocity + new PhysicsVector(0, 0, 2.5f);
@@ -632,14 +599,12 @@ namespace OpenSim.Region.Physics.OdePlugin
632 } 599 }
633 else 600 else
634 { 601 {
635 602
636 //contacts[i].depth = 0.0000000f; 603 //contacts[i].depth = 0.0000000f;
637 } 604 }
638 */ 605 */
639 #endregion 606 #endregion
640
641 } 607 }
642
643 608
644 // If you interpenetrate a prim with another prim 609 // If you interpenetrate a prim with another prim
645 if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim) 610 if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim)
@@ -649,7 +614,6 @@ namespace OpenSim.Region.Physics.OdePlugin
649 //OdePrim op2 = (OdePrim)p2; 614 //OdePrim op2 = (OdePrim)p2;
650 //op1.m_collisionscore++; 615 //op1.m_collisionscore++;
651 //op2.m_collisionscore++; 616 //op2.m_collisionscore++;
652
653 617
654 //if (op1.m_collisionscore > 8000 || op2.m_collisionscore > 8000) 618 //if (op1.m_collisionscore > 8000 || op2.m_collisionscore > 8000)
655 //{ 619 //{
@@ -658,11 +622,10 @@ namespace OpenSim.Region.Physics.OdePlugin
658 //op2.m_taintdisable = true; 622 //op2.m_taintdisable = true;
659 //AddPhysicsActorTaint(p2); 623 //AddPhysicsActorTaint(p2);
660 //} 624 //}
661 625
662 //if (contacts[i].depth >= 0.25f) 626 //if (contacts[i].depth >= 0.25f)
663 //{ 627 //{
664 // Don't collide, one or both prim will expld. 628 // Don't collide, one or both prim will expld.
665
666 629
667 //op1.m_interpenetrationcount++; 630 //op1.m_interpenetrationcount++;
668 //op2.m_interpenetrationcount++; 631 //op2.m_interpenetrationcount++;
@@ -678,17 +641,17 @@ namespace OpenSim.Region.Physics.OdePlugin
678 //AddPhysicsActorTaint(p2); 641 //AddPhysicsActorTaint(p2);
679 //} 642 //}
680 643
681
682 //contacts[i].depth = contacts[i].depth / 8f; 644 //contacts[i].depth = contacts[i].depth / 8f;
683 //contacts[i].normal = new d.Vector3(0, 0, 1); 645 //contacts[i].normal = new d.Vector3(0, 0, 1);
684 //} 646 //}
685 //if (op1.m_disabled || op2.m_disabled) 647 //if (op1.m_disabled || op2.m_disabled)
686 //{ 648 //{
687 //Manually disabled objects stay disabled 649 //Manually disabled objects stay disabled
688 //contacts[i].depth = 0f; 650 //contacts[i].depth = 0f;
689 //} 651 //}
690 #endregion 652 #endregion
691 } 653 }
654
692 if (contacts[i].depth >= 1.00f) 655 if (contacts[i].depth >= 1.00f)
693 { 656 {
694 //m_log.Info("[P]: " + contacts[i].depth.ToString()); 657 //m_log.Info("[P]: " + contacts[i].depth.ToString());
@@ -713,6 +676,7 @@ namespace OpenSim.Region.Physics.OdePlugin
713 else 676 else
714 { 677 {
715 } 678 }
679
716 if (p1.PhysicsActorType == (int) ActorTypes.Agent) 680 if (p1.PhysicsActorType == (int) ActorTypes.Agent)
717 { 681 {
718 OdeCharacter character = (OdeCharacter)p1; 682 OdeCharacter character = (OdeCharacter)p1;
@@ -738,7 +702,7 @@ namespace OpenSim.Region.Physics.OdePlugin
738 702
739 if (contacts[i].depth >= 0f) 703 if (contacts[i].depth >= 0f)
740 { 704 {
741 // If we're collidng against terrain 705 // If we're colliding against terrain
742 if (name1 == "Terrain" || name2 == "Terrain") 706 if (name1 == "Terrain" || name2 == "Terrain")
743 { 707 {
744 // If we're moving 708 // If we're moving
@@ -760,12 +724,11 @@ namespace OpenSim.Region.Physics.OdePlugin
760 { 724 {
761 if ((p2.PhysicsActorType == (int)ActorTypes.Prim)) 725 if ((p2.PhysicsActorType == (int)ActorTypes.Prim))
762 { 726 {
763
764 } 727 }
765 else 728 else
766 { 729 {
767
768 } 730 }
731
769 //WaterContact.surface.soft_cfm = 0.0000f; 732 //WaterContact.surface.soft_cfm = 0.0000f;
770 //WaterContact.surface.soft_erp = 0.00000f; 733 //WaterContact.surface.soft_erp = 0.00000f;
771 if (contacts[i].depth > 0.1f) 734 if (contacts[i].depth > 0.1f)
@@ -775,7 +738,7 @@ namespace OpenSim.Region.Physics.OdePlugin
775 //contacts[i].pos = new d.Vector3(0, 0, contacts[i].pos.Z - 5f); 738 //contacts[i].pos = new d.Vector3(0, 0, contacts[i].pos.Z - 5f);
776 } 739 }
777 WaterContact.geom = contacts[i]; 740 WaterContact.geom = contacts[i];
778 741
779 joint = d.JointCreateContact(world, contactgroup, ref WaterContact); 742 joint = d.JointCreateContact(world, contactgroup, ref WaterContact);
780 743
781 //m_log.Info("[PHYSICS]: Prim Water Contact" + contacts[i].depth); 744 //m_log.Info("[PHYSICS]: Prim Water Contact" + contacts[i].depth);
@@ -806,7 +769,7 @@ namespace OpenSim.Region.Physics.OdePlugin
806 { 769 {
807 // If there are more then 3 contact points, it's likely 770 // If there are more then 3 contact points, it's likely
808 // that we've got a pile of objects 771 // that we've got a pile of objects
809 // 772 //
810 // We don't want to send out hundreds of terse updates over and over again 773 // We don't want to send out hundreds of terse updates over and over again
811 // so lets throttle them and send them again after it's somewhat sorted out. 774 // so lets throttle them and send them again after it's somewhat sorted out.
812 p2.ThrottleUpdates = true; 775 p2.ThrottleUpdates = true;
@@ -814,7 +777,6 @@ namespace OpenSim.Region.Physics.OdePlugin
814 //System.Console.WriteLine(count.ToString()); 777 //System.Console.WriteLine(count.ToString());
815 //System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2); 778 //System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2);
816 } 779 }
817
818 } 780 }
819 781
820 private void collision_accounting_events(PhysicsActor p1, PhysicsActor p2, float collisiondepth) 782 private void collision_accounting_events(PhysicsActor p1, PhysicsActor p2, float collisiondepth)
@@ -831,7 +793,7 @@ namespace OpenSim.Region.Physics.OdePlugin
831 { 793 {
832 case ActorTypes.Agent: 794 case ActorTypes.Agent:
833 cc2 = (OdeCharacter)p2; 795 cc2 = (OdeCharacter)p2;
834 796
835 obj1LocalID = cc2.m_localID; 797 obj1LocalID = cc2.m_localID;
836 switch ((ActorTypes)p1.PhysicsActorType) 798 switch ((ActorTypes)p1.PhysicsActorType)
837 { 799 {
@@ -840,7 +802,7 @@ namespace OpenSim.Region.Physics.OdePlugin
840 obj2LocalID = cc1.m_localID; 802 obj2LocalID = cc1.m_localID;
841 cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); 803 cc1.AddCollisionEvent(cc2.m_localID, collisiondepth);
842 //ctype = (int)CollisionCategories.Character; 804 //ctype = (int)CollisionCategories.Character;
843 805
844 //if (cc1.CollidingObj) 806 //if (cc1.CollidingObj)
845 //cStartStop = (int)StatusIndicators.Generic; 807 //cStartStop = (int)StatusIndicators.Generic;
846 //else 808 //else
@@ -858,7 +820,7 @@ namespace OpenSim.Region.Physics.OdePlugin
858 //cStartStop = (int)StatusIndicators.Generic; 820 //cStartStop = (int)StatusIndicators.Generic;
859 //else 821 //else
860 //cStartStop = (int)StatusIndicators.Start; 822 //cStartStop = (int)StatusIndicators.Start;
861 823
862 //returncollisions = true; 824 //returncollisions = true;
863 break; 825 break;
864 826
@@ -869,14 +831,12 @@ namespace OpenSim.Region.Physics.OdePlugin
869 //returncollisions = true; 831 //returncollisions = true;
870 break; 832 break;
871 } 833 }
872
873 834
874
875 cc2.AddCollisionEvent(obj2LocalID, collisiondepth); 835 cc2.AddCollisionEvent(obj2LocalID, collisiondepth);
876 break; 836 break;
877 case ActorTypes.Prim: 837 case ActorTypes.Prim:
878 cp2 = (OdePrim)p2; 838 cp2 = (OdePrim)p2;
879 839
880 obj1LocalID = cp2.m_localID; 840 obj1LocalID = cp2.m_localID;
881 switch ((ActorTypes)p1.PhysicsActorType) 841 switch ((ActorTypes)p1.PhysicsActorType)
882 { 842 {
@@ -891,7 +851,7 @@ namespace OpenSim.Region.Physics.OdePlugin
891 //else 851 //else
892 //cStartStop = (int)StatusIndicators.Start; 852 //cStartStop = (int)StatusIndicators.Start;
893 //returncollisions = true; 853 //returncollisions = true;
894 854
895 break; 855 break;
896 case ActorTypes.Prim: 856 case ActorTypes.Prim:
897 cp1 = (OdePrim)p1; 857 cp1 = (OdePrim)p1;
@@ -903,7 +863,7 @@ namespace OpenSim.Region.Physics.OdePlugin
903 //cStartStop = (int)StatusIndicators.Generic; 863 //cStartStop = (int)StatusIndicators.Generic;
904 //else 864 //else
905 //cStartStop = (int)StatusIndicators.Start; 865 //cStartStop = (int)StatusIndicators.Start;
906 866
907 //returncollisions = true; 867 //returncollisions = true;
908 break; 868 break;
909 869
@@ -911,11 +871,11 @@ namespace OpenSim.Region.Physics.OdePlugin
911 case ActorTypes.Unknown: 871 case ActorTypes.Unknown:
912 obj2LocalID = 0; 872 obj2LocalID = 0;
913 //ctype = (int)CollisionCategories.Land; 873 //ctype = (int)CollisionCategories.Land;
914 874
915 //returncollisions = true; 875 //returncollisions = true;
916 break; 876 break;
917 } 877 }
918 878
919 cp2.AddCollisionEvent(obj2LocalID, collisiondepth); 879 cp2.AddCollisionEvent(obj2LocalID, collisiondepth);
920 break; 880 break;
921 } 881 }
@@ -999,7 +959,7 @@ namespace OpenSim.Region.Physics.OdePlugin
999 /// <param name="timeStep"></param> 959 /// <param name="timeStep"></param>
1000 private void collision_optimized(float timeStep) 960 private void collision_optimized(float timeStep)
1001 { 961 {
1002 962
1003 foreach (OdeCharacter chr in _characters) 963 foreach (OdeCharacter chr in _characters)
1004 { 964 {
1005 // Reset the collision values to false 965 // Reset the collision values to false
@@ -1008,7 +968,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1008 chr.IsColliding = false; 968 chr.IsColliding = false;
1009 chr.CollidingGround = false; 969 chr.CollidingGround = false;
1010 chr.CollidingObj = false; 970 chr.CollidingObj = false;
1011 971
1012 // test the avatar's geometry for collision with the space 972 // test the avatar's geometry for collision with the space
1013 // This will return near and the space that they are the closest to 973 // This will return near and the space that they are the closest to
1014 // And we'll run this again against the avatar and the space segment 974 // And we'll run this again against the avatar and the space segment
@@ -1029,15 +989,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1029 //forcedZ = true; 989 //forcedZ = true;
1030 //} 990 //}
1031 } 991 }
1032
1033 992
1034
1035 lock (_activeprims) 993 lock (_activeprims)
1036 { 994 {
1037
1038 foreach (OdePrim chr in _activeprims) 995 foreach (OdePrim chr in _activeprims)
1039 { 996 {
1040
1041 if (d.BodyIsEnabled(chr.Body) && (!chr.m_disabled)) 997 if (d.BodyIsEnabled(chr.Body) && (!chr.m_disabled))
1042 { 998 {
1043 try 999 try
@@ -1049,18 +1005,14 @@ namespace OpenSim.Region.Physics.OdePlugin
1049 else 1005 else
1050 m_log.Debug("[PHYSICS]: unable to collide test active prim against space. The space was zero, the geom was zero or it was in the process of being removed"); 1006 m_log.Debug("[PHYSICS]: unable to collide test active prim against space. The space was zero, the geom was zero or it was in the process of being removed");
1051 } 1007 }
1052
1053 } 1008 }
1054 catch (AccessViolationException) 1009 catch (AccessViolationException)
1055 { 1010 {
1056 m_log.Warn("[PHYSICS]: Unable to space collide"); 1011 m_log.Warn("[PHYSICS]: Unable to space collide");
1057 } 1012 }
1058
1059 } 1013 }
1060
1061 } 1014 }
1062 } 1015 }
1063
1064 } 1016 }
1065 1017
1066 #endregion 1018 #endregion
@@ -1077,7 +1029,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1077 { 1029 {
1078 if (!_collisionEventPrim.Contains(obj)) 1030 if (!_collisionEventPrim.Contains(obj))
1079 _collisionEventPrim.Add(obj); 1031 _collisionEventPrim.Add(obj);
1080
1081 } 1032 }
1082 } 1033 }
1083 1034
@@ -1090,7 +1041,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1090 } 1041 }
1091 } 1042 }
1092 1043
1093
1094 #region Add/Remove Entities 1044 #region Add/Remove Entities
1095 1045
1096 public override PhysicsActor AddAvatar(string avName, PhysicsVector position, PhysicsVector size) 1046 public override PhysicsActor AddAvatar(string avName, PhysicsVector position, PhysicsVector size)
@@ -1131,8 +1081,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1131 rot.y = rotation.y; 1081 rot.y = rotation.y;
1132 rot.z = rotation.z; 1082 rot.z = rotation.z;
1133 1083
1134
1135
1136 OdePrim newPrim; 1084 OdePrim newPrim;
1137 lock (OdeLock) 1085 lock (OdeLock)
1138 { 1086 {
@@ -1141,7 +1089,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1141 _prims.Add(newPrim); 1089 _prims.Add(newPrim);
1142 } 1090 }
1143 1091
1144
1145 return newPrim; 1092 return newPrim;
1146 } 1093 }
1147 1094
@@ -1178,11 +1125,9 @@ namespace OpenSim.Region.Physics.OdePlugin
1178 1125
1179 result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical); 1126 result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical);
1180 1127
1181
1182 return result; 1128 return result;
1183 } 1129 }
1184 1130
1185
1186 public void remActivePrim(OdePrim deactivatePrim) 1131 public void remActivePrim(OdePrim deactivatePrim)
1187 { 1132 {
1188 lock (_activeprims) 1133 lock (_activeprims)
@@ -1210,8 +1155,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1210 /// This is called from within simulate but outside the locked portion 1155 /// This is called from within simulate but outside the locked portion
1211 /// We need to do our own locking here 1156 /// We need to do our own locking here
1212 /// Essentially, we need to remove the prim from our space segment, whatever segment it's in. 1157 /// Essentially, we need to remove the prim from our space segment, whatever segment it's in.
1213 /// 1158 ///
1214 /// If there are no more prim in the segment, we need to empty (spacedestroy)the segment and reclaim memory 1159 /// If there are no more prim in the segment, we need to empty (spacedestroy)the segment and reclaim memory
1215 /// that the space was using. 1160 /// that the space was using.
1216 /// </summary> 1161 /// </summary>
1217 /// <param name="prim"></param> 1162 /// <param name="prim"></param>
@@ -1226,7 +1171,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1226 { 1171 {
1227 prim.ResetTaints(); 1172 prim.ResetTaints();
1228 1173
1229
1230 if (prim.IsPhysical) 1174 if (prim.IsPhysical)
1231 { 1175 {
1232 prim.disableBody(); 1176 prim.disableBody();
@@ -1267,7 +1211,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1267 { 1211 {
1268 m_log.Warn("[PHYSICS]: Unable to remove prim from physics scene"); 1212 m_log.Warn("[PHYSICS]: Unable to remove prim from physics scene");
1269 } 1213 }
1270
1271 } 1214 }
1272 catch (AccessViolationException) 1215 catch (AccessViolationException)
1273 { 1216 {
@@ -1297,8 +1240,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1297 //} 1240 //}
1298 //} 1241 //}
1299 } 1242 }
1300
1301
1302 } 1243 }
1303 } 1244 }
1304 } 1245 }
@@ -1337,12 +1278,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1337 /// <returns>a pointer to the new space it's in</returns> 1278 /// <returns>a pointer to the new space it's in</returns>
1338 public IntPtr recalculateSpaceForGeom(IntPtr geom, PhysicsVector pos, IntPtr currentspace) 1279 public IntPtr recalculateSpaceForGeom(IntPtr geom, PhysicsVector pos, IntPtr currentspace)
1339 { 1280 {
1340 1281 // Called from setting the Position and Size of an ODEPrim so
1341 // Called from setting the Position and Size of an ODEPrim so
1342 // it's already in locked space. 1282 // it's already in locked space.
1343 1283
1344 // we don't want to remove the main space 1284 // we don't want to remove the main space
1345 // we don't need to test physical here because this function should 1285 // we don't need to test physical here because this function should
1346 // never be called if the prim is physical(active) 1286 // never be called if the prim is physical(active)
1347 1287
1348 // All physical prim end up in the root space 1288 // All physical prim end up in the root space
@@ -1399,7 +1339,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1399 waitForSpaceUnlock(space); 1339 waitForSpaceUnlock(space);
1400 d.SpaceRemove(space, currentspace); 1340 d.SpaceRemove(space, currentspace);
1401 // free up memory used by the space. 1341 // free up memory used by the space.
1402 1342
1403 //d.SpaceDestroy(currentspace); 1343 //d.SpaceDestroy(currentspace);
1404 resetSpaceArrayItemToZero(currentspace); 1344 resetSpaceArrayItemToZero(currentspace);
1405 } 1345 }
@@ -1418,7 +1358,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1418 { 1358 {
1419 if (d.SpaceQuery(currentspace, geom)) 1359 if (d.SpaceQuery(currentspace, geom))
1420 { 1360 {
1421
1422 if (d.GeomIsSpace(currentspace)) 1361 if (d.GeomIsSpace(currentspace))
1423 { 1362 {
1424 waitForSpaceUnlock(currentspace); 1363 waitForSpaceUnlock(currentspace);
@@ -1453,8 +1392,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1453 } 1392 }
1454 } 1393 }
1455 1394
1456 // The routines in the Position and Size sections do the 'inserting' into the space, 1395 // The routines in the Position and Size sections do the 'inserting' into the space,
1457 // so all we have to do is make sure that the space that we're putting the prim into 1396 // so all we have to do is make sure that the space that we're putting the prim into
1458 // is in the 'main' space. 1397 // is in the 'main' space.
1459 int[] iprimspaceArrItem = calculateSpaceArrayItemFromPos(pos); 1398 int[] iprimspaceArrItem = calculateSpaceArrayItemFromPos(pos);
1460 IntPtr newspace = calculateSpaceForGeom(pos); 1399 IntPtr newspace = calculateSpaceForGeom(pos);
@@ -1492,11 +1431,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1492 public IntPtr calculateSpaceForGeom(PhysicsVector pos) 1431 public IntPtr calculateSpaceForGeom(PhysicsVector pos)
1493 { 1432 {
1494 IntPtr locationbasedspace =IntPtr.Zero; 1433 IntPtr locationbasedspace =IntPtr.Zero;
1495 1434
1496 int[] xyspace = calculateSpaceArrayItemFromPos(pos); 1435 int[] xyspace = calculateSpaceArrayItemFromPos(pos);
1497 //m_log.Info("[Physics]: Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString()); 1436 //m_log.Info("[Physics]: Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString());
1498 locationbasedspace = staticPrimspace[xyspace[0], xyspace[1]]; 1437 locationbasedspace = staticPrimspace[xyspace[0], xyspace[1]];
1499 1438
1500 //locationbasedspace = space; 1439 //locationbasedspace = space;
1501 return locationbasedspace; 1440 return locationbasedspace;
1502 } 1441 }
@@ -1523,13 +1462,10 @@ namespace OpenSim.Region.Physics.OdePlugin
1523 if (returnint[1] < 0) 1462 if (returnint[1] < 0)
1524 returnint[1] = 0; 1463 returnint[1] = 0;
1525 1464
1526
1527 return returnint; 1465 return returnint;
1528 } 1466 }
1529 #endregion
1530
1531
1532 1467
1468 #endregion
1533 1469
1534 /// <summary> 1470 /// <summary>
1535 /// Routine to figure out if we need to mesh this prim with our mesher 1471 /// Routine to figure out if we need to mesh this prim with our mesher
@@ -1564,7 +1500,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1564 return false; 1500 return false;
1565 } 1501 }
1566 1502
1567
1568 /// <summary> 1503 /// <summary>
1569 /// Called after our prim properties are set Scale, position etc. 1504 /// Called after our prim properties are set Scale, position etc.
1570 /// We use this event queue like method to keep changes to the physical scene occuring in the threadlocked mutex 1505 /// We use this event queue like method to keep changes to the physical scene occuring in the threadlocked mutex
@@ -1586,7 +1521,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1586 1521
1587 /// <summary> 1522 /// <summary>
1588 /// This is our main simulate loop 1523 /// This is our main simulate loop
1589 /// It's thread locked by a Mutex in the scene. 1524 /// It's thread locked by a Mutex in the scene.
1590 /// It holds Collisions, it instructs ODE to step through the physical reactions 1525 /// It holds Collisions, it instructs ODE to step through the physical reactions
1591 /// It moves the objects around in memory 1526 /// It moves the objects around in memory
1592 /// It calls the methods that report back to the object owners.. (scenepresence, SceneObjectGroup) 1527 /// It calls the methods that report back to the object owners.. (scenepresence, SceneObjectGroup)
@@ -1597,7 +1532,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1597 { 1532 {
1598 if (framecount >= int.MaxValue) 1533 if (framecount >= int.MaxValue)
1599 framecount = 0; 1534 framecount = 0;
1600 1535
1601 framecount++; 1536 framecount++;
1602 1537
1603 float fps = 0; 1538 float fps = 0;
@@ -1605,12 +1540,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1605 step_time += timeStep; 1540 step_time += timeStep;
1606 1541
1607 1542
1608 // If We're loaded down by something else, 1543 // If We're loaded down by something else,
1609 // or debugging with the Visual Studio project on pause 1544 // or debugging with the Visual Studio project on pause
1610 // skip a few frames to catch up gracefully. 1545 // skip a few frames to catch up gracefully.
1611 // without shooting the physicsactors all over the place 1546 // without shooting the physicsactors all over the place
1612 1547
1613
1614 if (step_time >= m_SkipFramesAtms) 1548 if (step_time >= m_SkipFramesAtms)
1615 { 1549 {
1616 // Instead of trying to catch up, it'll do 5 physics frames only 1550 // Instead of trying to catch up, it'll do 5 physics frames only
@@ -1623,7 +1557,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1623 } 1557 }
1624 lock (OdeLock) 1558 lock (OdeLock)
1625 { 1559 {
1626 // Process 10 frames if the sim is running normal.. 1560 // Process 10 frames if the sim is running normal..
1627 // process 5 frames if the sim is running slow 1561 // process 5 frames if the sim is running slow
1628 //try 1562 //try
1629 //{ 1563 //{
@@ -1642,13 +1576,13 @@ namespace OpenSim.Region.Physics.OdePlugin
1642 //(step_time == 0.004f, there's 250 of those per second. Times the step time/step size 1576 //(step_time == 0.004f, there's 250 of those per second. Times the step time/step size
1643 step_time = 0.09375f; 1577 step_time = 0.09375f;
1644 fps = (step_time/ODE_STEPSIZE) * 1000; 1578 fps = (step_time/ODE_STEPSIZE) * 1000;
1645 1579
1646 while (step_time > 0.0f) 1580 while (step_time > 0.0f)
1647 { 1581 {
1648 //lock (ode) 1582 //lock (ode)
1649 //{ 1583 //{
1650 //if (!ode.lockquery()) 1584 //if (!ode.lockquery())
1651 //{ 1585 //{
1652 // ode.dlock(world); 1586 // ode.dlock(world);
1653 try 1587 try
1654 { 1588 {
@@ -1661,9 +1595,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1661 } 1595 }
1662 } 1596 }
1663 1597
1664
1665 bool processedtaints = false; 1598 bool processedtaints = false;
1666 1599
1667 lock (_taintedPrim) 1600 lock (_taintedPrim)
1668 { 1601 {
1669 foreach (OdePrim prim in _taintedPrim) 1602 foreach (OdePrim prim in _taintedPrim)
@@ -1679,10 +1612,9 @@ namespace OpenSim.Region.Physics.OdePlugin
1679 processedtaints = true; 1612 processedtaints = true;
1680 prim.m_collisionscore = 0; 1613 prim.m_collisionscore = 0;
1681 } 1614 }
1682 1615
1683 if (processedtaints) 1616 if (processedtaints)
1684 _taintedPrim = new List<OdePrim>(); 1617 _taintedPrim = new List<OdePrim>();
1685
1686 } 1618 }
1687 1619
1688 lock (_activeprims) 1620 lock (_activeprims)
@@ -1696,7 +1628,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1696 1628
1697 //if ((framecount % m_randomizeWater) == 0) 1629 //if ((framecount % m_randomizeWater) == 0)
1698 // randomizeWater(waterlevel); 1630 // randomizeWater(waterlevel);
1699
1700 1631
1701 collision_optimized(timeStep); 1632 collision_optimized(timeStep);
1702 1633
@@ -1718,7 +1649,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1718 pobj.SendCollisions(); 1649 pobj.SendCollisions();
1719 break; 1650 break;
1720 } 1651 }
1721
1722 } 1652 }
1723 } 1653 }
1724 1654
@@ -1726,13 +1656,13 @@ namespace OpenSim.Region.Physics.OdePlugin
1726 1656
1727 d.JointGroupEmpty(contactgroup); 1657 d.JointGroupEmpty(contactgroup);
1728 //ode.dunlock(world); 1658 //ode.dunlock(world);
1729 } 1659 }
1730 catch (Exception e) 1660 catch (Exception e)
1731 { 1661 {
1732 m_log.Error("[PHYSICS]: " + e.Message.ToString() + e.TargetSite.ToString()); 1662 m_log.Error("[PHYSICS]: " + e.Message.ToString() + e.TargetSite.ToString());
1733 ode.dunlock(world); 1663 ode.dunlock(world);
1734 } 1664 }
1735 1665
1736 step_time -= ODE_STEPSIZE; 1666 step_time -= ODE_STEPSIZE;
1737 i++; 1667 i++;
1738 //} 1668 //}
@@ -1765,7 +1695,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1765 } 1695 }
1766 } 1696 }
1767 } 1697 }
1768
1769 } 1698 }
1770 return fps; 1699 return fps;
1771 } 1700 }
@@ -1780,7 +1709,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1780 get { return (false); } 1709 get { return (false); }
1781 } 1710 }
1782 1711
1783 #region ODE Specific Terrain Fixes 1712 #region ODE Specific Terrain Fixes
1784 public float[] ResizeTerrain512NearestNeighbour(float[] heightMap) 1713 public float[] ResizeTerrain512NearestNeighbour(float[] heightMap)
1785 { 1714 {
1786 float[] returnarr = new float[262144]; 1715 float[] returnarr = new float[262144];
@@ -1800,7 +1729,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1800 // This particular way is quick but it only works on a multiple of the original 1729 // This particular way is quick but it only works on a multiple of the original
1801 1730
1802 // The idea behind this method can be described with the following diagrams 1731 // The idea behind this method can be described with the following diagrams
1803 // second pass and third pass happen in the same loop really.. just separated 1732 // second pass and third pass happen in the same loop really.. just separated
1804 // them to show what this does. 1733 // them to show what this does.
1805 1734
1806 // First Pass 1735 // First Pass
@@ -1893,6 +1822,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1893 1822
1894 return returnarr; 1823 return returnarr;
1895 } 1824 }
1825
1896 public float[] ResizeTerrain512Interpolation(float[] heightMap) 1826 public float[] ResizeTerrain512Interpolation(float[] heightMap)
1897 { 1827 {
1898 float[] returnarr = new float[262144]; 1828 float[] returnarr = new float[262144];
@@ -1912,7 +1842,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1912 // This particular way is quick but it only works on a multiple of the original 1842 // This particular way is quick but it only works on a multiple of the original
1913 1843
1914 // The idea behind this method can be described with the following diagrams 1844 // The idea behind this method can be described with the following diagrams
1915 // second pass and third pass happen in the same loop really.. just separated 1845 // second pass and third pass happen in the same loop really.. just separated
1916 // them to show what this does. 1846 // them to show what this does.
1917 1847
1918 // First Pass 1848 // First Pass
@@ -2139,7 +2069,6 @@ namespace OpenSim.Region.Physics.OdePlugin
2139 // m_log.Info((baseheight - 0.1f) + ((float)fluidRandomizer.Next(1, 9) / 10f)); 2069 // m_log.Info((baseheight - 0.1f) + ((float)fluidRandomizer.Next(1, 9) / 10f));
2140 } 2070 }
2141 2071
2142
2143 lock (OdeLock) 2072 lock (OdeLock)
2144 { 2073 {
2145 if (!(WaterGeom == (IntPtr)0)) 2074 if (!(WaterGeom == (IntPtr)0))
@@ -2183,7 +2112,6 @@ namespace OpenSim.Region.Physics.OdePlugin
2183 { 2112 {
2184 lock (OdeLock) 2113 lock (OdeLock)
2185 { 2114 {
2186
2187 foreach (OdePrim prm in _prims) 2115 foreach (OdePrim prm in _prims)
2188 { 2116 {
2189 RemovePrim(prm); 2117 RemovePrim(prm);
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
index 9ca1b23..82ce144 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
@@ -171,12 +171,12 @@ namespace OpenSim.Region.Physics.POSPlugin
171 { 171 {
172 if (check_collision(c, _prims[i])) 172 if (check_collision(c, _prims[i]))
173 { 173 {
174 174
175 return true; 175 return true;
176 } 176 }
177 177
178 } 178 }
179 179
180 return false; 180 return false;
181 } 181 }
182 182
@@ -234,7 +234,7 @@ namespace OpenSim.Region.Physics.POSPlugin
234 character.Position.Z += character._target_velocity.Z*timeStep; 234 character.Position.Z += character._target_velocity.Z*timeStep;
235 } 235 }
236 236
237 /// this is it -- the magic you've all been waiting for! Ladies and gentlemen -- 237 /// this is it -- the magic you've all been waiting for! Ladies and gentlemen --
238 /// Completely Bogus Collision Detection!!! 238 /// Completely Bogus Collision Detection!!!
239 /// better known as the CBCD algorithm 239 /// better known as the CBCD algorithm
240 240
diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
index afc3ff2..2c33b57 100644
--- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
@@ -108,7 +108,7 @@ namespace OpenSim.Region.ScriptEngine.Common
108 public void state(string state) 108 public void state(string state)
109 { 109 {
110 State = state; 110 State = state;
111 111
112 } 112 }
113 113
114 public void Start(BuilIn_Commands LSL_Functions) 114 public void Start(BuilIn_Commands LSL_Functions)
@@ -125,9 +125,9 @@ namespace OpenSim.Region.ScriptEngine.Common
125 ads.ConfigurationFile 125 ads.ConfigurationFile
126 ); 126 );
127 127
128 // Display the name of the calling AppDomain and the name 128 // Display the name of the calling AppDomain and the name
129 // of the second domain. 129 // of the second domain.
130 // NOTE: The application's thread has transitioned between 130 // NOTE: The application's thread has transitioned between
131 // AppDomains. 131 // AppDomains.
132 Console.WriteLine("Calling to '{0}'.", 132 Console.WriteLine("Calling to '{0}'.",
133 Thread.GetDomain().FriendlyName 133 Thread.GetDomain().FriendlyName
diff --git a/OpenSim/Region/ScriptEngine/Common/ExecutorBase.cs b/OpenSim/Region/ScriptEngine/Common/ExecutorBase.cs
index 2e35b46..2887f1e 100644
--- a/OpenSim/Region/ScriptEngine/Common/ExecutorBase.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ExecutorBase.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.ScriptEngine.Common
42 /// </summary> 42 /// </summary>
43 protected bool m_Running = true; 43 protected bool m_Running = true;
44 /// <summary> 44 /// <summary>
45 /// True indicates that the ScriptManager has stopped 45 /// True indicates that the ScriptManager has stopped
46 /// this script. This prevents a script that has been 46 /// this script. This prevents a script that has been
47 /// stopped as part of deactivation from being 47 /// stopped as part of deactivation from being
48 /// resumed by a pending llSetScriptState request. 48 /// resumed by a pending llSetScriptState request.
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index d73a47a..ab91424 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Region.ScriptEngine.Common
57 internal uint m_localID; 57 internal uint m_localID;
58 internal LLUUID m_itemID; 58 internal LLUUID m_itemID;
59 internal bool throwErrorOnNotImplemented = true; 59 internal bool throwErrorOnNotImplemented = true;
60 60
61 public LSL_BuiltIn_Commands(ScriptEngineBase.ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) 61 public LSL_BuiltIn_Commands(ScriptEngineBase.ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID)
62 { 62 {
63 m_ScriptEngine = ScriptEngine; 63 m_ScriptEngine = ScriptEngine;
@@ -93,7 +93,7 @@ namespace OpenSim.Region.ScriptEngine.Common
93 try 93 try
94 { 94 {
95 int eventFlags = m_ScriptEngine.m_ScriptManager.GetStateEventFlags(m_localID, m_itemID); 95 int eventFlags = m_ScriptEngine.m_ScriptManager.GetStateEventFlags(m_localID, m_itemID);
96 m_host.SetScriptEvents(m_itemID, eventFlags); 96 m_host.SetScriptEvents(m_itemID, eventFlags);
97 m_ScriptEngine.m_EventManager.state_entry(m_localID); 97 m_ScriptEngine.m_EventManager.state_entry(m_localID);
98 } 98 }
99 catch (AppDomainUnloadedException) 99 catch (AppDomainUnloadedException)
@@ -186,7 +186,7 @@ namespace OpenSim.Region.ScriptEngine.Common
186 World.EventManager.TriggerRequestChangeWaterHeight((float)height); 186 World.EventManager.TriggerRequestChangeWaterHeight((float)height);
187 } 187 }
188 } 188 }
189 189
190 //These are the implementations of the various ll-functions used by the LSL scripts. 190 //These are the implementations of the various ll-functions used by the LSL scripts.
191 //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 191 //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07
192 public double llSin(double f) 192 public double llSin(double f)
@@ -331,9 +331,9 @@ namespace OpenSim.Region.ScriptEngine.Common
331 // New and improved, now actually works as described. Prim rotates as expected as does llRot2Euler. 331 // New and improved, now actually works as described. Prim rotates as expected as does llRot2Euler.
332 332
333 /* From wiki: 333 /* From wiki:
334 The Euler angle vector (in radians) is converted to a rotation by doing the rotations around the 3 axes 334 The Euler angle vector (in radians) is converted to a rotation by doing the rotations around the 3 axes
335 in Z, Y, X order. So llEuler2Rot(<1.0, 2.0, 3.0> * DEG_TO_RAD) generates a rotation by taking the zero rotation, 335 in Z, Y, X order. So llEuler2Rot(<1.0, 2.0, 3.0> * DEG_TO_RAD) generates a rotation by taking the zero rotation,
336 a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting 336 a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting
337 vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. 337 vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis.
338 */ 338 */
339 339
@@ -349,24 +349,24 @@ namespace OpenSim.Region.ScriptEngine.Common
349 double sinX = Math.Sin(v.x); 349 double sinX = Math.Sin(v.x);
350 double sinY = Math.Sin(v.y); 350 double sinY = Math.Sin(v.y);
351 double sinZ = Math.Sin(v.z); 351 double sinZ = Math.Sin(v.z);
352 352
353 s = Math.Sqrt( cosY * cosZ - sinX * sinY * sinZ + cosX * cosZ + cosX * cosY + 1.0f) * 0.5f; 353 s = Math.Sqrt(cosY * cosZ - sinX * sinY * sinZ + cosX * cosZ + cosX * cosY + 1.0f) * 0.5f;
354 if (Math.Abs(s) < 0.00001) // null rotation 354 if (Math.Abs(s) < 0.00001) // null rotation
355 { 355 {
356 x = 0.0f; 356 x = 0.0f;
357 y = 1.0f; 357 y = 1.0f;
358 z = 0.0f; 358 z = 0.0f;
359 } 359 }
360 else 360 else
361 { 361 {
362 s_i = 1.0f / (4.0f * s); 362 s_i = 1.0f / (4.0f * s);
363 x = - ( -sinX * cosY - cosX * sinY * sinZ - sinX * cosZ) * s_i; 363 x = - (-sinX * cosY - cosX * sinY * sinZ - sinX * cosZ) * s_i;
364 y = - ( -cosX * sinY * cosZ + sinX * sinZ - sinY) * s_i; 364 y = - (-cosX * sinY * cosZ + sinX * sinZ - sinY) * s_i;
365 z = - ( -cosY * sinZ - sinX * sinY * cosZ - cosX * sinZ) * s_i; 365 z = - (-cosY * sinZ - sinX * sinY * cosZ - cosX * sinZ) * s_i;
366 } 366 }
367 return new LSL_Types.Quaternion(x, y, z, s); 367 return new LSL_Types.Quaternion(x, y, z, s);
368 } 368 }
369 369
370 370
371 public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) 371 public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up)
372 { 372 {
@@ -477,7 +477,7 @@ namespace OpenSim.Region.ScriptEngine.Common
477 m_host.AddScriptLPS(1); 477 m_host.AddScriptLPS(1);
478 LLUUID keyID = LLUUID.Zero; 478 LLUUID keyID = LLUUID.Zero;
479 LLUUID.TryParse(id, out keyID); 479 LLUUID.TryParse(id, out keyID);
480 480
481 m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); 481 m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host);
482 } 482 }
483 483
@@ -625,7 +625,7 @@ namespace OpenSim.Region.ScriptEngine.Common
625 625
626 626
627 return String.Empty; 627 return String.Empty;
628 628
629 } 629 }
630 630
631 public LSL_Types.LSLInteger llDetectedType(int number) 631 public LSL_Types.LSLInteger llDetectedType(int number)
@@ -644,7 +644,7 @@ namespace OpenSim.Region.ScriptEngine.Common
644 mask |= 0x04; // passive non-moving 644 mask |= 0x04; // passive non-moving
645 else 645 else
646 mask |= 0x02; // active moving 646 mask |= 0x02; // active moving
647 if (SensedObject is IScript) mask |= 0x08; // Scripted. It COULD have one hidden ... 647 if (SensedObject is IScript) mask |= 0x08; // Scripted. It COULD have one hidden ...
648 return mask; 648 return mask;
649 649
650 } 650 }
@@ -655,7 +655,7 @@ namespace OpenSim.Region.ScriptEngine.Common
655 EntityBase SensedObject = entityDetectedKey(number); 655 EntityBase SensedObject = entityDetectedKey(number);
656 if (SensedObject == null) 656 if (SensedObject == null)
657 return new LSL_Types.Vector3(0, 0, 0); 657 return new LSL_Types.Vector3(0, 0, 0);
658 658
659 return new LSL_Types.Vector3(SensedObject.AbsolutePosition.X,SensedObject.AbsolutePosition.Y,SensedObject.AbsolutePosition.Z); 659 return new LSL_Types.Vector3(SensedObject.AbsolutePosition.X,SensedObject.AbsolutePosition.Y,SensedObject.AbsolutePosition.Z);
660 } 660 }
661 661
@@ -757,7 +757,7 @@ namespace OpenSim.Region.ScriptEngine.Common
757 if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) 757 if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X)
758 { 758 {
759 statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X; 759 statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X;
760 760
761 } 761 }
762 if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) 762 if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y)
763 { 763 {
@@ -824,9 +824,9 @@ namespace OpenSim.Region.ScriptEngine.Common
824 824
825 if (m_host.GetDieAtEdge()) 825 if (m_host.GetDieAtEdge())
826 return 1; 826 return 1;
827 else 827 else
828 return 0; 828 return 0;
829 829
830 case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE: 830 case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE:
831 NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); 831 NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE");
832 return 0; 832 return 0;
@@ -1248,7 +1248,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1248 { 1248 {
1249 m_host.AddScriptLPS(1); 1249 m_host.AddScriptLPS(1);
1250 return m_host.registerTargetWaypoint(new LLVector3((float)position.x, (float)position.y, (float)position.z), (float)range); 1250 return m_host.registerTargetWaypoint(new LLVector3((float)position.x, (float)position.y, (float)position.z), (float)range);
1251 1251
1252 } 1252 }
1253 1253
1254 public void llTargetRemove(int number) 1254 public void llTargetRemove(int number)
@@ -1286,21 +1286,21 @@ namespace OpenSim.Region.ScriptEngine.Common
1286 { 1286 {
1287 m_host.AddScriptLPS(1); 1287 m_host.AddScriptLPS(1);
1288 //No energy force yet 1288 //No energy force yet
1289 1289
1290 if (force.x > 20000) 1290 if (force.x > 20000)
1291 force.x = 20000; 1291 force.x = 20000;
1292 if (force.y > 20000) 1292 if (force.y > 20000)
1293 force.y = 20000; 1293 force.y = 20000;
1294 if (force.z > 20000) 1294 if (force.z > 20000)
1295 force.z = 20000; 1295 force.z = 20000;
1296 1296
1297 if (local == 1) 1297 if (local == 1)
1298 { 1298 {
1299 m_host.ApplyImpulse(new LLVector3((float)force.x, (float)force.y, (float)force.z), true); 1299 m_host.ApplyImpulse(new LLVector3((float)force.x, (float)force.y, (float)force.z), true);
1300 } 1300 }
1301 else 1301 else
1302 { 1302 {
1303 1303
1304 m_host.ApplyImpulse(new LLVector3((float)force.x,(float)force.y,(float)force.z), false); 1304 m_host.ApplyImpulse(new LLVector3((float)force.x,(float)force.y,(float)force.z), false);
1305 } 1305 }
1306 } 1306 }
@@ -1475,7 +1475,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1475 } 1475 }
1476 // If end is positive, then it directly 1476 // If end is positive, then it directly
1477 // corresponds to the lengt of the substring 1477 // corresponds to the lengt of the substring
1478 // needed (plus one of course). BUT, it 1478 // needed (plus one of course). BUT, it
1479 // must be within bounds. 1479 // must be within bounds.
1480 if (end >= src.Length) 1480 if (end >= src.Length)
1481 { 1481 {
@@ -1493,15 +1493,15 @@ namespace OpenSim.Region.ScriptEngine.Common
1493 // Inverted substring (end < start) 1493 // Inverted substring (end < start)
1494 else 1494 else
1495 { 1495 {
1496 // Implies both indices are below the 1496 // Implies both indices are below the
1497 // lower bound. In the inverted case, that 1497 // lower bound. In the inverted case, that
1498 // means the entire string will be returned 1498 // means the entire string will be returned
1499 // unchanged. 1499 // unchanged.
1500 if (start < 0) 1500 if (start < 0)
1501 { 1501 {
1502 return src; 1502 return src;
1503 } 1503 }
1504 // If both indices are greater than the upper 1504 // If both indices are greater than the upper
1505 // bound the result may seem initially counter 1505 // bound the result may seem initially counter
1506 // intuitive. 1506 // intuitive.
1507 if (end >= src.Length) 1507 if (end >= src.Length)
@@ -1536,7 +1536,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1536 1536
1537 /// <summary> 1537 /// <summary>
1538 /// Delete substring removes the specified substring bounded 1538 /// Delete substring removes the specified substring bounded
1539 /// by the inclusive indices start and end. Indices may be 1539 /// by the inclusive indices start and end. Indices may be
1540 /// negative (indicating end-relative) and may be inverted, 1540 /// negative (indicating end-relative) and may be inverted,
1541 /// i.e. end < start. 1541 /// i.e. end < start.
1542 /// </summary> 1542 /// </summary>
@@ -1591,7 +1591,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1591 { 1591 {
1592 return String.Empty; 1592 return String.Empty;
1593 } 1593 }
1594 1594
1595 if (end > 0) 1595 if (end > 0)
1596 { 1596 {
1597 if (start < src.Length) 1597 if (start < src.Length)
@@ -1616,7 +1616,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1616 } 1616 }
1617 } 1617 }
1618 } 1618 }
1619 1619
1620 /// <summary> 1620 /// <summary>
1621 /// Insert string inserts the specified string identified by src 1621 /// Insert string inserts the specified string identified by src
1622 /// at the index indicated by index. Index may be negative, in 1622 /// at the index indicated by index. Index may be negative, in
@@ -1655,13 +1655,13 @@ namespace OpenSim.Region.ScriptEngine.Common
1655 1655
1656 // The index is in bounds. 1656 // The index is in bounds.
1657 // In this case the index refers to the index that will 1657 // In this case the index refers to the index that will
1658 // be assigned to the first character of the inserted string. 1658 // be assigned to the first character of the inserted string.
1659 // So unlike the other string operations, we do not add one 1659 // So unlike the other string operations, we do not add one
1660 // to get the correct string length. 1660 // to get the correct string length.
1661 return dest.Substring(0,index)+src+dest.Substring(index); 1661 return dest.Substring(0,index)+src+dest.Substring(index);
1662 1662
1663 } 1663 }
1664 1664
1665 public string llToUpper(string src) 1665 public string llToUpper(string src)
1666 { 1666 {
1667 m_host.AddScriptLPS(1); 1667 m_host.AddScriptLPS(1);
@@ -1767,12 +1767,12 @@ namespace OpenSim.Region.ScriptEngine.Common
1767 return; // wiki says, if it's further away then 10m, silently fail. 1767 return; // wiki says, if it's further away then 10m, silently fail.
1768 1768
1769 LLVector3 llvel = new LLVector3((float)vel.x, (float)vel.y, (float)vel.z); 1769 LLVector3 llvel = new LLVector3((float)vel.x, (float)vel.y, (float)vel.z);
1770 1770
1771 // need the magnitude later 1771 // need the magnitude later
1772 float velmag = (float)Util.GetMagnitude(llvel); 1772 float velmag = (float)Util.GetMagnitude(llvel);
1773 1773
1774 SceneObjectGroup new_group = World.RezObject(inv.Value, llpos, new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param); 1774 SceneObjectGroup new_group = World.RezObject(inv.Value, llpos, new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param);
1775 1775
1776 // If either of these are null, then there was an unknown error. 1776 // If either of these are null, then there was an unknown error.
1777 if (new_group == null) 1777 if (new_group == null)
1778 continue; 1778 continue;
@@ -1844,7 +1844,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1844 if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) 1844 if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero)
1845 { 1845 {
1846 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); 1846 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter);
1847 1847
1848 if (presence != null) 1848 if (presence != null)
1849 { 1849 {
1850 if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) 1850 if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0)
@@ -1871,7 +1871,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1871 if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) 1871 if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero)
1872 { 1872 {
1873 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); 1873 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter);
1874 1874
1875 if (presence != null) 1875 if (presence != null)
1876 { 1876 {
1877 if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) 1877 if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0)
@@ -1924,7 +1924,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1924 // InstantMessageModule.OnInstantMessage searches through a list of scenes for a client matching the toAgent, 1924 // InstantMessageModule.OnInstantMessage searches through a list of scenes for a client matching the toAgent,
1925 // but I don't think we have a list of scenes available from here. 1925 // but I don't think we have a list of scenes available from here.
1926 // (We also don't want to duplicate the code in OnInstantMessage if we can avoid it.) 1926 // (We also don't want to duplicate the code in OnInstantMessage if we can avoid it.)
1927 1927
1928 // user is a UUID 1928 // user is a UUID
1929 1929
1930 // TODO: figure out values for client, fromSession, and imSessionID 1930 // TODO: figure out values for client, fromSession, and imSessionID
@@ -1991,7 +1991,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1991 } 1991 }
1992 } 1992 }
1993 1993
1994 1994
1995 1995
1996 public void llSetHoverHeight(double height, int water, double tau) 1996 public void llSetHoverHeight(double height, int water, double tau)
1997 { 1997 {
@@ -2050,7 +2050,7 @@ namespace OpenSim.Region.ScriptEngine.Common
2050 if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) 2050 if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
2051 { 2051 {
2052 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); 2052 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter);
2053 2053
2054 if (presence != null) 2054 if (presence != null)
2055 { 2055 {
2056 // Do NOT try to parse LLUUID, animations cannot be triggered by ID 2056 // Do NOT try to parse LLUUID, animations cannot be triggered by ID
@@ -2087,7 +2087,7 @@ namespace OpenSim.Region.ScriptEngine.Common
2087 return; 2087 return;
2088 2088
2089 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); 2089 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter);
2090 2090
2091 if (presence != null) 2091 if (presence != null)
2092 { 2092 {
2093 if (animID == LLUUID.Zero) 2093 if (animID == LLUUID.Zero)
@@ -2194,7 +2194,7 @@ namespace OpenSim.Region.ScriptEngine.Common
2194 } 2194 }
2195 2195
2196 ScenePresence presence = World.GetScenePresence(agentID); 2196 ScenePresence presence = World.GetScenePresence(agentID);
2197 2197
2198 if (presence != null) 2198 if (presence != null)
2199 { 2199 {
2200 string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID); 2200 string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID);
@@ -2467,7 +2467,7 @@ namespace OpenSim.Region.ScriptEngine.Common
2467 2467
2468 // These functions are supposed to be robust, 2468 // These functions are supposed to be robust,
2469 // so get the state one step at a time. 2469 // so get the state one step at a time.
2470 2470
2471 if ((item = ScriptByName(name)) != LLUUID.Zero) 2471 if ((item = ScriptByName(name)) != LLUUID.Zero)
2472 { 2472 {
2473 if ((sm = m_ScriptEngine.m_ScriptManager) != null) 2473 if ((sm = m_ScriptEngine.m_ScriptManager) != null)
@@ -2480,14 +2480,14 @@ namespace OpenSim.Region.ScriptEngine.Common
2480 } 2480 }
2481 } 2481 }
2482 } 2482 }
2483 } 2483 }
2484 2484
2485 // Required by SL 2485 // Required by SL
2486 2486
2487 if (script == null) 2487 if (script == null)
2488 ShoutError("llSetScriptState: script "+name+" not found"); 2488 ShoutError("llSetScriptState: script "+name+" not found");
2489 2489
2490 // If we didn't find it, then it's safe to 2490 // If we didn't find it, then it's safe to
2491 // assume it is not running. 2491 // assume it is not running.
2492 } 2492 }
2493 2493
@@ -2806,23 +2806,23 @@ namespace OpenSim.Region.ScriptEngine.Common
2806 2806
2807 2807
2808 /* The new / changed functions were tested with the following LSL script: 2808 /* The new / changed functions were tested with the following LSL script:
2809 2809
2810 default 2810 default
2811 { 2811 {
2812 state_entry() 2812 state_entry()
2813 { 2813 {
2814 rotation rot = llEuler2Rot(<0,70,0> * DEG_TO_RAD); 2814 rotation rot = llEuler2Rot(<0,70,0> * DEG_TO_RAD);
2815 2815
2816 llOwnerSay("to get here, we rotate over: "+ (string) llRot2Axis(rot)); 2816 llOwnerSay("to get here, we rotate over: "+ (string) llRot2Axis(rot));
2817 llOwnerSay("and we rotate for: "+ (llRot2Angle(rot) * RAD_TO_DEG)); 2817 llOwnerSay("and we rotate for: "+ (llRot2Angle(rot) * RAD_TO_DEG));
2818 2818
2819 // convert back and forth between quaternion <-> vector and angle 2819 // convert back and forth between quaternion <-> vector and angle
2820 2820
2821 rotation newrot = llAxisAngle2Rot(llRot2Axis(rot),llRot2Angle(rot)); 2821 rotation newrot = llAxisAngle2Rot(llRot2Axis(rot),llRot2Angle(rot));
2822 2822
2823 llOwnerSay("Old rotation was: "+(string) rot); 2823 llOwnerSay("Old rotation was: "+(string) rot);
2824 llOwnerSay("re-converted rotation is: "+(string) newrot); 2824 llOwnerSay("re-converted rotation is: "+(string) newrot);
2825 2825
2826 llSetRot(rot); // to check the parameters in the prim 2826 llSetRot(rot); // to check the parameters in the prim
2827 } 2827 }
2828 } 2828 }
@@ -2832,7 +2832,7 @@ namespace OpenSim.Region.ScriptEngine.Common
2832 2832
2833 // Xantor 29/apr/2008 2833 // Xantor 29/apr/2008
2834 // Returns rotation described by rotating angle radians about axis. 2834 // Returns rotation described by rotating angle radians about axis.
2835 // q = cos(a/2) + i ( x * sin(a/2)) + j (y * sin(a/2)) + k ( z * sin(a/2)) 2835 // q = cos(a/2) + i (x * sin(a/2)) + j (y * sin(a/2)) + k (z * sin(a/2))
2836 public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) 2836 public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle)
2837 { 2837 {
2838 m_host.AddScriptLPS(1); 2838 m_host.AddScriptLPS(1);
@@ -2849,7 +2849,7 @@ namespace OpenSim.Region.ScriptEngine.Common
2849 // NotImplemented("llAxisAngle2Rot"); 2849 // NotImplemented("llAxisAngle2Rot");
2850 } 2850 }
2851 2851
2852 2852
2853 // Xantor 29/apr/2008 2853 // Xantor 29/apr/2008
2854 // converts a Quaternion to X,Y,Z axis rotations 2854 // converts a Quaternion to X,Y,Z axis rotations
2855 public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) 2855 public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot)
@@ -3264,7 +3264,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3264 /// <summary> 3264 /// <summary>
3265 /// The supplied string is scanned for commas 3265 /// The supplied string is scanned for commas
3266 /// and converted into a list. Commas are only 3266 /// and converted into a list. Commas are only
3267 /// effective if they are encountered outside 3267 /// effective if they are encountered outside
3268 /// of '<' '>' delimiters. Any whitespace 3268 /// of '<' '>' delimiters. Any whitespace
3269 /// before or after an element is trimmed. 3269 /// before or after an element is trimmed.
3270 /// </summary> 3270 /// </summary>
@@ -3314,7 +3314,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3314 } 3314 }
3315 3315
3316 /// <summary> 3316 /// <summary>
3317 /// Randomizes the list, be arbitrarily reordering 3317 /// Randomizes the list, be arbitrarily reordering
3318 /// sublists of stride elements. As the stride approaches 3318 /// sublists of stride elements. As the stride approaches
3319 /// the size of the list, the options become very 3319 /// the size of the list, the options become very
3320 /// limited. 3320 /// limited.
@@ -3323,7 +3323,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3323 /// This could take a while for very large list 3323 /// This could take a while for very large list
3324 /// sizes. 3324 /// sizes.
3325 /// </remarks> 3325 /// </remarks>
3326 3326
3327 public LSL_Types.list llListRandomize(LSL_Types.list src, int stride) 3327 public LSL_Types.list llListRandomize(LSL_Types.list src, int stride)
3328 { 3328 {
3329 3329
@@ -3344,7 +3344,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3344 // Stride MUST be a factor of the list length 3344 // Stride MUST be a factor of the list length
3345 // If not, then return the src list. This also 3345 // If not, then return the src list. This also
3346 // traps those cases where stride > length. 3346 // traps those cases where stride > length.
3347 3347
3348 if (src.Length != stride && src.Length%stride == 0) 3348 if (src.Length != stride && src.Length%stride == 0)
3349 { 3349 {
3350 chunkk = src.Length/stride; 3350 chunkk = src.Length/stride;
@@ -3384,7 +3384,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3384 object[] array = new object[src.Length]; 3384 object[] array = new object[src.Length];
3385 Array.Copy(src.Data, 0, array, 0, src.Length); 3385 Array.Copy(src.Data, 0, array, 0, src.Length);
3386 result = new LSL_Types.list(array); 3386 result = new LSL_Types.list(array);
3387 } 3387 }
3388 3388
3389 return result; 3389 return result;
3390 3390
@@ -3394,10 +3394,10 @@ namespace OpenSim.Region.ScriptEngine.Common
3394 /// Elements in the source list starting with 0 and then 3394 /// Elements in the source list starting with 0 and then
3395 /// every i+stride. If the stride is negative then the scan 3395 /// every i+stride. If the stride is negative then the scan
3396 /// is backwards producing an inverted result. 3396 /// is backwards producing an inverted result.
3397 /// Only those elements that are also in the specified 3397 /// Only those elements that are also in the specified
3398 /// range are included in the result. 3398 /// range are included in the result.
3399 /// </summary> 3399 /// </summary>
3400 3400
3401 public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride) 3401 public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride)
3402 { 3402 {
3403 3403
@@ -3415,7 +3415,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3415 if (end < 0) 3415 if (end < 0)
3416 end = src.Length+end; 3416 end = src.Length+end;
3417 3417
3418 // Out of bounds indices are OK, just trim them 3418 // Out of bounds indices are OK, just trim them
3419 // accordingly 3419 // accordingly
3420 3420
3421 if (start > src.Length) 3421 if (start > src.Length)
@@ -3429,7 +3429,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3429 if (start != end) 3429 if (start != end)
3430 { 3430 {
3431 3431
3432 if (start <= end) 3432 if (start <= end)
3433 { 3433 {
3434 si[0] = start; 3434 si[0] = start;
3435 ei[0] = end; 3435 ei[0] = end;
@@ -3448,8 +3448,8 @@ namespace OpenSim.Region.ScriptEngine.Common
3448 // fall within the specified sub-range. The specified 3448 // fall within the specified sub-range. The specified
3449 // range values are inclusive. 3449 // range values are inclusive.
3450 // A negative stride reverses the direction of the 3450 // A negative stride reverses the direction of the
3451 // scan producing an inverted list as a result. 3451 // scan producing an inverted list as a result.
3452 3452
3453 if (stride == 0) 3453 if (stride == 0)
3454 stride = 1; 3454 stride = 1;
3455 3455
@@ -3492,7 +3492,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3492 3492
3493 public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int index) 3493 public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int index)
3494 { 3494 {
3495 3495
3496 LSL_Types.list pref = null; 3496 LSL_Types.list pref = null;
3497 LSL_Types.list suff = null; 3497 LSL_Types.list suff = null;
3498 3498
@@ -3539,7 +3539,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3539 /// Returns the index of the first occurrence of test 3539 /// Returns the index of the first occurrence of test
3540 /// in src. 3540 /// in src.
3541 /// </summary> 3541 /// </summary>
3542 3542
3543 public LSL_Types.LSLInteger llListFindList(LSL_Types.list src, LSL_Types.list test) 3543 public LSL_Types.LSLInteger llListFindList(LSL_Types.list src, LSL_Types.list test)
3544 { 3544 {
3545 3545
@@ -3568,7 +3568,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3568 } 3568 }
3569 } 3569 }
3570 } 3570 }
3571 3571
3572 return index; 3572 return index;
3573 3573
3574 } 3574 }
@@ -3632,12 +3632,12 @@ namespace OpenSim.Region.ScriptEngine.Common
3632 if (LLUUID.TryParse(id,out key)) 3632 if (LLUUID.TryParse(id,out key))
3633 { 3633 {
3634 ScenePresence presence = World.GetScenePresence(key); 3634 ScenePresence presence = World.GetScenePresence(key);
3635 3635
3636 if (presence != null) 3636 if (presence != null)
3637 { 3637 {
3638 return presence.Name; 3638 return presence.Name;
3639 } 3639 }
3640 3640
3641 if (World.GetSceneObjectPart(key) != null) 3641 if (World.GetSceneObjectPart(key) != null)
3642 { 3642 {
3643 return World.GetSceneObjectPart(key).Name; 3643 return World.GetSceneObjectPart(key).Name;
@@ -3646,18 +3646,18 @@ namespace OpenSim.Region.ScriptEngine.Common
3646 return String.Empty; 3646 return String.Empty;
3647 } 3647 }
3648 3648
3649 3649
3650 3650
3651 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) 3651 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
3652 { 3652 {
3653 m_host.AddScriptLPS(1); 3653 m_host.AddScriptLPS(1);
3654 Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); 3654 Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation();
3655 pTexAnim.Flags =(uint) mode; 3655 pTexAnim.Flags =(uint) mode;
3656 3656
3657 //ALL_SIDES 3657 //ALL_SIDES
3658 if (face == -1) 3658 if (face == -1)
3659 face = 255; 3659 face = 255;
3660 3660
3661 pTexAnim.Face = (uint)face; 3661 pTexAnim.Face = (uint)face;
3662 pTexAnim.Length = (float)length; 3662 pTexAnim.Length = (float)length;
3663 pTexAnim.Rate = (float)rate; 3663 pTexAnim.Rate = (float)rate;
@@ -3688,7 +3688,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3688 LSL_Types.list ret = new LSL_Types.list(); 3688 LSL_Types.list ret = new LSL_Types.list();
3689 object[] delimiters = new object[separators.Length + spacers.Length]; 3689 object[] delimiters = new object[separators.Length + spacers.Length];
3690 separators.Data.CopyTo(delimiters, 0); 3690 separators.Data.CopyTo(delimiters, 0);
3691 spacers.Data.CopyTo(delimiters, separators.Length); 3691 spacers.Data.CopyTo(delimiters, separators.Length);
3692 bool dfound = false; 3692 bool dfound = false;
3693 do 3693 do
3694 { 3694 {
@@ -3735,7 +3735,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3735 3735
3736 public LSL_Types.LSLInteger llOverMyLand(string id) 3736 public LSL_Types.LSLInteger llOverMyLand(string id)
3737 { 3737 {
3738 3738
3739 m_host.AddScriptLPS(1); 3739 m_host.AddScriptLPS(1);
3740 LLUUID key = new LLUUID(); 3740 LLUUID key = new LLUUID();
3741 if (LLUUID.TryParse(id,out key)) 3741 if (LLUUID.TryParse(id,out key))
@@ -3790,14 +3790,14 @@ namespace OpenSim.Region.ScriptEngine.Common
3790 3790
3791 LLUUID key = new LLUUID(); 3791 LLUUID key = new LLUUID();
3792 if (LLUUID.TryParse(id, out key)) 3792 if (LLUUID.TryParse(id, out key))
3793 { 3793 {
3794 ScenePresence av = World.GetScenePresence(key); 3794 ScenePresence av = World.GetScenePresence(key);
3795 3795
3796 if (av != null) 3796 if (av != null)
3797 { 3797 {
3798 if (llAvatarOnSitTarget() == id) 3798 if (llAvatarOnSitTarget() == id)
3799 { 3799 {
3800 // if the avatar is sitting on this object, then 3800 // if the avatar is sitting on this object, then
3801 // we can unsit them. We don't want random scripts unsitting random people 3801 // we can unsit them. We don't want random scripts unsitting random people
3802 // Lets avoid the popcorn avatar scenario. 3802 // Lets avoid the popcorn avatar scenario.
3803 av.StandUp(); 3803 av.StandUp();
@@ -3809,12 +3809,12 @@ namespace OpenSim.Region.ScriptEngine.Common
3809 // if the land is group owned and the object is group owned by the same group 3809 // if the land is group owned and the object is group owned by the same group
3810 // or 3810 // or
3811 // if the object is owned by a person with estate access. 3811 // if the object is owned by a person with estate access.
3812 3812
3813 ILandObject parcel = World.LandChannel.GetLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y); 3813 ILandObject parcel = World.LandChannel.GetLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y);
3814 if (parcel != null) 3814 if (parcel != null)
3815 { 3815 {
3816 if (m_host.ObjectOwner == parcel.landData.ownerID || 3816 if (m_host.ObjectOwner == parcel.landData.ownerID ||
3817 (m_host.OwnerID == m_host.GroupID && m_host.GroupID == parcel.landData.groupID 3817 (m_host.OwnerID == m_host.GroupID && m_host.GroupID == parcel.landData.groupID
3818 && parcel.landData.isGroupOwned) || World.ExternalChecks.ExternalChecksCanBeGodLike(m_host.OwnerID)) 3818 && parcel.landData.isGroupOwned) || World.ExternalChecks.ExternalChecksCanBeGodLike(m_host.OwnerID))
3819 { 3819 {
3820 av.StandUp(); 3820 av.StandUp();
@@ -3822,7 +3822,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3822 } 3822 }
3823 } 3823 }
3824 } 3824 }
3825 3825
3826 } 3826 }
3827 3827
3828 } 3828 }
@@ -3928,7 +3928,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3928 m_host.AddScriptLPS(1); 3928 m_host.AddScriptLPS(1);
3929 Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); 3929 Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
3930 LSL_Types.Vector3 tempv = new LSL_Types.Vector3(); 3930 LSL_Types.Vector3 tempv = new LSL_Types.Vector3();
3931 3931
3932 float tempf = 0; 3932 float tempf = 0;
3933 3933
3934 for (int i = 0; i < rules.Length; i += 2) 3934 for (int i = 0; i < rules.Length; i += 2)
@@ -3954,7 +3954,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3954 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_END_COLOR: 3954 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_END_COLOR:
3955 tempv = (LSL_Types.Vector3)rules.Data[i + 1]; 3955 tempv = (LSL_Types.Vector3)rules.Data[i + 1];
3956 //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1); 3956 //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1);
3957 3957
3958 prules.PartEndColor.R = (float)tempv.x; 3958 prules.PartEndColor.R = (float)tempv.x;
3959 prules.PartEndColor.G = (float)tempv.y; 3959 prules.PartEndColor.G = (float)tempv.y;
3960 prules.PartEndColor.B = (float)tempv.z; 3960 prules.PartEndColor.B = (float)tempv.z;
@@ -3996,7 +3996,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3996 3996
3997 // Xantor 03-May-2008 3997 // Xantor 03-May-2008
3998 // Wiki: PSYS_SRC_TEXTURE string inventory item name or key of the particle texture 3998 // Wiki: PSYS_SRC_TEXTURE string inventory item name or key of the particle texture
3999 // "" = default texture. 3999 // "" = default texture.
4000 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_TEXTURE: 4000 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_TEXTURE:
4001 LLUUID tkey = LLUUID.Zero; 4001 LLUUID tkey = LLUUID.Zero;
4002 4002
@@ -4007,11 +4007,11 @@ namespace OpenSim.Region.ScriptEngine.Common
4007 } 4007 }
4008 // else try to locate the name in inventory of object. found returns key, 4008 // else try to locate the name in inventory of object. found returns key,
4009 // not found returns LLUUID.Zero which will translate to the default particle texture 4009 // not found returns LLUUID.Zero which will translate to the default particle texture
4010 else 4010 else
4011 { 4011 {
4012 prules.Texture = InventoryKey(rules.Data[i+1].ToString()); 4012 prules.Texture = InventoryKey(rules.Data[i+1].ToString());
4013 } 4013 }
4014 break; 4014 break;
4015 4015
4016 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_BURST_RATE: 4016 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_BURST_RATE:
4017 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4017 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
@@ -4150,7 +4150,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4150 m_host.AddScriptLPS(1); 4150 m_host.AddScriptLPS(1);
4151 return m_host.GetAvatarOnSitTarget().ToString(); 4151 return m_host.GetAvatarOnSitTarget().ToString();
4152 //LLUUID AVID = m_host.GetAvatarOnSitTarget(); 4152 //LLUUID AVID = m_host.GetAvatarOnSitTarget();
4153 4153
4154 //if (AVID != LLUUID.Zero) 4154 //if (AVID != LLUUID.Zero)
4155 // return AVID.ToString(); 4155 // return AVID.ToString();
4156 //else 4156 //else
@@ -4283,7 +4283,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4283 4283
4284 // These functions are supposed to be robust, 4284 // These functions are supposed to be robust,
4285 // so get the state one step at a time. 4285 // so get the state one step at a time.
4286 4286
4287 if ((item = ScriptByName(name)) != LLUUID.Zero) 4287 if ((item = ScriptByName(name)) != LLUUID.Zero)
4288 if ((sm = m_ScriptEngine.m_ScriptManager) != null) 4288 if ((sm = m_ScriptEngine.m_ScriptManager) != null)
4289 sm.ResetScript(m_localID, item); 4289 sm.ResetScript(m_localID, item);
@@ -4293,7 +4293,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4293 if (script == null) 4293 if (script == null)
4294 ShoutError("llResetOtherScript: script "+name+" not found"); 4294 ShoutError("llResetOtherScript: script "+name+" not found");
4295 4295
4296 // If we didn't find it, then it's safe to 4296 // If we didn't find it, then it's safe to
4297 // assume it is not running. 4297 // assume it is not running.
4298 } 4298 }
4299 4299
@@ -4307,7 +4307,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4307 4307
4308 // These functions are supposed to be robust, 4308 // These functions are supposed to be robust,
4309 // so get the state one step at a time. 4309 // so get the state one step at a time.
4310 4310
4311 if ((item = ScriptByName(name)) != LLUUID.Zero) 4311 if ((item = ScriptByName(name)) != LLUUID.Zero)
4312 { 4312 {
4313 if ((sm = m_ScriptEngine.m_ScriptManager) != null) 4313 if ((sm = m_ScriptEngine.m_ScriptManager) != null)
@@ -4324,7 +4324,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4324 if (script == null) 4324 if (script == null)
4325 ShoutError("llGetScriptState: script "+name+" not found"); 4325 ShoutError("llGetScriptState: script "+name+" not found");
4326 4326
4327 // If we didn't find it, then it's safe to 4327 // If we didn't find it, then it's safe to
4328 // assume it is not running. 4328 // assume it is not running.
4329 4329
4330 return 0; 4330 return 0;
@@ -4586,7 +4586,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4586 { 4586 {
4587 return; 4587 return;
4588 } 4588 }
4589 4589
4590 if (landowner != m_host.ObjectOwner) 4590 if (landowner != m_host.ObjectOwner)
4591 { 4591 {
4592 return; 4592 return;
@@ -4857,7 +4857,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4857 4857
4858 case 21: // PRIM_FLEXIBLE 4858 case 21: // PRIM_FLEXIBLE
4859 PrimitiveBaseShape shape = m_host.Shape; 4859 PrimitiveBaseShape shape = m_host.Shape;
4860 4860
4861 if (shape.FlexiEntry) 4861 if (shape.FlexiEntry)
4862 res.Add(new LSL_Types.LSLInteger(1)); // active 4862 res.Add(new LSL_Types.LSLInteger(1)); // active
4863 else 4863 else
@@ -4885,7 +4885,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4885 4885
4886 case 23: // PRIM_POINT_LIGHT: 4886 case 23: // PRIM_POINT_LIGHT:
4887 shape = m_host.Shape; 4887 shape = m_host.Shape;
4888 4888
4889 if (shape.LightEntry) 4889 if (shape.LightEntry)
4890 res.Add(new LSL_Types.LSLInteger(1)); // active 4890 res.Add(new LSL_Types.LSLInteger(1)); // active
4891 else 4891 else
@@ -4932,12 +4932,12 @@ namespace OpenSim.Region.ScriptEngine.Common
4932 // </para> 4932 // </para>
4933 // <para> 4933 // <para>
4934 // Each point in a base-64 string represents 4934 // Each point in a base-64 string represents
4935 // a 6 bit value. A 32-bit integer can be 4935 // a 6 bit value. A 32-bit integer can be
4936 // represented using 6 characters (with some 4936 // represented using 6 characters (with some
4937 // redundancy). 4937 // redundancy).
4938 // </para> 4938 // </para>
4939 // <para> 4939 // <para>
4940 // LSL requires a base64 string to be 8 4940 // LSL requires a base64 string to be 8
4941 // characters in length. LSL also uses '/' 4941 // characters in length. LSL also uses '/'
4942 // rather than '-' (MIME compliant). 4942 // rather than '-' (MIME compliant).
4943 // </para> 4943 // </para>
@@ -4948,7 +4948,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4948 // <para> 4948 // <para>
4949 // SL do not record any kind of exception for 4949 // SL do not record any kind of exception for
4950 // these functions, so the string to integer 4950 // these functions, so the string to integer
4951 // conversion returns '0' if an invalid 4951 // conversion returns '0' if an invalid
4952 // character is encountered during conversion. 4952 // character is encountered during conversion.
4953 // </para> 4953 // </para>
4954 // <para> 4954 // <para>
@@ -4962,13 +4962,13 @@ namespace OpenSim.Region.ScriptEngine.Common
4962 // </list> 4962 // </list>
4963 // </para> 4963 // </para>
4964 // </remarks> 4964 // </remarks>
4965 4965
4966 // <summary> 4966 // <summary>
4967 // Table for converting 6-bit integers into 4967 // Table for converting 6-bit integers into
4968 // base-64 characters 4968 // base-64 characters
4969 // </summary> 4969 // </summary>
4970 4970
4971 private static readonly char[] i2ctable = 4971 private static readonly char[] i2ctable =
4972 { 4972 {
4973 'A','B','C','D','E','F','G','H', 4973 'A','B','C','D','E','F','G','H',
4974 'I','J','K','L','M','N','O','P', 4974 'I','J','K','L','M','N','O','P',
@@ -4992,7 +4992,7 @@ namespace OpenSim.Region.ScriptEngine.Common
4992 { 4992 {
4993 -1,-1,-1,-1,-1,-1,-1,-1, // 0x 4993 -1,-1,-1,-1,-1,-1,-1,-1, // 0x
4994 -1,-1,-1,-1,-1,-1,-1,-1, 4994 -1,-1,-1,-1,-1,-1,-1,-1,
4995 -1,-1,-1,-1,-1,-1,-1,-1, // 1x 4995 -1,-1,-1,-1,-1,-1,-1,-1, // 1x
4996 -1,-1,-1,-1,-1,-1,-1,-1, 4996 -1,-1,-1,-1,-1,-1,-1,-1,
4997 -1,-1,-1,-1,-1,-1,-1,-1, // 2x 4997 -1,-1,-1,-1,-1,-1,-1,-1, // 2x
4998 -1,-1,-1,63,-1,-1,-1,64, 4998 -1,-1,-1,63,-1,-1,-1,64,
@@ -5070,25 +5070,25 @@ namespace OpenSim.Region.ScriptEngine.Common
5070 // length strings return zero. 5070 // length strings return zero.
5071 // </param> 5071 // </param>
5072 // <returns> 5072 // <returns>
5073 // Returns an integer representing the 5073 // Returns an integer representing the
5074 // encoded value providedint he 1st 6 5074 // encoded value providedint he 1st 6
5075 // characters of the string. 5075 // characters of the string.
5076 // </returns> 5076 // </returns>
5077 // <remarks> 5077 // <remarks>
5078 // This is coded to behave like LSL's 5078 // This is coded to behave like LSL's
5079 // implementation (I think), based upon the 5079 // implementation (I think), based upon the
5080 // information available at the Wiki. 5080 // information available at the Wiki.
5081 // If more than 8 characters are supplied, 5081 // If more than 8 characters are supplied,
5082 // zero is returned. 5082 // zero is returned.
5083 // If a NULL string is supplied, zero will 5083 // If a NULL string is supplied, zero will
5084 // be returned. 5084 // be returned.
5085 // If fewer than 6 characters are supplied, then 5085 // If fewer than 6 characters are supplied, then
5086 // the answer will reflect a partial 5086 // the answer will reflect a partial
5087 // accumulation. 5087 // accumulation.
5088 // <para> 5088 // <para>
5089 // The 6-bit segments are 5089 // The 6-bit segments are
5090 // extracted left-to-right in big-endian mode, 5090 // extracted left-to-right in big-endian mode,
5091 // which means that segment 6 only contains the 5091 // which means that segment 6 only contains the
5092 // two low-order bits of the 32 bit integer as 5092 // two low-order bits of the 32 bit integer as
5093 // its high order 2 bits. A short string therefore 5093 // its high order 2 bits. A short string therefore
5094 // means loss of low-order information. E.g. 5094 // means loss of low-order information. E.g.
@@ -5126,39 +5126,39 @@ namespace OpenSim.Region.ScriptEngine.Common
5126 return digit<0?(int)0:number; 5126 return digit<0?(int)0:number;
5127 } 5127 }
5128 number += --digit<<26; 5128 number += --digit<<26;
5129 5129
5130 if ((digit=c2itable[str[1]])<=0) 5130 if ((digit=c2itable[str[1]])<=0)
5131 { 5131 {
5132 return digit<0?(int)0:number; 5132 return digit<0?(int)0:number;
5133 } 5133 }
5134 number += --digit<<20; 5134 number += --digit<<20;
5135 5135
5136 if ((digit=c2itable[str[2]])<=0) 5136 if ((digit=c2itable[str[2]])<=0)
5137 { 5137 {
5138 return digit<0?(int)0:number; 5138 return digit<0?(int)0:number;
5139 } 5139 }
5140 number += --digit<<14; 5140 number += --digit<<14;
5141 5141
5142 if ((digit=c2itable[str[3]])<=0) 5142 if ((digit=c2itable[str[3]])<=0)
5143 { 5143 {
5144 return digit<0?(int)0:number; 5144 return digit<0?(int)0:number;
5145 } 5145 }
5146 number += --digit<<8; 5146 number += --digit<<8;
5147 5147
5148 if ((digit=c2itable[str[4]])<=0) 5148 if ((digit=c2itable[str[4]])<=0)
5149 { 5149 {
5150 return digit<0?(int)0:number; 5150 return digit<0?(int)0:number;
5151 } 5151 }
5152 number += --digit<<2; 5152 number += --digit<<2;
5153 5153
5154 if ((digit=c2itable[str[5]])<=0) 5154 if ((digit=c2itable[str[5]])<=0)
5155 { 5155 {
5156 return digit<0?(int)0:number; 5156 return digit<0?(int)0:number;
5157 } 5157 }
5158 number += --digit>>4; 5158 number += --digit>>4;
5159 5159
5160 // ignore trailing padding 5160 // ignore trailing padding
5161 5161
5162 return number; 5162 return number;
5163 } 5163 }
5164 5164
@@ -5182,8 +5182,8 @@ namespace OpenSim.Region.ScriptEngine.Common
5182 5182
5183 // <summary> 5183 // <summary>
5184 // Scan the string supplied in 'src' and 5184 // Scan the string supplied in 'src' and
5185 // tokenize it based upon two sets of 5185 // tokenize it based upon two sets of
5186 // tokenizers provided in two lists, 5186 // tokenizers provided in two lists,
5187 // separators and spacers. 5187 // separators and spacers.
5188 // </summary> 5188 // </summary>
5189 // 5189 //
@@ -5196,38 +5196,38 @@ namespace OpenSim.Region.ScriptEngine.Common
5196 // Both separators and spacers may be arbitrarily 5196 // Both separators and spacers may be arbitrarily
5197 // long strings. i.e. ":::". 5197 // long strings. i.e. ":::".
5198 // 5198 //
5199 // The function returns an ordered list 5199 // The function returns an ordered list
5200 // representing the tokens found in the supplied 5200 // representing the tokens found in the supplied
5201 // sources string. If two successive tokenizers 5201 // sources string. If two successive tokenizers
5202 // are encountered, then a NULL entry is added 5202 // are encountered, then a NULL entry is added
5203 // to the list. 5203 // to the list.
5204 // 5204 //
5205 // It is a precondition that the source and 5205 // It is a precondition that the source and
5206 // toekizer lisst are non-null. If they are null, 5206 // toekizer lisst are non-null. If they are null,
5207 // then a null pointer exception will be thrown 5207 // then a null pointer exception will be thrown
5208 // while their lengths are being determined. 5208 // while their lengths are being determined.
5209 // 5209 //
5210 // A small amount of working memoryis required 5210 // A small amount of working memoryis required
5211 // of approximately 8*#tokenizers. 5211 // of approximately 8*#tokenizers.
5212 // 5212 //
5213 // There are many ways in which this function 5213 // There are many ways in which this function
5214 // can be implemented, this implementation is 5214 // can be implemented, this implementation is
5215 // fairly naive and assumes that when the 5215 // fairly naive and assumes that when the
5216 // function is invooked with a short source 5216 // function is invooked with a short source
5217 // string and/or short lists of tokenizers, then 5217 // string and/or short lists of tokenizers, then
5218 // performance will not be an issue. 5218 // performance will not be an issue.
5219 // 5219 //
5220 // In order to minimize the perofrmance 5220 // In order to minimize the perofrmance
5221 // effects of long strings, or large numbers 5221 // effects of long strings, or large numbers
5222 // of tokeizers, the function skips as far as 5222 // of tokeizers, the function skips as far as
5223 // possible whenever a toekenizer is found, 5223 // possible whenever a toekenizer is found,
5224 // and eliminates redundant tokenizers as soon 5224 // and eliminates redundant tokenizers as soon
5225 // as is possible. 5225 // as is possible.
5226 // 5226 //
5227 // The implementation tries to avoid any copying 5227 // The implementation tries to avoid any copying
5228 // of arrays or other objects. 5228 // of arrays or other objects.
5229 // </remarks> 5229 // </remarks>
5230 5230
5231 public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list separators, LSL_Types.list spacers) 5231 public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list separators, LSL_Types.list spacers)
5232 { 5232 {
5233 int beginning = 0; 5233 int beginning = 0;
@@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Common
5256 active[i] = true; 5256 active[i] = true;
5257 5257
5258 offset[mlen] = srclen; 5258 offset[mlen] = srclen;
5259 5259
5260 while (beginning < srclen) 5260 while (beginning < srclen)
5261 { 5261 {
5262 5262
@@ -5270,7 +5270,7 @@ namespace OpenSim.Region.ScriptEngine.Common
5270 { 5270 {
5271 // scan all of the markers 5271 // scan all of the markers
5272 if ((offset[j] = src.IndexOf((string)separray[j],beginning)) == -1) 5272 if ((offset[j] = src.IndexOf((string)separray[j],beginning)) == -1)
5273 { 5273 {
5274 // not present at all 5274 // not present at all
5275 active[j] = false; 5275 active[j] = false;
5276 } 5276 }
@@ -5278,7 +5278,7 @@ namespace OpenSim.Region.ScriptEngine.Common
5278 { 5278 {
5279 // present and correct 5279 // present and correct
5280 if (offset[j] < offset[best]) 5280 if (offset[j] < offset[best])
5281 { 5281 {
5282 // closest so far 5282 // closest so far
5283 best = j; 5283 best = j;
5284 if (offset[best] == beginning) 5284 if (offset[best] == beginning)
@@ -5293,19 +5293,19 @@ namespace OpenSim.Region.ScriptEngine.Common
5293 if (offset[best] != beginning) 5293 if (offset[best] != beginning)
5294 { 5294 {
5295 for (j = seplen; (j < mlen) && (offset[best] > beginning); j++) 5295 for (j = seplen; (j < mlen) && (offset[best] > beginning); j++)
5296 { 5296 {
5297 if (active[j]) 5297 if (active[j])
5298 { 5298 {
5299 // scan all of the markers 5299 // scan all of the markers
5300 if ((offset[j] = src.IndexOf((string)spcarray[j-seplen],beginning)) == -1) 5300 if ((offset[j] = src.IndexOf((string)spcarray[j-seplen],beginning)) == -1)
5301 { 5301 {
5302 // not present at all 5302 // not present at all
5303 active[j] = false; 5303 active[j] = false;
5304 } else 5304 } else
5305 { 5305 {
5306 // present and correct 5306 // present and correct
5307 if (offset[j] < offset[best]) 5307 if (offset[j] < offset[best])
5308 { 5308 {
5309 // closest so far 5309 // closest so far
5310 best = j; 5310 best = j;
5311 } 5311 }
@@ -5317,7 +5317,7 @@ namespace OpenSim.Region.ScriptEngine.Common
5317 // This is the normal exit from the scanning loop 5317 // This is the normal exit from the scanning loop
5318 5318
5319 if (best == mlen) 5319 if (best == mlen)
5320 { 5320 {
5321 // no markers were found on this pass 5321 // no markers were found on this pass
5322 // so we're pretty much done 5322 // so we're pretty much done
5323 tokens.Add(src.Substring(beginning, srclen-beginning)); 5323 tokens.Add(src.Substring(beginning, srclen-beginning));
@@ -5478,7 +5478,7 @@ namespace OpenSim.Region.ScriptEngine.Common
5478 //should be similar to : llInstantMessage(llGetOwner(),msg) 5478 //should be similar to : llInstantMessage(llGetOwner(),msg)
5479 // llGetOwner ==> m_host.ObjectOwner.ToString() 5479 // llGetOwner ==> m_host.ObjectOwner.ToString()
5480 llInstantMessage(m_host.ObjectOwner.ToString(),msg); 5480 llInstantMessage(m_host.ObjectOwner.ToString(),msg);
5481 5481
5482 //World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 5482 //World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
5483 //IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 5483 //IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
5484 //wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg); 5484 //wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg);
@@ -5509,19 +5509,19 @@ namespace OpenSim.Region.ScriptEngine.Common
5509 5509
5510 /// <summary> 5510 /// <summary>
5511 /// illListReplaceList removes the sub-list defined by the inclusive indices 5511 /// illListReplaceList removes the sub-list defined by the inclusive indices
5512 /// start and end and inserts the src list in its place. The inclusive 5512 /// start and end and inserts the src list in its place. The inclusive
5513 /// nature of the indices means that at least one element must be deleted 5513 /// nature of the indices means that at least one element must be deleted
5514 /// if the indices are within the bounds of the existing list. I.e. 2,2 5514 /// if the indices are within the bounds of the existing list. I.e. 2,2
5515 /// will remove the element at index 2 and replace it with the source 5515 /// will remove the element at index 2 and replace it with the source
5516 /// list. Both indices may be negative, with the usual interpretation. An 5516 /// list. Both indices may be negative, with the usual interpretation. An
5517 /// interesting case is where end is lower than start. As these indices 5517 /// interesting case is where end is lower than start. As these indices
5518 /// bound the list to be removed, then 0->end, and start->lim are removed 5518 /// bound the list to be removed, then 0->end, and start->lim are removed
5519 /// and the source list is added as a suffix. 5519 /// and the source list is added as a suffix.
5520 /// </summary> 5520 /// </summary>
5521 5521
5522 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) 5522 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end)
5523 { 5523 {
5524 5524
5525 LSL_Types.list pref = null; 5525 LSL_Types.list pref = null;
5526 5526
5527 m_host.AddScriptLPS(1); 5527 m_host.AddScriptLPS(1);
@@ -5542,9 +5542,9 @@ namespace OpenSim.Region.ScriptEngine.Common
5542 // list. 5542 // list.
5543 if (start <= end) 5543 if (start <= end)
5544 { 5544 {
5545 // If greater than zero, then there is going to be a 5545 // If greater than zero, then there is going to be a
5546 // surviving prefix. Otherwise the inclusive nature 5546 // surviving prefix. Otherwise the inclusive nature
5547 // of the indices mean that we're going to add the 5547 // of the indices mean that we're going to add the
5548 // source list as a prefix. 5548 // source list as a prefix.
5549 if (start > 0) 5549 if (start > 0)
5550 { 5550 {
@@ -5580,7 +5580,7 @@ namespace OpenSim.Region.ScriptEngine.Common
5580 } 5580 }
5581 // Finally, if start > end, we strip away a prefix and 5581 // Finally, if start > end, we strip away a prefix and
5582 // a suffix, to leave the list that sits <between> ens 5582 // a suffix, to leave the list that sits <between> ens
5583 // and start, and then tag on the src list. AT least 5583 // and start, and then tag on the src list. AT least
5584 // that's my interpretation. We can get sublist to do 5584 // that's my interpretation. We can get sublist to do
5585 // this for us. Note that one, or both of the indices 5585 // this for us. Note that one, or both of the indices
5586 // might have been negative. 5586 // might have been negative.
@@ -6084,7 +6084,7 @@ namespace OpenSim.Region.ScriptEngine.Common
6084 if (LLUUID.TryParse(id, out key)) 6084 if (LLUUID.TryParse(id, out key))
6085 { 6085 {
6086 ScenePresence av = World.GetScenePresence(key); 6086 ScenePresence av = World.GetScenePresence(key);
6087 6087
6088 if (av != null) 6088 if (av != null)
6089 { 6089 {
6090 foreach (object o in args.Data) 6090 foreach (object o in args.Data)
@@ -6103,7 +6103,7 @@ namespace OpenSim.Region.ScriptEngine.Common
6103 case "4": 6103 case "4":
6104 ret.Add(new LSL_Types.Quaternion((double)av.Rotation.x, (double)av.Rotation.y, (double)av.Rotation.z, (double)av.Rotation.w)); 6104 ret.Add(new LSL_Types.Quaternion((double)av.Rotation.x, (double)av.Rotation.y, (double)av.Rotation.z, (double)av.Rotation.w));
6105 break; 6105 break;
6106 case "5": 6106 case "5":
6107 ret.Add(new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z)); 6107 ret.Add(new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z));
6108 break; 6108 break;
6109 case "6": 6109 case "6":
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
index e031c01..c8c51f8 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
@@ -493,7 +493,7 @@ namespace OpenSim.Region.ScriptEngine.Common
493 493
494 // now, this makes the math easier 494 // now, this makes the math easier
495 int remove=end+1-start; 495 int remove=end+1-start;
496 496
497 ret=new Object[m_data.Length-remove]; 497 ret=new Object[m_data.Length-remove];
498 if (ret.Length == 0) 498 if (ret.Length == 0)
499 return new list(ret); 499 return new list(ret);
@@ -519,7 +519,7 @@ namespace OpenSim.Region.ScriptEngine.Common
519 // NOTE that either index may still be negative after 519 // NOTE that either index may still be negative after
520 // adding the length, so we must take additional 520 // adding the length, so we must take additional
521 // measures to protect against this. Note also that 521 // measures to protect against this. Note also that
522 // after normalisation the negative indices are no 522 // after normalisation the negative indices are no
523 // longer relative to the end of the list. 523 // longer relative to the end of the list.
524 524
525 if (start < 0) 525 if (start < 0)
@@ -533,7 +533,7 @@ namespace OpenSim.Region.ScriptEngine.Common
533 } 533 }
534 534
535 // The conventional case is start <= end 535 // The conventional case is start <= end
536 // NOTE that the case of an empty list is 536 // NOTE that the case of an empty list is
537 // dealt with by the initial test. Start 537 // dealt with by the initial test. Start
538 // less than end is taken to be the most 538 // less than end is taken to be the most
539 // common case. 539 // common case.
@@ -553,7 +553,7 @@ namespace OpenSim.Region.ScriptEngine.Common
553 { 553 {
554 end = m_data.Length - 1; 554 end = m_data.Length - 1;
555 } 555 }
556 556
557 // Sublist still starts before the beginning of the list 557 // Sublist still starts before the beginning of the list
558 if (start < 0) 558 if (start < 0)
559 { 559 {
@@ -561,7 +561,7 @@ namespace OpenSim.Region.ScriptEngine.Common
561 } 561 }
562 562
563 ret = new object[end - start + 1]; 563 ret = new object[end - start + 1];
564 564
565 Array.Copy(m_data, start, ret, 0, end - start + 1); 565 Array.Copy(m_data, start, ret, 0, end - start + 1);
566 566
567 return new list(ret); 567 return new list(ret);
@@ -580,7 +580,7 @@ namespace OpenSim.Region.ScriptEngine.Common
580 { 580 {
581 result = new list(); 581 result = new list();
582 // If start is still negative, then the whole of 582 // If start is still negative, then the whole of
583 // the existing list is returned. This case is 583 // the existing list is returned. This case is
584 // only admitted if end is also still negative. 584 // only admitted if end is also still negative.
585 if (start < 0) 585 if (start < 0)
586 { 586 {
@@ -593,7 +593,7 @@ namespace OpenSim.Region.ScriptEngine.Common
593 result = GetSublist(0,end); 593 result = GetSublist(0,end);
594 } 594 }
595 595
596 // If start is outside of list, then just return 596 // If start is outside of list, then just return
597 // the prefix, whatever it is. 597 // the prefix, whatever it is.
598 if (start >= m_data.Length) 598 if (start >= m_data.Length)
599 { 599 {
@@ -896,7 +896,7 @@ namespace OpenSim.Region.ScriptEngine.Common
896 } 896 }
897 } 897 }
898 898
899 #endregion 899 #endregion
900 900
901 public string ToPrettyString() 901 public string ToPrettyString()
902 { 902 {
@@ -962,7 +962,7 @@ namespace OpenSim.Region.ScriptEngine.Common
962 } 962 }
963 963
964 // 964 //
965 // BELOW IS WORK IN PROGRESS... IT WILL CHANGE, SO DON'T USE YET! :) 965 // BELOW IS WORK IN PROGRESS... IT WILL CHANGE, SO DON'T USE YET! :)
966 // 966 //
967 967
968 public struct StringTest 968 public struct StringTest
@@ -1103,7 +1103,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1103 } 1103 }
1104 } 1104 }
1105 1105
1106 1106
1107 1107
1108 static public implicit operator String(LSLString s) 1108 static public implicit operator String(LSLString s)
1109 { 1109 {
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1267 i.value++; 1267 i.value++;
1268 return i; 1268 return i;
1269 } 1269 }
1270 1270
1271 1271
1272 public static LSLInteger operator --(LSLInteger i) 1272 public static LSLInteger operator --(LSLInteger i)
1273 { 1273 {
diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs
index 2b6f6d9..03d3a41 100644
--- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs
@@ -268,7 +268,7 @@ namespace OpenSim.Region.ScriptEngine.Common
268 return 0; 268 return 0;
269 } 269 }
270 } 270 }
271 271
272 public double osTerrainGetHeight(int x, int y) 272 public double osTerrainGetHeight(int x, int y)
273 { 273 {
274 m_host.AddScriptLPS(1); 274 m_host.AddScriptLPS(1);
@@ -448,7 +448,7 @@ namespace OpenSim.Region.ScriptEngine.Common
448 } 448 }
449 } 449 }
450 450
451 //Texture draw functions 451 //Texture draw functions
452 public string osMovePen(string drawList, int x, int y) 452 public string osMovePen(string drawList, int x, int y)
453 { 453 {
454 m_host.AddScriptLPS(1); 454 m_host.AddScriptLPS(1);
diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs
index 2d58b57..aa9c8c7 100644
--- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs
+++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ScriptEngine.Common
60 string osSetPenSize(string drawList, int penSize); 60 string osSetPenSize(string drawList, int penSize);
61 string osSetPenColour(string drawList, string colour); 61 string osSetPenColour(string drawList, string colour);
62 string osDrawImage(string drawList, int width, int height, string imageUrl); 62 string osDrawImage(string drawList, int width, int height, string imageUrl);
63 void osSetStateEvents(int events); 63 void osSetStateEvents(int events);
64 64
65 } 65 }
66} 66}
diff --git a/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs
index f438120..335d1a0 100644
--- a/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30 30
31// General Information about an assembly is controlled through the following 31// General information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information 32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly. 33// associated with an assembly.
34 34
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
41[assembly : AssemblyTrademark("")] 41[assembly : AssemblyTrademark("")]
42[assembly : AssemblyCulture("")] 42[assembly : AssemblyCulture("")]
43 43
44// Setting ComVisible to false makes the types in this assembly not visible 44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from 45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type. 46// COM, set the ComVisible attribute to true on that type.
47 47
48[assembly : ComVisible(false)] 48[assembly : ComVisible(false)]
@@ -54,7 +54,7 @@ using System.Runtime.InteropServices;
54// Version information for an assembly consists of the following four values: 54// Version information for an assembly consists of the following four values:
55// 55//
56// Major Version 56// Major Version
57// Minor Version 57// Minor Version
58// Build Number 58// Build Number
59// Revision 59// Revision
60// 60//
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs
index f3af621..2a0ed37 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs
@@ -115,7 +115,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
115 Thread.Sleep(cmdHandlerThreadCycleSleepms); 115 Thread.Sleep(cmdHandlerThreadCycleSleepms);
116 //lock (ScriptEngine.ScriptEngines) 116 //lock (ScriptEngine.ScriptEngines)
117 //{ 117 //{
118 foreach (ScriptEngine se in new ArrayList(ScriptEngine.ScriptEngines)) 118 foreach (ScriptEngine se in new ArrayList(ScriptEngine.ScriptEngines))
119 { 119 {
120 se.m_ASYNCLSLCommandManager.DoOneCmdHandlerPass(); 120 se.m_ASYNCLSLCommandManager.DoOneCmdHandlerPass();
121 } 121 }
@@ -176,7 +176,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
176 176
177 #region Check llRemoteData channels 177 #region Check llRemoteData channels
178 178
179 179
180 #endregion 180 #endregion
181 181
182 #region Check llListeners 182 #region Check llListeners
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs
index 4311836..13c9d25 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs
@@ -218,7 +218,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
218 objtype |= 0x04; // passive non-moving 218 objtype |= 0x04; // passive non-moving
219 else 219 else
220 objtype |= 0x02; // active moving 220 objtype |= 0x02; // active moving
221 if (ent is IScript) objtype |= 0x08; // Scripted. It COULD have one hidden ... 221 if (ent is IScript) objtype |= 0x08; // Scripted. It COULD have one hidden ...
222 222
223 if (((ts.type & objtype) != 0) || ((ts.type & objtype) == ts.type)) 223 if (((ts.type & objtype) != 0) || ((ts.type & objtype) == ts.type))
224 { 224 {
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs
index 141e471..6f88e11 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs
@@ -94,7 +94,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
94 } 94 }
95 } 95 }
96 96
97 // Old method: Create new list 97 // Old method: Create new list
98 //List<TimerClass> NewTimers = new List<TimerClass>(); 98 //List<TimerClass> NewTimers = new List<TimerClass>();
99 //foreach (TimerClass ts in Timers) 99 //foreach (TimerClass ts in Timers)
100 //{ 100 //{
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs
index 715e465..fc005ab 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
39 /// </summary> 39 /// </summary>
40 public class MaintenanceThread : iScriptEngineFunctionModule 40 public class MaintenanceThread : iScriptEngineFunctionModule
41 { 41 {
42 42
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 //public ScriptEngine m_ScriptEngine; 45 //public ScriptEngine m_ScriptEngine;
@@ -238,6 +238,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
238 // get { return _PleaseShutdown; } 238 // get { return _PleaseShutdown; }
239 // set { _PleaseShutdown = value; } 239 // set { _PleaseShutdown = value; }
240 //} 240 //}
241 //private bool _PleaseShutdown = false; 241 //private bool _PleaseShutdown = false;
242 } 242 }
243} 243}
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
index a7ad50d..b0c6314 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
38 /// <summary> 38 /// <summary>
39 /// This is the root object for ScriptEngine. Objects access each other trough this class. 39 /// This is the root object for ScriptEngine. Objects access each other trough this class.
40 /// </summary> 40 /// </summary>
41 /// 41 ///
42 [Serializable] 42 [Serializable]
43 public abstract class ScriptEngine : IRegionModule, ScriptServerInterfaces.ScriptEngine, iScriptEngineFunctionModule 43 public abstract class ScriptEngine : IRegionModule, ScriptServerInterfaces.ScriptEngine, iScriptEngineFunctionModule
44 { 44 {
@@ -154,7 +154,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
154 #region IRegionModule 154 #region IRegionModule
155 155
156 public abstract void Initialise(Scene scene, IConfigSource config); 156 public abstract void Initialise(Scene scene, IConfigSource config);
157 157
158 public void PostInitialise() 158 public void PostInitialise()
159 { 159 {
160 } 160 }
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
index 2233913..c84975a 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
41 /// Compiles them if necessary 41 /// Compiles them if necessary
42 /// Execute functions for EventQueueManager (Sends them to script on other AppDomain for execution) 42 /// Execute functions for EventQueueManager (Sends them to script on other AppDomain for execution)
43 /// </summary> 43 /// </summary>
44 /// 44 ///
45 45
46 // This class is as close as you get to the script without being inside script class. It handles all the dirty work for other classes. 46 // This class is as close as you get to the script without being inside script class. It handles all the dirty work for other classes.
47 // * Keeps track of running scripts 47 // * Keeps track of running scripts
@@ -212,7 +212,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
212 if (LUQueue.Count > 0) 212 if (LUQueue.Count > 0)
213 { 213 {
214 LUStruct item = LUQueue.Dequeue(); 214 LUStruct item = LUQueue.Dequeue();
215 215
216 if (item.Action == LUType.Unload) 216 if (item.Action == LUType.Unload)
217 { 217 {
218 _StopScript(item.localID, item.itemID); 218 _StopScript(item.localID, item.itemID);
@@ -224,7 +224,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
224 } 224 }
225 } 225 }
226 } 226 }
227 227
228 #endregion 228 #endregion
229 229
230 #region Helper functions 230 #region Helper functions
diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPServer.cs b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPServer.cs
index 55a20e7..26892a2 100644
--- a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPServer.cs
+++ b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPServer.cs
@@ -33,7 +33,7 @@ using System.Net.Sockets;
33 33
34namespace OpenSim.Region.ScriptEngine.Common.TRPC 34namespace OpenSim.Region.ScriptEngine.Common.TRPC
35{ 35{
36 public class TCPServer: TCPCommon.ServerInterface 36 public class TCPServer: TCPCommon.ServerInterface
37 { 37 {
38 public readonly int LocalPort; 38 public readonly int LocalPort;
39 public TCPServer(int localPort) 39 public TCPServer(int localPort)
diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs
index c293ecb..a310978 100644
--- a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs
+++ b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.Common
44 public delegate void ReceiveCommandDelegate(int ID, string Command, params object[] p); 44 public delegate void ReceiveCommandDelegate(int ID, string Command, params object[] p);
45 public event ReceiveCommandDelegate ReceiveCommand; 45 public event ReceiveCommandDelegate ReceiveCommand;
46 Dictionary<string, Type> TypeDictionary = new Dictionary<string, Type>(); 46 Dictionary<string, Type> TypeDictionary = new Dictionary<string, Type>();
47 Type[] Types = 47 Type[] Types =
48 { 48 {
49 typeof(String), 49 typeof(String),
50 typeof(Int16), 50 typeof(Int16),
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index 1d71182..f661162 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -39,9 +39,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
39{ 39{
40 public class Compiler 40 public class Compiler
41 { 41 {
42 private static readonly log4net.ILog m_log 42 private static readonly log4net.ILog m_log
43 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 43 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 // * Uses "LSL2Converter" to convert LSL to C# if necessary. 45 // * Uses "LSL2Converter" to convert LSL to C# if necessary.
46 // * Compiles C#-code into an assembly 46 // * Compiles C#-code into an assembly
47 // * Returns assembly name ready for AppDomain load. 47 // * Returns assembly name ready for AppDomain load.
@@ -278,8 +278,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
278 278
279 if (enableCommanderLSL == true && l == enumCompileType.cs) 279 if (enableCommanderLSL == true && l == enumCompileType.cs)
280 { 280 {
281 foreach (KeyValuePair<string, 281 foreach (KeyValuePair<string,
282 ICommander> com 282 ICommander> com
283 in m_scriptEngine.World.GetCommanders()) 283 in m_scriptEngine.World.GetCommanders())
284 { 284 {
285 compileScript = com.Value.GenerateRuntimeAPI() + compileScript; 285 compileScript = com.Value.GenerateRuntimeAPI() + compileScript;
@@ -305,7 +305,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
305 m_log.Debug("[ScriptEngine.DotNetEngine]: Preparing to compile the following LSL to C# translated code"); 305 m_log.Debug("[ScriptEngine.DotNetEngine]: Preparing to compile the following LSL to C# translated code");
306 m_log.Debug(""); 306 m_log.Debug("");
307 m_log.Debug(compileScript); 307 m_log.Debug(compileScript);
308 308
309 return CompileFromDotNetText(compileScript, l); 309 return CompileFromDotNetText(compileScript, l);
310 } 310 }
311 311
@@ -322,7 +322,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
322 322
323 private static string CreateCSCompilerScript(string compileScript) 323 private static string CreateCSCompilerScript(string compileScript)
324 { 324 {
325 325
326 326
327 compileScript = String.Empty + 327 compileScript = String.Empty +
328 "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + 328 "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" +
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
index 2100900..1832864 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
@@ -23,7 +23,7 @@
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*/
28 28
29using System; 29using System;
@@ -32,17 +32,13 @@ using System.Text.RegularExpressions;
32 32
33namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL 33namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
34{ 34{
35
36 public class LSL2CSConverter 35 public class LSL2CSConverter
37 { 36 {
38
39
40 // Uses regex to convert LSL code to C# code. 37 // Uses regex to convert LSL code to C# code.
41 38
42 //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled); 39 //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled);
43 private Dictionary<string, string> dataTypes = new Dictionary<string, string>(); 40 private Dictionary<string, string> dataTypes = new Dictionary<string, string>();
44 private Dictionary<string, string> quotes = new Dictionary<string, string>(); 41 private Dictionary<string, string> quotes = new Dictionary<string, string>();
45
46 42
47 public LSL2CSConverter() 43 public LSL2CSConverter()
48 { 44 {
@@ -72,7 +68,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
72 Script = Regex.Replace(Script, @"\r\n", "\n"); 68 Script = Regex.Replace(Script, @"\r\n", "\n");
73 Script = Regex.Replace(Script, @"\n", "\r\n"); 69 Script = Regex.Replace(Script, @"\n", "\r\n");
74 70
75
76 // QUOTE REPLACEMENT 71 // QUOTE REPLACEMENT
77 // temporarily replace quotes so we can work our magic on the script without 72 // temporarily replace quotes so we can work our magic on the script without
78 // always considering if we are inside our outside quotes's 73 // always considering if we are inside our outside quotes's
@@ -86,21 +81,16 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
86 bool last_was_escape = false; 81 bool last_was_escape = false;
87 int quote_replaced_count = 0; 82 int quote_replaced_count = 0;
88 83
89
90
91 string[] blocked = new string[] {"Axiom","Db4objects","libsecondlife","log4net","Microsoft", 84 string[] blocked = new string[] {"Axiom","Db4objects","libsecondlife","log4net","Microsoft",
92 "Modified","Mono","MonoXnaCompactMaths","mscorlib","MySql", 85 "Modified","Mono","MonoXnaCompactMaths","mscorlib","MySql",
93 "NHibernate","Nini","nunit","Ode","OpenSim","PhysX_Wrapper_Dotnet", 86 "NHibernate","Nini","nunit","Ode","OpenSim","PhysX_Wrapper_Dotnet",
94 "PumaCode","RAIL","XMLRPC","System"}; 87 "PumaCode","RAIL","XMLRPC","System"};
95
96 88
97 for (int p = 0; p < blocked.Length;p++) 89 for (int p = 0; p < blocked.Length;p++)
98 { 90 {
99
100 Match SecurityM = Regex.Match(Script, "[;}][^\"']+" + blocked[p].Replace(".", "\\.") + "\\.[^\"']", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); 91 Match SecurityM = Regex.Match(Script, "[;}][^\"']+" + blocked[p].Replace(".", "\\.") + "\\.[^\"']", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
101 if (SecurityM.Success) 92 if (SecurityM.Success)
102 throw new Exception("CS0103: 'The name '" + blocked[p] + "' does not exist in the current context'"); 93 throw new Exception("CS0103: 'The name '" + blocked[p] + "' does not exist in the current context'");
103
104 } 94 }
105 95
106 for (int p = 0; p < Script.Length; p++) 96 for (int p = 0; p < Script.Length; p++)
@@ -166,7 +156,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
166 // END OF QUOTE REPLACEMENT 156 // END OF QUOTE REPLACEMENT
167 // 157 //
168 158
169
170 // 159 //
171 // PROCESS STATES 160 // PROCESS STATES
172 // Remove state definitions and add state names to start of each event within state 161 // Remove state definitions and add state names to start of each event within state
@@ -194,7 +183,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
194 // if level == 0, add to return 183 // if level == 0, add to return
195 if (ilevel == 1 && lastlevel == 0) 184 if (ilevel == 1 && lastlevel == 0)
196 { 185 {
197 // 0 => 1: Get last 186 // 0 => 1: Get last
198 Match m = 187 Match m =
199 //Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", 188 //Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{",
200 Regex.Match(cache, @"(?![a-zA-Z_]+)\s*(state\s+)?(?<statename>[a-zA-Z_][a-zA-Z_0-9]*)[^a-zA-Z_0-9\(\)]*{", 189 Regex.Match(cache, @"(?![a-zA-Z_]+)\s*(state\s+)?(?<statename>[a-zA-Z_][a-zA-Z_0-9]*)[^a-zA-Z_0-9\(\)]*{",
@@ -253,7 +242,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
253 Script = ret; 242 Script = ret;
254 ret = String.Empty; 243 ret = String.Empty;
255 244
256
257 foreach (string key in dataTypes.Keys) 245 foreach (string key in dataTypes.Keys)
258 { 246 {
259 string val; 247 string val;
@@ -291,7 +279,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
291 Regex.Replace(Script, @"\[([^\]]*)\]", @"new LSL_Types.list($1)", 279 Regex.Replace(Script, @"\[([^\]]*)\]", @"new LSL_Types.list($1)",
292 RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); 280 RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
293 281
294
295 // Replace (string) to .ToString() // 282 // Replace (string) to .ToString() //
296 Script = 283 Script =
297 Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_.]+(\s*\([^\)]*\))?)", @"$1.ToString()", 284 Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_.]+(\s*\([^\)]*\))?)", @"$1.ToString()",
@@ -313,12 +300,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
313 Script = Script.Replace(key, "\"" + val + "\""); 300 Script = Script.Replace(key, "\"" + val + "\"");
314 } 301 }
315 302
316
317
318 //System.Console.WriteLine(Script); 303 //System.Console.WriteLine(Script);
319 Return = String.Empty;// + 304 Return = String.Empty;// +
320 //"using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;"; 305 //"using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;";
321
322 306
323 //Return += String.Empty + 307 //Return += String.Empty +
324 // "namespace SecondLife { "; 308 // "namespace SecondLife { ";
@@ -328,13 +312,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
328 //Return += @"public Script() { } "; 312 //Return += @"public Script() { } ";
329 Return += Script; 313 Return += Script;
330 //Return += "} }\r\n"; 314 //Return += "} }\r\n";
331 315
332 quotes.Clear(); 316 quotes.Clear();
333 317
334 return Return; 318 return Return;
335 } 319 }
336
337 } 320 }
338
339
340} 321}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs
index bce9cfc..799aa92 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30 30
31// General Information about an assembly is controlled through the following 31// General information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information 32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly. 33// associated with an assembly.
34 34
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
41[assembly : AssemblyTrademark("")] 41[assembly : AssemblyTrademark("")]
42[assembly : AssemblyCulture("")] 42[assembly : AssemblyCulture("")]
43 43
44// Setting ComVisible to false makes the types in this assembly not visible 44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from 45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type. 46// COM, set the ComVisible attribute to true on that type.
47 47
48[assembly : ComVisible(false)] 48[assembly : ComVisible(false)]
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
54// Version information for an assembly consists of the following four values: 54// Version information for an assembly consists of the following four values:
55// 55//
56// Major Version 56// Major Version
57// Minor Version 57// Minor Version
58// Build Number 58// Build Number
59// Revision 59// Revision
60// 60//
61// You can specify all the values or you can default the Revision and Build Numbers 61// You can specify all the values or you can default the Revision and Build Numbers
62// by using the '*' as shown below: 62// by using the '*' as shown below:
63 63
64[assembly : AssemblyVersion("1.0.0.0")] 64[assembly : AssemblyVersion("1.0.0.0")]
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index ed2c0a3..55289d9 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -102,7 +102,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
102 102
103 // Fire the first start-event 103 // Fire the first start-event
104 int eventFlags = m_scriptEngine.m_ScriptManager.GetStateEventFlags(localID, itemID); 104 int eventFlags = m_scriptEngine.m_ScriptManager.GetStateEventFlags(localID, itemID);
105 m_host.SetScriptEvents(itemID, eventFlags); 105 m_host.SetScriptEvents(itemID, eventFlags);
106 m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { }); 106 m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { });
107 } 107 }
108 catch (Exception e) // LEGIT: User Scripting 108 catch (Exception e) // LEGIT: User Scripting
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs
index 0208350..f53772e 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs
@@ -168,7 +168,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
168 Common.SendToDebug("IL_CREATE_CONSTRUCTOR()"); 168 Common.SendToDebug("IL_CREATE_CONSTRUCTOR()");
169 //ConstructorBuilder constructor = typeBuilder.DefineConstructor( 169 //ConstructorBuilder constructor = typeBuilder.DefineConstructor(
170 // MethodAttributes.Public, 170 // MethodAttributes.Public,
171 // CallingConventions.Standard, 171 // CallingConventions.Standard,
172 // new Type[0]); 172 // new Type[0]);
173 ConstructorBuilder constructor = typeBuilder.DefineConstructor( 173 ConstructorBuilder constructor = typeBuilder.DefineConstructor(
174 MethodAttributes.Public | 174 MethodAttributes.Public |
@@ -192,8 +192,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
192 //// Create state object 192 //// Create state object
193 //FieldName = "State"; 193 //FieldName = "State";
194 //FieldBuilder State_fb = typeBuilder.DefineField( 194 //FieldBuilder State_fb = typeBuilder.DefineField(
195 // FieldName, 195 // FieldName,
196 // typeof(UInt32), 196 // typeof(UInt32),
197 // FieldAttributes.Public); 197 // FieldAttributes.Public);
198 //il.Emit(OpCodes.Ldarg_0); 198 //il.Emit(OpCodes.Ldarg_0);
199 //il.Emit(OpCodes.Ldc_I4, 0); 199 //il.Emit(OpCodes.Ldc_I4, 0);
@@ -206,8 +206,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
206 206
207 //FieldName = "LSL_BuiltIns"; 207 //FieldName = "LSL_BuiltIns";
208 //FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField( 208 //FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField(
209 // FieldName, 209 // FieldName,
210 // objType1, 210 // objType1,
211 // FieldAttributes.Public); 211 // FieldAttributes.Public);
212 212
213 ////LSL_BuiltIn_Commands_TestImplementation _ti = new LSL_BuiltIn_Commands_TestImplementation(); 213 ////LSL_BuiltIn_Commands_TestImplementation _ti = new LSL_BuiltIn_Commands_TestImplementation();
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs
index 1b73311..7805aa3 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs
@@ -34,9 +34,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
34 // * 34 // *
35 // * These are internal "assembly" commands, 35 // * These are internal "assembly" commands,
36 // * basic operators like "ADD", "PUSH" and "POP" 36 // * basic operators like "ADD", "PUSH" and "POP"
37 // * 37 // *
38 // * It also contains managed stack and keeps track of internal variables, etc. 38 // * It also contains managed stack and keeps track of internal variables, etc.
39 // * 39 // *
40 // */ 40 // */
41 41
42 42
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs
index 06ae1e9..b2a2f25 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs
@@ -69,14 +69,12 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
69 fs.Close(); 69 fs.Close();
70 } 70 }
71 71
72
73 /// <summary> 72 /// <summary>
74 /// Parse LSO file. 73 /// Parse LSO file.
75 /// </summary> 74 /// </summary>
76 public void Parse() 75 public void Parse()
77 { 76 {
78 // The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack. 77 // The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack.
79
80 78
81 // HEADER BLOCK 79 // HEADER BLOCK
82 Common.SendToDebug("Reading HEADER BLOCK at: 0"); 80 Common.SendToDebug("Reading HEADER BLOCK at: 0");
@@ -156,7 +154,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
156 } 154 }
157 Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount); 155 Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount);
158 156
159
160 // FUNCTION BLOCK 157 // FUNCTION BLOCK
161 // Always right after STATIC BLOCK 158 // Always right after STATIC BLOCK
162 LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock(); 159 LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock();
@@ -186,7 +183,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
186 } 183 }
187 } 184 }
188 185
189
190 // STATE FRAME BLOCK 186 // STATE FRAME BLOCK
191 // Always right after FUNCTION BLOCK 187 // Always right after FUNCTION BLOCK
192 Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR); 188 Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR);
@@ -213,7 +209,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
213 } 209 }
214 } 210 }
215 211
216
217 // STATE BLOCK 212 // STATE BLOCK
218 // For each StateFrameBlock there is one StateBlock with multiple event handlers 213 // For each StateFrameBlock there is one StateBlock with multiple event handlers
219 214
@@ -239,7 +234,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
239 234
240 // We need to count number of bits flagged in EventMask? 235 // We need to count number of bits flagged in EventMask?
241 236
242
243 // for each bit in myStateFrameBlock.StatePointer[i].EventMask 237 // for each bit in myStateFrameBlock.StatePointer[i].EventMask
244 238
245 // ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE 239 // ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE
@@ -273,7 +267,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
273 } 267 }
274 } 268 }
275 269
276
277 //// READ FUNCTION CODE CHUNKS 270 //// READ FUNCTION CODE CHUNKS
278 //// Functions + Function start pos (GFR) 271 //// Functions + Function start pos (GFR)
279 //// TODO: Somehow be able to identify and reference this 272 //// TODO: Somehow be able to identify and reference this
@@ -293,7 +286,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
293 { 286 {
294 for (int i = 0; i < myStateFrameBlock.StateCount; i++) 287 for (int i = 0; i < myStateFrameBlock.StateCount; i++)
295 { 288 {
296 // TODO: Somehow organize events and functions so they can be found again, 289 // TODO: Somehow organize events and functions so they can be found again,
297 // two level search ain't no good 290 // two level search ain't no good
298 for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++) 291 for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++)
299 { 292 {
@@ -320,7 +313,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
320 } 313 }
321 } 314 }
322 315
323
324 if (Common.IL_CreateFunctionList) 316 if (Common.IL_CreateFunctionList)
325 IL_INSERT_FUNCTIONLIST(); 317 IL_INSERT_FUNCTIONLIST();
326 } 318 }
@@ -371,7 +363,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
371 363
372 //private byte[] br_read_smallendian(int len) 364 //private byte[] br_read_smallendian(int len)
373 //{ 365 //{
374 // byte[] bytes = new byte[len]; 366 // byte[] bytes = new byte[len];
375 // br.Read(bytes,0, len); 367 // br.Read(bytes,0, len);
376 // return bytes; 368 // return bytes;
377 //} 369 //}
@@ -459,7 +451,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
459 Common.SendToDebug("Return type #" + myCodeChunk.ReturnType.ObjectType + ": " + 451 Common.SendToDebug("Return type #" + myCodeChunk.ReturnType.ObjectType + ": " +
460 ((LSO_Enums.Variable_Type_Codes) myCodeChunk.ReturnType.ObjectType).ToString()); 452 ((LSO_Enums.Variable_Type_Codes) myCodeChunk.ReturnType.ObjectType).ToString());
461 453
462
463 // TODO: How to determine number of codechunks -- does this method work? 454 // TODO: How to determine number of codechunks -- does this method work?
464 myCodeChunk.CodeChunkArguments = new List<LSO_Struct.CodeChunkArgument>(); 455 myCodeChunk.CodeChunkArguments = new List<LSO_Struct.CodeChunkArgument>();
465 byte reader = br_read(1)[0]; 456 byte reader = br_read(1)[0];
@@ -492,7 +483,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
492 // End marker is 0x000 483 // End marker is 0x000
493 myCodeChunk.EndMarker = reader; 484 myCodeChunk.EndMarker = reader;
494 485
495
496 // 486 //
497 // Emit: START OF METHOD (FUNCTION) 487 // Emit: START OF METHOD (FUNCTION)
498 // 488 //
@@ -515,11 +505,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
515 Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();"); 505 Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();");
516 ILGenerator il = methodBuilder.GetILGenerator(); 506 ILGenerator il = methodBuilder.GetILGenerator();
517 507
518
519 if (Common.IL_UseTryCatch) 508 if (Common.IL_UseTryCatch)
520 IL_INSERT_TRY(il, eventname); 509 IL_INSERT_TRY(il, eventname);
521 510
522
523 // Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!"); 511 // Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!");
524 //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call..."); 512 //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call...");
525 //il.Emit(OpCodes.Call, typeof(Console).GetMethod 513 //il.Emit(OpCodes.Call, typeof(Console).GetMethod
@@ -534,7 +522,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
534 il.Emit(OpCodes.Ldarg, _ic); 522 il.Emit(OpCodes.Ldarg, _ic);
535 } 523 }
536 524
537
538 // 525 //
539 // CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL 526 // CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL
540 // 527 //
@@ -544,7 +531,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
544 FoundRet = LSL_PROCESS_OPCODE(il); 531 FoundRet = LSL_PROCESS_OPCODE(il);
545 } 532 }
546 533
547
548 if (Common.IL_UseTryCatch) 534 if (Common.IL_UseTryCatch)
549 IL_INSERT_END_TRY(il, eventname); 535 IL_INSERT_END_TRY(il, eventname);
550 536
@@ -558,17 +544,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
558 { 544 {
559 Common.SendToDebug("Creating function list"); 545 Common.SendToDebug("Creating function list");
560 546
561
562 string eventname = "GetFunctions"; 547 string eventname = "GetFunctions";
563 548
564 Common.SendToDebug("Creating IL " + eventname); 549 Common.SendToDebug("Creating IL " + eventname);
565 // Define a private String field. 550 // Define a private String field.
566 //FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public); 551 //FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public);
567 552
568
569 //FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private); 553 //FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private);
570 554
571
572 MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname, 555 MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname,
573 MethodAttributes.Public, 556 MethodAttributes.Public,
574 typeof (string[]), 557 typeof (string[]),
@@ -579,7 +562,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
579 562
580 ILGenerator il = methodBuilder.GetILGenerator(); 563 ILGenerator il = methodBuilder.GetILGenerator();
581 564
582
583 // IL_INSERT_TRY(il, eventname); 565 // IL_INSERT_TRY(il, eventname);
584 566
585 // // Push string to stack 567 // // Push string to stack
@@ -615,17 +597,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
615 //il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddFunction", new Type[] { typeof(string) })); 597 //il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddFunction", new Type[] { typeof(string) }));
616 } 598 }
617 599
618
619 // IL_INSERT_END_TRY(il, eventname); 600 // IL_INSERT_END_TRY(il, eventname);
620 601
621
622 il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack 602 il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack
623 // il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("SetFunctionList", new Type[] { typeof(Array) })); 603 // il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("SetFunctionList", new Type[] { typeof(Array) }));
624 604
625 il.Emit(OpCodes.Ret); // Return 605 il.Emit(OpCodes.Ret); // Return
626 } 606 }
627 607
628
629 private void IL_INSERT_TRY(ILGenerator il, string eventname) 608 private void IL_INSERT_TRY(ILGenerator il, string eventname)
630 { 609 {
631 /* 610 /*
@@ -687,7 +666,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
687 { 666 {
688 Common.SendToDebug("Found cached STATIC BLOCK"); 667 Common.SendToDebug("Found cached STATIC BLOCK");
689 668
690
691 return StaticBlocks[pos]; 669 return StaticBlocks[pos];
692 } 670 }
693 671
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/LSOEngine/Properties/AssemblyInfo.cs
index 78b44a0..5210ff0 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30 30
31// General Information about an assembly is controlled through the following 31// General information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information 32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly. 33// associated with an assembly.
34 34
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
41[assembly : AssemblyTrademark("")] 41[assembly : AssemblyTrademark("")]
42[assembly : AssemblyCulture("")] 42[assembly : AssemblyCulture("")]
43 43
44// Setting ComVisible to false makes the types in this assembly not visible 44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from 45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type. 46// COM, set the ComVisible attribute to true on that type.
47 47
48[assembly : ComVisible(false)] 48[assembly : ComVisible(false)]
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
54// Version information for an assembly consists of the following four values: 54// Version information for an assembly consists of the following four values:
55// 55//
56// Major Version 56// Major Version
57// Minor Version 57// Minor Version
58// Build Number 58// Build Number
59// Revision 59// Revision
60// 60//
61// You can specify all the values or you can default the Revision and Build Numbers 61// You can specify all the values or you can default the Revision and Build Numbers
62// by using the '*' as shown below: 62// by using the '*' as shown below:
63 63
64[assembly : AssemblyVersion("1.0.0.0")] 64[assembly : AssemblyVersion("1.0.0.0")]
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs
index 20d1a58..617d6f6 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine
92 92
93 // Fire the first start-event 93 // Fire the first start-event
94 int eventFlags = m_scriptEngine.m_ScriptManager.GetStateEventFlags(localID, itemID); 94 int eventFlags = m_scriptEngine.m_ScriptManager.GetStateEventFlags(localID, itemID);
95 m_host.SetScriptEvents(itemID, eventFlags); 95 m_host.SetScriptEvents(itemID, eventFlags);
96 m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { }); 96 m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { });
97 } 97 }
98 catch (Exception e) // LEGIT - User Script Compilation 98 catch (Exception e) // LEGIT - User Script Compilation
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs
index 70a84f1..77d9b10 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30 30
31// General Information about an assembly is controlled through the following 31// General information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information 32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly. 33// associated with an assembly.
34 34
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
41[assembly : AssemblyTrademark("")] 41[assembly : AssemblyTrademark("")]
42[assembly : AssemblyCulture("")] 42[assembly : AssemblyCulture("")]
43 43
44// Setting ComVisible to false makes the types in this assembly not visible 44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from 45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type. 46// COM, set the ComVisible attribute to true on that type.
47 47
48[assembly : ComVisible(false)] 48[assembly : ComVisible(false)]
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
54// Version information for an assembly consists of the following four values: 54// Version information for an assembly consists of the following four values:
55// 55//
56// Major Version 56// Major Version
57// Minor Version 57// Minor Version
58// Build Number 58// Build Number
59// Revision 59// Revision
60// 60//
61// You can specify all the values or you can default the Revision and Build Numbers 61// You can specify all the values or you can default the Revision and Build Numbers
62// by using the '*' as shown below: 62// by using the '*' as shown below:
63 63
64[assembly : AssemblyVersion("1.0.0.0")] 64[assembly : AssemblyVersion("1.0.0.0")]
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs
index c33cfd1..8754516 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
39 /// <summary> 39 /// <summary>
40 /// This is the root object for RemoteServer. Objects access each other trough this class. 40 /// This is the root object for RemoteServer. Objects access each other trough this class.
41 /// </summary> 41 /// </summary>
42 /// 42 ///
43 [Serializable] 43 [Serializable]
44 public class ScriptEngine : IRegionModule 44 public class ScriptEngine : IRegionModule
45 { 45 {
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs
index c0fc890..0416779 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs
@@ -29,7 +29,7 @@ using System.Reflection;
29using System.Runtime.CompilerServices; 29using System.Runtime.CompilerServices;
30using System.Runtime.InteropServices; 30using System.Runtime.InteropServices;
31 31
32// General Information about an assembly is controlled through the following 32// General information about an assembly is controlled through the following
33// set of attributes. Change these attribute values to modify the information 33// set of attributes. Change these attribute values to modify the information
34// associated with an assembly. 34// associated with an assembly.
35[assembly: AssemblyTitle("OpenSim.DataStore.DB4o")] 35[assembly: AssemblyTitle("OpenSim.DataStore.DB4o")]
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
41[assembly: AssemblyTrademark("")] 41[assembly: AssemblyTrademark("")]
42[assembly: AssemblyCulture("")] 42[assembly: AssemblyCulture("")]
43 43
44// Setting ComVisible to false makes the types in this assembly not visible 44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from 45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type. 46// COM, set the ComVisible attribute to true on that type.
47[assembly: ComVisible(false)] 47[assembly: ComVisible(false)]
48 48
@@ -52,11 +52,11 @@ using System.Runtime.InteropServices;
52// Version information for an assembly consists of the following four values: 52// Version information for an assembly consists of the following four values:
53// 53//
54// Major Version 54// Major Version
55// Minor Version 55// Minor Version
56// Build Number 56// Build Number
57// Revision 57// Revision
58// 58//
59// You can specify all the values or you can default the Revision and Build Numbers 59// You can specify all the values or you can default the Revision and Build Numbers
60// by using the '*' as shown below: 60// by using the '*' as shown below:
61[assembly: AssemblyVersion("1.0.0.0")] 61[assembly: AssemblyVersion("1.0.0.0")]
62[assembly: AssemblyFileVersion("1.0.0.0")] 62[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
index c917e1e..fa0d0b6 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
@@ -142,7 +142,7 @@ namespace OpenSim.DataStore.MSSQL
142 public void RemoveObject(LLUUID obj, LLUUID regionUUID) 142 public void RemoveObject(LLUUID obj, LLUUID regionUUID)
143 { 143 {
144 m_log.InfoFormat("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID); 144 m_log.InfoFormat("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
145 145
146 DataTable prims = ds.Tables["prims"]; 146 DataTable prims = ds.Tables["prims"];
147 DataTable shapes = ds.Tables["primshapes"]; 147 DataTable shapes = ds.Tables["primshapes"];
148 148
@@ -332,7 +332,7 @@ namespace OpenSim.DataStore.MSSQL
332 /*********************************************************************** 332 /***********************************************************************
333 * 333 *
334 * Database Definition Functions 334 * Database Definition Functions
335 * 335 *
336 * This should be db agnostic as we define them in ADO.NET terms 336 * This should be db agnostic as we define them in ADO.NET terms
337 * 337 *
338 **********************************************************************/ 338 **********************************************************************/
@@ -460,7 +460,7 @@ namespace OpenSim.DataStore.MSSQL
460 } 460 }
461 461
462 /*********************************************************************** 462 /***********************************************************************
463 * 463 *
464 * Convert between ADO.NET <=> OpenSim Objects 464 * Convert between ADO.NET <=> OpenSim Objects
465 * 465 *
466 * These should be database independant 466 * These should be database independant
@@ -650,7 +650,7 @@ namespace OpenSim.DataStore.MSSQL
650 s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); 650 s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]);
651 651
652 // text TODO: this isn't right] = but I'm not sure the right 652 // text TODO: this isn't right] = but I'm not sure the right
653 // way to specify this as a blob atm 653 // way to specify this as a blob atm
654 byte[] textureEntry = (byte[]) row["Texture"]; 654 byte[] textureEntry = (byte[]) row["Texture"];
655 s.TextureEntry = textureEntry; 655 s.TextureEntry = textureEntry;
656 656
@@ -695,7 +695,7 @@ namespace OpenSim.DataStore.MSSQL
695 // way to specify this as a blob atm 695 // way to specify this as a blob atm
696 696
697 // And I couldn't work out how to save binary data either 697 // And I couldn't work out how to save binary data either
698 // seems that the texture colum is being treated as a string in the Datarow 698 // seems that the texture colum is being treated as a string in the Datarow
699 // if you do a .getType() on it, it returns string, while the other columns return correct type 699 // if you do a .getType() on it, it returns string, while the other columns return correct type
700 // MW[10-08-07] 700 // MW[10-08-07]
701 // Added following xml hack but not really ideal , also ExtraParams isn't currently part of the database 701 // Added following xml hack but not really ideal , also ExtraParams isn't currently part of the database
@@ -738,7 +738,7 @@ namespace OpenSim.DataStore.MSSQL
738 fillShapeRow(shapeRow, prim); 738 fillShapeRow(shapeRow, prim);
739 } 739 }
740 } 740 }
741 741
742 // see IRegionDatastore 742 // see IRegionDatastore
743 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items) 743 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
744 { 744 {
@@ -868,7 +868,7 @@ namespace OpenSim.DataStore.MSSQL
868 /// This is a convenience function that collapses 5 repetitive 868 /// This is a convenience function that collapses 5 repetitive
869 /// lines for defining SqlParameters to 2 parameters: 869 /// lines for defining SqlParameters to 2 parameters:
870 /// column name and database type. 870 /// column name and database type.
871 /// 871 ///
872 /// It assumes certain conventions like :param as the param 872 /// It assumes certain conventions like :param as the param
873 /// name to replace in parametrized queries, and that source 873 /// name to replace in parametrized queries, and that source
874 /// version is always current version, both of which are fine 874 /// version is always current version, both of which are fine