From 67e12b95ea7b68f4904a7484d77ecfd787d16d0c Mon Sep 17 00:00:00 2001
From: lbsa71
Date: Tue, 30 Oct 2007 09:05:31 +0000
Subject: * Optimized usings * Shortened type references * Removed redundant
'this' qualifier
---
OpenSim/Region/Application/Application.cs | 17 +-
OpenSim/Region/Application/OpenSimController.cs | 68 +-
OpenSim/Region/Application/OpenSimMain.cs | 68 +-
OpenSim/Region/Application/VersionInfo.cs | 2 +-
.../ClientStack/ClientStackNetworkHandler.cs | 6 +-
OpenSim/Region/ClientStack/ClientView.API.cs | 538 ++---
.../ClientStack/ClientView.PacketHandlers.cs | 89 +-
.../Region/ClientStack/ClientView.PacketQueue.cs | 39 +-
.../ClientStack/ClientView.ProcessPackets.cs | 270 ++-
OpenSim/Region/ClientStack/ClientView.cs | 86 +-
OpenSim/Region/ClientStack/PacketServer.cs | 33 +-
.../Region/ClientStack/RegionApplicationBase.cs | 25 +-
OpenSim/Region/ClientStack/UDPServer.cs | 60 +-
.../Communications/Local/CommunicationsLocal.cs | 20 +-
.../Communications/Local/LocalBackEndServices.cs | 63 +-
.../Communications/Local/LocalInventoryService.cs | 21 +-
.../Communications/Local/LocalLoginService.cs | 49 +-
.../Communications/Local/LocalUserServices.cs | 8 +-
.../Local/Properties/AssemblyInfo.cs | 31 +-
.../Communications/OGS1/CommunicationsOGS1.cs | 8 +-
.../Region/Communications/OGS1/OGS1GridServices.cs | 104 +-
.../Communications/OGS1/OGS1InterSimComms.cs | 18 +-
.../Communications/OGS1/OGS1InventoryService.cs | 17 +-
.../Region/Communications/OGS1/OGS1UserServices.cs | 63 +-
.../Communications/OGS1/Properties/AssemblyInfo.cs | 31 +-
OpenSim/Region/Environment/EstateManager.cs | 28 +-
.../Environment/Interfaces/IAvatarFactory.cs | 5 +-
.../Interfaces/IDynamicTextureManager.cs | 2 +-
.../Region/Environment/Interfaces/IHttpRequests.cs | 2 +-
.../Region/Environment/Interfaces/IRegionModule.cs | 4 +-
OpenSim/Region/Environment/Interfaces/ISimChat.cs | 7 +-
OpenSim/Region/Environment/Interfaces/ITerrain.cs | 3 +-
.../Region/Environment/Interfaces/IWorldComm.cs | 2 +-
OpenSim/Region/Environment/Interfaces/IXMLRPC.cs | 2 +-
OpenSim/Region/Environment/Interfaces/IXfer.cs | 2 +-
OpenSim/Region/Environment/LandManagement/Land.cs | 3 +-
.../Environment/LandManagement/LandManager.cs | 1 -
OpenSim/Region/Environment/ModuleLoader.cs | 19 +-
.../Environment/Modules/AssetDownloadModule.cs | 7 +-
.../Environment/Modules/AvatarFactoryModule.cs | 11 +-
.../Environment/Modules/AvatarProfilesModule.cs | 7 +-
OpenSim/Region/Environment/Modules/ChatModule.cs | 266 +--
.../Environment/Modules/DynamicTextureModule.cs | 6 +-
OpenSim/Region/Environment/Modules/EmailModule.cs | 2 +-
.../Region/Environment/Modules/FriendsModule.cs | 4 +-
OpenSim/Region/Environment/Modules/GroupsModule.cs | 4 +-
.../Environment/Modules/InstantMessageModule.cs | 30 +-
.../Region/Environment/Modules/InventoryModule.cs | 4 +-
.../Environment/Modules/LoadImageURLModule.cs | 33 +-
.../Environment/Modules/ScriptsHttpRequests.cs | 2 +-
.../Region/Environment/Modules/TeleportModule.cs | 2 +-
.../Environment/Modules/TextureDownloadModule.cs | 49 +-
.../Region/Environment/Modules/WorldCommModule.cs | 146 +-
OpenSim/Region/Environment/Modules/XMLRPCModule.cs | 65 +-
OpenSim/Region/Environment/Modules/XferModule.cs | 7 +-
OpenSim/Region/Environment/PermissionManager.cs | 3 +-
OpenSim/Region/Environment/Scenes/EntityBase.cs | 2 +-
.../Environment/Scenes/IScenePresenceBody.cs | 3 +-
.../Region/Environment/Scenes/Scene.Inventory.cs | 9 +-
.../Environment/Scenes/Scene.PacketHandlers.cs | 22 +-
OpenSim/Region/Environment/Scenes/Scene.cs | 197 +-
OpenSim/Region/Environment/Scenes/SceneBase.cs | 4 +-
OpenSim/Region/Environment/Scenes/SceneEvents.cs | 5 +-
OpenSim/Region/Environment/Scenes/SceneManager.cs | 86 +-
.../Region/Environment/Scenes/SceneObjectGroup.cs | 44 +-
.../Region/Environment/Scenes/SceneObjectPart.cs | 23 +-
.../Environment/Scenes/ScenePresence.Animations.cs | 2 +-
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 83 +-
.../Environment/Scenes/Scripting/IScriptHost.cs | 2 +-
.../Environment/Scenes/Scripting/NullScriptHost.cs | 2 +-
OpenSim/Region/Environment/StorageManager.cs | 2 +-
.../Region/Environment/Types/BasicQuadTreeNode.cs | 45 +-
OpenSim/Region/Environment/Types/UpdateQueue.cs | 2 +-
OpenSim/Region/Examples/SimpleApp/ComplexObject.cs | 65 +-
.../Region/Examples/SimpleApp/CpuCounterObject.cs | 25 +-
.../Region/Examples/SimpleApp/FileSystemObject.cs | 14 +-
.../Region/Examples/SimpleApp/MyNpcCharacter.cs | 286 ++-
OpenSim/Region/Examples/SimpleApp/MyWorld.cs | 32 +-
OpenSim/Region/Examples/SimpleApp/Program.cs | 87 +-
.../Examples/SimpleApp/Properties/AssemblyInfo.cs | 31 +-
.../Engines/CSharp/CSharpScriptEngine.cs | 13 +-
.../Engines/CSharp/Examples/ExportRegionToLSL.cs | 16 +-
.../Engines/JScript/JScriptEngine.cs | 5 +-
.../Engines/JVMEngine/JVM/ClassInstance.cs | 5 +-
.../Engines/JVMEngine/JVM/ClassRecord.cs | 222 +-
.../Engines/JVMEngine/JVM/Heap.cs | 5 +-
.../Engines/JVMEngine/JVM/Interpreter.Logic.cs | 454 ++--
.../Engines/JVMEngine/JVM/Interpreter.Methods.cs | 44 +-
.../Engines/JVMEngine/JVM/Interpreter.Return.cs | 6 +-
.../Engines/JVMEngine/JVM/Interpreter.cs | 63 +-
.../Engines/JVMEngine/JVM/MainMemory.cs | 8 +-
.../Engines/JVMEngine/JVM/MethodMemory.cs | 4 +-
.../Engines/JVMEngine/JVM/Object.cs | 6 +-
.../Engines/JVMEngine/JVM/OpCodes.cs | 6 +-
.../Engines/JVMEngine/JVM/Stack.cs | 4 +-
.../Engines/JVMEngine/JVM/StackFrame.cs | 5 +-
.../Engines/JVMEngine/JVM/Thread.cs | 32 +-
.../Engines/JVMEngine/JavaEngine.cs | 6 +-
.../Engines/JVMEngine/OpenSimJVM.cs | 55 +-
.../Engines/JVMEngine/Types/ArrayReference.cs | 8 +-
.../Engines/JVMEngine/Types/ObjectReference.cs | 7 +-
.../Engines/JVMEngine/Types/PrimitiveTypes/Byte.cs | 7 +-
.../Engines/JVMEngine/Types/PrimitiveTypes/Char.cs | 7 +-
.../JVMEngine/Types/PrimitiveTypes/Float.cs | 8 +-
.../Engines/JVMEngine/Types/PrimitiveTypes/Int.cs | 8 +-
OpenSim/Region/ExtensionsScriptModule/Script.cs | 8 +-
OpenSim/Region/ExtensionsScriptModule/ScriptAPI.cs | 11 +-
.../Region/ExtensionsScriptModule/ScriptInfo.cs | 7 +-
.../ExtensionsScriptModule/ScriptInterpretedAPI.cs | 52 +-
.../ScriptInterpretedEvents.cs | 9 +-
.../Region/ExtensionsScriptModule/ScriptManager.cs | 26 +-
.../Physics/BasicPhysicsPlugin/AssemblyInfo.cs | 22 +-
.../BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 106 +-
.../Region/Physics/BulletXPlugin/AssemblyInfo.cs | 24 +-
.../Region/Physics/BulletXPlugin/BulletXPlugin.cs | 589 +++---
OpenSim/Region/Physics/Manager/AssemblyInfo.cs | 22 +-
OpenSim/Region/Physics/Manager/PhysicsActor.cs | 110 +-
.../Region/Physics/Manager/PhysicsPluginManager.cs | 143 +-
OpenSim/Region/Physics/Manager/PhysicsScene.cs | 26 +-
OpenSim/Region/Physics/Manager/PhysicsVector.cs | 5 +-
OpenSim/Region/Physics/OdePlugin/AssemblyInfo.cs | 22 +-
.../Physics/OdePlugin/Meshing/HelperTypes.cs | 72 +-
.../Physics/OdePlugin/Meshing/Meshmerizer.cs | 256 ++-
OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 274 +--
OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs | 22 +-
OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | 643 +++---
OpenSim/Region/ScriptEngine/Common/Executor.cs | 88 +-
OpenSim/Region/ScriptEngine/Common/IScript.cs | 6 +-
.../Common/LSL_BuiltIn_Commands_Interface.cs | 15 +-
OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 26 +-
.../ScriptEngine/Common/Properties/AssemblyInfo.cs | 31 +-
.../ScriptEngine/DotNetEngine/AppDomainManager.cs | 48 +-
OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs | 16 +-
.../DotNetEngine/Compiler/LSL/Compiler.cs | 38 +-
.../DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 82 +-
.../DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | 2173 ++++++++++++++++----
.../DotNetEngine/Compiler/LSO/Common.cs | 27 +-
.../DotNetEngine/Compiler/LSO/Engine.cs | 149 +-
.../Compiler/LSO/IL_common_functions.cs | 25 +-
.../DotNetEngine/Compiler/LSO/LSL_BaseClass.cs | 20 +-
.../Compiler/LSO/LSL_BaseClass_OPCODES.cs | 186 +-
.../DotNetEngine/Compiler/LSO/LSL_CLRInterface.cs | 6 +-
.../Compiler/LSO/LSL_OPCODE_IL_processor.cs | 135 +-
.../DotNetEngine/Compiler/LSO/LSO_Enums.cs | 11 +-
.../DotNetEngine/Compiler/LSO/LSO_Parser.cs | 208 +-
.../DotNetEngine/Compiler/LSO/LSO_Struct.cs | 20 +-
.../Compiler/Server_API/LSL_BuiltIn_Commands.cs | 2020 +++++++++++++-----
.../ScriptEngine/DotNetEngine/EventManager.cs | 173 +-
.../ScriptEngine/DotNetEngine/EventQueueManager.cs | 64 +-
.../ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs | 74 +-
.../DotNetEngine/Properties/AssemblyInfo.cs | 31 +-
.../ScriptEngine/DotNetEngine/ScriptEngine.cs | 33 +-
.../ScriptEngine/DotNetEngine/ScriptManager.cs | 101 +-
.../TempDotNetMicroThreadingCodeInjector.cs | 20 +-
.../MonoSqliteDataStore.cs | 289 +--
.../OpenSim.DataStore.NullStorage/NullDataStore.cs | 19 +-
.../Properties/AssemblyInfo.cs | 31 +-
.../Properties/AssemblyInfo.cs | 31 +-
.../Region/Terrain.BasicTerrain/TerrainEngine.cs | 169 +-
.../Region/Terrain.BasicTerrain/TerrainFilter.cs | 8 +-
.../libTerrainBSD/Bitmap/Bitmap.cs | 20 +-
.../libTerrainBSD/Channel/Channel.cs | 18 +-
.../libTerrainBSD/Channel/Common.cs | 33 +-
.../libTerrainBSD/Channel/Editing/Flatten.cs | 29 +-
.../libTerrainBSD/Channel/Editing/Raise.cs | 14 +-
.../libTerrainBSD/Channel/File.cs | 15 +-
.../libTerrainBSD/Channel/Generators/Fracture.cs | 10 +-
.../libTerrainBSD/Channel/Generators/Gradient.cs | 5 -
.../Channel/Generators/HillPlanter.cs | 77 +-
.../libTerrainBSD/Channel/Generators/Noise.cs | 4 +-
.../libTerrainBSD/Channel/Generators/Spiral.cs | 47 +-
.../libTerrainBSD/Channel/Generators/Voronoi.cs | 35 +-
.../libTerrainBSD/Channel/Generators/Worms.cs | 14 +-
.../libTerrainBSD/Channel/Grid.cs | 42 +-
.../Channel/Manipulators/AerobicErosion.cs | 23 +-
.../Channel/Manipulators/HydraulicErosion.cs | 19 +-
.../Channel/Manipulators/NavierStokes.cs | 100 +-
.../Channel/Manipulators/ThermalWeathering.cs | 18 +-
.../libTerrainBSD/Channel/Neighbours.cs | 10 +-
.../libTerrainBSD/Channel/Operators.cs | 9 +-
.../libTerrainBSD/Tools/Point2D.cs | 6 +-
.../libTerrainBSD/Tools/Tools.cs | 31 +-
182 files changed, 8211 insertions(+), 5729 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 0288f63..bb26ce3 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -26,27 +26,24 @@
*
*/
using System;
-using OpenSim.Framework.Console;
-using OpenSim.Region.Environment.Scenes;
using Nini.Config;
-using System.Threading;
using OpenSim.Framework;
+using OpenSim.Framework.Console;
namespace OpenSim
{
public class Application
- {
+ {
//could move our main function into OpenSimMain and kill this class
[STAThread]
public static void Main(string[] args)
{
-
Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
-
+
Console.Write("Performing compatibility checks... ");
string supported = "";
- if (OpenSim.Framework.Util.IsEnvironmentSupported(ref supported))
+ if (Util.IsEnvironmentSupported(ref supported))
{
Console.WriteLine(" Environment is compatible.\n");
}
@@ -54,10 +51,10 @@ namespace OpenSim
{
Console.WriteLine(" Environment is unsupported (" + supported + ")\n");
}
-
+
Console.WriteLine("Starting...\n");
- Culture.SetCurrentCulture();
+ Culture.SetCurrentCulture();
ArgvConfigSource configSource = new ArgvConfigSource(args);
@@ -80,4 +77,4 @@ namespace OpenSim
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Application/OpenSimController.cs b/OpenSim/Region/Application/OpenSimController.cs
index da93b54..1fa4b04 100644
--- a/OpenSim/Region/Application/OpenSimController.cs
+++ b/OpenSim/Region/Application/OpenSimController.cs
@@ -1,28 +1,15 @@
using System;
-using System.Collections.Generic;
using System.Collections;
-using System.IO;
-using System.Text;
-using Nini.Config;
-using OpenSim.Framework.Communications.Cache;
+using System.Net;
+using System.Timers;
+using Nwc.XmlRpc;
+using OpenSim.Framework;
using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Servers;
-using OpenSim.Framework;
-using OpenSim.Framework;
-using OpenSim.Region.ClientStack;
-using OpenSim.Region.Communications.Local;
-using OpenSim.Region.Communications.OGS1;
-using OpenSim.Region.Environment;
-using OpenSim.Region.Environment.Scenes;
-using OpenSim.Region.Physics.Manager;
-using System.Globalization;
-using Nwc.XmlRpc;
-using RegionInfo = OpenSim.Framework.RegionInfo;
namespace OpenSim
{
- class OpenSimController
+ internal class OpenSimController
{
private OpenSimMain m_app;
private BaseHttpServer m_httpServer;
@@ -44,22 +31,23 @@ namespace OpenSim
{
MainLog.Instance.Verbose("CONTROLLER", "Recieved Shutdown Administrator Request");
XmlRpcResponse response = new XmlRpcResponse();
- Hashtable requestData = (Hashtable)request.Params[0];
+ Hashtable requestData = (Hashtable) request.Params[0];
- if ((string)requestData["shutdown"] == "delayed")
+ if ((string) requestData["shutdown"] == "delayed")
{
- int timeout = Convert.ToInt32((string)requestData["milliseconds"]);
+ int timeout = Convert.ToInt32((string) requestData["milliseconds"]);
Hashtable responseData = new Hashtable();
responseData["accepted"] = "true";
response.Value = responseData;
- m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int)(timeout / 1000)).ToString() + " second(s). Please save what you are doing and log out.");
+ m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int) (timeout/1000)).ToString() +
+ " second(s). Please save what you are doing and log out.");
// Perform shutdown
- System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing
+ Timer shutdownTimer = new Timer(timeout); // Wait before firing
shutdownTimer.AutoReset = false;
- shutdownTimer.Elapsed += new System.Timers.ElapsedEventHandler(shutdownTimer_Elapsed);
+ shutdownTimer.Elapsed += new ElapsedEventHandler(shutdownTimer_Elapsed);
return response;
}
@@ -72,15 +60,15 @@ namespace OpenSim
m_app.SceneManager.SendGeneralMessage("Region is going down now.");
// Perform shutdown
- System.Timers.Timer shutdownTimer = new System.Timers.Timer(2000); // Wait 2 seconds before firing
+ Timer shutdownTimer = new Timer(2000); // Wait 2 seconds before firing
shutdownTimer.AutoReset = false;
- shutdownTimer.Elapsed += new System.Timers.ElapsedEventHandler(shutdownTimer_Elapsed);
+ shutdownTimer.Elapsed += new ElapsedEventHandler(shutdownTimer_Elapsed);
return response;
}
}
- void shutdownTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
+ private void shutdownTimer_Elapsed(object sender, ElapsedEventArgs e)
{
m_app.Shutdown();
}
@@ -89,28 +77,28 @@ namespace OpenSim
{
MainLog.Instance.Verbose("CONTROLLER", "Recieved Create Region Administrator Request");
XmlRpcResponse response = new XmlRpcResponse();
- Hashtable requestData = (Hashtable)request.Params[0];
+ Hashtable requestData = (Hashtable) request.Params[0];
RegionInfo newRegionData = new RegionInfo();
try
{
- newRegionData.RegionID = (string)requestData["region_id"];
- newRegionData.RegionName = (string)requestData["region_name"];
- newRegionData.RegionLocX = Convert.ToUInt32((string)requestData["region_x"]);
- newRegionData.RegionLocY = Convert.ToUInt32((string)requestData["region_y"]);
+ newRegionData.RegionID = (string) requestData["region_id"];
+ newRegionData.RegionName = (string) requestData["region_name"];
+ newRegionData.RegionLocX = Convert.ToUInt32((string) requestData["region_x"]);
+ newRegionData.RegionLocY = Convert.ToUInt32((string) requestData["region_y"]);
// Security risk
- newRegionData.DataStore = (string)requestData["datastore"];
+ newRegionData.DataStore = (string) requestData["datastore"];
- newRegionData.InternalEndPoint = new System.Net.IPEndPoint(
- System.Net.IPAddress.Parse((string)requestData["listen_ip"]), 0);
+ newRegionData.InternalEndPoint = new IPEndPoint(
+ IPAddress.Parse((string) requestData["listen_ip"]), 0);
- newRegionData.InternalEndPoint.Port = Convert.ToInt32((string)requestData["listen_port"]);
- newRegionData.ExternalHostName = (string)requestData["external_address"];
+ newRegionData.InternalEndPoint.Port = Convert.ToInt32((string) requestData["listen_port"]);
+ newRegionData.ExternalHostName = (string) requestData["external_address"];
- newRegionData.MasterAvatarFirstName = (string)requestData["region_master_first"];
- newRegionData.MasterAvatarLastName = (string)requestData["region_master_last"];
+ newRegionData.MasterAvatarFirstName = (string) requestData["region_master_first"];
+ newRegionData.MasterAvatarLastName = (string) requestData["region_master_last"];
m_app.CreateRegion(newRegionData);
@@ -129,4 +117,4 @@ namespace OpenSim
return response;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index b938227..7245482 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -31,21 +31,17 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using Nini.Config;
+using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Servers;
-using OpenSim.Framework;
-using OpenSim.Framework;
using OpenSim.Region.ClientStack;
using OpenSim.Region.Communications.Local;
using OpenSim.Region.Communications.OGS1;
using OpenSim.Region.Environment;
+using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Physics.Manager;
-using OpenSim.Framework;
-using System.Globalization;
-using RegionInfo = OpenSim.Framework.RegionInfo;
namespace OpenSim
{
@@ -114,7 +110,6 @@ namespace OpenSim
}
else
{
-
// no default config files, so set default values, and save it
SetDefaultConfig();
@@ -125,7 +120,6 @@ namespace OpenSim
}
ReadConfigSettings();
-
}
protected void SetDefaultConfig()
@@ -148,7 +142,6 @@ namespace OpenSim
config.Set("script_engine", "DotNetEngine");
config.Set("asset_database", "sqlite");
-
}
if (m_config.Configs["StandAlone"] == null)
@@ -217,7 +210,8 @@ namespace OpenSim
standaloneConfig.GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
m_standaloneUserPlugin =
standaloneConfig.GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
- m_standaloneAssetPlugin = standaloneConfig.GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll");
+ m_standaloneAssetPlugin =
+ standaloneConfig.GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll");
m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
}
@@ -230,7 +224,6 @@ namespace OpenSim
///
public override void StartUp()
{
-
if (!Directory.Exists(Util.logDir()))
{
Directory.CreateDirectory(Util.logDir());
@@ -248,22 +241,28 @@ namespace OpenSim
LocalInventoryService inventoryService = new LocalInventoryService();
inventoryService.AddPlugin(m_standaloneInventoryPlugin);
- LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService);
+ LocalUserServices userService =
+ new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX,
+ m_networkServersInfo.DefaultHomeLocY, inventoryService);
userService.AddPlugin(m_standaloneUserPlugin);
LocalBackEndServices backendService = new LocalBackEndServices();
- CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService, m_dumpAssetsToFile);
+ CommunicationsLocal localComms =
+ new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService,
+ inventoryService, backendService, backendService, m_dumpAssetsToFile);
m_commsManager = localComms;
- m_loginService = new LocalLoginService(userService, m_standaloneWelcomeMessage, localComms, m_networkServersInfo, m_standaloneAuthenticate);
+ m_loginService =
+ new LocalLoginService(userService, m_standaloneWelcomeMessage, localComms, m_networkServersInfo,
+ m_standaloneAuthenticate);
m_loginService.OnLoginToRegion += backendService.AddNewSession;
m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
if (m_standaloneAuthenticate)
{
- this.CreateAccount = localComms.doCreate;
+ CreateAccount = localComms.doCreate;
}
}
else
@@ -308,7 +307,7 @@ namespace OpenSim
// Start UDP servers
for (int i = 0; i < m_udpServers.Count; i++)
{
- this.m_udpServers[i].ServerListener();
+ m_udpServers[i].ServerListener();
}
//Run Startup Commands
@@ -321,7 +320,8 @@ namespace OpenSim
MainLog.Instance.Verbose("STARTUP", "No startup command script specified. Moving on...");
}
- MainLog.Instance.Status("STARTUP", "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
+ MainLog.Instance.Status("STARTUP",
+ "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
}
public UDPServer CreateRegion(RegionInfo regionInfo)
@@ -365,9 +365,12 @@ namespace OpenSim
return new StorageManager(m_storageDLL, regionInfo.DataStore, regionInfo.RegionName);
}
- protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager)
+ protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
+ AgentCircuitManager circuitManager)
{
- return new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer, m_moduleLoader, m_dumpAssetsToFile);
+ return
+ new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer,
+ m_moduleLoader, m_dumpAssetsToFile);
}
protected override void Initialize()
@@ -436,7 +439,6 @@ namespace OpenSim
protected void ConnectToRemoteGridServer()
{
-
}
#endregion
@@ -464,6 +466,7 @@ namespace OpenSim
}
#region Console Commands
+
///
///
///
@@ -649,11 +652,10 @@ namespace OpenSim
case "change-region":
if (cmdparams.Length > 0)
{
- string regionName = this.CombineParams(cmdparams, 0);
+ string regionName = CombineParams(cmdparams, 0);
if (m_sceneManager.TrySetCurrentScene(regionName))
{
-
}
else
{
@@ -663,11 +665,13 @@ namespace OpenSim
if (m_sceneManager.CurrentScene == null)
{
- MainLog.Instance.Verbose("Currently at Root level. To change region please use 'change-region '");
+ MainLog.Instance.Verbose(
+ "Currently at Root level. To change region please use 'change-region '");
}
else
{
- MainLog.Instance.Verbose("Current Region: " + m_sceneManager.CurrentScene.RegionInfo.RegionName + ". To change region please use 'change-region '");
+ MainLog.Instance.Verbose("Current Region: " + m_sceneManager.CurrentScene.RegionInfo.RegionName +
+ ". To change region please use 'change-region '");
}
break;
@@ -676,7 +680,6 @@ namespace OpenSim
m_log.Error("Unknown command");
break;
}
-
}
public void Debug(string[] args)
@@ -695,8 +698,7 @@ namespace OpenSim
{
m_log.Error("packet debug should be 0..2");
}
- System.Console.WriteLine("New packet debug: " + newDebug.ToString());
-
+ Console.WriteLine("New packet debug: " + newDebug.ToString());
}
break;
@@ -704,7 +706,6 @@ namespace OpenSim
m_log.Error("Unknown debug");
break;
}
-
}
///
@@ -720,7 +721,9 @@ namespace OpenSim
m_log.Error("That is " + (DateTime.Now - m_startuptime).ToString());
break;
case "users":
- m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP", "World"));
+ m_log.Error(
+ String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname",
+ "Agent ID", "Session ID", "Circuit", "IP", "World"));
foreach (ScenePresence presence in m_sceneManager.GetCurrentSceneAvatars())
{
@@ -750,7 +753,7 @@ namespace OpenSim
break;
case "modules":
m_log.Error("The currently loaded shared modules are:");
- foreach (OpenSim.Region.Environment.Interfaces.IRegionModule module in m_moduleLoader.GetLoadedSharedModules )
+ foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules)
{
m_log.Error("Shared Module: " + module.Name);
}
@@ -768,8 +771,7 @@ namespace OpenSim
result = result.TrimEnd(' ');
return result;
}
+
#endregion
}
-
-
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Application/VersionInfo.cs b/OpenSim/Region/Application/VersionInfo.cs
index f045164..7840206 100644
--- a/OpenSim/Region/Application/VersionInfo.cs
+++ b/OpenSim/Region/Application/VersionInfo.cs
@@ -33,4 +33,4 @@ namespace OpenSim
{
public static string Version = "0.4, SVN build ";
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/ClientStackNetworkHandler.cs b/OpenSim/Region/ClientStack/ClientStackNetworkHandler.cs
index 3960c19..4b44ead 100644
--- a/OpenSim/Region/ClientStack/ClientStackNetworkHandler.cs
+++ b/OpenSim/Region/ClientStack/ClientStackNetworkHandler.cs
@@ -29,12 +29,10 @@ using System.Net.Sockets;
namespace OpenSim.Region.ClientStack
{
-
public interface ClientStackNetworkHandler
{
- void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender);
+ void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode); // EndPoint packetSender);
void RemoveClientCircuit(uint circuitcode);
void RegisterPacketServer(PacketServer server);
}
-
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 24962f8..7dcf1e8 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -32,10 +32,8 @@ using System.Text;
using Axiom.Math;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Framework;
using OpenSim.Framework;
+using OpenSim.Framework.Console;
namespace OpenSim.Region.ClientStack
{
@@ -116,26 +114,18 @@ namespace OpenSim.Region.ClientStack
///
public LLVector3 StartPos
{
- get
- {
- return startpos;
- }
- set
- {
- startpos = value;
- }
+ get { return startpos; }
+ set { startpos = value; }
}
///
///
///
private LLUUID m_agentId;
+
public LLUUID AgentId
{
- get
- {
- return m_agentId;
- }
+ get { return m_agentId; }
}
///
@@ -143,11 +133,7 @@ namespace OpenSim.Region.ClientStack
///
public string FirstName
{
- get
- {
- return this.firstName;
- }
-
+ get { return firstName; }
}
///
@@ -155,10 +141,7 @@ namespace OpenSim.Region.ClientStack
///
public string LastName
{
- get
- {
- return this.lastName;
- }
+ get { return lastName; }
}
#region Scene/Avatar to Client
@@ -182,11 +165,11 @@ namespace OpenSim.Region.ClientStack
handshake.RegionInfo.TerrainStartHeight01 = regionInfo.EstateSettings.terrainStartHeight1;
handshake.RegionInfo.TerrainStartHeight10 = regionInfo.EstateSettings.terrainStartHeight2;
handshake.RegionInfo.TerrainStartHeight11 = regionInfo.EstateSettings.terrainStartHeight3;
- handshake.RegionInfo.SimAccess = (byte)regionInfo.EstateSettings.simAccess;
+ handshake.RegionInfo.SimAccess = (byte) regionInfo.EstateSettings.simAccess;
handshake.RegionInfo.WaterHeight = regionInfo.EstateSettings.waterHeight;
- handshake.RegionInfo.RegionFlags = (uint)regionInfo.EstateSettings.regionFlags;
+ handshake.RegionInfo.RegionFlags = (uint) regionInfo.EstateSettings.regionFlags;
handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.RegionName + "\0");
handshake.RegionInfo.SimOwner = regionInfo.MasterAvatarAssignedUUID;
@@ -200,7 +183,7 @@ namespace OpenSim.Region.ClientStack
handshake.RegionInfo.TerrainDetail3 = regionInfo.EstateSettings.terrainDetail3;
handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting?
- this.OutPacket(handshake);
+ OutPacket(handshake);
}
///
@@ -210,14 +193,14 @@ namespace OpenSim.Region.ClientStack
public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look)
{
AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
- mov.AgentData.SessionID = this.m_sessionId;
- mov.AgentData.AgentID = this.AgentId;
+ mov.AgentData.SessionID = m_sessionId;
+ mov.AgentData.AgentID = AgentId;
mov.Data.RegionHandle = regInfo.RegionHandle;
mov.Data.Timestamp = 1172750370; // TODO - dynamicalise this
if ((pos.X == 0) && (pos.Y == 0) && (pos.Z == 0))
{
- mov.Data.Position = this.startpos;
+ mov.Data.Position = startpos;
}
else
{
@@ -255,7 +238,7 @@ namespace OpenSim.Region.ClientStack
reply.ChatData.OwnerID = fromAgentID;
reply.ChatData.SourceID = fromAgentID;
- this.OutPacket(reply);
+ OutPacket(reply);
}
///
@@ -264,27 +247,27 @@ namespace OpenSim.Region.ClientStack
/// TODO
///
///
- public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, LLUUID imSessionID, string fromName, byte dialog, uint timeStamp)
+ public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent,
+ LLUUID imSessionID, string fromName, byte dialog, uint timeStamp)
{
-
- Encoding enc = Encoding.ASCII;
- ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
- msg.AgentData.AgentID = fromAgent;
- msg.AgentData.SessionID = fromAgentSession;
- msg.MessageBlock.FromAgentName = enc.GetBytes(fromName + " \0");
- msg.MessageBlock.Dialog = dialog;
- msg.MessageBlock.FromGroup = false;
- msg.MessageBlock.ID = imSessionID;
- msg.MessageBlock.Offline = 0;
- msg.MessageBlock.ParentEstateID = 0;
- msg.MessageBlock.Position = new LLVector3();
- msg.MessageBlock.RegionID = LLUUID.Random();
- msg.MessageBlock.Timestamp = timeStamp;
- msg.MessageBlock.ToAgentID = toAgent;
- msg.MessageBlock.Message = enc.GetBytes(message + "\0");
- msg.MessageBlock.BinaryBucket = new byte[0];
-
- this.OutPacket(msg);
+ Encoding enc = Encoding.ASCII;
+ ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
+ msg.AgentData.AgentID = fromAgent;
+ msg.AgentData.SessionID = fromAgentSession;
+ msg.MessageBlock.FromAgentName = enc.GetBytes(fromName + " \0");
+ msg.MessageBlock.Dialog = dialog;
+ msg.MessageBlock.FromGroup = false;
+ msg.MessageBlock.ID = imSessionID;
+ msg.MessageBlock.Offline = 0;
+ msg.MessageBlock.ParentEstateID = 0;
+ msg.MessageBlock.Position = new LLVector3();
+ msg.MessageBlock.RegionID = LLUUID.Random();
+ msg.MessageBlock.Timestamp = timeStamp;
+ msg.MessageBlock.ToAgentID = toAgent;
+ msg.MessageBlock.Message = enc.GetBytes(message + "\0");
+ msg.MessageBlock.BinaryBucket = new byte[0];
+
+ OutPacket(msg);
}
///
@@ -301,10 +284,10 @@ namespace OpenSim.Region.ClientStack
{
for (int x = 0; x < 16; x = x + 4)
{
- patches[0] = x + 0 + y * 16;
- patches[1] = x + 1 + y * 16;
- patches[2] = x + 2 + y * 16;
- patches[3] = x + 3 + y * 16;
+ patches[0] = x + 0 + y*16;
+ patches[1] = x + 1 + y*16;
+ patches[2] = x + 2 + y*16;
+ patches[3] = x + 3 + y*16;
Packet layerpack = TerrainManager.CreateLandPacket(map, patches);
OutPacket(layerpack);
@@ -313,7 +296,8 @@ namespace OpenSim.Region.ClientStack
}
catch (Exception e)
{
- MainLog.Instance.Warn("client", "ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString());
+ MainLog.Instance.Warn("client",
+ "ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString());
}
}
@@ -332,14 +316,15 @@ namespace OpenSim.Region.ClientStack
patchx = px;
patchy = py;
- patches[0] = patchx + 0 + patchy * 16;
+ patches[0] = patchx + 0 + patchy*16;
Packet layerpack = TerrainManager.CreateLandPacket(map, patches);
OutPacket(layerpack);
}
catch (Exception e)
{
- MainLog.Instance.Warn("client", "ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString());
+ MainLog.Instance.Warn("client",
+ "ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString());
}
}
@@ -352,17 +337,17 @@ namespace OpenSim.Region.ClientStack
public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint)
{
IPAddress neighbourIP = neighbourEndPoint.Address;
- ushort neighbourPort = (ushort)neighbourEndPoint.Port;
+ ushort neighbourPort = (ushort) neighbourEndPoint.Port;
EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
enablesimpacket.SimulatorInfo.Handle = neighbourHandle;
byte[] byteIP = neighbourIP.GetAddressBytes();
- enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
- enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
- enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
- enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
+ enablesimpacket.SimulatorInfo.IP = (uint) byteIP[3] << 24;
+ enablesimpacket.SimulatorInfo.IP += (uint) byteIP[2] << 16;
+ enablesimpacket.SimulatorInfo.IP += (uint) byteIP[1] << 8;
+ enablesimpacket.SimulatorInfo.IP += (uint) byteIP[0];
enablesimpacket.SimulatorInfo.Port = neighbourPort;
OutPacket(enablesimpacket);
}
@@ -374,46 +359,48 @@ namespace OpenSim.Region.ClientStack
public AgentCircuitData RequestClientInfo()
{
AgentCircuitData agentData = new AgentCircuitData();
- agentData.AgentID = this.AgentId;
- agentData.SessionID = this.m_sessionId;
- agentData.SecureSessionID = this.SecureSessionID;
- agentData.circuitcode = this.m_circuitCode;
+ agentData.AgentID = AgentId;
+ agentData.SessionID = m_sessionId;
+ agentData.SecureSessionID = SecureSessionID;
+ agentData.circuitcode = m_circuitCode;
agentData.child = false;
- agentData.firstname = this.firstName;
- agentData.lastname = this.lastName;
+ agentData.firstname = firstName;
+ agentData.lastname = lastName;
agentData.CapsPath = "";
return agentData;
}
- public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint externalIPEndPoint, string capsURL)
+ public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint externalIPEndPoint,
+ string capsURL)
{
- LLVector3 look = new LLVector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10);
+ LLVector3 look = new LLVector3(lookAt.X*10, lookAt.Y*10, lookAt.Z*10);
CrossedRegionPacket newSimPack = new CrossedRegionPacket();
newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock();
- newSimPack.AgentData.AgentID = this.AgentId;
- newSimPack.AgentData.SessionID = this.m_sessionId;
+ newSimPack.AgentData.AgentID = AgentId;
+ newSimPack.AgentData.SessionID = m_sessionId;
newSimPack.Info = new CrossedRegionPacket.InfoBlock();
newSimPack.Info.Position = pos;
- newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!!
+ newSimPack.Info.LookAt = look;
+ // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!!
newSimPack.RegionData = new CrossedRegionPacket.RegionDataBlock();
newSimPack.RegionData.RegionHandle = newRegionHandle;
byte[] byteIP = externalIPEndPoint.Address.GetAddressBytes();
- newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24;
- newSimPack.RegionData.SimIP += (uint)byteIP[2] << 16;
- newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8;
- newSimPack.RegionData.SimIP += (uint)byteIP[0];
- newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port;
+ newSimPack.RegionData.SimIP = (uint) byteIP[3] << 24;
+ newSimPack.RegionData.SimIP += (uint) byteIP[2] << 16;
+ newSimPack.RegionData.SimIP += (uint) byteIP[1] << 8;
+ newSimPack.RegionData.SimIP += (uint) byteIP[0];
+ newSimPack.RegionData.SimPort = (ushort) externalIPEndPoint.Port;
//newSimPack.RegionData.SeedCapability = new byte[0];
newSimPack.RegionData.SeedCapability = Helpers.StringToField(capsURL);
- this.OutPacket(newSimPack);
+ OutPacket(newSimPack);
}
public void SendMapBlock(List mapBlocks)
{
MapBlockReplyPacket mapReply = new MapBlockReplyPacket();
- mapReply.AgentData.AgentID = this.AgentId;
+ mapReply.AgentData.AgentID = AgentId;
mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks.Count];
mapReply.AgentData.Flags = 0;
@@ -429,13 +416,13 @@ namespace OpenSim.Region.ClientStack
mapReply.Data[i].Access = mapBlocks[i].Access;
mapReply.Data[i].Agents = mapBlocks[i].Agents;
}
- this.OutPacket(mapReply);
+ OutPacket(mapReply);
}
public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags)
{
TeleportLocalPacket tpLocal = new TeleportLocalPacket();
- tpLocal.Info.AgentID = this.AgentId;
+ tpLocal.Info.AgentID = AgentId;
tpLocal.Info.TeleportFlags = flags;
tpLocal.Info.LocationID = 2;
tpLocal.Info.LookAt = lookAt;
@@ -443,10 +430,11 @@ namespace OpenSim.Region.ClientStack
OutPacket(tpLocal);
}
- public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags, string capsURL)
+ public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID,
+ uint flags, string capsURL)
{
TeleportFinishPacket teleport = new TeleportFinishPacket();
- teleport.Info.AgentID = this.AgentId;
+ teleport.Info.AgentID = AgentId;
teleport.Info.RegionHandle = regionHandle;
teleport.Info.SimAccess = simAccess;
@@ -455,13 +443,13 @@ namespace OpenSim.Region.ClientStack
IPAddress oIP = newRegionEndPoint.Address;
byte[] byteIP = oIP.GetAddressBytes();
- uint ip = (uint)byteIP[3] << 24;
- ip += (uint)byteIP[2] << 16;
- ip += (uint)byteIP[1] << 8;
- ip += (uint)byteIP[0];
+ uint ip = (uint) byteIP[3] << 24;
+ ip += (uint) byteIP[2] << 16;
+ ip += (uint) byteIP[1] << 8;
+ ip += (uint) byteIP[0];
teleport.Info.SimIP = ip;
- teleport.Info.SimPort = (ushort)newRegionEndPoint.Port;
+ teleport.Info.SimPort = (ushort) newRegionEndPoint.Port;
teleport.Info.LocationID = 4;
teleport.Info.TeleportFlags = 1 << 4;
OutPacket(teleport);
@@ -473,8 +461,8 @@ namespace OpenSim.Region.ClientStack
public void SendTeleportCancel()
{
TeleportCancelPacket tpCancel = new TeleportCancelPacket();
- tpCancel.Info.SessionID = this.m_sessionId;
- tpCancel.Info.AgentID = this.AgentId;
+ tpCancel.Info.SessionID = m_sessionId;
+ tpCancel.Info.AgentID = AgentId;
OutPacket(tpCancel);
}
@@ -492,7 +480,7 @@ namespace OpenSim.Region.ClientStack
public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance)
{
MoneyBalanceReplyPacket money = new MoneyBalanceReplyPacket();
- money.MoneyData.AgentID = this.AgentId;
+ money.MoneyData.AgentID = AgentId;
money.MoneyData.TransactionID = transaction;
money.MoneyData.TransactionSuccess = success;
money.MoneyData.Description = description;
@@ -506,7 +494,6 @@ namespace OpenSim.Region.ClientStack
pc.PingID.PingID = seq;
pc.Header.Reliable = false;
OutPacket(pc);
-
}
public void SendKillObject(ulong regionHandle, uint localID)
@@ -522,8 +509,8 @@ namespace OpenSim.Region.ClientStack
{
Encoding enc = Encoding.ASCII;
uint FULL_MASK_PERMISSIONS = 2147483647;
- InventoryDescendentsPacket descend = this.CreateInventoryDescendentsPacket(ownerID, folderID);
-
+ InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID);
+
int count = 0;
if (items.Count < 40)
{
@@ -550,25 +537,30 @@ namespace OpenSim.Region.ClientStack
descend.ItemData[i].FolderID = item.parentFolderID;
descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
descend.ItemData[i].GroupMask = 0;
- descend.ItemData[i].InvType = (sbyte)item.invType;
+ descend.ItemData[i].InvType = (sbyte) item.invType;
descend.ItemData[i].Name = enc.GetBytes(item.inventoryName + "\0");
descend.ItemData[i].NextOwnerMask = item.inventoryNextPermissions;
descend.ItemData[i].OwnerID = item.avatarID;
descend.ItemData[i].OwnerMask = item.inventoryCurrentPermissions;
descend.ItemData[i].SalePrice = 0;
descend.ItemData[i].SaleType = 0;
- descend.ItemData[i].Type = (sbyte)item.assetType;
- descend.ItemData[i].CRC = Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type, descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100, descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID, descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
+ descend.ItemData[i].Type = (sbyte) item.assetType;
+ descend.ItemData[i].CRC =
+ Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type,
+ descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100,
+ descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID,
+ descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS,
+ 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
i++;
count++;
if (i == 40)
{
- this.OutPacket(descend);
-
+ OutPacket(descend);
+
if ((items.Count - count) > 0)
{
- descend = this.CreateInventoryDescendentsPacket(ownerID, folderID);
+ descend = CreateInventoryDescendentsPacket(ownerID, folderID);
if ((items.Count - count) < 40)
{
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count - count];
@@ -586,15 +578,14 @@ namespace OpenSim.Region.ClientStack
if (i < 40)
{
- this.OutPacket(descend);
+ OutPacket(descend);
}
-
}
private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID)
{
InventoryDescendentsPacket descend = new InventoryDescendentsPacket();
- descend.AgentData.AgentID = this.AgentId;
+ descend.AgentData.AgentID = AgentId;
descend.AgentData.OwnerID = ownerID;
descend.AgentData.FolderID = folderID;
descend.AgentData.Version = 0;
@@ -607,31 +598,39 @@ namespace OpenSim.Region.ClientStack
Encoding enc = Encoding.ASCII;
uint FULL_MASK_PERMISSIONS = 2147483647;
FetchInventoryReplyPacket inventoryReply = new FetchInventoryReplyPacket();
- inventoryReply.AgentData.AgentID = this.AgentId;
+ inventoryReply.AgentData.AgentID = AgentId;
inventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1];
inventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock();
inventoryReply.InventoryData[0].ItemID = item.inventoryID;
inventoryReply.InventoryData[0].AssetID = item.assetID;
inventoryReply.InventoryData[0].CreatorID = item.creatorsID;
inventoryReply.InventoryData[0].BaseMask = item.inventoryBasePermissions;
- inventoryReply.InventoryData[0].CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
+ inventoryReply.InventoryData[0].CreationDate =
+ (int) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
inventoryReply.InventoryData[0].Description = enc.GetBytes(item.inventoryDescription + "\0");
inventoryReply.InventoryData[0].EveryoneMask = item.inventoryEveryOnePermissions;
inventoryReply.InventoryData[0].Flags = 0;
inventoryReply.InventoryData[0].FolderID = item.parentFolderID;
inventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
inventoryReply.InventoryData[0].GroupMask = 0;
- inventoryReply.InventoryData[0].InvType = (sbyte)item.invType;
+ inventoryReply.InventoryData[0].InvType = (sbyte) item.invType;
inventoryReply.InventoryData[0].Name = enc.GetBytes(item.inventoryName + "\0");
inventoryReply.InventoryData[0].NextOwnerMask = item.inventoryNextPermissions;
inventoryReply.InventoryData[0].OwnerID = item.avatarID;
inventoryReply.InventoryData[0].OwnerMask = item.inventoryCurrentPermissions;
inventoryReply.InventoryData[0].SalePrice = 0;
inventoryReply.InventoryData[0].SaleType = 0;
- inventoryReply.InventoryData[0].Type = (sbyte)item.assetType;
- inventoryReply.InventoryData[0].CRC = Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType, inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID, inventoryReply.InventoryData[0].GroupID, 100, inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID, inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
-
- this.OutPacket(inventoryReply);
+ inventoryReply.InventoryData[0].Type = (sbyte) item.assetType;
+ inventoryReply.InventoryData[0].CRC =
+ Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType,
+ inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID,
+ inventoryReply.InventoryData[0].GroupID, 100,
+ inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID,
+ inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID,
+ FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
+ FULL_MASK_PERMISSIONS);
+
+ OutPacket(inventoryReply);
}
public void SendInventoryItemUpdate(InventoryItemBase Item)
@@ -639,7 +638,7 @@ namespace OpenSim.Region.ClientStack
Encoding enc = Encoding.ASCII;
uint FULL_MASK_PERMISSIONS = 2147483647;
UpdateCreateInventoryItemPacket InventoryReply = new UpdateCreateInventoryItemPacket();
- InventoryReply.AgentData.AgentID = this.AgentId;
+ InventoryReply.AgentData.AgentID = AgentId;
InventoryReply.AgentData.SimApproved = true;
InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1];
InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock();
@@ -654,15 +653,22 @@ namespace OpenSim.Region.ClientStack
InventoryReply.InventoryData[0].FolderID = Item.parentFolderID;
InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
InventoryReply.InventoryData[0].GroupMask = 0;
- InventoryReply.InventoryData[0].InvType = (sbyte)Item.invType;
+ InventoryReply.InventoryData[0].InvType = (sbyte) Item.invType;
InventoryReply.InventoryData[0].Name = enc.GetBytes(Item.inventoryName + "\0");
InventoryReply.InventoryData[0].NextOwnerMask = Item.inventoryNextPermissions;
InventoryReply.InventoryData[0].OwnerID = Item.avatarID;
InventoryReply.InventoryData[0].OwnerMask = Item.inventoryCurrentPermissions;
InventoryReply.InventoryData[0].SalePrice = 100;
InventoryReply.InventoryData[0].SaleType = 0;
- InventoryReply.InventoryData[0].Type = (sbyte)Item.assetType;
- InventoryReply.InventoryData[0].CRC = Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
+ InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType;
+ InventoryReply.InventoryData[0].CRC =
+ Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType,
+ InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID,
+ InventoryReply.InventoryData[0].GroupID, 100,
+ InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID,
+ InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID,
+ FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
+ FULL_MASK_PERMISSIONS);
OutPacket(InventoryReply);
}
@@ -670,8 +676,8 @@ namespace OpenSim.Region.ClientStack
public void SendRemoveInventoryItem(LLUUID itemID)
{
RemoveInventoryItemPacket remove = new RemoveInventoryItemPacket();
- remove.AgentData.AgentID = this.AgentId;
- remove.AgentData.SessionID = this.m_sessionId;
+ remove.AgentData.AgentID = AgentId;
+ remove.AgentData.SessionID = m_sessionId;
remove.InventoryData = new RemoveInventoryItemPacket.InventoryDataBlock[1];
remove.InventoryData[0] = new RemoveInventoryItemPacket.InventoryDataBlock();
remove.InventoryData[0].ItemID = itemID;
@@ -716,13 +722,14 @@ namespace OpenSim.Region.ClientStack
public void SendAgentAlertMessage(string message, bool modal)
{
AgentAlertMessagePacket alertPack = new AgentAlertMessagePacket();
- alertPack.AgentData.AgentID = this.AgentId;
+ alertPack.AgentData.AgentID = AgentId;
alertPack.AlertData.Message = Helpers.StringToField(message);
alertPack.AlertData.Modal = modal;
OutPacket(alertPack);
}
- public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url)
+ public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message,
+ string url)
{
LoadURLPacket loadURL = new LoadURLPacket();
loadURL.Data.ObjectName = Helpers.StringToField(objectname);
@@ -761,14 +768,13 @@ namespace OpenSim.Region.ClientStack
public void SendViewerTime(int phase)
{
-
SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket();
//viewertime.TimeInfo.SecPerDay = 86400;
// viewertime.TimeInfo.SecPerYear = 31536000;
viewertime.TimeInfo.SecPerDay = 1000;
viewertime.TimeInfo.SecPerYear = 365000;
viewertime.TimeInfo.SunPhase = 1;
- int sunPhase = (phase + 2) / 2;
+ int sunPhase = (phase + 2)/2;
if ((sunPhase < 6) || (sunPhase > 36))
{
viewertime.TimeInfo.SunDirection = new LLVector3(0f, 0.8f, -0.8f);
@@ -781,27 +787,41 @@ namespace OpenSim.Region.ClientStack
sunPhase = 12;
}
sunPhase = sunPhase - 12;
- float yValue = 0.1f * (sunPhase);
- if (yValue > 1.2f) { yValue = yValue - 1.2f; }
- if (yValue > 1 ) { yValue = 1; }
- if (yValue < 0) { yValue = 0; }
+ float yValue = 0.1f*(sunPhase);
+ if (yValue > 1.2f)
+ {
+ yValue = yValue - 1.2f;
+ }
+ if (yValue > 1)
+ {
+ yValue = 1;
+ }
+ if (yValue < 0)
+ {
+ yValue = 0;
+ }
if (sunPhase < 14)
{
yValue = 1 - yValue;
}
- if (sunPhase < 12) { yValue *= -1; }
+ if (sunPhase < 12)
+ {
+ yValue *= -1;
+ }
viewertime.TimeInfo.SunDirection = new LLVector3(0f, yValue, 0.3f);
//Console.WriteLine("sending sun update " + yValue);
}
viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f);
- viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch();
+ viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch();
OutPacket(viewertime);
}
- public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID)
+ public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember,
+ string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL,
+ LLUUID partnerID)
{
AvatarPropertiesReplyPacket avatarReply = new AvatarPropertiesReplyPacket();
- avatarReply.AgentData.AgentID = this.AgentId;
+ avatarReply.AgentData.AgentID = AgentId;
avatarReply.AgentData.AvatarID = avatarID;
avatarReply.PropertiesData.AboutText = Helpers.StringToField(aboutText);
avatarReply.PropertiesData.BornOn = Helpers.StringToField(bornOn);
@@ -827,6 +847,7 @@ namespace OpenSim.Region.ClientStack
OutPacket(avatarSitResponse);
}
+
#endregion
#region Appearance/ Wearables Methods
@@ -838,22 +859,22 @@ namespace OpenSim.Region.ClientStack
public void SendWearables(AvatarWearable[] wearables)
{
AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
- aw.AgentData.AgentID = this.AgentId;
+ aw.AgentData.AgentID = AgentId;
aw.AgentData.SerialNum = 0;
- aw.AgentData.SessionID = this.m_sessionId;
+ aw.AgentData.SessionID = m_sessionId;
aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
AgentWearablesUpdatePacket.WearableDataBlock awb;
for (int i = 0; i < wearables.Length; i++)
{
awb = new AgentWearablesUpdatePacket.WearableDataBlock();
- awb.WearableType = (byte)i;
+ awb.WearableType = (byte) i;
awb.AssetID = wearables[i].AssetID;
awb.ItemID = wearables[i].ItemID;
aw.WearableData[i] = awb;
}
- this.OutPacket(aw);
+ OutPacket(aw);
}
///
@@ -893,7 +914,7 @@ namespace OpenSim.Region.ClientStack
ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock();
ani.AnimationList[0].AnimID = animID;
ani.AnimationList[0].AnimSequenceID = seq;
- this.OutPacket(ani);
+ OutPacket(ani);
}
#endregion
@@ -909,25 +930,26 @@ namespace OpenSim.Region.ClientStack
///
///
///
- public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID)
+ public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID,
+ uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID)
{
ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
objupdate.RegionData.RegionHandle = regionHandle;
objupdate.RegionData.TimeDilation = 64096;
objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
- objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket(textureEntry);
+ objupdate.ObjectData[0] = CreateDefaultAvatarPacket(textureEntry);
//give this avatar object a local id and assign the user a name
objupdate.ObjectData[0].ID = avatarLocalID;
objupdate.ObjectData[0].FullID = avatarID;
objupdate.ObjectData[0].ParentID = parentID;
- objupdate.ObjectData[0].NameValue = Helpers.StringToField("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName);
- LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z);
+ objupdate.ObjectData[0].NameValue =
+ Helpers.StringToField("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName);
+ LLVector3 pos2 = new LLVector3((float) Pos.X, (float) Pos.Y, (float) Pos.Z);
byte[] pb = pos2.GetBytes();
Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
OutPacket(objupdate);
-
}
///
@@ -938,38 +960,41 @@ namespace OpenSim.Region.ClientStack
///
///
///
- public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity, LLQuaternion rotation)
+ public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
+ LLVector3 velocity, LLQuaternion rotation)
{
- ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = this.CreateAvatarImprovedBlock(localID, position, velocity, rotation);
+ ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock =
+ CreateAvatarImprovedBlock(localID, position, velocity, rotation);
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
terse.RegionData.RegionHandle = regionHandle;
terse.RegionData.TimeDilation = timeDilation;
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
terse.ObjectData[0] = terseBlock;
- this.OutPacket(terse);
+ OutPacket(terse);
}
- public void SendCoarseLocationUpdate(List CoarseLocations)
- {
- CoarseLocationUpdatePacket loc = new CoarseLocationUpdatePacket();
- int total = CoarseLocations.Count;
- CoarseLocationUpdatePacket.IndexBlock ib =
- new CoarseLocationUpdatePacket.IndexBlock();
- loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total];
- for(int i=0; i CoarseLocations)
+ {
+ CoarseLocationUpdatePacket loc = new CoarseLocationUpdatePacket();
+ int total = CoarseLocations.Count;
+ CoarseLocationUpdatePacket.IndexBlock ib =
+ new CoarseLocationUpdatePacket.IndexBlock();
+ loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total];
+ for (int i = 0; i < total; i++)
+ {
+ CoarseLocationUpdatePacket.LocationBlock lb =
+ new CoarseLocationUpdatePacket.LocationBlock();
+ lb.X = (byte) CoarseLocations[i].X;
+ lb.Y = (byte) CoarseLocations[i].Y;
+ lb.Z = (byte) (CoarseLocations[i].Z/4);
+ loc.Location[i] = lb;
+ }
+ ib.You = -1;
+ ib.Prey = -1;
+ loc.Index = ib;
+ OutPacket(loc);
+ }
#endregion
@@ -984,27 +1009,28 @@ namespace OpenSim.Region.ClientStack
public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint)
{
ObjectAttachPacket attach = new ObjectAttachPacket();
- attach.AgentData.AgentID = this.AgentId;
- attach.AgentData.SessionID = this.m_sessionId;
+ attach.AgentData.AgentID = AgentId;
+ attach.AgentData.SessionID = m_sessionId;
attach.AgentData.AttachmentPoint = attachPoint;
attach.ObjectData = new ObjectAttachPacket.ObjectDataBlock[1];
attach.ObjectData[0] = new ObjectAttachPacket.ObjectDataBlock();
attach.ObjectData[0].ObjectLocalID = localID;
attach.ObjectData[0].Rotation = rotation;
- this.OutPacket(attach);
+ OutPacket(attach);
}
public void SendPrimitiveToClient(
- ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags,
+ ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos,
+ uint flags,
LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem, LLQuaternion rotation)
{
ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
outPacket.RegionData.RegionHandle = regionHandle;
- outPacket.RegionData.TimeDilation = timeDilation;
+ outPacket.RegionData.TimeDilation = timeDilation;
outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
- outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primShape, flags);
+ outPacket.ObjectData[0] = CreatePrimUpdateBlock(primShape, flags);
outPacket.ObjectData[0].ID = localID;
outPacket.ObjectData[0].FullID = objectID;
@@ -1033,35 +1059,38 @@ namespace OpenSim.Region.ClientStack
///
///
///
- public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation)
+ public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
+ LLQuaternion rotation)
{
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
terse.RegionData.RegionHandle = regionHandle;
terse.RegionData.TimeDilation = timeDilation;
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
- terse.ObjectData[0] = this.CreatePrimImprovedBlock(localID, position, rotation);
+ terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation);
- this.OutPacket(terse);
+ OutPacket(terse);
}
#endregion
#region Helper Methods
- protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos, LLVector3 velocity, LLQuaternion rotation)
+ protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos,
+ LLVector3 velocity,
+ LLQuaternion rotation)
{
byte[] bytes = new byte[60];
int i = 0;
ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
- dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry;
+ dat.TextureEntry = new byte[0]; // AvatarTemplate.TextureEntry;
uint ID = localID;
- bytes[i++] = (byte)(ID % 256);
- bytes[i++] = (byte)((ID >> 8) % 256);
- bytes[i++] = (byte)((ID >> 16) % 256);
- bytes[i++] = (byte)((ID >> 24) % 256);
+ bytes[i++] = (byte) (ID%256);
+ bytes[i++] = (byte) ((ID >> 8)%256);
+ bytes[i++] = (byte) ((ID >> 16)%256);
+ bytes[i++] = (byte) ((ID >> 24)%256);
bytes[i++] = 0;
bytes[i++] = 1;
i += 14;
@@ -1078,55 +1107,55 @@ namespace OpenSim.Region.ClientStack
internDirec = new Vector3(velocity.X, velocity.Y, velocity.Z);
- internDirec = internDirec / 128.0f;
+ internDirec = internDirec/128.0f;
internDirec.x += 1;
internDirec.y += 1;
internDirec.z += 1;
- InternVelocityX = (ushort)(32768 * internDirec.x);
- InternVelocityY = (ushort)(32768 * internDirec.y);
- InternVelocityZ = (ushort)(32768 * internDirec.z);
+ InternVelocityX = (ushort) (32768*internDirec.x);
+ InternVelocityY = (ushort) (32768*internDirec.y);
+ InternVelocityZ = (ushort) (32768*internDirec.z);
ushort ac = 32767;
- bytes[i++] = (byte)(InternVelocityX % 256);
- bytes[i++] = (byte)((InternVelocityX >> 8) % 256);
- bytes[i++] = (byte)(InternVelocityY % 256);
- bytes[i++] = (byte)((InternVelocityY >> 8) % 256);
- bytes[i++] = (byte)(InternVelocityZ % 256);
- bytes[i++] = (byte)((InternVelocityZ >> 8) % 256);
+ bytes[i++] = (byte) (InternVelocityX%256);
+ bytes[i++] = (byte) ((InternVelocityX >> 8)%256);
+ bytes[i++] = (byte) (InternVelocityY%256);
+ bytes[i++] = (byte) ((InternVelocityY >> 8)%256);
+ bytes[i++] = (byte) (InternVelocityZ%256);
+ bytes[i++] = (byte) ((InternVelocityZ >> 8)%256);
//accel
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
//rotation
ushort rw, rx, ry, rz;
- rw = (ushort)(32768 * (rotation.W + 1));
- rx = (ushort)(32768 * (rotation.X + 1));
- ry = (ushort)(32768 * (rotation.Y + 1));
- rz = (ushort)(32768 * (rotation.Z + 1));
+ rw = (ushort) (32768*(rotation.W + 1));
+ rx = (ushort) (32768*(rotation.X + 1));
+ ry = (ushort) (32768*(rotation.Y + 1));
+ rz = (ushort) (32768*(rotation.Z + 1));
//rot
- bytes[i++] = (byte)(rx % 256);
- bytes[i++] = (byte)((rx >> 8) % 256);
- bytes[i++] = (byte)(ry % 256);
- bytes[i++] = (byte)((ry >> 8) % 256);
- bytes[i++] = (byte)(rz % 256);
- bytes[i++] = (byte)((rz >> 8) % 256);
- bytes[i++] = (byte)(rw % 256);
- bytes[i++] = (byte)((rw >> 8) % 256);
+ bytes[i++] = (byte) (rx%256);
+ bytes[i++] = (byte) ((rx >> 8)%256);
+ bytes[i++] = (byte) (ry%256);
+ bytes[i++] = (byte) ((ry >> 8)%256);
+ bytes[i++] = (byte) (rz%256);
+ bytes[i++] = (byte) ((rz >> 8)%256);
+ bytes[i++] = (byte) (rw%256);
+ bytes[i++] = (byte) ((rw >> 8)%256);
//rotation vel
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
dat.Data = bytes;
@@ -1140,7 +1169,9 @@ namespace OpenSim.Region.ClientStack
///
///
///
- protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreatePrimImprovedBlock(uint localID, LLVector3 position, LLQuaternion rotation)
+ protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreatePrimImprovedBlock(uint localID,
+ LLVector3 position,
+ LLQuaternion rotation)
{
uint ID = localID;
byte[] bytes = new byte[60];
@@ -1148,10 +1179,10 @@ namespace OpenSim.Region.ClientStack
int i = 0;
ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
dat.TextureEntry = new byte[0];
- bytes[i++] = (byte)(ID % 256);
- bytes[i++] = (byte)((ID >> 8) % 256);
- bytes[i++] = (byte)((ID >> 16) % 256);
- bytes[i++] = (byte)((ID >> 24) % 256);
+ bytes[i++] = (byte) (ID%256);
+ bytes[i++] = (byte) ((ID >> 8)%256);
+ bytes[i++] = (byte) ((ID >> 16)%256);
+ bytes[i++] = (byte) ((ID >> 24)%256);
bytes[i++] = 0;
bytes[i++] = 0;
@@ -1161,44 +1192,44 @@ namespace OpenSim.Region.ClientStack
ushort ac = 32767;
//vel
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
//accel
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
ushort rw, rx, ry, rz;
- rw = (ushort)(32768 * (rotation.W + 1));
- rx = (ushort)(32768 * (rotation.X + 1));
- ry = (ushort)(32768 * (rotation.Y + 1));
- rz = (ushort)(32768 * (rotation.Z + 1));
+ rw = (ushort) (32768*(rotation.W + 1));
+ rx = (ushort) (32768*(rotation.X + 1));
+ ry = (ushort) (32768*(rotation.Y + 1));
+ rz = (ushort) (32768*(rotation.Z + 1));
//rot
- bytes[i++] = (byte)(rx % 256);
- bytes[i++] = (byte)((rx >> 8) % 256);
- bytes[i++] = (byte)(ry % 256);
- bytes[i++] = (byte)((ry >> 8) % 256);
- bytes[i++] = (byte)(rz % 256);
- bytes[i++] = (byte)((rz >> 8) % 256);
- bytes[i++] = (byte)(rw % 256);
- bytes[i++] = (byte)((rw >> 8) % 256);
+ bytes[i++] = (byte) (rx%256);
+ bytes[i++] = (byte) ((rx >> 8)%256);
+ bytes[i++] = (byte) (ry%256);
+ bytes[i++] = (byte) ((ry >> 8)%256);
+ bytes[i++] = (byte) (rz%256);
+ bytes[i++] = (byte) ((rz >> 8)%256);
+ bytes[i++] = (byte) (rw%256);
+ bytes[i++] = (byte) ((rw >> 8)%256);
//rotation vel
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
- bytes[i++] = (byte)(ac % 256);
- bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
+ bytes[i++] = (byte) (ac%256);
+ bytes[i++] = (byte) ((ac >> 8)%256);
dat.Data = bytes;
return dat;
@@ -1212,16 +1243,15 @@ namespace OpenSim.Region.ClientStack
protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimitiveBaseShape primShape, uint flags)
{
ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock();
- this.SetDefaultPrimPacketValues(objupdate);
+ SetDefaultPrimPacketValues(objupdate);
objupdate.UpdateFlags = flags;
- this.SetPrimPacketShapeData(objupdate, primShape);
+ SetPrimPacketShapeData(objupdate, primShape);
return objupdate;
}
protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimitiveBaseShape primData)
{
-
objectData.TextureEntry = primData.TextureEntry;
objectData.PCode = primData.PCode;
objectData.PathBegin = primData.PathBegin;
@@ -1278,10 +1308,11 @@ namespace OpenSim.Region.ClientStack
///
protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry)
{
- ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
+ ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock();
+ // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
SetDefaultAvatarPacketValues(ref objdata);
- objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
+ objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
objdata.PathCurve = 16;
objdata.ProfileCurve = 1;
objdata.PathScaleX = 100;
@@ -1353,6 +1384,5 @@ namespace OpenSim.Region.ClientStack
}
#endregion
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
index 0771a4a..d589a7b 100644
--- a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
+++ b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
@@ -27,9 +27,8 @@
*/
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
+using OpenSim.Framework.Console;
namespace OpenSim.Region.ClientStack
{
@@ -37,17 +36,17 @@ namespace OpenSim.Region.ClientStack
{
protected virtual void RegisterLocalPacketHandlers()
{
- this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout);
- this.AddLocalPacketHandler(PacketType.ViewerEffect, this.HandleViewerEffect);
- this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached);
- this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate);
+ AddLocalPacketHandler(PacketType.LogoutRequest, Logout);
+ AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect);
+ AddLocalPacketHandler(PacketType.AgentCachedTexture, AgentTextureCached);
+ AddLocalPacketHandler(PacketType.MultipleObjectUpdate, MultipleObjUpdate);
}
private bool HandleViewerEffect(IClientAPI sender, Packet Pack)
{
- ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
+ ViewerEffectPacket viewer = (ViewerEffectPacket) Pack;
- if( OnViewerEffect != null )
+ if (OnViewerEffect != null)
{
OnViewerEffect(sender, viewer.Effect);
}
@@ -59,7 +58,7 @@ namespace OpenSim.Region.ClientStack
{
MainLog.Instance.Verbose("CLIENT", "Got a logout request");
- if( OnLogout != null )
+ if (OnLogout != null)
{
OnLogout(client);
}
@@ -70,13 +69,14 @@ namespace OpenSim.Region.ClientStack
protected bool AgentTextureCached(IClientAPI simclient, Packet packet)
{
//System.Console.WriteLine("texture cached: " + packet.ToString());
- AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet;
+ AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket) packet;
AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket();
- cachedresp.AgentData.AgentID = this.AgentId;
- cachedresp.AgentData.SessionID = this.m_sessionId;
- cachedresp.AgentData.SerialNum = this.cachedtextureserial;
- this.cachedtextureserial++;
- cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length];
+ cachedresp.AgentData.AgentID = AgentId;
+ cachedresp.AgentData.SessionID = m_sessionId;
+ cachedresp.AgentData.SerialNum = cachedtextureserial;
+ cachedtextureserial++;
+ cachedresp.WearableData =
+ new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length];
for (int i = 0; i < chechedtex.WearableData.Length; i++)
{
cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
@@ -84,17 +84,18 @@ namespace OpenSim.Region.ClientStack
cachedresp.WearableData[i].TextureID = LLUUID.Zero;
cachedresp.WearableData[i].HostName = new byte[0];
}
- this.OutPacket(cachedresp);
+ OutPacket(cachedresp);
return true;
}
protected bool MultipleObjUpdate(IClientAPI simClient, Packet packet)
{
- MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
+ MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket) packet;
// System.Console.WriteLine("new multi update packet " + multipleupdate.ToString());
for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
{
#region position
+
if (multipleupdate.ObjectData[i].Type == 9) //change position
{
if (OnUpdatePrimGroupPosition != null)
@@ -102,20 +103,20 @@ namespace OpenSim.Region.ClientStack
LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
OnUpdatePrimGroupPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
}
-
}
else if (multipleupdate.ObjectData[i].Type == 1) //single item of group change position
{
if (OnUpdatePrimSinglePosition != null)
{
- libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
+ LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
// System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
}
}
- #endregion position
- #region rotation
- else if (multipleupdate.ObjectData[i].Type == 2)// single item of group rotation from tab
+ #endregion position
+ #region rotation
+
+ else if (multipleupdate.ObjectData[i].Type == 2) // single item of group rotation from tab
{
if (OnUpdatePrimSingleRotation != null)
{
@@ -124,38 +125,39 @@ namespace OpenSim.Region.ClientStack
OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
}
}
- else if (multipleupdate.ObjectData[i].Type == 3)// single item of group rotation from mouse
+ else if (multipleupdate.ObjectData[i].Type == 3) // single item of group rotation from mouse
{
if (OnUpdatePrimSingleRotation != null)
{
- libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true);
+ LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true);
//System.Console.WriteLine("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
}
}
- else if (multipleupdate.ObjectData[i].Type == 10)//group rotation from object tab
+ else if (multipleupdate.ObjectData[i].Type == 10) //group rotation from object tab
{
if (OnUpdatePrimGroupRotation != null)
{
- libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
+ LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
// Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
OnUpdatePrimGroupRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
}
}
- else if (multipleupdate.ObjectData[i].Type == 11)//group rotation from mouse
+ else if (multipleupdate.ObjectData[i].Type == 11) //group rotation from mouse
{
if (OnUpdatePrimGroupMouseRotation != null)
{
- libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
- libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true);
+ LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
+ LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true);
//Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
// Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
OnUpdatePrimGroupMouseRotation(multipleupdate.ObjectData[i].ObjectLocalID, pos, rot, this);
}
}
- #endregion
- #region scale
- else if (multipleupdate.ObjectData[i].Type == 13)//group scale from object tab
+ #endregion
+ #region scale
+
+ else if (multipleupdate.ObjectData[i].Type == 13) //group scale from object tab
{
if (OnUpdatePrimScale != null)
{
@@ -164,40 +166,41 @@ namespace OpenSim.Region.ClientStack
OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
// Change the position based on scale (for bug number 246)
- libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
+ LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
// System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
}
}
- else if (multipleupdate.ObjectData[i].Type == 29)//group scale from mouse
+ else if (multipleupdate.ObjectData[i].Type == 29) //group scale from mouse
{
if (OnUpdatePrimScale != null)
{
- libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
+ LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
// Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z );
OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
- libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
+ LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
}
}
- else if (multipleupdate.ObjectData[i].Type == 5)//single prim scale from object tab
+ else if (multipleupdate.ObjectData[i].Type == 5) //single prim scale from object tab
{
if (OnUpdatePrimScale != null)
{
- libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
+ LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
// Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
}
}
- else if (multipleupdate.ObjectData[i].Type == 21)//single prim scale from mouse
+ else if (multipleupdate.ObjectData[i].Type == 21) //single prim scale from mouse
{
if (OnUpdatePrimScale != null)
{
- libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
+ LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
// Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
}
}
+
#endregion
}
return true;
@@ -208,7 +211,7 @@ namespace OpenSim.Region.ClientStack
//should be getting the map layer from the grid server
//send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area)
MapLayerReplyPacket mapReply = new MapLayerReplyPacket();
- mapReply.AgentData.AgentID = this.AgentId;
+ mapReply.AgentData.AgentID = AgentId;
mapReply.AgentData.Flags = 0;
mapReply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1];
mapReply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock();
@@ -217,7 +220,7 @@ namespace OpenSim.Region.ClientStack
mapReply.LayerData[0].Top = 30000;
mapReply.LayerData[0].Right = 30000;
mapReply.LayerData[0].ImageID = new LLUUID("00000000-0000-0000-9999-000000000006");
- this.OutPacket(mapReply);
+ OutPacket(mapReply);
}
public void RequestMapBlocks(int minX, int minY, int maxX, int maxY)
@@ -251,4 +254,4 @@ namespace OpenSim.Region.ClientStack
*/
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs b/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs
index 5cd30ce..efeff29 100644
--- a/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs
+++ b/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs
@@ -32,13 +32,12 @@ using System.Net.Sockets;
using System.Timers;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Console;
using OpenSim.Framework;
-using OpenSim.Region.Environment;
+using OpenSim.Framework.Console;
namespace OpenSim.Region.ClientStack
{
- public partial class ClientView
+ public partial class ClientView
{
protected BlockingQueue PacketQueue;
protected Dictionary PendingAcks = new Dictionary();
@@ -84,7 +83,7 @@ namespace OpenSim.Region.ClientStack
Pack.Header.Sequence = Sequence;
}
- if (Pack.Header.Reliable) //DIRTY HACK
+ if (Pack.Header.Reliable) //DIRTY HACK
{
lock (NeedAck)
{
@@ -148,19 +147,21 @@ namespace OpenSim.Region.ClientStack
if (Pack.Header.Zerocoded)
{
int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
- m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode);//userEP);
+ m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode); //userEP);
}
else
{
- m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode); //userEP);
+ m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode);
+ //userEP);
}
}
catch (Exception)
{
- MainLog.Instance.Warn("client", "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread");
- this.KillThread();
+ MainLog.Instance.Warn("client",
+ "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " +
+ userEP.ToString() + " - killing thread");
+ KillThread();
}
-
}
public virtual void InPacket(Packet NewPack)
@@ -180,7 +181,7 @@ namespace OpenSim.Region.ClientStack
// Handle PacketAck packets
if (NewPack.Type == PacketType.PacketAck)
{
- PacketAckPacket ackPacket = (PacketAckPacket)NewPack;
+ PacketAckPacket ackPacket = (PacketAckPacket) NewPack;
lock (NeedAck)
{
@@ -193,7 +194,7 @@ namespace OpenSim.Region.ClientStack
else if ((NewPack.Type == PacketType.StartPingCheck))
{
//reply to pingcheck
- StartPingCheckPacket startPing = (StartPingCheckPacket)NewPack;
+ StartPingCheckPacket startPing = (StartPingCheckPacket) NewPack;
CompletePingCheckPacket endPing = new CompletePingCheckPacket();
endPing.PingID.PingID = startPing.PingID.PingID;
OutPacket(endPing);
@@ -203,9 +204,8 @@ namespace OpenSim.Region.ClientStack
QueItem item = new QueItem();
item.Packet = NewPack;
item.Incoming = true;
- this.PacketQueue.Enqueue(item);
+ PacketQueue.Enqueue(item);
}
-
}
public virtual void OutPacket(Packet NewPack)
@@ -213,7 +213,7 @@ namespace OpenSim.Region.ClientStack
QueItem item = new QueItem();
item.Packet = NewPack;
item.Incoming = false;
- this.PacketQueue.Enqueue(item);
+ PacketQueue.Enqueue(item);
}
# region Low Level Packet Methods
@@ -229,7 +229,6 @@ namespace OpenSim.Region.ClientStack
ack_it.Header.Reliable = false;
OutPacket(ack_it);
-
}
/*
if (Pack.Header.Reliable)
@@ -252,8 +251,8 @@ namespace OpenSim.Region.ClientStack
{
if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent))
{
- MainLog.Instance.Verbose( "Resending " + packet.Type.ToString() + " packet, " +
- (now - packet.TickCount) + "ms have passed");
+ MainLog.Instance.Verbose("Resending " + packet.Type.ToString() + " packet, " +
+ (now - packet.TickCount) + "ms have passed");
packet.Header.Resent = true;
OutPacket(packet);
@@ -271,7 +270,7 @@ namespace OpenSim.Region.ClientStack
if (PendingAcks.Count > 250)
{
// FIXME: Handle the odd case where we have too many pending ACKs queued up
- MainLog.Instance.Verbose( "Too many ACKs queued up!");
+ MainLog.Instance.Verbose("Too many ACKs queued up!");
return;
}
@@ -302,6 +301,7 @@ namespace OpenSim.Region.ClientStack
SendAcks();
ResendUnacked();
}
+
#endregion
#region Nested Classes
@@ -315,6 +315,7 @@ namespace OpenSim.Region.ClientStack
public Packet Packet;
public bool Incoming;
}
+
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 13e8b43..dd2562c 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -31,8 +31,6 @@ using System.Text;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Framework;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.ClientStack
{
@@ -63,7 +61,7 @@ namespace OpenSim.Region.ClientStack
{
ack_pack(Pack);
- if (this.ProcessPacketMethod(Pack))
+ if (ProcessPacketMethod(Pack))
{
//there is a handler registered that handled this packet type
return;
@@ -74,16 +72,17 @@ namespace OpenSim.Region.ClientStack
switch (Pack.Type)
{
- #region Scene/Avatar
+ #region Scene/Avatar
+
case PacketType.AvatarPropertiesRequest:
- AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
+ AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket) Pack;
if (OnRequestAvatarProperties != null)
{
OnRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID);
}
break;
case PacketType.ChatFromViewer:
- ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
+ ChatFromViewerPacket inchatpack = (ChatFromViewerPacket) Pack;
if (Util.FieldToString(inchatpack.ChatData.Message) == "")
{
//empty message so don't bother with it
@@ -103,30 +102,32 @@ namespace OpenSim.Region.ClientStack
args.Channel = channel;
args.From = fromName;
args.Message = Util.FieldToString(message);
- args.Type = (ChatTypeEnum)type;
+ args.Type = (ChatTypeEnum) type;
args.Position = fromPos;
args.Scene = Scene;
args.Sender = this;
- this.OnChatFromViewer(this, args);
+ OnChatFromViewer(this, args);
}
break;
case PacketType.ImprovedInstantMessage:
- ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;
+ ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket) Pack;
string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
string IMmessage = Util.FieldToString(msgpack.MessageBlock.Message);
if (OnInstantMessage != null)
{
- this.OnInstantMessage(msgpack.AgentData.AgentID, msgpack.AgentData.SessionID, msgpack.MessageBlock.ToAgentID, msgpack.MessageBlock.ID,
- msgpack.MessageBlock.Timestamp, IMfromName, IMmessage, msgpack.MessageBlock.Dialog);
+ OnInstantMessage(msgpack.AgentData.AgentID, msgpack.AgentData.SessionID,
+ msgpack.MessageBlock.ToAgentID, msgpack.MessageBlock.ID,
+ msgpack.MessageBlock.Timestamp, IMfromName, IMmessage,
+ msgpack.MessageBlock.Dialog);
}
break;
case PacketType.RezObject:
- RezObjectPacket rezPacket = (RezObjectPacket)Pack;
+ RezObjectPacket rezPacket = (RezObjectPacket) Pack;
if (OnRezObject != null)
{
- this.OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd);
+ OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd);
}
break;
case PacketType.DeRezObject:
@@ -136,13 +137,15 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.ModifyLand:
- ModifyLandPacket modify = (ModifyLandPacket)Pack;
+ ModifyLandPacket modify = (ModifyLandPacket) Pack;
if (modify.ParcelData.Length > 0)
{
if (OnModifyTerrain != null)
{
- OnModifyTerrain(modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, modify.ModifyBlock.BrushSize,
- modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West, this);
+ OnModifyTerrain(modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
+ modify.ModifyBlock.BrushSize,
+ modify.ModifyBlock.Action, modify.ParcelData[0].North,
+ modify.ParcelData[0].West, this);
}
}
break;
@@ -164,7 +167,7 @@ namespace OpenSim.Region.ClientStack
break;
case PacketType.AgentSetAppearance:
//OpenSim.Framework.Console.MainLog.Instance.Verbose("set appear", Pack.ToString());
- AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack;
+ AgentSetAppearancePacket appear = (AgentSetAppearancePacket) Pack;
if (OnSetAppearance != null)
{
OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam);
@@ -179,17 +182,16 @@ namespace OpenSim.Region.ClientStack
case PacketType.AgentUpdate:
if (OnAgentUpdate != null)
{
- AgentUpdatePacket agenUpdate = (AgentUpdatePacket)Pack;
+ AgentUpdatePacket agenUpdate = (AgentUpdatePacket) Pack;
OnAgentUpdate(this, agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotation);
}
break;
case PacketType.AgentAnimation:
- AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
+ AgentAnimationPacket AgentAni = (AgentAnimationPacket) Pack;
for (int i = 0; i < AgentAni.AnimationList.Length; i++)
{
if (AgentAni.AnimationList[i].StartAnim)
{
-
if (OnStartAnim != null)
{
OnStartAnim(this, AgentAni.AnimationList[i].AnimID, 1);
@@ -198,27 +200,29 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.AgentRequestSit:
- AgentRequestSitPacket agentRequestSit = (AgentRequestSitPacket)Pack;
+ AgentRequestSitPacket agentRequestSit = (AgentRequestSitPacket) Pack;
SendSitResponse(agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
if (OnAgentRequestSit != null)
{
- OnAgentRequestSit(this, agentRequestSit.AgentData.AgentID, agentRequestSit.TargetObject.TargetID);
+ OnAgentRequestSit(this, agentRequestSit.AgentData.AgentID,
+ agentRequestSit.TargetObject.TargetID);
}
break;
case PacketType.AgentSit:
if (OnAgentSit != null)
{
- AgentSitPacket agentSit = (AgentSitPacket)Pack;
+ AgentSitPacket agentSit = (AgentSitPacket) Pack;
OnAgentSit(this, agentSit.AgentData.AgentID);
}
break;
- #endregion
+ #endregion
+
+ #region Objects/m_sceneObjects
- #region Objects/m_sceneObjects
case PacketType.ObjectLink:
// OpenSim.Framework.Console.MainLog.Instance.Verbose( Pack.ToString());
- ObjectLinkPacket link = (ObjectLinkPacket)Pack;
+ ObjectLinkPacket link = (ObjectLinkPacket) Pack;
uint parentprimid = 0;
List childrenprims = new List();
if (link.ObjectData.Length > 1)
@@ -238,13 +242,13 @@ namespace OpenSim.Region.ClientStack
case PacketType.ObjectAdd:
if (OnAddPrim != null)
{
- ObjectAddPacket addPacket = (ObjectAddPacket)Pack;
+ ObjectAddPacket addPacket = (ObjectAddPacket) Pack;
PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket);
- OnAddPrim(this.AgentId, addPacket.ObjectData.RayEnd, shape);
+ OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, shape);
}
break;
case PacketType.ObjectShape:
- ObjectShapePacket shapePacket = (ObjectShapePacket)Pack;
+ ObjectShapePacket shapePacket = (ObjectShapePacket) Pack;
for (int i = 0; i < shapePacket.ObjectData.Length; i++)
{
if (OnUpdatePrimShape != null)
@@ -254,26 +258,28 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.ObjectExtraParams:
- ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket)Pack;
+ ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket) Pack;
if (OnUpdateExtraParams != null)
{
- OnUpdateExtraParams(extraPar.ObjectData[0].ObjectLocalID, extraPar.ObjectData[0].ParamType, extraPar.ObjectData[0].ParamInUse, extraPar.ObjectData[0].ParamData);
+ OnUpdateExtraParams(extraPar.ObjectData[0].ObjectLocalID, extraPar.ObjectData[0].ParamType,
+ extraPar.ObjectData[0].ParamInUse, extraPar.ObjectData[0].ParamData);
}
break;
case PacketType.ObjectDuplicate:
- ObjectDuplicatePacket dupe = (ObjectDuplicatePacket)Pack;
+ ObjectDuplicatePacket dupe = (ObjectDuplicatePacket) Pack;
for (int i = 0; i < dupe.ObjectData.Length; i++)
{
if (OnObjectDuplicate != null)
{
- OnObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset, dupe.SharedData.DuplicateFlags);
+ OnObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset,
+ dupe.SharedData.DuplicateFlags);
}
}
break;
case PacketType.ObjectSelect:
- ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack;
+ ObjectSelectPacket incomingselect = (ObjectSelectPacket) Pack;
for (int i = 0; i < incomingselect.ObjectData.Length; i++)
{
if (OnObjectSelect != null)
@@ -283,7 +289,7 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.ObjectDeselect:
- ObjectDeselectPacket incomingdeselect = (ObjectDeselectPacket)Pack;
+ ObjectDeselectPacket incomingdeselect = (ObjectDeselectPacket) Pack;
for (int i = 0; i < incomingdeselect.ObjectData.Length; i++)
{
if (OnObjectDeselect != null)
@@ -293,55 +299,58 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.ObjectFlagUpdate:
- ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack;
+ ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket) Pack;
if (OnUpdatePrimFlags != null)
{
OnUpdatePrimFlags(flags.AgentData.ObjectLocalID, Pack, this);
}
break;
case PacketType.ObjectImage:
- ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
+ ObjectImagePacket imagePack = (ObjectImagePacket) Pack;
for (int i = 0; i < imagePack.ObjectData.Length; i++)
{
if (OnUpdatePrimTexture != null)
{
- OnUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID, imagePack.ObjectData[i].TextureEntry, this);
+ OnUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID,
+ imagePack.ObjectData[i].TextureEntry, this);
}
}
break;
case PacketType.ObjectGrab:
- ObjectGrabPacket grab = (ObjectGrabPacket)Pack;
+ ObjectGrabPacket grab = (ObjectGrabPacket) Pack;
if (OnGrabObject != null)
{
OnGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this);
}
break;
case PacketType.ObjectGrabUpdate:
- ObjectGrabUpdatePacket grabUpdate = (ObjectGrabUpdatePacket)Pack;
+ ObjectGrabUpdatePacket grabUpdate = (ObjectGrabUpdatePacket) Pack;
if (OnGrabUpdate != null)
{
- OnGrabUpdate(grabUpdate.ObjectData.ObjectID, grabUpdate.ObjectData.GrabOffsetInitial, grabUpdate.ObjectData.GrabPosition, this);
+ OnGrabUpdate(grabUpdate.ObjectData.ObjectID, grabUpdate.ObjectData.GrabOffsetInitial,
+ grabUpdate.ObjectData.GrabPosition, this);
}
break;
case PacketType.ObjectDeGrab:
- ObjectDeGrabPacket deGrab = (ObjectDeGrabPacket)Pack;
+ ObjectDeGrabPacket deGrab = (ObjectDeGrabPacket) Pack;
if (OnDeGrabObject != null)
{
OnDeGrabObject(deGrab.ObjectData.LocalID, this);
}
break;
case PacketType.ObjectDescription:
- ObjectDescriptionPacket objDes = (ObjectDescriptionPacket)Pack;
+ ObjectDescriptionPacket objDes = (ObjectDescriptionPacket) Pack;
for (int i = 0; i < objDes.ObjectData.Length; i++)
{
if (OnObjectDescription != null)
{
- OnObjectDescription(objDes.ObjectData[i].LocalID, enc.GetString(objDes.ObjectData[i].Description));
+ OnObjectDescription(objDes.ObjectData[i].LocalID,
+ enc.GetString(objDes.ObjectData[i].Description));
}
}
break;
case PacketType.ObjectName:
- ObjectNamePacket objName = (ObjectNamePacket)Pack;
+ ObjectNamePacket objName = (ObjectNamePacket) Pack;
for (int i = 0; i < objName.ObjectData.Length; i++)
{
if (OnObjectName != null)
@@ -353,15 +362,16 @@ namespace OpenSim.Region.ClientStack
case PacketType.ObjectPermissions:
//Console.WriteLine("permissions set " + Pack.ToString());
break;
- #endregion
- #region Inventory/Asset/Other related packets
+ #endregion
+
+ #region Inventory/Asset/Other related packets
+
case PacketType.RequestImage:
- RequestImagePacket imageRequest = (RequestImagePacket)Pack;
+ RequestImagePacket imageRequest = (RequestImagePacket) Pack;
//Console.WriteLine("image request: " + Pack.ToString());
for (int i = 0; i < imageRequest.RequestImage.Length; i++)
{
-
// still working on the Texture download module so for now using old method
// TextureRequestArgs args = new TextureRequestArgs();
// args.RequestedAssetID = imageRequest.RequestImage[i].Image;
@@ -373,86 +383,104 @@ namespace OpenSim.Region.ClientStack
// OnRequestTexture(this, args);
// }
- m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet, imageRequest.RequestImage[i].DiscardLevel);
+ m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image,
+ imageRequest.RequestImage[i].Packet,
+ imageRequest.RequestImage[i].DiscardLevel);
}
break;
case PacketType.TransferRequest:
//Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request");
- TransferRequestPacket transfer = (TransferRequestPacket)Pack;
+ TransferRequestPacket transfer = (TransferRequestPacket) Pack;
m_assetCache.AddAssetRequest(this, transfer);
break;
case PacketType.AssetUploadRequest:
- AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
+ AssetUploadRequestPacket request = (AssetUploadRequestPacket) Pack;
// Console.WriteLine("upload request " + Pack.ToString());
// Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionID).ToStringHyphenated());
if (OnAssetUploadRequest != null)
{
- OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
+ OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(SecureSessionID),
+ request.AssetBlock.TransactionID, request.AssetBlock.Type,
+ request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
}
break;
case PacketType.RequestXfer:
- RequestXferPacket xferReq = (RequestXferPacket)Pack;
+ RequestXferPacket xferReq = (RequestXferPacket) Pack;
if (OnRequestXfer != null)
{
OnRequestXfer(this, xferReq.XferID.ID, Util.FieldToString(xferReq.XferID.Filename));
}
break;
case PacketType.SendXferPacket:
- SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack;
+ SendXferPacketPacket xferRec = (SendXferPacketPacket) Pack;
if (OnXferReceive != null)
{
OnXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data);
}
break;
case PacketType.ConfirmXferPacket:
- ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack;
+ ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket) Pack;
if (OnConfirmXfer != null)
{
OnConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet);
}
break;
case PacketType.CreateInventoryFolder:
- if (this.OnCreateNewInventoryFolder != null)
+ if (OnCreateNewInventoryFolder != null)
{
- CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack;
- this.OnCreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID);
+ CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket) Pack;
+ OnCreateNewInventoryFolder(this, invFolder.FolderData.FolderID,
+ (ushort) invFolder.FolderData.Type,
+ Util.FieldToString(invFolder.FolderData.Name),
+ invFolder.FolderData.ParentID);
}
break;
case PacketType.CreateInventoryItem:
- CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack;
- if (this.OnCreateNewInventoryItem != null)
+ CreateInventoryItemPacket createItem = (CreateInventoryItemPacket) Pack;
+ if (OnCreateNewInventoryItem != null)
{
- this.OnCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, createItem.InventoryBlock.FolderID, createItem.InventoryBlock.CallbackID,
- Util.FieldToString(createItem.InventoryBlock.Description), Util.FieldToString(createItem.InventoryBlock.Name), createItem.InventoryBlock.InvType,
- createItem.InventoryBlock.Type, createItem.InventoryBlock.WearableType, createItem.InventoryBlock.NextOwnerMask);
+ OnCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID,
+ createItem.InventoryBlock.FolderID,
+ createItem.InventoryBlock.CallbackID,
+ Util.FieldToString(createItem.InventoryBlock.Description),
+ Util.FieldToString(createItem.InventoryBlock.Name),
+ createItem.InventoryBlock.InvType,
+ createItem.InventoryBlock.Type,
+ createItem.InventoryBlock.WearableType,
+ createItem.InventoryBlock.NextOwnerMask);
}
break;
case PacketType.FetchInventory:
- if (this.OnFetchInventory != null)
+ if (OnFetchInventory != null)
{
- FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack;
+ FetchInventoryPacket FetchInventory = (FetchInventoryPacket) Pack;
for (int i = 0; i < FetchInventory.InventoryData.Length; i++)
{
- this.OnFetchInventory(this, FetchInventory.InventoryData[i].ItemID, FetchInventory.InventoryData[i].OwnerID);
+ OnFetchInventory(this, FetchInventory.InventoryData[i].ItemID,
+ FetchInventory.InventoryData[i].OwnerID);
}
}
break;
case PacketType.FetchInventoryDescendents:
- if (this.OnFetchInventoryDescendents != null)
+ if (OnFetchInventoryDescendents != null)
{
- FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack;
- this.OnFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID, Fetch.InventoryData.FetchFolders, Fetch.InventoryData.FetchItems, Fetch.InventoryData.SortOrder);
+ FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket) Pack;
+ OnFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID,
+ Fetch.InventoryData.FetchFolders, Fetch.InventoryData.FetchItems,
+ Fetch.InventoryData.SortOrder);
}
break;
case PacketType.UpdateInventoryItem:
- UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack;
+ UpdateInventoryItemPacket update = (UpdateInventoryItemPacket) Pack;
if (OnUpdateInventoryItem != null)
{
for (int i = 0; i < update.InventoryData.Length; i++)
{
if (update.InventoryData[i].TransactionID != LLUUID.Zero)
{
- OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID, update.InventoryData[i].TransactionID.Combine(this.SecureSessionID), update.InventoryData[i].ItemID);
+ OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID,
+ update.InventoryData[i].TransactionID.Combine(SecureSessionID),
+ update.InventoryData[i].ItemID);
}
}
}
@@ -488,25 +516,26 @@ namespace OpenSim.Region.ClientStack
}*/
break;
case PacketType.RequestTaskInventory:
- RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack;
- if (this.OnRequestTaskInventory != null)
+ RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket) Pack;
+ if (OnRequestTaskInventory != null)
{
- this.OnRequestTaskInventory(this, requesttask.InventoryData.LocalID);
+ OnRequestTaskInventory(this, requesttask.InventoryData.LocalID);
}
break;
case PacketType.UpdateTaskInventory:
//Console.WriteLine(Pack.ToString());
- UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
+ UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket) Pack;
if (OnUpdateTaskInventory != null)
{
if (updatetask.UpdateData.Key == 0)
{
- OnUpdateTaskInventory(this, updatetask.InventoryData.ItemID, updatetask.InventoryData.FolderID, updatetask.UpdateData.LocalID);
+ OnUpdateTaskInventory(this, updatetask.InventoryData.ItemID,
+ updatetask.InventoryData.FolderID, updatetask.UpdateData.LocalID);
}
}
break;
case PacketType.RemoveTaskInventory:
- RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket)Pack;
+ RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket) Pack;
if (OnRemoveTaskItem != null)
{
OnRemoveTaskItem(this, removeTask.InventoryData.ItemID, removeTask.InventoryData.LocalID);
@@ -517,38 +546,39 @@ namespace OpenSim.Region.ClientStack
break;
case PacketType.RezScript:
//Console.WriteLine(Pack.ToString());
- RezScriptPacket rezScript = (RezScriptPacket)Pack;
+ RezScriptPacket rezScript = (RezScriptPacket) Pack;
if (OnRezScript != null)
{
OnRezScript(this, rezScript.InventoryBlock.ItemID, rezScript.UpdateBlock.ObjectLocalID);
}
break;
case PacketType.MapLayerRequest:
- this.RequestMapLayer();
+ RequestMapLayer();
break;
case PacketType.MapBlockRequest:
- MapBlockRequestPacket MapRequest = (MapBlockRequestPacket)Pack;
+ MapBlockRequestPacket MapRequest = (MapBlockRequestPacket) Pack;
if (OnRequestMapBlocks != null)
{
- OnRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, MapRequest.PositionData.MaxX, MapRequest.PositionData.MaxY);
+ OnRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY,
+ MapRequest.PositionData.MaxX, MapRequest.PositionData.MaxY);
}
break;
case PacketType.TeleportLandmarkRequest:
- TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack;
+ TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket) Pack;
TeleportStartPacket tpStart = new TeleportStartPacket();
tpStart.Info.TeleportFlags = 8; // tp via lm
- this.OutPacket(tpStart);
+ OutPacket(tpStart);
TeleportProgressPacket tpProgress = new TeleportProgressPacket();
tpProgress.Info.Message = (new ASCIIEncoding()).GetBytes("sending_landmark");
tpProgress.Info.TeleportFlags = 8;
tpProgress.AgentData.AgentID = tpReq.Info.AgentID;
- this.OutPacket(tpProgress);
+ OutPacket(tpProgress);
// Fetch landmark
LLUUID lmid = tpReq.Info.LandmarkID;
- AssetBase lma = this.m_assetCache.GetAsset(lmid);
+ AssetBase lma = m_assetCache.GetAsset(lmid);
if (lma != null)
{
AssetLandmark lm = new AssetLandmark(lma);
@@ -558,7 +588,7 @@ namespace OpenSim.Region.ClientStack
TeleportLocalPacket tpLocal = new TeleportLocalPacket();
tpLocal.Info.AgentID = tpReq.Info.AgentID;
- tpLocal.Info.TeleportFlags = 8; // Teleport via landmark
+ tpLocal.Info.TeleportFlags = 8; // Teleport via landmark
tpLocal.Info.LocationID = 2;
tpLocal.Info.Position = lm.Position;
OutPacket(tpLocal);
@@ -582,12 +612,13 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.TeleportLocationRequest:
- TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack;
+ TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket) Pack;
// Console.WriteLine(tpLocReq.ToString());
if (OnTeleportLocationRequest != null)
{
- OnTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position, tpLocReq.Info.LookAt, 16);
+ OnTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position,
+ tpLocReq.Info.LookAt, 16);
}
else
{
@@ -598,76 +629,94 @@ namespace OpenSim.Region.ClientStack
OutPacket(tpCancel);
}
break;
- #endregion
+
+ #endregion
case PacketType.MoneyBalanceRequest:
SendMoneyBalance(LLUUID.Zero, true, new byte[0], MoneyBalance);
break;
case PacketType.UUIDNameRequest:
- UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack;
+ UUIDNameRequestPacket incoming = (UUIDNameRequestPacket) Pack;
foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock)
{
OnNameFromUUIDRequest(UUIDBlock.ID, this);
}
break;
- #region Parcel related packets
+
+ #region Parcel related packets
+
case PacketType.ParcelPropertiesRequest:
- ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack;
+ ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket) Pack;
if (OnParcelPropertiesRequest != null)
{
- OnParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), (int)Math.Round(propertiesRequest.ParcelData.South), (int)Math.Round(propertiesRequest.ParcelData.East), (int)Math.Round(propertiesRequest.ParcelData.North), propertiesRequest.ParcelData.SequenceID, propertiesRequest.ParcelData.SnapSelection, this);
+ OnParcelPropertiesRequest((int) Math.Round(propertiesRequest.ParcelData.West),
+ (int) Math.Round(propertiesRequest.ParcelData.South),
+ (int) Math.Round(propertiesRequest.ParcelData.East),
+ (int) Math.Round(propertiesRequest.ParcelData.North),
+ propertiesRequest.ParcelData.SequenceID,
+ propertiesRequest.ParcelData.SnapSelection, this);
}
break;
case PacketType.ParcelDivide:
- ParcelDividePacket landDivide = (ParcelDividePacket)Pack;
+ ParcelDividePacket landDivide = (ParcelDividePacket) Pack;
if (OnParcelDivideRequest != null)
{
- OnParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West), (int)Math.Round(landDivide.ParcelData.South), (int)Math.Round(landDivide.ParcelData.East), (int)Math.Round(landDivide.ParcelData.North), this);
+ OnParcelDivideRequest((int) Math.Round(landDivide.ParcelData.West),
+ (int) Math.Round(landDivide.ParcelData.South),
+ (int) Math.Round(landDivide.ParcelData.East),
+ (int) Math.Round(landDivide.ParcelData.North), this);
}
break;
case PacketType.ParcelJoin:
- ParcelJoinPacket landJoin = (ParcelJoinPacket)Pack;
+ ParcelJoinPacket landJoin = (ParcelJoinPacket) Pack;
if (OnParcelJoinRequest != null)
{
- OnParcelJoinRequest((int)Math.Round(landJoin.ParcelData.West), (int)Math.Round(landJoin.ParcelData.South), (int)Math.Round(landJoin.ParcelData.East), (int)Math.Round(landJoin.ParcelData.North), this);
+ OnParcelJoinRequest((int) Math.Round(landJoin.ParcelData.West),
+ (int) Math.Round(landJoin.ParcelData.South),
+ (int) Math.Round(landJoin.ParcelData.East),
+ (int) Math.Round(landJoin.ParcelData.North), this);
}
break;
case PacketType.ParcelPropertiesUpdate:
- ParcelPropertiesUpdatePacket updatePacket = (ParcelPropertiesUpdatePacket)Pack;
+ ParcelPropertiesUpdatePacket updatePacket = (ParcelPropertiesUpdatePacket) Pack;
if (OnParcelPropertiesUpdateRequest != null)
{
OnParcelPropertiesUpdateRequest(updatePacket, this);
-
}
break;
case PacketType.ParcelSelectObjects:
- ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket)Pack;
+ ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket) Pack;
if (OnParcelSelectObjects != null)
{
- OnParcelSelectObjects(selectPacket.ParcelData.LocalID, Convert.ToInt32(selectPacket.ParcelData.ReturnType), this);
+ OnParcelSelectObjects(selectPacket.ParcelData.LocalID,
+ Convert.ToInt32(selectPacket.ParcelData.ReturnType), this);
}
break;
case PacketType.ParcelObjectOwnersRequest:
- ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack;
+ ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket) Pack;
if (OnParcelObjectOwnerRequest != null)
{
OnParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this);
}
break;
- #endregion
- #region Estate Packets
+ #endregion
+
+ #region Estate Packets
+
case PacketType.EstateOwnerMessage:
- EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack;
+ EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket) Pack;
if (OnEstateOwnerMessage != null)
{
OnEstateOwnerMessage(messagePacket, this);
}
break;
- #endregion
- #region unimplemented handlers
+ #endregion
+
+ #region unimplemented handlers
+
case PacketType.AgentIsNowWearing:
// AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack;
//Console.WriteLine(Pack.ToString());
@@ -675,7 +724,8 @@ namespace OpenSim.Region.ClientStack
case PacketType.ObjectScale:
//OpenSim.Framework.Console.MainLog.Instance.Verbose( Pack.ToString());
break;
- #endregion
+
+ #endregion
}
}
}
@@ -721,4 +771,4 @@ namespace OpenSim.Region.ClientStack
OutPacket(logReply);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 6d49e34..55f50a4 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -36,7 +36,7 @@ using libsecondlife.Packets;
using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
-using Timer = System.Timers.Timer;
+using Timer=System.Timers.Timer;
namespace OpenSim.Region.ClientStack
{
@@ -50,8 +50,11 @@ namespace OpenSim.Region.ClientStack
{
public static TerrainManager TerrainManager;
- protected static Dictionary PacketHandlers = new Dictionary(); //Global/static handlers for all clients
- protected Dictionary m_packetHandlers = new Dictionary(); //local handlers for this instance
+ protected static Dictionary PacketHandlers =
+ new Dictionary(); //Global/static handlers for all clients
+
+ protected Dictionary m_packetHandlers = new Dictionary();
+ //local handlers for this instance
private LLUUID m_sessionId;
public LLUUID SecureSessionID = LLUUID.Zero;
@@ -84,7 +87,9 @@ namespace OpenSim.Region.ClientStack
private int probesWithNoIngressPackets = 0;
private int lastPacketsReceived = 0;
- public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions)
+ public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager,
+ IScene scene, AssetCache assetCache, PacketServer packServer,
+ AgentCircuitManager authenSessions)
{
m_moneyBalance = 1000;
@@ -96,11 +101,11 @@ namespace OpenSim.Region.ClientStack
// m_inventoryCache = inventoryCache;
m_authenticateSessionsHandler = authenSessions;
- MainLog.Instance.Verbose("CLIENT","Started up new client thread to handle incoming request");
+ MainLog.Instance.Verbose("CLIENT", "Started up new client thread to handle incoming request");
cirpack = initialcirpack;
userEP = remoteEP;
- this.startpos = m_authenticateSessionsHandler.GetPosition(initialcirpack.CircuitCode.Code);
+ startpos = m_authenticateSessionsHandler.GetPosition(initialcirpack.CircuitCode.Code);
PacketQueue = new BlockingQueue();
@@ -109,7 +114,7 @@ namespace OpenSim.Region.ClientStack
AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed);
AckTimer.Start();
- this.RegisterLocalPacketHandlers();
+ RegisterLocalPacketHandlers();
ClientThread = new Thread(new ThreadStart(AuthUser));
ClientThread.IsBackground = true;
@@ -121,7 +126,7 @@ namespace OpenSim.Region.ClientStack
get { return m_sessionId; }
}
- public void SetDebug(int newDebug)
+ public void SetDebug(int newDebug)
{
debug = newDebug;
}
@@ -132,14 +137,15 @@ namespace OpenSim.Region.ClientStack
{
clientPingTimer.Stop();
- m_scene.RemoveClient(this.AgentId);
+ m_scene.RemoveClient(AgentId);
- this.ClientThread.Abort();
+ ClientThread.Abort();
}
#endregion
# region Packet Handling
+
public static bool AddPacketHandler(PacketType packetType, PacketMethod handler)
{
bool result = false;
@@ -195,23 +201,27 @@ namespace OpenSim.Region.ClientStack
protected void DebugPacket(string direction, Packet packet)
{
- if (debug > 0) {
+ if (debug > 0)
+ {
string info;
- if (debug < 255 && packet.Type == PacketType.AgentUpdate)
- return;
- if (debug < 254 && packet.Type == PacketType.ViewerEffect)
- return;
+ if (debug < 255 && packet.Type == PacketType.AgentUpdate)
+ return;
+ if (debug < 254 && packet.Type == PacketType.ViewerEffect)
+ return;
if (debug < 253 && (
- packet.Type == PacketType.CompletePingCheck ||
- packet.Type == PacketType.StartPingCheck
- ) )
- return;
- if (debug < 252 && packet.Type == PacketType.PacketAck)
- return;
-
- if (debug > 1) {
+ packet.Type == PacketType.CompletePingCheck ||
+ packet.Type == PacketType.StartPingCheck
+ ))
+ return;
+ if (debug < 252 && packet.Type == PacketType.PacketAck)
+ return;
+
+ if (debug > 1)
+ {
info = packet.ToString();
- } else {
+ }
+ else
+ {
info = packet.Type.ToString();
}
Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
@@ -242,6 +252,7 @@ namespace OpenSim.Region.ClientStack
}
}
}
+
# endregion
protected void CheckClientConnectivity(object sender, ElapsedEventArgs e)
@@ -251,7 +262,7 @@ namespace OpenSim.Region.ClientStack
probesWithNoIngressPackets++;
if (probesWithNoIngressPackets > 30)
{
- if( OnConnectionClosed != null )
+ if (OnConnectionClosed != null)
{
OnConnectionClosed(this);
}
@@ -278,14 +289,16 @@ namespace OpenSim.Region.ClientStack
clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
clientPingTimer.Enabled = true;
- MainLog.Instance.Verbose("CLIENT","Adding viewer agent to scene");
- this.m_scene.AddNewClient(this, true);
+ MainLog.Instance.Verbose("CLIENT", "Adding viewer agent to scene");
+ m_scene.AddNewClient(this, true);
}
protected virtual void AuthUser()
{
// AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(cirpack.m_circuitCode.m_sessionId, cirpack.m_circuitCode.ID, cirpack.m_circuitCode.Code);
- AuthenticateResponse sessionInfo = this.m_authenticateSessionsHandler.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
+ AuthenticateResponse sessionInfo =
+ m_authenticateSessionsHandler.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID,
+ cirpack.CircuitCode.Code);
if (!sessionInfo.Authorised)
{
//session/circuit not authorised
@@ -297,27 +310,26 @@ namespace OpenSim.Region.ClientStack
MainLog.Instance.Notice("CLIENT", "Got authenticated connection from " + userEP.ToString());
//session is authorised
m_agentId = cirpack.CircuitCode.ID;
- this.m_sessionId = cirpack.CircuitCode.SessionID;
- this.m_circuitCode = cirpack.CircuitCode.Code;
- this.firstName = sessionInfo.LoginInfo.First;
- this.lastName = sessionInfo.LoginInfo.Last;
+ m_sessionId = cirpack.CircuitCode.SessionID;
+ m_circuitCode = cirpack.CircuitCode.Code;
+ firstName = sessionInfo.LoginInfo.First;
+ lastName = sessionInfo.LoginInfo.Last;
if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero)
{
- this.SecureSessionID = sessionInfo.LoginInfo.SecureSession;
+ SecureSessionID = sessionInfo.LoginInfo.SecureSession;
}
InitNewClient();
ClientLoop();
}
}
- # endregion
+ # endregion
protected void KillThread()
{
- this.ClientThread.Abort();
+ ClientThread.Abort();
}
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs
index 1b64602..f75536a 100644
--- a/OpenSim/Region/ClientStack/PacketServer.cs
+++ b/OpenSim/Region/ClientStack/PacketServer.cs
@@ -25,15 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using libsecondlife.Packets;
using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
-using OpenSim.Framework;
-using OpenSim.Framework.Interfaces;
-using libsecondlife;
namespace OpenSim.Region.ClientStack
{
@@ -56,10 +52,7 @@ namespace OpenSim.Region.ClientStack
public IScene LocalScene
{
- set
- {
- this.m_scene = value;
- }
+ set { m_scene = value; }
}
///
@@ -72,17 +65,21 @@ namespace OpenSim.Region.ClientStack
m_scene.ClientManager.InPacket(circuitCode, packet);
}
- protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions)
+ protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack,
+ ClientManager clientManager, IScene scene, AssetCache assetCache,
+ PacketServer packServer, AgentCircuitManager authenSessions)
{
- return new ClientView(remoteEP, initialcirpack, clientManager, scene, assetCache, packServer, authenSessions );
+ return
+ new ClientView(remoteEP, initialcirpack, clientManager, scene, assetCache, packServer, authenSessions);
}
- public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, AgentCircuitManager authenticateSessionsClass)
+ public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache,
+ AgentCircuitManager authenticateSessionsClass)
{
IClientAPI newuser;
if (m_scene.ClientManager.TryGetClient(useCircuit.CircuitCode.Code, out newuser))
- {
+ {
return false;
}
else
@@ -104,7 +101,7 @@ namespace OpenSim.Region.ClientStack
{
client.SendLogoutPacket();
- CloseClient( client );
+ CloseClient(client);
}
@@ -117,7 +114,7 @@ namespace OpenSim.Region.ClientStack
///
public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
{
- this.m_networkHandler.SendPacketTo(buffer, size, flags, circuitcode);
+ m_networkHandler.SendPacketTo(buffer, size, flags, circuitcode);
}
///
@@ -126,13 +123,13 @@ namespace OpenSim.Region.ClientStack
///
public virtual void CloseCircuit(uint circuitcode)
{
- m_networkHandler.RemoveClientCircuit( circuitcode );
+ m_networkHandler.RemoveClientCircuit(circuitcode);
m_scene.ClientManager.CloseAllAgents(circuitcode);
}
- public virtual void CloseClient( IClientAPI client )
+ public virtual void CloseClient(IClientAPI client)
{
- CloseCircuit( client.CircuitCode );
+ CloseCircuit(client.CircuitCode);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 657af54..7551bff 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -28,17 +28,15 @@
using System;
using System.Collections.Generic;
using System.Net;
+using libsecondlife;
using OpenSim.Framework;
+using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Servers;
-using OpenSim.Framework;
-using OpenSim.Region.Physics.Manager;
using OpenSim.Region.Environment;
-using libsecondlife;
using OpenSim.Region.Environment.Scenes;
-using OpenSim.Framework.Communications;
+using OpenSim.Region.Physics.Manager;
namespace OpenSim.Region.ClientStack
{
@@ -67,9 +65,8 @@ namespace OpenSim.Region.ClientStack
m_startuptime = DateTime.Now;
}
- virtual public void StartUp()
+ public virtual void StartUp()
{
-
ClientView.TerrainManager = new TerrainManager(new SecondLife());
Initialize();
@@ -116,7 +113,10 @@ namespace OpenSim.Region.ClientStack
scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D());
//Master Avatar Setup
- UserProfileData masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword);
+ UserProfileData masterAvatar =
+ m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName,
+ scene.RegionInfo.MasterAvatarLastName,
+ scene.RegionInfo.MasterAvatarSandboxPassword);
if (masterAvatar != null)
{
m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]");
@@ -126,7 +126,7 @@ namespace OpenSim.Region.ClientStack
else
{
m_log.Verbose("PARCEL", "No master avatar found, using null.");
- scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero;
+ scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero;
//TODO: Load parcels from storageManager
}
@@ -138,8 +138,7 @@ namespace OpenSim.Region.ClientStack
return scene;
}
- protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager);
-
-
+ protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
+ AgentCircuitManager circuitManager);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs
index 584b80c..e5965cb 100644
--- a/OpenSim/Region/ClientStack/UDPServer.cs
+++ b/OpenSim/Region/ClientStack/UDPServer.cs
@@ -32,13 +32,10 @@ using System.Net.Sockets;
using libsecondlife.Packets;
using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
-using OpenSim.Framework;
using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
namespace OpenSim.Region.ClientStack
{
-
public class UDPServer : ClientStackNetworkHandler
{
protected Dictionary clientCircuits = new Dictionary();
@@ -59,22 +56,16 @@ namespace OpenSim.Region.ClientStack
public PacketServer PacketServer
{
- get
- {
- return m_packetServer;
- }
- set
- {
- m_packetServer = value;
- }
+ get { return m_packetServer; }
+ set { m_packetServer = value; }
}
public IScene LocalScene
{
set
{
- this.m_localScene = value;
- this.m_packetServer.LocalScene = this.m_localScene;
+ m_localScene = value;
+ m_packetServer.LocalScene = m_localScene;
}
}
@@ -85,10 +76,10 @@ namespace OpenSim.Region.ClientStack
public UDPServer(int port, AssetCache assetCache, LogBase console, AgentCircuitManager authenticateClass)
{
listenPort = port;
- this.m_assetCache = assetCache;
- this.m_log = console;
- this.m_authenticateSessionsClass = authenticateClass;
- this.CreatePacketServer();
+ m_assetCache = assetCache;
+ m_log = console;
+ m_authenticateSessionsClass = authenticateClass;
+ CreatePacketServer();
}
protected virtual void CreatePacketServer()
@@ -99,7 +90,7 @@ namespace OpenSim.Region.ClientStack
protected virtual void OnReceivedData(IAsyncResult result)
{
ipeSender = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
- epSender = (EndPoint)ipeSender;
+ epSender = (EndPoint) ipeSender;
Packet packet = null;
int numBytes;
@@ -108,7 +99,7 @@ namespace OpenSim.Region.ClientStack
{
numBytes = Server.EndReceiveFrom(result, ref epSender);
}
- catch (System.Net.Sockets.SocketException e)
+ catch (SocketException e)
{
// TODO : Actually only handle those states that we have control over, re-throw everything else,
// TODO: implement cases as we encounter them.
@@ -134,7 +125,7 @@ namespace OpenSim.Region.ClientStack
if (clientCircuits.TryGetValue(epSender, out circuit))
{
//if so then send packet to the packetserver
- this.m_packetServer.InPacket(circuit, packet);
+ m_packetServer.InPacket(circuit, packet);
}
else if (packet.Type == PacketType.UseCircuitCode)
{
@@ -142,7 +133,8 @@ namespace OpenSim.Region.ClientStack
AddNewClient(packet);
}
else
- { // invalid client
+ {
+ // invalid client
m_log.Warn("client", "Got a packet from an invalid client - " + epSender.ToString());
}
@@ -160,10 +152,10 @@ namespace OpenSim.Region.ClientStack
protected virtual void AddNewClient(Packet packet)
{
- UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet;
- this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
+ UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet;
+ clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
- this.PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_authenticateSessionsClass);
+ PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_authenticateSessionsClass);
}
public void ServerListener()
@@ -177,24 +169,24 @@ namespace OpenSim.Region.ClientStack
m_log.Verbose("SERVER", "UDP socket bound, getting ready to listen");
ipeSender = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
- epSender = (EndPoint)ipeSender;
- ReceivedData = new AsyncCallback(this.OnReceivedData);
+ epSender = (EndPoint) ipeSender;
+ ReceivedData = new AsyncCallback(OnReceivedData);
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
m_log.Status("SERVER", "Listening...");
-
}
public virtual void RegisterPacketServer(PacketServer server)
{
- this.m_packetServer = server;
+ m_packetServer = server;
}
- public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)//EndPoint packetSender)
+ public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
+ //EndPoint packetSender)
{
// find the endpoint for this circuit
EndPoint sendto = null;
- foreach (KeyValuePair p in this.clientCircuits)
+ foreach (KeyValuePair p in clientCircuits)
{
if (p.Value == circuitcode)
{
@@ -205,22 +197,20 @@ namespace OpenSim.Region.ClientStack
if (sendto != null)
{
//we found the endpoint so send the packet to it
- this.Server.SendTo(buffer, size, flags, sendto);
+ Server.SendTo(buffer, size, flags, sendto);
}
}
public virtual void RemoveClientCircuit(uint circuitcode)
{
- foreach (KeyValuePair p in this.clientCircuits)
+ foreach (KeyValuePair p in clientCircuits)
{
if (p.Value == circuitcode)
{
- this.clientCircuits.Remove(p.Key);
+ clientCircuits.Remove(p.Key);
break;
}
}
}
-
-
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index ef5150f..eac293e 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -25,32 +25,30 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Servers;
-using OpenSim.Framework;
namespace OpenSim.Region.Communications.Local
{
public class CommunicationsLocal : CommunicationsManager
{
public CommunicationsLocal(
- NetworkServersInfo serversInfo,
- BaseHttpServer httpServer,
- AssetCache assetCache,
- IUserService userService,
- LocalInventoryService inventoryService,
- IInterRegionCommunications interRegionService,
- IGridServices gridService, bool dumpAssetsToFile )
+ NetworkServersInfo serversInfo,
+ BaseHttpServer httpServer,
+ AssetCache assetCache,
+ IUserService userService,
+ LocalInventoryService inventoryService,
+ IInterRegionCommunications interRegionService,
+ IGridServices gridService, bool dumpAssetsToFile)
: base(serversInfo, httpServer, assetCache, dumpAssetsToFile)
{
m_inventoryService = inventoryService;
m_userService = userService;
m_gridService = gridService;
m_interRegion = interRegionService;
-
}
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 99c4bc3..3a0b47f 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -25,25 +25,25 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+using System.Collections;
using System.Collections.Generic;
using libsecondlife;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
-using OpenSim.Framework;
-using System.Collections;
namespace OpenSim.Region.Communications.Local
{
-
public class LocalBackEndServices : IGridServices, IInterRegionCommunications
{
protected Dictionary m_regions = new Dictionary();
- protected Dictionary m_regionListeners = new Dictionary();
+
+ protected Dictionary m_regionListeners =
+ new Dictionary();
+
private Dictionary m_remoteRegionInfoCache = new Dictionary();
public LocalBackEndServices()
{
-
}
///
@@ -54,13 +54,13 @@ namespace OpenSim.Region.Communications.Local
public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
{
//Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
- if (!this.m_regions.ContainsKey((uint)regionInfo.RegionHandle))
+ if (!m_regions.ContainsKey((uint) regionInfo.RegionHandle))
{
//Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
- this.m_regions.Add(regionInfo.RegionHandle, regionInfo);
+ m_regions.Add(regionInfo.RegionHandle, regionInfo);
RegionCommsListener regionHost = new RegionCommsListener();
- this.m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
+ m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
return regionHost;
}
@@ -103,9 +103,9 @@ namespace OpenSim.Region.Communications.Local
///
public RegionInfo RequestNeighbourInfo(ulong regionHandle)
{
- if (this.m_regions.ContainsKey(regionHandle))
+ if (m_regions.ContainsKey(regionHandle))
{
- return this.m_regions[regionHandle];
+ return m_regions[regionHandle];
}
return null;
}
@@ -121,16 +121,18 @@ namespace OpenSim.Region.Communications.Local
public List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
{
List mapBlocks = new List();
- foreach (RegionInfo regInfo in this.m_regions.Values)
+ foreach (RegionInfo regInfo in m_regions.Values)
{
- if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY)))
+ if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) &&
+ ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY)))
{
MapBlockData map = new MapBlockData();
map.Name = regInfo.RegionName;
- map.X = (ushort)regInfo.RegionLocX;
- map.Y = (ushort)regInfo.RegionLocY;
- map.WaterHeight = (byte)regInfo.EstateSettings.waterHeight;
- map.MapImageId = regInfo.EstateSettings.terrainImageID; //new LLUUID("00000000-0000-0000-9999-000000000007");
+ map.X = (ushort) regInfo.RegionLocX;
+ map.Y = (ushort) regInfo.RegionLocY;
+ map.WaterHeight = (byte) regInfo.EstateSettings.waterHeight;
+ map.MapImageId = regInfo.EstateSettings.terrainImageID;
+ //new LLUUID("00000000-0000-0000-9999-000000000007");
map.Agents = 1;
map.RegionFlags = 72458694;
map.Access = 13;
@@ -145,13 +147,14 @@ namespace OpenSim.Region.Communications.Local
///
///
///
- public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
+ public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
+ //should change from agentCircuitData
{
//Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
- if (this.m_regionListeners.ContainsKey(regionHandle))
+ if (m_regionListeners.ContainsKey(regionHandle))
{
// Console.WriteLine("CommsManager- Informing a region to expect child agent");
- this.m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
+ m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
return true;
}
return false;
@@ -166,10 +169,10 @@ namespace OpenSim.Region.Communications.Local
///
public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
{
- if (this.m_regionListeners.ContainsKey(regionHandle))
+ if (m_regionListeners.ContainsKey(regionHandle))
{
// Console.WriteLine("CommsManager- Informing a region to expect avatar crossing");
- this.m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying);
+ m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying);
return true;
}
return false;
@@ -177,7 +180,7 @@ namespace OpenSim.Region.Communications.Local
public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId)
{
- if (this.m_regionListeners.ContainsKey(regionHandle))
+ if (m_regionListeners.ContainsKey(regionHandle))
{
return true;
}
@@ -210,15 +213,15 @@ namespace OpenSim.Region.Communications.Local
public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
{
- if (this.m_regionListeners.ContainsKey(regionHandle))
+ if (m_regionListeners.ContainsKey(regionHandle))
{
- this.m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent);
+ m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent);
}
}
public void PingCheckReply(Hashtable respData)
{
- foreach (ulong region in this.m_regions.Keys)
+ foreach (ulong region in m_regions.Keys)
{
Hashtable regData = new Hashtable();
RegionInfo reg = m_regions[region];
@@ -234,7 +237,7 @@ namespace OpenSim.Region.Communications.Local
if (m_regionListeners.ContainsKey(regionHandle))
{
return m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position,
- isFlying);
+ isFlying);
}
return false;
@@ -250,11 +253,5 @@ namespace OpenSim.Region.Communications.Local
return false;
}
-
-
-
}
-}
-
-
-
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
index b7d78bc..c38e922 100644
--- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs
+++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
@@ -28,29 +28,28 @@
using System.Collections.Generic;
using libsecondlife;
+using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
-using OpenSim.Framework;
namespace OpenSim.Region.Communications.Local
{
public class LocalInventoryService : InventoryServiceBase
{
-
public LocalInventoryService()
{
-
}
- public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack)
+ public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack,
+ InventoryItemInfo itemCallBack)
{
- List folders = this.RequestFirstLevelFolders(userID);
+ List folders = RequestFirstLevelFolders(userID);
InventoryFolderImpl rootFolder = null;
//need to make sure we send root folder first
foreach (InventoryFolderBase folder in folders)
{
- if (folder.parentID == libsecondlife.LLUUID.Zero)
+ if (folder.parentID == LLUUID.Zero)
{
InventoryFolderImpl newfolder = new InventoryFolderImpl(folder);
rootFolder = newfolder;
@@ -67,7 +66,7 @@ namespace OpenSim.Region.Communications.Local
InventoryFolderImpl newfolder = new InventoryFolderImpl(folder);
folderCallBack(userID, newfolder);
- List items = this.RequestFolderItems(newfolder.folderID);
+ List items = RequestFolderItems(newfolder.folderID);
foreach (InventoryItemBase item in items)
{
itemCallBack(userID, item);
@@ -79,17 +78,17 @@ namespace OpenSim.Region.Communications.Local
public override void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder)
{
- this.AddFolder(folder);
+ AddFolder(folder);
}
public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
{
- this.AddItem(item);
+ AddItem(item);
}
public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
{
- this.deleteItem(item);
+ deleteItem(item);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 1043683..aa1a0d9 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections;
using System.Collections.Generic;
using libsecondlife;
-using OpenSim.Framework.Communications;
using OpenSim.Framework;
using OpenSim.Framework.UserManagement;
+using InventoryFolder=OpenSim.Framework.InventoryFolder;
namespace OpenSim.Region.Communications.Local
{
@@ -49,23 +49,23 @@ namespace OpenSim.Region.Communications.Local
public event LoginToRegionEvent OnLoginToRegion;
- public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate)
+ public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent,
+ NetworkServersInfo serversInfo, bool authenticate)
: base(userManager, welcomeMess)
{
m_Parent = parent;
this.serversInfo = serversInfo;
defaultHomeX = this.serversInfo.DefaultHomeLocX;
defaultHomeY = this.serversInfo.DefaultHomeLocY;
- this.authUsers = authenticate;
+ authUsers = authenticate;
}
public override UserProfileData GetTheUser(string firstname, string lastname)
{
- UserProfileData profile = this.m_userManager.GetUserProfile(firstname, lastname);
+ UserProfileData profile = m_userManager.GetUserProfile(firstname, lastname);
if (profile != null)
{
-
return profile;
}
@@ -73,9 +73,9 @@ namespace OpenSim.Region.Communications.Local
{
//no current user account so make one
Console.WriteLine("No User account found so creating a new one ");
- this.m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
+ m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
- profile = this.m_userManager.GetUserProfile(firstname, lastname);
+ profile = m_userManager.GetUserProfile(firstname, lastname);
if (profile != null)
{
m_Parent.InventoryService.CreateNewUserInventory(profile.UUID);
@@ -113,18 +113,22 @@ namespace OpenSim.Region.Communications.Local
if (reg != null)
{
- response.Home = "{'region_handle':[r" + (reg.RegionLocX * 256).ToString() + ",r" + (reg.RegionLocY * 256).ToString() + "], " +
- "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
- "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
+ response.Home = "{'region_handle':[r" + (reg.RegionLocX*256).ToString() + ",r" +
+ (reg.RegionLocY*256).ToString() + "], " +
+ "'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
+ theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
+ "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" +
+ theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
string capsPath = Util.GetRandomCapsPath();
response.SimAddress = reg.ExternalEndPoint.Address.ToString();
- response.SimPort = (Int32)reg.ExternalEndPoint.Port;
+ response.SimPort = (Int32) reg.ExternalEndPoint.Port;
response.RegionX = reg.RegionLocX;
response.RegionY = reg.RegionLocY;
-
- response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/";
- // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/";
+
+ response.SeedCapability = "http://" + reg.ExternalHostName + ":" +
+ serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/";
+ // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/";
theUser.currentAgent.currentRegion = reg.RegionID;
theUser.currentAgent.currentHandle = reg.RegionHandle;
@@ -135,11 +139,11 @@ namespace OpenSim.Region.Communications.Local
_login.Agent = response.AgentID;
_login.Session = response.SessionID;
_login.SecureSession = response.SecureSessionID;
- _login.CircuitCode = (uint)response.CircuitCode;
+ _login.CircuitCode = (uint) response.CircuitCode;
_login.StartPos = new LLVector3(128, 128, 70);
_login.CapsPath = capsPath;
- if( OnLoginToRegion != null )
+ if (OnLoginToRegion != null)
{
OnLoginToRegion(currentRegion, _login);
}
@@ -148,7 +152,6 @@ namespace OpenSim.Region.Communications.Local
{
Console.WriteLine("not found region " + currentRegion);
}
-
}
protected override InventoryData CreateInventoryData(LLUUID userID)
@@ -168,8 +171,8 @@ namespace OpenSim.Region.Communications.Local
TempHash = new Hashtable();
TempHash["name"] = InvFolder.name;
TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated();
- TempHash["version"] = (Int32)InvFolder.version;
- TempHash["type_default"] = (Int32)InvFolder.type;
+ TempHash["version"] = (Int32) InvFolder.version;
+ TempHash["type_default"] = (Int32) InvFolder.type;
TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated();
AgentInventoryArray.Add(TempHash);
}
@@ -182,13 +185,13 @@ namespace OpenSim.Region.Communications.Local
ArrayList AgentInventoryArray = new ArrayList();
Hashtable TempHash;
- foreach (OpenSim.Framework.InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
+ foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
{
TempHash = new Hashtable();
TempHash["name"] = InvFolder.FolderName;
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
- TempHash["version"] = (Int32)InvFolder.Version;
- TempHash["type_default"] = (Int32)InvFolder.DefaultType;
+ TempHash["version"] = (Int32) InvFolder.Version;
+ TempHash["type_default"] = (Int32) InvFolder.DefaultType;
TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
AgentInventoryArray.Add(TempHash);
}
@@ -197,4 +200,4 @@ namespace OpenSim.Region.Communications.Local
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index 1dede97..a7687c7 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -27,8 +27,8 @@
*/
using System;
-using OpenSim.Framework.Communications;
using OpenSim.Framework;
+using OpenSim.Framework.Communications;
using OpenSim.Framework.UserManagement;
namespace OpenSim.Region.Communications.Local
@@ -41,7 +41,8 @@ namespace OpenSim.Region.Communications.Local
private IInventoryServices m_inventoryService;
- public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY, IInventoryServices inventoryService)
+ public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY,
+ IInventoryServices inventoryService)
{
m_serversInfo = serversInfo;
@@ -49,7 +50,6 @@ namespace OpenSim.Region.Communications.Local
m_defaultHomeY = defaultHomeLocY;
m_inventoryService = inventoryService;
-
}
public override UserProfileData SetupMasterUser(string firstName, string lastName)
@@ -82,4 +82,4 @@ namespace OpenSim.Region.Communications.Local
return profile;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs
index ca64319..481577e 100644
--- a/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs
@@ -1,24 +1,28 @@
-using System.Reflection;
+using System.Reflection;
using System.Runtime.InteropServices;
+
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("OpenSim.Region.Communications.Local")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("OpenSim.Region.Communications.Local")]
-[assembly: AssemblyCopyright("Copyright © 2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+
+[assembly : AssemblyTitle("OpenSim.Region.Communications.Local")]
+[assembly : AssemblyDescription("")]
+[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyCompany("")]
+[assembly : AssemblyProduct("OpenSim.Region.Communications.Local")]
+[assembly : AssemblyCopyright("Copyright © 2007")]
+[assembly : AssemblyTrademark("")]
+[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
+
+[assembly : ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("fb173926-bd0a-4cd0-bb45-185b2f72ddfb")]
+
+[assembly : Guid("fb173926-bd0a-4cd0-bb45-185b2f72ddfb")]
// Version information for an assembly consists of the following four values:
//
@@ -29,5 +33,6 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly : AssemblyVersion("1.0.0.0")]
+[assembly : AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
index 1807cc7..941cc30 100644
--- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
+++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
@@ -26,17 +26,17 @@
*
*/
+using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
-using OpenSim.Framework;
using OpenSim.Framework.Servers;
-
namespace OpenSim.Region.Communications.OGS1
{
public class CommunicationsOGS1 : CommunicationsManager
{
- public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache, false)
+ public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache)
+ : base(serversInfo, httpServer, assetCache, false)
{
OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);
m_gridService = gridInterComms;
@@ -46,4 +46,4 @@ namespace OpenSim.Region.Communications.OGS1
m_userService = new OGS1UserServices(this);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 3719c97..d9af95b 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -35,14 +35,12 @@ using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Security.Authentication;
-
using libsecondlife;
using Nwc.XmlRpc;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Console;
using OpenSim.Framework.Servers;
-using OpenSim.Framework;
using OpenSim.Region.Communications.Local;
namespace OpenSim.Region.Communications.OGS1
@@ -65,10 +63,10 @@ namespace OpenSim.Region.Communications.OGS1
{
serversInfo = servers_info;
httpServer = httpServe;
- httpServer.AddXmlRPCHandler("expect_user", this.ExpectUser);
- httpServer.AddXmlRPCHandler("check", this.PingCheckReply);
+ httpServer.AddXmlRPCHandler("expect_user", ExpectUser);
+ httpServer.AddXmlRPCHandler("check", PingCheckReply);
- this.StartRemoting();
+ StartRemoting();
}
///
@@ -99,14 +97,14 @@ namespace OpenSim.Region.Communications.OGS1
// Send Request
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 10000);
- Hashtable GridRespData = (Hashtable)GridResp.Value;
+ Hashtable GridRespData = (Hashtable) GridResp.Value;
Hashtable griddatahash = GridRespData;
// Process Response
if (GridRespData.ContainsKey("error"))
{
- string errorstring = (string)GridRespData["error"];
+ string errorstring = (string) GridRespData["error"];
MainLog.Instance.Error("Unable to connect to grid: " + errorstring);
return null;
}
@@ -121,8 +119,7 @@ namespace OpenSim.Region.Communications.OGS1
///
public List RequestNeighbours(uint x, uint y)
{
-
- Hashtable respData = MapBlockQuery((int)x - 1, (int)y - 1, (int)x + 1, (int)y + 1);
+ Hashtable respData = MapBlockQuery((int) x - 1, (int) y - 1, (int) x + 1, (int) y + 1);
List neighbours = new List();
@@ -134,16 +131,15 @@ namespace OpenSim.Region.Communications.OGS1
uint regY = Convert.ToUInt32(neighbourData["y"]);
if ((x != regX) || (y != regY))
{
-
- string simIp = (string)neighbourData["sim_ip"];
+ string simIp = (string) neighbourData["sim_ip"];
int port = Convert.ToInt32(neighbourData["sim_port"]);
- string externalUri = (string)neighbourData["sim_uri"];
+ string externalUri = (string) neighbourData["sim_uri"];
- string externalIpStr = OpenSim.Framework.Util.GetHostFromDNS(simIp).ToString();
+ string externalIpStr = Util.GetHostFromDNS(simIp).ToString();
SimpleRegionInfo sri = new SimpleRegionInfo(regX, regY, simIp, port);
sri.RemotingPort = Convert.ToUInt32(neighbourData["remoting_port"]);
- sri.RegionID = new LLUUID((string)neighbourData["uuid"]);
+ sri.RegionID = new LLUUID((string) neighbourData["uuid"]);
neighbours.Add(sri);
}
@@ -175,11 +171,11 @@ namespace OpenSim.Region.Communications.OGS1
{
Hashtable requestData = new Hashtable();
requestData["region_handle"] = regionHandle.ToString();
- requestData["authkey"] = this.serversInfo.GridSendKey;
+ requestData["authkey"] = serversInfo.GridSendKey;
ArrayList SendParams = new ArrayList();
SendParams.Add(requestData);
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
- XmlRpcResponse GridResp = GridReq.Send(this.serversInfo.GridURL, 3000);
+ XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
Hashtable responseData = (Hashtable) GridResp.Value;
@@ -205,7 +201,7 @@ namespace OpenSim.Region.Communications.OGS1
regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]);
regionInfo.RegionName = (string) responseData["region_name"];
- m_remoteRegionInfoCache.Add( regionHandle, regionInfo );
+ m_remoteRegionInfoCache.Add(regionHandle, regionInfo);
}
return regionInfo;
@@ -234,11 +230,11 @@ namespace OpenSim.Region.Communications.OGS1
neighbour.X = Convert.ToUInt16(n["x"]);
neighbour.Y = Convert.ToUInt16(n["y"]);
- neighbour.Name = (string)n["name"];
+ neighbour.Name = (string) n["name"];
neighbour.Access = Convert.ToByte(n["access"]);
neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]);
neighbour.WaterHeight = Convert.ToByte(n["water-height"]);
- neighbour.MapImageId = new LLUUID((string)n["map-image-id"]);
+ neighbour.MapImageId = new LLUUID((string) n["map-image-id"]);
neighbours.Add(neighbour);
}
@@ -267,7 +263,7 @@ namespace OpenSim.Region.Communications.OGS1
parameters.Add(param);
XmlRpcRequest req = new XmlRpcRequest("map_block", parameters);
XmlRpcResponse resp = req.Send(serversInfo.GridURL, 10000);
- Hashtable respData = (Hashtable)resp.Value;
+ Hashtable respData = (Hashtable) resp.Value;
return respData;
}
@@ -300,15 +296,15 @@ namespace OpenSim.Region.Communications.OGS1
public XmlRpcResponse ExpectUser(XmlRpcRequest request)
{
Console.WriteLine("Expecting User...");
- Hashtable requestData = (Hashtable)request.Params[0];
+ Hashtable requestData = (Hashtable) request.Params[0];
AgentCircuitData agentData = new AgentCircuitData();
- agentData.SessionID = new LLUUID((string)requestData["session_id"]);
- agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
- agentData.firstname = (string)requestData["firstname"];
- agentData.lastname = (string)requestData["lastname"];
- agentData.AgentID = new LLUUID((string)requestData["agent_id"]);
+ agentData.SessionID = new LLUUID((string) requestData["session_id"]);
+ agentData.SecureSessionID = new LLUUID((string) requestData["secure_session_id"]);
+ agentData.firstname = (string) requestData["firstname"];
+ agentData.lastname = (string) requestData["lastname"];
+ agentData.AgentID = new LLUUID((string) requestData["agent_id"]);
agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
- agentData.CapsPath = (string)requestData["caps_path"];
+ agentData.CapsPath = (string) requestData["caps_path"];
if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
{
@@ -316,12 +312,14 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
- agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"]));
+ agentData.startpos =
+ new LLVector3(Convert.ToUInt32(requestData["startpos_x"]),
+ Convert.ToUInt32(requestData["startpos_y"]),
+ Convert.ToUInt32(requestData["startpos_z"]));
agentData.child = false;
-
}
- ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
+ ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]);
m_localBackend.TriggerExpectUser(regionHandle, agentData);
@@ -331,6 +329,7 @@ namespace OpenSim.Region.Communications.OGS1
}
#region m_interRegion Comms
+
///
///
///
@@ -339,13 +338,16 @@ namespace OpenSim.Region.Communications.OGS1
TcpChannel ch = new TcpChannel(NetworkServersInfo.RemotingListenerPort);
ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesnt support this.
- WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton);
+ WellKnownServiceTypeEntry wellType =
+ new WellKnownServiceTypeEntry(typeof (OGS1InterRegionRemoting), "InterRegions",
+ WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(wellType);
- InterRegionSingleton.Instance.OnArrival += this.TriggerExpectAvatarCrossing;
- InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent;
+ InterRegionSingleton.Instance.OnArrival += TriggerExpectAvatarCrossing;
+ InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent;
}
#region Methods called by regions in this instance
+
///
///
///
@@ -361,17 +363,19 @@ namespace OpenSim.Region.Communications.OGS1
return true;
}
- RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle);
+ RegionInfo regInfo = RequestNeighbourInfo(regionHandle);
if (regInfo != null)
{
//don't want to be creating a new link to the remote instance every time like we are here
bool retValue = false;
- OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
- typeof(OGS1InterRegionRemoting),
- "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions");
-
+ OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting) Activator.GetObject(
+ typeof (OGS1InterRegionRemoting),
+ "tcp://" + regInfo.RemotingAddress +
+ ":" + regInfo.RemotingPort +
+ "/InterRegions");
+
if (remObject != null)
{
retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData);
@@ -388,7 +392,7 @@ namespace OpenSim.Region.Communications.OGS1
return false;
}
- catch (System.Runtime.Remoting.RemotingException e)
+ catch (RemotingException e)
{
MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
@@ -432,13 +436,15 @@ namespace OpenSim.Region.Communications.OGS1
return true;
}
- RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle);
+ RegionInfo regInfo = RequestNeighbourInfo(regionHandle);
if (regInfo != null)
{
bool retValue = false;
- OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
- typeof(OGS1InterRegionRemoting),
- "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions");
+ OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting) Activator.GetObject(
+ typeof (OGS1InterRegionRemoting),
+ "tcp://" + regInfo.RemotingAddress +
+ ":" + regInfo.RemotingPort +
+ "/InterRegions");
if (remObject != null)
{
retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position, isFlying);
@@ -455,7 +461,7 @@ namespace OpenSim.Region.Communications.OGS1
// to inform it.
return false;
}
- catch (System.Runtime.Remoting.RemotingException e)
+ catch (RemotingException e)
{
MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
@@ -474,6 +480,7 @@ namespace OpenSim.Region.Communications.OGS1
#endregion
#region Methods triggered by calls from external instances
+
///
///
///
@@ -486,7 +493,7 @@ namespace OpenSim.Region.Communications.OGS1
{
return m_localBackend.IncomingChildAgent(regionHandle, agentData);
}
- catch (System.Runtime.Remoting.RemotingException e)
+ catch (RemotingException e)
{
MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
@@ -502,18 +509,19 @@ namespace OpenSim.Region.Communications.OGS1
///
public bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
{
-
try
{
return m_localBackend.TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying);
}
- catch (System.Runtime.Remoting.RemotingException e)
+ catch (RemotingException e)
{
MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
}
}
+
#endregion
+
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
index 0b7bd82..a127010 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
@@ -27,17 +27,19 @@
*/
using System;
+using System.Runtime.Remoting;
using libsecondlife;
using OpenSim.Framework;
namespace OpenSim.Region.Communications.OGS1
{
public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData);
+
public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying);
public sealed class InterRegionSingleton
{
- static readonly InterRegionSingleton instance = new InterRegionSingleton();
+ private static readonly InterRegionSingleton instance = new InterRegionSingleton();
public event InformRegionChild OnChildAgent;
public event ExpectArrival OnArrival;
@@ -46,16 +48,13 @@ namespace OpenSim.Region.Communications.OGS1
{
}
- InterRegionSingleton()
+ private InterRegionSingleton()
{
}
public static InterRegionSingleton Instance
{
- get
- {
- return instance;
- }
+ get { return instance; }
}
public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
@@ -79,7 +78,6 @@ namespace OpenSim.Region.Communications.OGS1
public class OGS1InterRegionRemoting : MarshalByRefObject
{
-
public OGS1InterRegionRemoting()
{
}
@@ -90,7 +88,7 @@ namespace OpenSim.Region.Communications.OGS1
{
return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData);
}
- catch (System.Runtime.Remoting.RemotingException e)
+ catch (RemotingException e)
{
Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
@@ -103,11 +101,11 @@ namespace OpenSim.Region.Communications.OGS1
{
return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position, isFlying);
}
- catch (System.Runtime.Remoting.RemotingException e)
+ catch (RemotingException e)
{
Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 11dee2d..49fdee9 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -28,46 +28,39 @@
using System.Collections.Generic;
using libsecondlife;
+using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
-using OpenSim.Framework;
-
namespace OpenSim.Region.Communications.OGS1
{
public class OGS1InventoryService : IInventoryServices
{
-
public OGS1InventoryService()
{
-
}
#region IInventoryServices Members
-
- public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack)
+
+ public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack,
+ InventoryItemInfo itemCallBack)
{
-
}
public void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder)
{
-
}
public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
{
-
}
public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
{
-
}
public void CreateNewUserInventory(LLUUID user)
{
-
}
public List RequestFirstLevelFolders(LLUUID userID)
@@ -77,4 +70,4 @@ namespace OpenSim.Region.Communications.OGS1
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 19a3c3b..d00a813 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -28,16 +28,19 @@
using System;
using System.Collections;
+using System.Net;
using libsecondlife;
using Nwc.XmlRpc;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
+using OpenSim.Framework.Console;
+using OpenSim.Framework.Interfaces;
namespace OpenSim.Region.Communications.OGS1
{
- public class OGS1UserServices :IUserService
+ public class OGS1UserServices : IUserService
{
- CommunicationsOGS1 m_parent;
+ private CommunicationsOGS1 m_parent;
+
public OGS1UserServices(CommunicationsOGS1 parent)
{
m_parent = parent;
@@ -47,32 +50,41 @@ namespace OpenSim.Region.Communications.OGS1
{
if (data.Contains("error_type"))
{
- Console.WriteLine("Error sent by user server when trying to get user profile: (" + data["error_type"] + "): " + data["error_desc"]);
+ Console.WriteLine("Error sent by user server when trying to get user profile: (" + data["error_type"] +
+ "): " + data["error_desc"]);
return null;
}
UserProfileData userData = new UserProfileData();
- userData.username = (string)data["firstname"];
- userData.surname = (string)data["lastname"];
- userData.UUID = new LLUUID((string)data["uuid"]);
- userData.userInventoryURI = (string)data["server_inventory"];
- userData.userAssetURI = (string)data["server_asset"];
- userData.profileFirstText = (string)data["profile_firstlife_about"];
- userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]);
- userData.profileCanDoMask = Convert.ToUInt32((string)data["profile_can_do"]);
+ userData.username = (string) data["firstname"];
+ userData.surname = (string) data["lastname"];
+ userData.UUID = new LLUUID((string) data["uuid"]);
+ userData.userInventoryURI = (string) data["server_inventory"];
+ userData.userAssetURI = (string) data["server_asset"];
+ userData.profileFirstText = (string) data["profile_firstlife_about"];
+ userData.profileFirstImage = new LLUUID((string) data["profile_firstlife_image"]);
+ userData.profileCanDoMask = Convert.ToUInt32((string) data["profile_can_do"]);
userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]);
- userData.profileImage = new LLUUID((string)data["profile_image"]);
- userData.lastLogin = Convert.ToInt32((string)data["profile_lastlogin"]);
- userData.homeRegion = Convert.ToUInt64((string)data["home_region"]);
- userData.homeLocation = new LLVector3((float)Convert.ToDecimal((string)data["home_coordinates_x"]), (float)Convert.ToDecimal((string)data["home_coordinates_y"]), (float)Convert.ToDecimal((string)data["home_coordinates_z"]));
- userData.homeLookAt = new LLVector3((float)Convert.ToDecimal((string)data["home_look_x"]), (float)Convert.ToDecimal((string)data["home_look_y"]), (float)Convert.ToDecimal((string)data["home_look_z"]));
+ userData.profileImage = new LLUUID((string) data["profile_image"]);
+ userData.lastLogin = Convert.ToInt32((string) data["profile_lastlogin"]);
+ userData.homeRegion = Convert.ToUInt64((string) data["home_region"]);
+ userData.homeLocation =
+ new LLVector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]),
+ (float) Convert.ToDecimal((string) data["home_coordinates_y"]),
+ (float) Convert.ToDecimal((string) data["home_coordinates_z"]));
+ userData.homeLookAt =
+ new LLVector3((float) Convert.ToDecimal((string) data["home_look_x"]),
+ (float) Convert.ToDecimal((string) data["home_look_y"]),
+ (float) Convert.ToDecimal((string) data["home_look_z"]));
return userData;
}
+
public UserProfileData GetUserProfile(string firstName, string lastName)
{
return GetUserProfile(firstName + " " + lastName);
}
+
public UserProfileData GetUserProfile(string name)
{
try
@@ -83,16 +95,18 @@ namespace OpenSim.Region.Communications.OGS1
parameters.Add(param);
XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters);
XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
- Hashtable respData = (Hashtable)resp.Value;
+ Hashtable respData = (Hashtable) resp.Value;
return ConvertXMLRPCDataToUserProfile(respData);
}
- catch (System.Net.WebException e)
+ catch (WebException e)
{
- OpenSim.Framework.Console.MainLog.Instance.Warn("Error when trying to fetch profile data by name from remote user server: " + e.Message);
+ MainLog.Instance.Warn("Error when trying to fetch profile data by name from remote user server: " +
+ e.Message);
}
return null;
}
+
public UserProfileData GetUserProfile(LLUUID avatarID)
{
try
@@ -103,18 +117,19 @@ namespace OpenSim.Region.Communications.OGS1
parameters.Add(param);
XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters);
XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
- Hashtable respData = (Hashtable)resp.Value;
+ Hashtable respData = (Hashtable) resp.Value;
return ConvertXMLRPCDataToUserProfile(respData);
}
catch (Exception e)
{
- Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " + e.Message);
+ Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " +
+ e.Message);
}
return null;
}
- public void clearUserAgent(LLUUID avatarID)
+ public void clearUserAgent(LLUUID avatarID)
{
// TODO: implement
}
@@ -135,4 +150,4 @@ namespace OpenSim.Region.Communications.OGS1
throw new Exception("The method or operation is not implemented.");
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
index 2bebf9f..631cfd0 100644
--- a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
@@ -1,24 +1,28 @@
-using System.Reflection;
+using System.Reflection;
using System.Runtime.InteropServices;
+
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("OpenGrid.Framework.Communications.OGS1")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("OpenGrid.Framework.Communications.OGS1")]
-[assembly: AssemblyCopyright("Copyright © 2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+
+[assembly : AssemblyTitle("OpenGrid.Framework.Communications.OGS1")]
+[assembly : AssemblyDescription("")]
+[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyCompany("")]
+[assembly : AssemblyProduct("OpenGrid.Framework.Communications.OGS1")]
+[assembly : AssemblyCopyright("Copyright © 2007")]
+[assembly : AssemblyTrademark("")]
+[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
+
+[assembly : ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("a8b2b39b-c83b-41e2-b0b5-7ccfc1fddae7")]
+
+[assembly : Guid("a8b2b39b-c83b-41e2-b0b5-7ccfc1fddae7")]
// Version information for an assembly consists of the following four values:
//
@@ -29,5 +33,6 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly : AssemblyVersion("1.0.0.0")]
+[assembly : AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index 41d14f0..9e32b35 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -30,12 +30,10 @@ using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
+using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Scenes;
-
namespace OpenSim.Region.Environment
{
///
@@ -216,14 +214,14 @@ namespace OpenSim.Region.Environment
int tempMaxAgents =
Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter)));
- m_regInfo.EstateSettings.maxAgents = (byte)tempMaxAgents;
+ m_regInfo.EstateSettings.maxAgents = (byte) tempMaxAgents;
float tempObjectBonusFactor =
- (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
+ (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
m_regInfo.EstateSettings.objectBonusFactor = tempObjectBonusFactor;
int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter));
- m_regInfo.EstateSettings.simAccess = (Simulator.SimAccess)tempMatureLevel;
+ m_regInfo.EstateSettings.simAccess = (Simulator.SimAccess) tempMatureLevel;
if (convertParamStringToBool(packet.ParamList[7].Parameter))
@@ -250,13 +248,13 @@ namespace OpenSim.Region.Environment
}
else
{
- float WaterHeight = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter));
+ float WaterHeight = (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter));
float TerrainRaiseLimit =
- (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter));
+ (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter));
float TerrainLowerLimit =
- (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter));
+ (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter));
bool UseFixedSun = convertParamStringToBool(packet.ParamList[4].Parameter);
- float SunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
+ float SunHour = (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
setRegionSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseFixedSun, SunHour);
@@ -273,8 +271,8 @@ namespace OpenSim.Region.Environment
if (splitField.Length == 3)
{
Int16 corner = Convert.ToInt16(splitField[0]);
- float lowValue = (float)Convert.ToDecimal(splitField[1]);
- float highValue = (float)Convert.ToDecimal(splitField[2]);
+ float lowValue = (float) Convert.ToDecimal(splitField[1]);
+ float highValue = (float) Convert.ToDecimal(splitField[2]);
setEstateTextureRange(corner, lowValue, highValue);
}
@@ -343,7 +341,7 @@ namespace OpenSim.Region.Environment
{
m_scene.Broadcast(
sendRegionHandshake
- );
+ );
}
public void sendRegionInfoPacket(IClientAPI remote_client)
@@ -363,8 +361,8 @@ namespace OpenSim.Region.Environment
regionInfoPacket.RegionInfo.PricePerMeter = m_regInfo.EstateSettings.pricePerMeter;
regionInfoPacket.RegionInfo.RedirectGridX = m_regInfo.EstateSettings.redirectGridX;
regionInfoPacket.RegionInfo.RedirectGridY = m_regInfo.EstateSettings.redirectGridY;
- regionInfoPacket.RegionInfo.RegionFlags = (uint)m_regInfo.EstateSettings.regionFlags;
- regionInfoPacket.RegionInfo.SimAccess = (byte)m_regInfo.EstateSettings.simAccess;
+ regionInfoPacket.RegionInfo.RegionFlags = (uint) m_regInfo.EstateSettings.regionFlags;
+ regionInfoPacket.RegionInfo.SimAccess = (byte) m_regInfo.EstateSettings.simAccess;
regionInfoPacket.RegionInfo.SimName = _enc.GetBytes(m_regInfo.RegionName);
regionInfoPacket.RegionInfo.SunHour = m_regInfo.EstateSettings.sunHour;
regionInfoPacket.RegionInfo.TerrainLowerLimit = m_regInfo.EstateSettings.terrainLowerLimit;
diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
index 90c3730..e7ce957 100644
--- a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
+++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
@@ -1,6 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
using libsecondlife;
using OpenSim.Framework;
@@ -10,4 +7,4 @@ namespace OpenSim.Region.Environment.Interfaces
{
bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, out byte[] visualParams);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Environment/Interfaces/IDynamicTextureManager.cs
index 8a31d87..daecf86 100644
--- a/OpenSim/Region/Environment/Interfaces/IDynamicTextureManager.cs
+++ b/OpenSim/Region/Environment/Interfaces/IDynamicTextureManager.cs
@@ -53,4 +53,4 @@ namespace OpenSim.Region.Environment.Interfaces
bool AsyncConvertUrl(LLUUID id, string url, string extraParams);
bool AsyncConvertData(LLUUID id, string bodyData, string extraParams);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs b/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs
index 19cf131..0357139 100644
--- a/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs
+++ b/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs
@@ -34,4 +34,4 @@ namespace OpenSim.Region.Environment.Interfaces
{
LLUUID MakeHttpRequest(string url, string type, string body);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionModule.cs b/OpenSim/Region/Environment/Interfaces/IRegionModule.cs
index 808b94a..e5d0b26 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionModule.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionModule.cs
@@ -26,8 +26,8 @@
*
*/
-using OpenSim.Region.Environment.Scenes;
using Nini.Config;
+using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Interfaces
{
@@ -39,4 +39,4 @@ namespace OpenSim.Region.Environment.Interfaces
string Name { get; }
bool IsSharedModule { get; }
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/ISimChat.cs b/OpenSim/Region/Environment/Interfaces/ISimChat.cs
index 7dc3e0b..fb491cc 100644
--- a/OpenSim/Region/Environment/Interfaces/ISimChat.cs
+++ b/OpenSim/Region/Environment/Interfaces/ISimChat.cs
@@ -26,12 +26,13 @@
*
*/
-using libsecondlife;
+using System;
+using OpenSim.Framework;
namespace OpenSim.Region.Environment.Interfaces
{
public interface ISimChat
{
- void SimChat(System.Object sender, OpenSim.Framework.ChatFromViewerArgs e);
+ void SimChat(Object sender, ChatFromViewerArgs e);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/ITerrain.cs b/OpenSim/Region/Environment/Interfaces/ITerrain.cs
index 77ec2dd..9171d09 100644
--- a/OpenSim/Region/Environment/Interfaces/ITerrain.cs
+++ b/OpenSim/Region/Environment/Interfaces/ITerrain.cs
@@ -26,7 +26,6 @@
*
*/
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
namespace OpenSim.Region.Environment.Interfaces
@@ -72,4 +71,4 @@ namespace OpenSim.Region.Environment.Interfaces
void ExportImage(string filename, string gradientmap);
byte[] ExportJpegImage(string gradientmap);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IWorldComm.cs b/OpenSim/Region/Environment/Interfaces/IWorldComm.cs
index 9d8c259..27b5466 100644
--- a/OpenSim/Region/Environment/Interfaces/IWorldComm.cs
+++ b/OpenSim/Region/Environment/Interfaces/IWorldComm.cs
@@ -40,4 +40,4 @@ namespace OpenSim.Region.Environment.Interfaces
void ListenControl(int handle, int active);
void ListenRemove(int handle);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs
index d888a36..6786b8c 100644
--- a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs
+++ b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs
@@ -39,4 +39,4 @@ namespace OpenSim.Region.Environment.Interfaces
RPCRequestInfo GetNextRequest();
void RemoteDataReply(string channel, string message_id, string sdata, int idata);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IXfer.cs b/OpenSim/Region/Environment/Interfaces/IXfer.cs
index 3cbd549..5e5ff1b 100644
--- a/OpenSim/Region/Environment/Interfaces/IXfer.cs
+++ b/OpenSim/Region/Environment/Interfaces/IXfer.cs
@@ -32,4 +32,4 @@ namespace OpenSim.Region.Environment.Interfaces
{
bool AddNewFile(string fileName, byte[] data);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs
index 3962e5f..e9837c0 100644
--- a/OpenSim/Region/Environment/LandManagement/Land.cs
+++ b/OpenSim/Region/Environment/LandManagement/Land.cs
@@ -30,7 +30,6 @@ using System;
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
using OpenSim.Region.Environment.Scenes;
@@ -652,4 +651,4 @@ namespace OpenSim.Region.Environment.LandManagement
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs
index ae89d85..785aafa 100644
--- a/OpenSim/Region/Environment/LandManagement/LandManager.cs
+++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs
@@ -29,7 +29,6 @@ using System;
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
using OpenSim.Region.Environment.Scenes;
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs
index c0dd52a..cb72638 100644
--- a/OpenSim/Region/Environment/ModuleLoader.cs
+++ b/OpenSim/Region/Environment/ModuleLoader.cs
@@ -27,15 +27,14 @@
*/
using System;
-using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
+using Nini.Config;
using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Modules;
using OpenSim.Region.Environment.Scenes;
-using Nini.Config;
namespace OpenSim.Region.Environment
{
@@ -58,8 +57,8 @@ namespace OpenSim.Region.Environment
{
get
{
- IRegionModule[] regionModules = new IRegionModule[ m_loadedSharedModules.Count ];
- m_loadedSharedModules.Values.CopyTo( regionModules, 0 );
+ IRegionModule[] regionModules = new IRegionModule[m_loadedSharedModules.Count];
+ m_loadedSharedModules.Values.CopyTo(regionModules, 0);
return regionModules;
}
}
@@ -132,7 +131,7 @@ namespace OpenSim.Region.Environment
if (modules.Length > 0)
{
- m_log.Verbose("MODULES", "Found Module Library [{0}]", dllName );
+ m_log.Verbose("MODULES", "Found Module Library [{0}]", dllName);
foreach (IRegionModule module in modules)
{
if (!module.IsSharedModule)
@@ -179,16 +178,16 @@ namespace OpenSim.Region.Environment
List modules = new List();
Assembly pluginAssembly;
- if (!LoadedAssemblys.TryGetValue(dllName, out pluginAssembly ))
+ if (!LoadedAssemblys.TryGetValue(dllName, out pluginAssembly))
{
try
{
pluginAssembly = Assembly.LoadFrom(dllName);
LoadedAssemblys.Add(dllName, pluginAssembly);
}
- catch( BadImageFormatException e )
+ catch (BadImageFormatException e)
{
- m_log.Verbose( "MODULES", "The file [{0}] is not a module assembly.", e.FileName );
+ m_log.Verbose("MODULES", "The file [{0}] is not a module assembly.", e.FileName);
}
}
@@ -201,7 +200,7 @@ namespace OpenSim.Region.Environment
{
if (!pluginType.IsAbstract)
{
- if( pluginType.GetInterface("IRegionModule") != null )
+ if (pluginType.GetInterface("IRegionModule") != null)
{
modules.Add((IRegionModule) Activator.CreateInstance(pluginType));
}
@@ -231,4 +230,4 @@ namespace OpenSim.Region.Environment
LoadedAssemblys.Clear();
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs
index e414713..54d5ad8 100644
--- a/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs
@@ -26,11 +26,10 @@
*
*/
-using OpenSim.Framework.Interfaces;
+using Nini.Config;
+using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using OpenSim.Framework;
-using Nini.Config;
namespace OpenSim.Region.Environment.Modules
{
@@ -70,4 +69,4 @@ namespace OpenSim.Region.Environment.Modules
{
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
index 456d838..4bb0638 100644
--- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
@@ -1,6 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
using libsecondlife;
using Nini.Config;
using OpenSim.Framework;
@@ -11,7 +8,8 @@ namespace OpenSim.Region.Environment.Modules
{
public class AvatarFactoryModule : IAvatarFactory
{
- public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, out byte[] visualParams)
+ public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables,
+ out byte[] visualParams)
{
GetDefaultAvatarAppearance(out wearables, out visualParams);
return true;
@@ -51,7 +49,4 @@ namespace OpenSim.Region.Environment.Modules
wearables = AvatarWearable.DefaultWearables;
}
}
-
-
-
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs
index 802655f..1b7e2a4 100644
--- a/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs
+++ b/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs
@@ -27,11 +27,10 @@
*/
using libsecondlife;
-using OpenSim.Framework.Interfaces;
+using Nini.Config;
+using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using OpenSim.Framework;
-using Nini.Config;
namespace OpenSim.Region.Environment.Modules
{
@@ -92,4 +91,4 @@ namespace OpenSim.Region.Environment.Modules
partner);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index bdb8ee5..9d4187a 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -27,13 +27,13 @@
*/
using System;
+using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
-using System.Threading;
-using System.Collections.Generic;
using System.Text.RegularExpressions;
+using System.Threading;
using libsecondlife;
-using OpenSim.Framework.Interfaces;
+using Nini.Config;
using OpenSim.Framework;
using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Interfaces;
@@ -54,18 +54,22 @@ namespace OpenSim.Region.Environment.Modules
public ChatModule()
{
- m_log = OpenSim.Framework.Console.MainLog.Instance;
+ m_log = MainLog.Instance;
}
- public void Initialise(Scene scene, Nini.Config.IConfigSource config)
+ public void Initialise(Scene scene, IConfigSource config)
{
// wrap this in a try block so that defaults will work if
// the config file doesn't specify otherwise.
- try {
- m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
+ try
+ {
+ m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
- } catch (Exception e) {}
+ }
+ catch (Exception e)
+ {
+ }
if (!m_scenes.Contains(scene))
{
@@ -73,20 +77,20 @@ namespace OpenSim.Region.Environment.Modules
scene.EventManager.OnNewClient += NewClient;
scene.RegisterModuleInterface(this);
}
-
+
// setup IRC Relay
m_irc = new IRCChatModule(config);
}
public void PostInitialise()
{
-
- if (m_irc.Enabled) {
+ if (m_irc.Enabled)
+ {
m_irc.Connect(m_scenes);
}
}
- public void Close()
+ public void Close()
{
m_irc.Close();
}
@@ -111,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules
ScenePresence avatar = null;
//TODO: Move ForEachScenePresence and others into IScene.
- Scene scene = (Scene)e.Scene;
+ Scene scene = (Scene) e.Scene;
//TODO: Remove the need for this check
if (scene == null)
@@ -119,10 +123,12 @@ namespace OpenSim.Region.Environment.Modules
// Filled in since it's easier than rewriting right now.
LLVector3 fromPos = e.Position;
- LLVector3 fromRegionPos = e.Position + new LLVector3(e.Scene.RegionInfo.RegionLocX * 256, e.Scene.RegionInfo.RegionLocY * 256, 0);
+ LLVector3 fromRegionPos = e.Position +
+ new LLVector3(e.Scene.RegionInfo.RegionLocX*256, e.Scene.RegionInfo.RegionLocY*256,
+ 0);
string fromName = e.From;
string message = e.Message;
- byte type = (byte)e.Type;
+ byte type = (byte) e.Type;
LLUUID fromAgentID = LLUUID.Zero;
if (e.Sender != null)
@@ -133,7 +139,8 @@ namespace OpenSim.Region.Environment.Modules
if (avatar != null)
{
fromPos = avatar.AbsolutePosition;
- fromRegionPos = fromPos + new LLVector3(e.Scene.RegionInfo.RegionLocX * 256, e.Scene.RegionInfo.RegionLocY * 256, 0);
+ fromRegionPos = fromPos +
+ new LLVector3(e.Scene.RegionInfo.RegionLocX*256, e.Scene.RegionInfo.RegionLocY*256, 0);
fromName = avatar.Firstname + " " + avatar.Lastname;
fromAgentID = e.Sender.AgentId;
avatar = null;
@@ -159,75 +166,84 @@ namespace OpenSim.Region.Environment.Modules
break;
}
- m_log.Verbose("CHAT", fromName + " (" + e.Channel + " @ " + scene.RegionInfo.RegionName + ") " + typeName + ": " + e.Message);
-
- if (m_irc.Connected)
- {
- m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message);
- }
-
- if (e.Channel == 0)
- {
- foreach (Scene m_scene in m_scenes)
- {
- m_scene.ForEachScenePresence(delegate(ScenePresence presence)
- {
- int dis = -100000;
-
- LLVector3 avatarRegionPos = presence.AbsolutePosition + new LLVector3(scene.RegionInfo.RegionLocX * 256, scene.RegionInfo.RegionLocY * 256, 0);
- dis = Math.Abs((int)avatarRegionPos.GetDistanceTo(fromRegionPos));
-
- switch (e.Type)
- {
- case ChatTypeEnum.Whisper:
- if (dis < m_whisperdistance)
- {
- //should change so the message is sent through the avatar rather than direct to the ClientView
- presence.ControllingClient.SendChatMessage(message,
- type,
- fromPos,
- fromName,
- fromAgentID);
- }
- break;
- case ChatTypeEnum.Say:
- if (dis < m_saydistance)
- {
- //Console.WriteLine("sending chat");
- presence.ControllingClient.SendChatMessage(message,
- type,
- fromPos,
- fromName,
- fromAgentID);
- }
- break;
- case ChatTypeEnum.Shout:
- if (dis < m_shoutdistance)
- {
- presence.ControllingClient.SendChatMessage(message,
- type,
- fromPos,
- fromName,
- fromAgentID);
- }
- break;
-
- case ChatTypeEnum.Broadcast:
- presence.ControllingClient.SendChatMessage(message, type,
- fromPos,
- fromName,
- fromAgentID);
- break;
- default:
- break;
- }
- });
+ m_log.Verbose("CHAT",
+ fromName + " (" + e.Channel + " @ " + scene.RegionInfo.RegionName + ") " + typeName + ": " +
+ e.Message);
+
+ if (m_irc.Connected)
+ {
+ m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message);
+ }
+
+ if (e.Channel == 0)
+ {
+ foreach (Scene m_scene in m_scenes)
+ {
+ m_scene.ForEachScenePresence(delegate(ScenePresence presence)
+ {
+ int dis = -100000;
+
+ LLVector3 avatarRegionPos = presence.AbsolutePosition +
+ new LLVector3(
+ scene.RegionInfo.RegionLocX*256,
+ scene.RegionInfo.RegionLocY*256,
+ 0);
+ dis =
+ Math.Abs((int) avatarRegionPos.GetDistanceTo(fromRegionPos));
+
+ switch (e.Type)
+ {
+ case ChatTypeEnum.Whisper:
+ if (dis < m_whisperdistance)
+ {
+ //should change so the message is sent through the avatar rather than direct to the ClientView
+ presence.ControllingClient.SendChatMessage(message,
+ type,
+ fromPos,
+ fromName,
+ fromAgentID);
+ }
+ break;
+ case ChatTypeEnum.Say:
+ if (dis < m_saydistance)
+ {
+ //Console.WriteLine("sending chat");
+ presence.ControllingClient.SendChatMessage(message,
+ type,
+ fromPos,
+ fromName,
+ fromAgentID);
+ }
+ break;
+ case ChatTypeEnum.Shout:
+ if (dis < m_shoutdistance)
+ {
+ presence.ControllingClient.SendChatMessage(message,
+ type,
+ fromPos,
+ fromName,
+ fromAgentID);
+ }
+ break;
+
+ case ChatTypeEnum.Broadcast:
+ presence.ControllingClient.SendChatMessage(message,
+ type,
+ fromPos,
+ fromName,
+ fromAgentID);
+ break;
+ default:
+ break;
+ }
+ });
}
}
}
}
- class IRCChatModule {
+ internal class IRCChatModule
+ {
private string m_server = null;
private int m_port = 6668;
private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
@@ -238,7 +254,7 @@ namespace OpenSim.Region.Environment.Modules
private TcpClient m_tcp;
private StreamWriter m_writer;
private StreamReader m_reader;
-
+
private Thread pingSender;
private Thread listener;
@@ -248,29 +264,36 @@ namespace OpenSim.Region.Environment.Modules
private List m_scenes = null;
private LogBase m_log;
- public IRCChatModule(Nini.Config.IConfigSource config) {
+ public IRCChatModule(IConfigSource config)
+ {
m_nick = "OSimBot" + Util.RandomClass.Next(1, 99);
m_tcp = null;
m_writer = null;
m_reader = null;
- try {
+ try
+ {
m_server = config.Configs["IRC"].GetString("server");
m_nick = config.Configs["IRC"].GetString("nick");
m_channel = config.Configs["IRC"].GetString("channel");
m_port = config.Configs["IRC"].GetInt("port", m_port);
m_user = config.Configs["IRC"].GetString("username", m_user);
- if (m_server != null && m_nick != null && m_channel != null) {
+ if (m_server != null && m_nick != null && m_channel != null)
+ {
m_enabled = true;
}
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
Console.WriteLine("No IRC config information, skipping IRC bridge configuration");
}
- m_log = OpenSim.Framework.Console.MainLog.Instance;
+ m_log = MainLog.Instance;
}
- public bool Connect(List scenes) {
- try {
+ public bool Connect(List scenes)
+ {
+ try
+ {
m_scenes = scenes;
m_tcp = new TcpClient(m_server, m_port);
@@ -279,13 +302,13 @@ namespace OpenSim.Region.Environment.Modules
m_log.Verbose("IRC", "Connected to " + m_server);
m_reader = new StreamReader(m_stream);
m_writer = new StreamWriter(m_stream);
-
- pingSender = new Thread(new ThreadStart(this.PingRun));
+
+ pingSender = new Thread(new ThreadStart(PingRun));
pingSender.Start();
-
- listener = new Thread(new ThreadStart(this.ListenerRun));
+
+ listener = new Thread(new ThreadStart(ListenerRun));
listener.Start();
-
+
m_writer.WriteLine(m_user);
m_writer.Flush();
m_writer.WriteLine("NICK " + m_nick);
@@ -294,50 +317,61 @@ namespace OpenSim.Region.Environment.Modules
m_writer.Flush();
m_log.Verbose("IRC", "Connection fully established");
m_connected = true;
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
Console.WriteLine(e.ToString());
}
return m_connected;
}
- public bool Enabled
+ public bool Enabled
{
get { return m_enabled; }
}
-
+
public bool Connected
{
get { return m_connected; }
}
- public void PrivMsg(string from, string region, string msg) {
- try {
+ public void PrivMsg(string from, string region, string msg)
+ {
+ try
+ {
m_writer.WriteLine("PRIVMSG {0} :<{1} in {2}>: {3}", m_channel, from, region, msg);
m_writer.Flush();
- } catch (IOException) {
- m_log.Error("IRC","Disconnected from IRC server.");
+ }
+ catch (IOException)
+ {
+ m_log.Error("IRC", "Disconnected from IRC server.");
listener.Abort();
pingSender.Abort();
m_connected = false;
}
}
- private Dictionary ExtractMsg(string input) {
+ private Dictionary ExtractMsg(string input)
+ {
Dictionary result = null;
string regex = @":(?\w*)!~(?\S*) PRIVMSG (?\S+) :(?.*)";
Regex RE = new Regex(regex, RegexOptions.Multiline);
MatchCollection matches = RE.Matches(input);
// Get some direct matches $1 $4 is a
- if ((matches.Count == 1) && (matches[0].Groups.Count == 5)) {
+ if ((matches.Count == 1) && (matches[0].Groups.Count == 5))
+ {
result = new Dictionary();
result.Add("nick", matches[0].Groups[1].Value);
result.Add("user", matches[0].Groups[2].Value);
result.Add("channel", matches[0].Groups[3].Value);
result.Add("msg", matches[0].Groups[4].Value);
- } else {
+ }
+ else
+ {
m_log.Verbose("IRC", "Number of matches: " + matches.Count);
- if (matches.Count > 0) {
- m_log.Verbose("IRC", "Number of groups: " + matches[0].Groups.Count);
+ if (matches.Count > 0)
+ {
+ m_log.Verbose("IRC", "Number of groups: " + matches[0].Groups.Count);
}
}
return result;
@@ -365,19 +399,20 @@ namespace OpenSim.Region.Environment.Modules
if (inputLine.Contains(m_channel))
{
Dictionary data = ExtractMsg(inputLine);
- if (data != null )
+ if (data != null)
{
foreach (Scene m_scene in m_scenes)
{
m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
- {
- if (!avatar.IsChildAgent)
{
- avatar.ControllingClient.SendChatMessage(
- Helpers.StringToField(data["msg"]), 255, pos, data["nick"],
- LLUUID.Zero);
- }
- });
+ if (!avatar.IsChildAgent)
+ {
+ avatar.ControllingClient.SendChatMessage(
+ Helpers.StringToField(data["msg"]), 255,
+ pos, data["nick"],
+ LLUUID.Zero);
+ }
+ });
}
}
}
@@ -387,7 +422,8 @@ namespace OpenSim.Region.Environment.Modules
}
- public void Close() {
+ public void Close()
+ {
listener.Abort();
pingSender.Abort();
m_writer.Close();
@@ -395,4 +431,4 @@ namespace OpenSim.Region.Environment.Modules
m_tcp.Close();
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
index 7c852dc..2bc3db8 100644
--- a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
@@ -29,10 +29,10 @@
using System;
using System.Collections.Generic;
using libsecondlife;
+using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using Nini.Config;
namespace OpenSim.Region.Environment.Modules
{
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules
if (RenderPlugins.ContainsKey(contentType))
{
//Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType);
-
+
DynamicTextureUpdater updater = new DynamicTextureUpdater();
updater.SimUUID = simID;
updater.PrimID = primID;
@@ -187,4 +187,4 @@ namespace OpenSim.Region.Environment.Modules
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/EmailModule.cs b/OpenSim/Region/Environment/Modules/EmailModule.cs
index 00ea07a..046a46c 100644
--- a/OpenSim/Region/Environment/Modules/EmailModule.cs
+++ b/OpenSim/Region/Environment/Modules/EmailModule.cs
@@ -31,4 +31,4 @@ namespace OpenSim.Region.Environment.Modules
internal class EmailModule
{
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs
index 9144bee..d9f09f7 100644
--- a/OpenSim/Region/Environment/Modules/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs
@@ -26,9 +26,9 @@
*
*/
+using Nini.Config;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using Nini.Config;
namespace OpenSim.Region.Environment.Modules
{
@@ -59,4 +59,4 @@ namespace OpenSim.Region.Environment.Modules
get { return false; }
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/GroupsModule.cs b/OpenSim/Region/Environment/Modules/GroupsModule.cs
index 150f294..50e9a39 100644
--- a/OpenSim/Region/Environment/Modules/GroupsModule.cs
+++ b/OpenSim/Region/Environment/Modules/GroupsModule.cs
@@ -26,9 +26,9 @@
*
*/
+using Nini.Config;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using Nini.Config;
namespace OpenSim.Region.Environment.Modules
{
@@ -59,4 +59,4 @@ namespace OpenSim.Region.Environment.Modules
get { return false; }
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
index 9ac1d76..2ad027a 100644
--- a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
+++ b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
@@ -27,11 +27,12 @@
*/
using System.Collections.Generic;
+using libsecondlife;
+using Nini.Config;
+using OpenSim.Framework;
+using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using OpenSim.Framework.Console;
-using OpenSim.Framework;
-using Nini.Config;
namespace OpenSim.Region.Environment.Modules
{
@@ -42,7 +43,7 @@ namespace OpenSim.Region.Environment.Modules
public InstantMessageModule()
{
- m_log = OpenSim.Framework.Console.MainLog.Instance;
+ m_log = MainLog.Instance;
}
public void Initialise(Scene scene, IConfigSource config)
@@ -50,33 +51,34 @@ namespace OpenSim.Region.Environment.Modules
if (!m_scenes.Contains(scene))
{
m_scenes.Add(scene);
- scene.EventManager.OnNewClient += OnNewClient;
+ scene.EventManager.OnNewClient += OnNewClient;
}
}
- void OnNewClient(OpenSim.Framework.IClientAPI client)
+ private void OnNewClient(IClientAPI client)
{
client.OnInstantMessage += OnInstantMessage;
}
- void OnInstantMessage(libsecondlife.LLUUID fromAgentID,
- libsecondlife.LLUUID fromAgentSession, libsecondlife.LLUUID toAgentID,
- libsecondlife.LLUUID imSessionID, uint timestamp, string fromAgentName,
- string message, byte dialog)
+ private void OnInstantMessage(LLUUID fromAgentID,
+ LLUUID fromAgentSession, LLUUID toAgentID,
+ LLUUID imSessionID, uint timestamp, string fromAgentName,
+ string message, byte dialog)
{
// TODO: Remove after debugging. Privacy implications.
- m_log.Verbose("IM",fromAgentName + ": " + message);
+ m_log.Verbose("IM", fromAgentName + ": " + message);
foreach (Scene m_scene in m_scenes)
{
if (m_scene.Entities.ContainsKey(toAgentID) && m_scene.Entities[toAgentID] is ScenePresence)
{
// Local Message
- ScenePresence user = (ScenePresence)m_scene.Entities[toAgentID];
+ ScenePresence user = (ScenePresence) m_scene.Entities[toAgentID];
if (!user.IsChildAgent)
{
user.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message,
- toAgentID, imSessionID, fromAgentName, dialog, timestamp);
+ toAgentID, imSessionID, fromAgentName, dialog,
+ timestamp);
}
// Message sent
return;
@@ -104,4 +106,4 @@ namespace OpenSim.Region.Environment.Modules
get { return true; }
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/InventoryModule.cs b/OpenSim/Region/Environment/Modules/InventoryModule.cs
index 3f8cd6e..e2ad0d5 100644
--- a/OpenSim/Region/Environment/Modules/InventoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/InventoryModule.cs
@@ -26,9 +26,9 @@
*
*/
+using Nini.Config;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using Nini.Config;
namespace OpenSim.Region.Environment.Modules
{
@@ -59,4 +59,4 @@ namespace OpenSim.Region.Environment.Modules
get { return false; }
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/LoadImageURLModule.cs b/OpenSim/Region/Environment/Modules/LoadImageURLModule.cs
index 8b8b386..9d10fc3 100644
--- a/OpenSim/Region/Environment/Modules/LoadImageURLModule.cs
+++ b/OpenSim/Region/Environment/Modules/LoadImageURLModule.cs
@@ -1,18 +1,16 @@
using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Net;
-using System.IO;
using System.Drawing;
+using System.IO;
+using System.Net;
using libsecondlife;
+using Nini.Config;
using OpenJPEGNet;
-using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Environment.Interfaces;
-using Nini.Config;
+using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Modules
{
- public class LoadImageURLModule : IRegionModule , IDynamicTextureRender
+ public class LoadImageURLModule : IRegionModule, IDynamicTextureRender
{
private string m_name = "LoadImageURL";
private IDynamicTextureManager m_textureManager;
@@ -85,25 +83,25 @@ namespace OpenSim.Region.Environment.Modules
private void MakeHttpRequest(string url, LLUUID requestID)
{
WebRequest request = HttpWebRequest.Create(url);
- RequestState state = new RequestState((HttpWebRequest)request, requestID);
+ RequestState state = new RequestState((HttpWebRequest) request, requestID);
IAsyncResult result = request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state);
TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1));
- state.TimeOfRequest = (int)t.TotalSeconds;
+ state.TimeOfRequest = (int) t.TotalSeconds;
}
private void HttpRequestReturn(IAsyncResult result)
{
- RequestState state = (RequestState)result.AsyncState;
- WebRequest request = (WebRequest)state.Request;
- HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(result);
+ RequestState state = (RequestState) result.AsyncState;
+ WebRequest request = (WebRequest) state.Request;
+ HttpWebResponse response = (HttpWebResponse) request.EndGetResponse(result);
if (response.StatusCode == HttpStatusCode.OK)
{
- Bitmap image = new Bitmap(response.GetResponseStream());
- Bitmap resize = new Bitmap(image, new Size(512, 512));
- byte[] imageJ2000 = OpenJPEG.EncodeFromImage(resize, true);
+ Bitmap image = new Bitmap(response.GetResponseStream());
+ Bitmap resize = new Bitmap(image, new Size(512, 512));
+ byte[] imageJ2000 = OpenJPEG.EncodeFromImage(resize, true);
- m_textureManager.ReturnData(state.RequestID, imageJ2000);
+ m_textureManager.ReturnData(state.RequestID, imageJ2000);
}
}
@@ -119,6 +117,5 @@ namespace OpenSim.Region.Environment.Modules
RequestID = requestID;
}
}
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
index 9412089..5ac0b39 100644
--- a/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
@@ -31,4 +31,4 @@ namespace OpenSim.Region.Environment.Modules
internal class ScriptsHttpRequests
{
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/TeleportModule.cs b/OpenSim/Region/Environment/Modules/TeleportModule.cs
index d22a722..77f8db2 100644
--- a/OpenSim/Region/Environment/Modules/TeleportModule.cs
+++ b/OpenSim/Region/Environment/Modules/TeleportModule.cs
@@ -31,4 +31,4 @@ namespace OpenSim.Region.Environment.Modules
internal class TeleportModule
{
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
index 5eeeca6..66c499b 100644
--- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
@@ -27,14 +27,12 @@
*/
using System;
using System.Collections.Generic;
-using System.Threading;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Interfaces;
+using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using Nini.Config;
namespace OpenSim.Region.Environment.Modules
{
@@ -42,17 +40,19 @@ namespace OpenSim.Region.Environment.Modules
{
private Scene m_scene;
private List m_scenes = new List();
- private Dictionary> ClientRequests = new Dictionary>();
+
+ private Dictionary> ClientRequests =
+ new Dictionary>();
private BlockingQueue QueueSenders = new BlockingQueue();
private Dictionary> InProcess = new Dictionary>();
- // private Thread m_thread;
+ // private Thread m_thread;
public TextureDownloadModule()
{
- // m_thread = new Thread(new ThreadStart(ProcessTextureSenders));
- // m_thread.IsBackground = true;
- // m_thread.Start();
+ // m_thread = new Thread(new ThreadStart(ProcessTextureSenders));
+ // m_thread.IsBackground = true;
+ // m_thread.Start();
}
public void Initialise(Scene scene, IConfigSource config)
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules
public void NewClient(IClientAPI client)
{
- /* lock (ClientRequests)
+ /* lock (ClientRequests)
{
if (!ClientRequests.ContainsKey(client.AgentId))
{
@@ -120,7 +120,7 @@ namespace OpenSim.Region.Environment.Modules
public void TextureRequest(Object sender, TextureRequestArgs e)
{
- IClientAPI client = (IClientAPI)sender;
+ IClientAPI client = (IClientAPI) sender;
if (!ClientRequests[client.AgentId].ContainsKey(e.RequestedAssetID))
{
lock (ClientRequests)
@@ -136,15 +136,15 @@ namespace OpenSim.Region.Environment.Modules
{
while (true)
{
- TextureSender sender = this.QueueSenders.Dequeue();
+ TextureSender sender = QueueSenders.Dequeue();
bool finished = sender.SendTexture();
if (finished)
{
- this.TextureSent(sender);
+ TextureSent(sender);
}
else
{
- this.QueueSenders.Enqueue(sender);
+ QueueSenders.Enqueue(sender);
}
}
}
@@ -173,13 +173,13 @@ namespace OpenSim.Region.Environment.Modules
if (asset.Data.LongLength > 600)
{
- NumPackets = 2 + (int)(asset.Data.Length - 601) / 1000;
+ NumPackets = 2 + (int) (asset.Data.Length - 601)/1000;
}
else
{
NumPackets = 1;
}
-
+
PacketCounter = (int) req.PacketNumber;
}
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Modules
im.Header.Reliable = false;
im.ImageID.Packets = 1;
im.ImageID.ID = m_asset.FullID;
- im.ImageID.Size = (uint)m_asset.Data.Length;
+ im.ImageID.Size = (uint) m_asset.Data.Length;
im.ImageData.Data = m_asset.Data;
im.ImageID.Codec = 2;
req.RequestUser.OutPacket(im);
@@ -215,9 +215,9 @@ namespace OpenSim.Region.Environment.Modules
{
ImageDataPacket im = new ImageDataPacket();
im.Header.Reliable = false;
- im.ImageID.Packets = (ushort)(NumPackets);
+ im.ImageID.Packets = (ushort) (NumPackets);
im.ImageID.ID = m_asset.FullID;
- im.ImageID.Size = (uint)m_asset.Data.Length;
+ im.ImageID.Size = (uint) m_asset.Data.Length;
im.ImageData.Data = new byte[600];
Array.Copy(m_asset.Data, 0, im.ImageData.Data, 0, 600);
im.ImageID.Codec = 2;
@@ -229,18 +229,16 @@ namespace OpenSim.Region.Environment.Modules
{
ImagePacketPacket im = new ImagePacketPacket();
im.Header.Reliable = false;
- im.ImageID.Packet = (ushort)(PacketCounter);
+ im.ImageID.Packet = (ushort) (PacketCounter);
im.ImageID.ID = m_asset.FullID;
- int size = m_asset.Data.Length - 600 - (1000 * (PacketCounter - 1));
+ int size = m_asset.Data.Length - 600 - (1000*(PacketCounter - 1));
if (size > 1000) size = 1000;
im.ImageData.Data = new byte[size];
- Array.Copy(m_asset.Data, 600 + (1000 * (PacketCounter - 1)), im.ImageData.Data, 0, size);
+ Array.Copy(m_asset.Data, 600 + (1000*(PacketCounter - 1)), im.ImageData.Data, 0, size);
req.RequestUser.OutPacket(im);
- PacketCounter++;
+ PacketCounter++;
}
-
}
-
}
public class AssetRequest
@@ -258,6 +256,5 @@ namespace OpenSim.Region.Environment.Modules
PacketNumber = packetNumber;
}
}
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/WorldCommModule.cs
index a697162..7a631d7 100644
--- a/OpenSim/Region/Environment/Modules/WorldCommModule.cs
+++ b/OpenSim/Region/Environment/Modules/WorldCommModule.cs
@@ -27,20 +27,12 @@
*/
using System;
-using System.IO;
-using System.Net.Sockets;
-using System.Text;
-using System.Threading;
+using System.Collections.Generic;
using libsecondlife;
-using OpenSim.Framework.Interfaces;
+using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using OpenSim.Framework.Servers;
-using Nwc.XmlRpc;
-using System.Collections;
-using System.Collections.Generic;
-using Nini.Config;
/*****************************************************
*
@@ -71,6 +63,7 @@ using Nini.Config;
* thats the way it works.
*
* **************************************************/
+
namespace OpenSim.Region.Environment.Modules
{
public class WorldCommModule : IRegionModule, IWorldComm
@@ -120,9 +113,9 @@ namespace OpenSim.Region.Environment.Modules
private void DeliverClientMessage(Object sender, ChatFromViewerArgs e)
{
DeliverMessage(e.Sender.AgentId.ToString(),
- (int)e.Type, e.Channel,
- e.Sender.FirstName + " " + e.Sender.LastName,
- e.Message);
+ (int) e.Type, e.Channel,
+ e.Sender.FirstName + " " + e.Sender.LastName,
+ e.Message);
}
public int Listen(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, string id, string msg)
@@ -132,11 +125,10 @@ namespace OpenSim.Region.Environment.Modules
public void ListenControl(int handle, int active)
{
- if ( active == 1 )
+ if (active == 1)
m_listenerManager.Activate(handle);
- else if ( active == 0 )
+ else if (active == 0)
m_listenerManager.Dectivate(handle);
-
}
public void ListenRemove(int handle)
@@ -151,7 +143,6 @@ namespace OpenSim.Region.Environment.Modules
// nearby avatards, the SimChat function is used.
public void DeliverMessage(string sourceItemID, int type, int channel, string name, string msg)
{
-
SceneObjectPart source = null;
ScenePresence avatar = null;
@@ -160,7 +151,7 @@ namespace OpenSim.Region.Environment.Modules
{
avatar = m_scene.GetScenePresence(new LLUUID(sourceItemID));
}
- if( (avatar != null) || (source != null) )
+ if ((avatar != null) || (source != null))
{
// Loop through the objects in the scene
// If they are in proximity, then if they are
@@ -169,12 +160,12 @@ namespace OpenSim.Region.Environment.Modules
foreach (LLUUID eb in m_scene.Entities.Keys)
{
EntityBase sPart;
-
+
m_scene.Entities.TryGetValue(eb, out sPart);
// Dont process if this message is from itself!
if (eb.ToString().Equals(sourceItemID) ||
- sPart.UUID.ToString().Equals(sourceItemID) )
+ sPart.UUID.ToString().Equals(sourceItemID))
continue;
double dis = 0;
@@ -192,12 +183,11 @@ namespace OpenSim.Region.Environment.Modules
{
ListenerInfo isListener = m_listenerManager.IsListenerMatch(
sourceItemID, sPart.UUID, channel, name, msg
- );
+ );
if (isListener != null)
{
m_pending.Enqueue(isListener);
}
-
}
break;
@@ -207,12 +197,11 @@ namespace OpenSim.Region.Environment.Modules
{
ListenerInfo isListener = m_listenerManager.IsListenerMatch(
sourceItemID, sPart.UUID, channel, name, msg
- );
+ );
if (isListener != null)
{
m_pending.Enqueue(isListener);
}
-
}
break;
@@ -221,22 +210,22 @@ namespace OpenSim.Region.Environment.Modules
{
ListenerInfo isListener = m_listenerManager.IsListenerMatch(
sourceItemID, sPart.UUID, channel, name, msg
- );
+ );
if (isListener != null)
{
m_pending.Enqueue(isListener);
}
-
}
break;
case 0xff: // Broadcast
- ListenerInfo isListen = m_listenerManager.IsListenerMatch(sourceItemID, eb, channel, name, msg);
+ ListenerInfo isListen =
+ m_listenerManager.IsListenerMatch(sourceItemID, eb, channel, name, msg);
if (isListen != null)
{
ListenerInfo isListener = m_listenerManager.IsListenerMatch(
sourceItemID, sPart.UUID, channel, name, msg
- );
+ );
if (isListener != null)
{
m_pending.Enqueue(isListener);
@@ -244,10 +233,9 @@ namespace OpenSim.Region.Environment.Modules
}
break;
}
- };
-
+ }
+ ;
}
-
}
public bool HasMessages()
@@ -257,18 +245,15 @@ namespace OpenSim.Region.Environment.Modules
public ListenerInfo GetNextMessage()
{
-
ListenerInfo li = null;
lock (CommListLock)
{
- li = m_pending.Dequeue();
+ li = m_pending.Dequeue();
}
return li;
-
}
-
}
// hostID: the ID of the ScenePart
@@ -285,20 +270,19 @@ namespace OpenSim.Region.Environment.Modules
m_listeners = new Dictionary();
}
- public int AddListener(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, string id, string msg)
+ public int AddListener(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, string id,
+ string msg)
{
-
- if ( m_listeners.Count < m_MaxListeners )
+ if (m_listeners.Count < m_MaxListeners)
{
ListenerInfo isListener = IsListenerMatch(LLUUID.Zero.ToString(), itemID, channel, name, msg);
- if(isListener == null)
+ if (isListener == null)
{
int newHandle = GetNewHandle();
if (newHandle > -1)
{
-
ListenerInfo li = new ListenerInfo(localID, newHandle, itemID, hostID, channel, name, id, msg);
lock (ListenersLock)
@@ -308,13 +292,10 @@ namespace OpenSim.Region.Environment.Modules
return newHandle;
}
-
}
-
}
return -1;
-
}
public void Remove(int handle)
@@ -324,7 +305,6 @@ namespace OpenSim.Region.Environment.Modules
private int GetNewHandle()
{
-
for (int i = 0; i < int.MaxValue - 1; i++)
{
if (!m_listeners.ContainsKey(i))
@@ -332,12 +312,10 @@ namespace OpenSim.Region.Environment.Modules
}
return -1;
-
}
public bool IsListener(LLUUID hostID)
{
-
foreach (ListenerInfo li in m_listeners.Values)
{
if (li.GetHostID().Equals(hostID))
@@ -345,15 +323,13 @@ namespace OpenSim.Region.Environment.Modules
}
return false;
-
}
public void Activate(int handle)
{
-
ListenerInfo li;
- if( m_listeners.TryGetValue(handle, out li) )
+ if (m_listeners.TryGetValue(handle, out li))
{
li.Activate();
}
@@ -361,10 +337,9 @@ namespace OpenSim.Region.Environment.Modules
public void Dectivate(int handle)
{
-
ListenerInfo li;
- if( m_listeners.TryGetValue(handle, out li) )
+ if (m_listeners.TryGetValue(handle, out li))
{
li.Deactivate();
}
@@ -372,40 +347,40 @@ namespace OpenSim.Region.Environment.Modules
// Theres probably a more clever and efficient way to
// do this, maybe with regex.
- public ListenerInfo IsListenerMatch(string sourceItemID, LLUUID listenerKey, int channel, string name, string msg)
+ public ListenerInfo IsListenerMatch(string sourceItemID, LLUUID listenerKey, int channel, string name,
+ string msg)
{
-
bool isMatch = true;
foreach (ListenerInfo li in m_listeners.Values)
{
if (li.GetHostID().Equals(listenerKey))
{
- if ( li.IsActive() )
+ if (li.IsActive())
{
- if ( channel == li.GetChannel() )
+ if (channel == li.GetChannel())
{
- if ( (li.GetID().ToString().Length > 0) &&
- (!li.GetID().Equals(LLUUID.Zero)) )
+ if ((li.GetID().ToString().Length > 0) &&
+ (!li.GetID().Equals(LLUUID.Zero)))
{
if (!li.GetID().ToString().Equals(sourceItemID))
{
isMatch = false;
}
}
- if ( isMatch && (li.GetName().Length > 0) )
+ if (isMatch && (li.GetName().Length > 0))
{
- if ( li.GetName().Equals(name) )
+ if (li.GetName().Equals(name))
{
isMatch = false;
}
}
- if ( isMatch )
+ if (isMatch)
{
return new ListenerInfo(
li.GetLocalID(), li.GetHandle(), li.GetItemID(), li.GetHostID(),
li.GetChannel(), name, li.GetID(), msg, new LLUUID(sourceItemID)
- );
+ );
}
}
}
@@ -413,35 +388,36 @@ namespace OpenSim.Region.Environment.Modules
}
return null;
}
-
}
public class ListenerInfo
{
-
- private LLUUID m_itemID; // ID of the host script engine
- private LLUUID m_hostID; // ID of the host/scene part
- private LLUUID m_sourceItemID; // ID of the scenePart or avatar source of the message
- private int m_channel; // Channel
- private int m_handle; // Assigned handle of this listener
- private uint m_localID; // Local ID from script engine
- private string m_name; // Object name to filter messages from
- private LLUUID m_id; // ID to filter messages from
- private string m_message; // The message
- private bool m_active; // Listener is active or not
-
- public ListenerInfo(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message)
+ private LLUUID m_itemID; // ID of the host script engine
+ private LLUUID m_hostID; // ID of the host/scene part
+ private LLUUID m_sourceItemID; // ID of the scenePart or avatar source of the message
+ private int m_channel; // Channel
+ private int m_handle; // Assigned handle of this listener
+ private uint m_localID; // Local ID from script engine
+ private string m_name; // Object name to filter messages from
+ private LLUUID m_id; // ID to filter messages from
+ private string m_message; // The message
+ private bool m_active; // Listener is active or not
+
+ public ListenerInfo(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id,
+ string message)
{
Initialise(localID, handle, ItemID, hostID, channel, name, id, message);
}
- public ListenerInfo(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message, LLUUID sourceItemID)
+ public ListenerInfo(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id,
+ string message, LLUUID sourceItemID)
{
Initialise(localID, handle, ItemID, hostID, channel, name, id, message);
m_sourceItemID = sourceItemID;
}
- private void Initialise(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message)
+ private void Initialise(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name,
+ LLUUID id, string message)
{
m_handle = handle;
m_channel = channel;
@@ -453,55 +429,65 @@ namespace OpenSim.Region.Environment.Modules
m_active = true;
m_localID = localID;
}
+
public LLUUID GetItemID()
{
return m_itemID;
}
+
public LLUUID GetHostID()
{
return m_hostID;
}
+
public LLUUID GetSourceItemID()
{
return m_sourceItemID;
}
+
public int GetChannel()
{
return m_channel;
}
+
public uint GetLocalID()
{
return m_localID;
}
+
public int GetHandle()
{
return m_handle;
}
+
public string GetMessage()
{
return m_message;
}
+
public string GetName()
{
return m_name;
}
+
public bool IsActive()
{
return m_active;
}
+
public void Deactivate()
{
m_active = false;
}
+
public void Activate()
{
m_active = true;
}
+
public LLUUID GetID()
{
return m_id;
}
-
}
-
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
index dd84778..434c92f 100644
--- a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
+++ b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
@@ -26,20 +26,15 @@
*
*/
-using System;
-using System.IO;
-using System.Net.Sockets;
+using System.Collections;
+using System.Collections.Generic;
using System.Threading;
using libsecondlife;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Framework;
+using Nini.Config;
+using Nwc.XmlRpc;
+using OpenSim.Framework.Servers;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using OpenSim.Framework.Servers;
-using Nwc.XmlRpc;
-using System.Collections;
-using System.Collections.Generic;
-using Nini.Config;
/*****************************************************
*
@@ -73,6 +68,7 @@ using Nini.Config;
* llCloseRemoteDataChannel
*
* **************************************************/
+
namespace OpenSim.Region.Environment.Modules
{
public class XMLRPCModule : IRegionModule, IXMLRPC
@@ -83,7 +79,7 @@ namespace OpenSim.Region.Environment.Modules
private string m_name = "XMLRPCModule";
private int RemoteReplyScriptWait = 100;
private int RemoteReplyScriptTimeout = 300;
-
+
//
private Dictionary m_openChannels;
@@ -106,7 +102,7 @@ namespace OpenSim.Region.Environment.Modules
// Start http server
// Attach xmlrpc handlers
BaseHttpServer httpServer = new BaseHttpServer(20800);
- httpServer.AddXmlRPCHandler("llRemoteData", this.XmlRpcRemoteData);
+ httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
httpServer.Start();
}
@@ -141,6 +137,7 @@ namespace OpenSim.Region.Environment.Modules
* current channel and assign a new one.
*
* ********************************************/
+
public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID)
{
LLUUID channel = null;
@@ -156,7 +153,7 @@ namespace OpenSim.Region.Environment.Modules
}
}
- if ( (channel == null) || (channel.Equals(LLUUID.Zero)) )
+ if ((channel == null) || (channel.Equals(LLUUID.Zero)))
{
channel = LLUUID.Random();
RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, channel);
@@ -164,7 +161,6 @@ namespace OpenSim.Region.Environment.Modules
{
m_openChannels.Add(channel, rpcChanInfo);
}
-
}
return channel;
@@ -176,6 +172,7 @@ namespace OpenSim.Region.Environment.Modules
* Response to RPC message
*
*********************************************/
+
public void RemoteDataReply(string channel, string message_id, string sdata, int idata)
{
RPCRequestInfo rpcInfo;
@@ -191,7 +188,6 @@ namespace OpenSim.Region.Environment.Modules
m_pendingResponse.Remove(message_key);
}
}
-
}
/**********************************************
@@ -200,41 +196,44 @@ namespace OpenSim.Region.Environment.Modules
* Remove channel from dictionary
*
*********************************************/
+
public void CloseXMLRPCChannel(LLUUID channelKey)
{
- if(m_openChannels.ContainsKey(channelKey))
+ if (m_openChannels.ContainsKey(channelKey))
m_openChannels.Remove(channelKey);
}
public XmlRpcResponse XmlRpcRemoteData(XmlRpcRequest request)
{
-
XmlRpcResponse response = new XmlRpcResponse();
- Hashtable requestData = (Hashtable)request.Params[0];
- bool GoodXML = (requestData.Contains("Channel") && requestData.Contains("IntValue") && requestData.Contains("StringValue"));
+ Hashtable requestData = (Hashtable) request.Params[0];
+ bool GoodXML = (requestData.Contains("Channel") && requestData.Contains("IntValue") &&
+ requestData.Contains("StringValue"));
if (GoodXML)
{
- LLUUID channel = new LLUUID((string)requestData["Channel"]);
+ LLUUID channel = new LLUUID((string) requestData["Channel"]);
RPCChannelInfo rpcChanInfo;
if (m_openChannels.TryGetValue(channel, out rpcChanInfo))
{
- string intVal = (string)requestData["IntValue"];
- string strVal = (string)requestData["StringValue"];
+ string intVal = (string) requestData["IntValue"];
+ string strVal = (string) requestData["StringValue"];
RPCRequestInfo rpcInfo;
lock (XMLRPCListLock)
{
- rpcInfo = new RPCRequestInfo(rpcChanInfo.GetLocalID(), rpcChanInfo.GetItemID(), channel, strVal, intVal);
+ rpcInfo =
+ new RPCRequestInfo(rpcChanInfo.GetLocalID(), rpcChanInfo.GetItemID(), channel, strVal,
+ intVal);
rpcQueue.Enqueue(rpcInfo);
}
int timeoutCtr = 0;
- while(!rpcInfo.IsProcessed() && (timeoutCtr < RemoteReplyScriptTimeout))
+ while (!rpcInfo.IsProcessed() && (timeoutCtr < RemoteReplyScriptTimeout))
{
Thread.Sleep(RemoteReplyScriptWait);
timeoutCtr += RemoteReplyScriptWait;
@@ -252,13 +251,11 @@ namespace OpenSim.Region.Environment.Modules
m_pendingResponse.Remove(rpcInfo.GetMessageID());
}
}
-
}
else
{
response.SetFault(-1, "Invalid channel");
}
-
}
return response;
@@ -278,7 +275,6 @@ namespace OpenSim.Region.Environment.Modules
return rpcInfo;
}
}
-
}
/**************************************************************
@@ -288,6 +284,7 @@ namespace OpenSim.Region.Environment.Modules
* Holds details about incoming requests until they are picked
* from the queue by LSLLongCmdHandler
* ***********************************************************/
+
public class RPCRequestInfo
{
private string m_StrVal;
@@ -315,6 +312,7 @@ namespace OpenSim.Region.Environment.Modules
{
return m_processed;
}
+
public LLUUID GetChannelKey()
{
return m_ChannelKey;
@@ -324,36 +322,41 @@ namespace OpenSim.Region.Environment.Modules
{
m_processed = processed;
}
+
public void SetRetval(string resp)
{
m_resp = resp;
}
+
public string GetRetval()
{
return m_resp;
}
+
public uint GetLocalID()
{
return m_localID;
}
+
public LLUUID GetItemID()
{
return m_ItemID;
}
+
public string GetStrVal()
{
return m_StrVal;
}
+
public int GetIntValue()
{
return int.Parse(m_IntVal);
}
+
public LLUUID GetMessageID()
{
return m_MessageID;
}
-
-
}
public class RPCChannelInfo
@@ -383,7 +386,5 @@ namespace OpenSim.Region.Environment.Modules
{
return m_localID;
}
-
}
-
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/XferModule.cs b/OpenSim/Region/Environment/Modules/XferModule.cs
index e555475..807b46c 100644
--- a/OpenSim/Region/Environment/Modules/XferModule.cs
+++ b/OpenSim/Region/Environment/Modules/XferModule.cs
@@ -29,11 +29,10 @@
using System;
using System.Collections.Generic;
using libsecondlife;
-using OpenSim.Framework.Interfaces;
+using Nini.Config;
+using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
-using OpenSim.Framework;
-using Nini.Config;
namespace OpenSim.Region.Environment.Modules
{
@@ -200,4 +199,4 @@ namespace OpenSim.Region.Environment.Modules
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index 63285dc..fd55833 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -29,7 +29,6 @@
using libsecondlife;
using OpenSim.Region.Environment.LandManagement;
using OpenSim.Region.Environment.Scenes;
-using OpenSim.Framework;
namespace OpenSim.Region.Environment
{
@@ -337,4 +336,4 @@ namespace OpenSim.Region.Environment
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index 767a740..b8bae57 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -146,4 +146,4 @@ namespace OpenSim.Region.Environment.Scenes
public abstract void SetText(string text, Vector3 color, double alpha);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs b/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs
index 14a1c7e..0f3bca1 100644
--- a/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs
+++ b/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs
@@ -29,7 +29,6 @@
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Framework;
-using OpenSim.Framework.Interfaces;
namespace OpenSim.Region.Environment.Scenes
{
@@ -40,4 +39,4 @@ namespace OpenSim.Region.Environment.Scenes
void SendOurAppearance(IClientAPI OurClient);
void SendAppearanceToOtherAgent(ScenePresence avatarInfo);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 68591d4..a0c9a50 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -29,9 +29,8 @@
using Axiom.Math;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Communications.Cache;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
+using OpenSim.Framework.Communications.Cache;
using OpenSim.Region.Physics.Manager;
namespace OpenSim.Region.Environment.Scenes
@@ -45,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes
{
ScenePresence avatar;
- if ( TryGetAvatar( avatarId, out avatar ))
+ if (TryGetAvatar(avatarId, out avatar))
{
AddInventoryItem(avatar.ControllingClient, item);
}
@@ -392,7 +391,7 @@ namespace OpenSim.Region.Environment.Scenes
remoteClient.SendInventoryItemUpdate(item);
}
- DeleteSceneObjectGroup((SceneObjectGroup)selectedEnt);
+ DeleteSceneObjectGroup((SceneObjectGroup) selectedEnt);
}
}
}
@@ -471,4 +470,4 @@ namespace OpenSim.Region.Environment.Scenes
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 3a35e21..69bd310 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -28,9 +28,8 @@
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
+using OpenSim.Framework.Console;
namespace OpenSim.Region.Environment.Scenes
{
@@ -73,12 +72,12 @@ namespace OpenSim.Region.Environment.Scenes
{
ChatFromViewerArgs args = new ChatFromViewerArgs();
- args.Message = OpenSim.Framework.Util.FieldToString(message);
+ args.Message = Util.FieldToString(message);
args.Channel = channel;
- args.Type = (ChatTypeEnum)type;
+ args.Type = (ChatTypeEnum) type;
args.Position = fromPos;
- ScenePresence user = this.GetScenePresence(fromAgentID);
+ ScenePresence user = GetScenePresence(fromAgentID);
if (user != null)
args.Sender = user.ControllingClient;
else
@@ -488,10 +487,7 @@ namespace OpenSim.Region.Environment.Scenes
public void StartAnimation(LLUUID animID, int seq, LLUUID agentId)
{
- Broadcast(delegate(IClientAPI client)
- {
- client.SendAnimation(animID, seq, agentId);
- });
+ Broadcast(delegate(IClientAPI client) { client.SendAnimation(animID, seq, agentId); });
}
public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
@@ -503,14 +499,14 @@ namespace OpenSim.Region.Environment.Scenes
if (ent is SceneObjectGroup)
{
SceneObjectGroup obj = ent as SceneObjectGroup;
-
- if( obj.HasChildPrim( localID ) )
+
+ if (obj.HasChildPrim(localID))
{
obj.ObjectGrabHandler(localID, offsetPos, remoteClient);
return;
- }
+ }
}
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index b54c25b..db4d230 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -26,9 +26,9 @@
*
*/
using System;
-using System.Net;
using System.Collections.Generic;
using System.IO;
+using System.Net;
using System.Threading;
using System.Timers;
using System.Xml;
@@ -38,17 +38,16 @@ using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Servers;
using OpenSim.Region.Capabilities;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.LandManagement;
+using OpenSim.Region.Environment.Modules;
using OpenSim.Region.Environment.Scenes.Scripting;
using OpenSim.Region.Environment.Types;
using OpenSim.Region.Physics.Manager;
using OpenSim.Region.Terrain;
-using Timer = System.Timers.Timer;
-using OpenSim.Region.Environment.Modules;
+using Timer=System.Timers.Timer;
namespace OpenSim.Region.Environment.Scenes
{
@@ -130,6 +129,7 @@ namespace OpenSim.Region.Environment.Scenes
private readonly EstateManager m_estateManager;
private PhysicsScene phyScene;
+
public PhysicsScene PhysScene
{
set { phyScene = value; }
@@ -199,7 +199,7 @@ namespace OpenSim.Region.Environment.Scenes
m_sceneObjects = new Dictionary();
MainLog.Instance.Verbose("Creating LandMap");
- Terrain = new TerrainEngine((int)RegionInfo.RegionLocX, (int)RegionInfo.RegionLocY);
+ Terrain = new TerrainEngine((int) RegionInfo.RegionLocX, (int) RegionInfo.RegionLocY);
ScenePresence.LoadAnims();
@@ -233,7 +233,7 @@ namespace OpenSim.Region.Environment.Scenes
public void StartTimer()
{
m_heartbeatTimer.Enabled = true;
- m_heartbeatTimer.Interval = (int)(m_timespan * 1000);
+ m_heartbeatTimer.Interval = (int) (m_timespan*1000);
m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
}
@@ -267,33 +267,33 @@ namespace OpenSim.Region.Environment.Scenes
if (m_frame == Int32.MaxValue)
m_frame = 0;
- if (m_frame % m_update_physics == 0)
+ if (m_frame%m_update_physics == 0)
UpdatePreparePhysics();
- if (m_frame % m_update_entitymovement == 0)
+ if (m_frame%m_update_entitymovement == 0)
UpdateEntityMovement();
- if (m_frame % m_update_physics == 0)
+ if (m_frame%m_update_physics == 0)
UpdatePhysics(
Math.Max(SinceLastFrame.TotalSeconds, m_timespan)
);
- if (m_frame % m_update_entities == 0)
+ if (m_frame%m_update_entities == 0)
UpdateEntities();
- if (m_frame % m_update_events == 0)
+ if (m_frame%m_update_events == 0)
UpdateEvents();
- if (m_frame % m_update_backup == 0)
+ if (m_frame%m_update_backup == 0)
UpdateStorageBackup();
- if (m_frame % m_update_terrain == 0)
+ if (m_frame%m_update_terrain == 0)
UpdateTerrain();
- if (m_frame % m_update_land == 0)
+ if (m_frame%m_update_land == 0)
UpdateLand();
- if (m_frame % m_update_avatars == 0)
+ if (m_frame%m_update_avatars == 0)
UpdateInWorldTime();
}
catch (NotImplementedException)
@@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Scenes
{
updateLock.ReleaseMutex();
- m_timedilation = m_timespan / (float)SinceLastFrame.TotalSeconds;
+ m_timedilation = m_timespan/(float) SinceLastFrame.TotalSeconds;
m_lastupdate = DateTime.Now;
}
}
@@ -369,24 +369,23 @@ namespace OpenSim.Region.Environment.Scenes
phyScene.SetTerrain(Terrain.GetHeights1D());
}
- storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(),RegionInfo.RegionID);
+ storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
float[] terData = Terrain.GetHeights1D();
Broadcast(delegate(IClientAPI client)
- {
- for (int x = 0; x < 16; x++)
- {
- for (int y = 0; y < 16; y++)
- {
- if (Terrain.Tainted(x * 16, y * 16))
- {
- client.SendLayerData(x, y, terData);
- }
- }
- }
- });
-
+ {
+ for (int x = 0; x < 16; x++)
+ {
+ for (int y = 0; y < 16; y++)
+ {
+ if (Terrain.Tainted(x*16, y*16))
+ {
+ client.SendLayerData(x, y, terData);
+ }
+ }
+ }
+ });
Terrain.ResetTaint();
@@ -418,7 +417,7 @@ namespace OpenSim.Region.Environment.Scenes
{
lock (m_syncRoot)
{
- phyScene.Simulate((float)elapsed);
+ phyScene.Simulate((float) elapsed);
}
}
@@ -438,11 +437,9 @@ namespace OpenSim.Region.Environment.Scenes
///
internal void Broadcast(Action whatToDo)
{
- ForEachScenePresence(delegate(ScenePresence presence)
- {
- whatToDo(presence.ControllingClient);
- });
+ ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); });
}
+
///
///
///
@@ -473,7 +470,7 @@ namespace OpenSim.Region.Environment.Scenes
MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain.");
Terrain.HillsGenerator();
- storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(),RegionInfo.RegionID);
+ storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
}
else
{
@@ -484,7 +481,8 @@ namespace OpenSim.Region.Environment.Scenes
}
catch
{
- MainLog.Instance.Verbose("TERRAIN", "No terrain found in database or default. Generating a new terrain.");
+ MainLog.Instance.Verbose("TERRAIN",
+ "No terrain found in database or default. Generating a new terrain.");
Terrain.HillsGenerator();
}
storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
@@ -535,7 +533,7 @@ namespace OpenSim.Region.Environment.Scenes
{
AddEntityFromStorage(prim);
SceneObjectPart rootPart = prim.GetChildPart(prim.UUID);
- if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0)
+ if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
rootPart.PhysActor = phyScene.AddPrimShape(
rootPart.Name,
rootPart.Shape,
@@ -581,17 +579,17 @@ namespace OpenSim.Region.Environment.Scenes
// if grass or tree, make phantom
if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255))
{
- rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom;
+ rootPart.ObjectFlags += (uint) LLObject.ObjectFlags.Phantom;
}
// if not phantom, add to physics
- if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0)
+ if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
rootPart.PhysActor =
phyScene.AddPrimShape(
- rootPart.Name,
- rootPart.Shape,
- new PhysicsVector(pos.X, pos.Y, pos.Z),
- new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
- new Quaternion());
+ rootPart.Name,
+ rootPart.Shape,
+ new PhysicsVector(pos.X, pos.Y, pos.Z),
+ new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
+ new Quaternion());
}
}
@@ -601,9 +599,9 @@ namespace OpenSim.Region.Environment.Scenes
{
if (obj is SceneObjectGroup)
{
- if (((SceneObjectGroup)obj).LocalId == localID)
+ if (((SceneObjectGroup) obj).LocalId == localID)
{
- RemoveEntity((SceneObjectGroup)obj);
+ RemoveEntity((SceneObjectGroup) obj);
return;
}
}
@@ -657,7 +655,6 @@ namespace OpenSim.Region.Environment.Scenes
int primCount = 0;
if ((fileName.StartsWith("http:")) | (File.Exists(fileName)))
{
-
XmlTextReader reader = new XmlTextReader(fileName);
reader.WhitespaceHandling = WhitespaceHandling.None;
doc.Load(reader);
@@ -672,7 +669,7 @@ namespace OpenSim.Region.Environment.Scenes
AddEntity(obj);
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
- if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0)
+ if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
rootPart.PhysActor = phyScene.AddPrimShape(
rootPart.Name,
rootPart.Shape,
@@ -700,7 +697,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (ent is SceneObjectGroup)
{
- stream.WriteLine(((SceneObjectGroup)ent).ToXmlString());
+ stream.WriteLine(((SceneObjectGroup) ent).ToXmlString());
primCount++;
}
}
@@ -737,7 +734,7 @@ namespace OpenSim.Region.Environment.Scenes
AddEntityFromStorage(obj);
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
- if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0)
+ if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
rootPart.PhysActor = phyScene.AddPrimShape(
rootPart.Name,
rootPart.Shape,
@@ -758,7 +755,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (ent is SceneObjectGroup)
{
- stream.WriteLine(((SceneObjectGroup)ent).ToXmlString2());
+ stream.WriteLine(((SceneObjectGroup) ent).ToXmlString2());
primCount++;
}
}
@@ -857,7 +854,8 @@ namespace OpenSim.Region.Environment.Scenes
byte[] visualParams;
AvatarWearable[] wearables;
- if( m_AvatarFactory == null || !m_AvatarFactory.TryGetIntialAvatarAppearance( client.AgentId, out wearables, out visualParams))
+ if (m_AvatarFactory == null ||
+ !m_AvatarFactory.TryGetIntialAvatarAppearance(client.AgentId, out wearables, out visualParams))
{
AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams);
}
@@ -916,16 +914,10 @@ namespace OpenSim.Region.Environment.Scenes
ScenePresence avatar = GetScenePresence(agentID);
- Broadcast(delegate(IClientAPI client)
- {
- client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
- });
+ Broadcast(delegate(IClientAPI client) { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); });
ForEachScenePresence(
- delegate(ScenePresence presence)
- {
- presence.CoarseLocationChange();
- });
+ delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
lock (m_scenePresences)
{
@@ -965,10 +957,8 @@ namespace OpenSim.Region.Environment.Scenes
public List GetAvatars()
{
- List result = GetScenePresences(delegate(ScenePresence scenePresence)
- {
- return !scenePresence.IsChildAgent;
- });
+ List result =
+ GetScenePresences(delegate(ScenePresence scenePresence) { return !scenePresence.IsChildAgent; });
return result;
}
@@ -1046,18 +1036,12 @@ namespace OpenSim.Region.Environment.Scenes
public void SendKillObject(uint localID)
{
- Broadcast(delegate(IClientAPI client)
- {
- client.SendKillObject(m_regionHandle, localID);
- });
+ Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); });
}
public void NotifyMyCoarseLocationChange()
{
- ForEachScenePresence(delegate(ScenePresence presence)
- {
- presence.CoarseLocationChange();
- });
+ ForEachScenePresence(delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
}
public void SendAllSceneObjectsToClient(ScenePresence presence)
@@ -1067,7 +1051,7 @@ namespace OpenSim.Region.Environment.Scenes
if (ent is SceneObjectGroup)
{
// ((SceneObjectGroup)ent).SendFullUpdateToClient(client);
- ((SceneObjectGroup)ent).ScheduleFullUpdateToAvatar(presence);
+ ((SceneObjectGroup) ent).ScheduleFullUpdateToAvatar(presence);
}
}
}
@@ -1137,11 +1121,12 @@ namespace OpenSim.Region.Environment.Scenes
}
}
- delegate void InformClientOfNeighbourDelegate(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint);
+ private delegate void InformClientOfNeighbourDelegate(
+ IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint);
private void InformClientOfNeighbourCompleted(IAsyncResult iar)
{
- InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState;
+ InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate) iar.AsyncState;
icon.EndInvoke(iar);
@@ -1157,7 +1142,8 @@ namespace OpenSim.Region.Environment.Scenes
///
///
///
- private void InformClientOfNeighbourAsync(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint)
+ private void InformClientOfNeighbourAsync(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle,
+ IPEndPoint endPoint)
{
MainLog.Instance.Notice("INTERGRID", "Starting to inform client about neighbours");
bool regionAccepted = commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, a);
@@ -1172,7 +1158,8 @@ namespace OpenSim.Region.Environment.Scenes
///
public void InformClientOfNeighbours(IClientAPI remoteClient)
{
- List neighbours = commsManager.GridService.RequestNeighbours(m_regInfo.RegionLocX, m_regInfo.RegionLocY);
+ List neighbours =
+ commsManager.GridService.RequestNeighbours(m_regInfo.RegionLocX, m_regInfo.RegionLocY);
if (neighbours != null)
{
for (int i = 0; i < neighbours.Count; i++)
@@ -1185,9 +1172,8 @@ namespace OpenSim.Region.Environment.Scenes
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
d.BeginInvoke(remoteClient, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint,
- InformClientOfNeighbourCompleted,
- d);
-
+ InformClientOfNeighbourCompleted,
+ d);
}
}
}
@@ -1289,17 +1275,17 @@ namespace OpenSim.Region.Environment.Scenes
public void RegisterModuleInterface(M mod)
{
- if (!ModuleInterfaces.ContainsKey(typeof(M)))
+ if (!ModuleInterfaces.ContainsKey(typeof (M)))
{
- ModuleInterfaces.Add(typeof(M), mod);
+ ModuleInterfaces.Add(typeof (M), mod);
}
}
public T RequestModuleInterface()
{
- if (ModuleInterfaces.ContainsKey(typeof(T)))
+ if (ModuleInterfaces.ContainsKey(typeof (T)))
{
- return (T)ModuleInterfaces[typeof(T)];
+ return (T) ModuleInterfaces[typeof (T)];
}
else
{
@@ -1317,7 +1303,8 @@ namespace OpenSim.Region.Environment.Scenes
{
if (m_scenePresences.ContainsKey(avatarID))
{
- m_scenePresences[avatarID].ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned, message, url);
+ m_scenePresences[avatarID].ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned,
+ message, url);
}
}
@@ -1388,7 +1375,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (ent is SceneObjectGroup)
{
- ((SceneObjectGroup)ent).ScheduleGroupForFullUpdate();
+ ((SceneObjectGroup) ent).ScheduleGroupForFullUpdate();
}
}
}
@@ -1400,7 +1387,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (ent is SceneObjectGroup)
{
- SceneObjectPart part = ((SceneObjectGroup)ent).GetChildPart(((SceneObjectGroup)ent).UUID);
+ SceneObjectPart part = ((SceneObjectGroup) ent).GetChildPart(((SceneObjectGroup) ent).UUID);
if (part != null)
{
if (part.Name == cmmdparams[0])
@@ -1429,14 +1416,14 @@ namespace OpenSim.Region.Environment.Scenes
foreach (ScenePresence scenePrescence in GetAvatars())
{
MainLog.Instance.Error(
- String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}",
- scenePrescence.Firstname,
- scenePrescence.Lastname,
- scenePrescence.UUID,
- scenePrescence.ControllingClient.AgentId,
- "Unknown",
- "Unknown",
- RegionInfo.RegionName));
+ String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}",
+ scenePrescence.Firstname,
+ scenePrescence.Lastname,
+ scenePrescence.UUID,
+ scenePrescence.ControllingClient.AgentId,
+ "Unknown",
+ "Unknown",
+ RegionInfo.RegionName));
}
break;
case "modules":
@@ -1482,10 +1469,10 @@ namespace OpenSim.Region.Environment.Scenes
{
if (ent is SceneObjectGroup)
{
- hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
+ hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
if (hasPrim != false)
{
- return ((SceneObjectGroup)ent).GetPartsFullID(localID);
+ return ((SceneObjectGroup) ent).GetPartsFullID(localID);
}
}
}
@@ -1499,10 +1486,10 @@ namespace OpenSim.Region.Environment.Scenes
{
if (ent is SceneObjectGroup)
{
- hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
+ hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
if (hasPrim != false)
{
- return ((SceneObjectGroup)ent).GetChildPart(localID);
+ return ((SceneObjectGroup) ent).GetChildPart(localID);
}
}
}
@@ -1516,10 +1503,10 @@ namespace OpenSim.Region.Environment.Scenes
{
if (ent is SceneObjectGroup)
{
- hasPrim = ((SceneObjectGroup)ent).HasChildPrim(fullID);
+ hasPrim = ((SceneObjectGroup) ent).HasChildPrim(fullID);
if (hasPrim != false)
{
- return ((SceneObjectGroup)ent).GetChildPart(fullID);
+ return ((SceneObjectGroup) ent).GetChildPart(fullID);
}
}
}
@@ -1569,12 +1556,12 @@ namespace OpenSim.Region.Environment.Scenes
return false;
}
- internal void ForEachClient( Action action )
+ internal void ForEachClient(Action action)
{
- foreach (ScenePresence presence in m_scenePresences.Values )
+ foreach (ScenePresence presence in m_scenePresences.Values)
{
action(presence.ControllingClient);
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index 0072d4e..4ad9d65 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -28,10 +28,9 @@
using System;
using System.Collections.Generic;
using libsecondlife;
+using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Framework;
using OpenSim.Region.Terrain;
namespace OpenSim.Region.Environment.Scenes
@@ -39,6 +38,7 @@ namespace OpenSim.Region.Environment.Scenes
public abstract class SceneBase : IScene
{
private readonly ClientManager m_clientManager = new ClientManager();
+
public ClientManager ClientManager
{
get { return m_clientManager; }
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index ea47713..493afd1 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -27,9 +27,8 @@
*/
using libsecondlife;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Region.Environment.Interfaces;
using OpenSim.Framework;
+using OpenSim.Region.Environment.Interfaces;
namespace OpenSim.Region.Environment.Scenes
{
@@ -207,4 +206,4 @@ namespace OpenSim.Region.Environment.Scenes
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index a315d02..75e2a41 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -28,9 +28,9 @@
using System;
using System.Collections.Generic;
-using OpenSim.Framework.Console;
-using OpenSim.Framework;
using libsecondlife;
+using OpenSim.Framework;
+using OpenSim.Framework.Console;
namespace OpenSim.Region.Environment.Scenes
{
@@ -152,10 +152,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SendGeneralMessage(string msg)
{
- ForEachCurrentScene(delegate(Scene scene)
- {
- scene.SendGeneralAlert(msg);
- });
+ ForEachCurrentScene(delegate(Scene scene) { scene.SendGeneralAlert(msg); });
}
public bool TrySetCurrentScene(string regionName)
@@ -185,23 +182,24 @@ namespace OpenSim.Region.Environment.Scenes
public void SetDebugPacketOnCurrentScene(LogBase log, int newDebug)
{
ForEachCurrentScene(delegate(Scene scene)
- {
- foreach (EntityBase entity in scene.Entities.Values)
- {
- if (entity is ScenePresence)
- {
- ScenePresence scenePrescence = entity as ScenePresence;
- if (!scenePrescence.IsChildAgent)
{
- log.Error(String.Format("Packet debug for {0} {1} set to {2}",
- scenePrescence.Firstname, scenePrescence.Lastname,
- newDebug));
-
- scenePrescence.ControllingClient.SetDebug(newDebug);
- }
- }
- }
- });
+ foreach (EntityBase entity in scene.Entities.Values)
+ {
+ if (entity is ScenePresence)
+ {
+ ScenePresence scenePrescence = entity as ScenePresence;
+ if (!scenePrescence.IsChildAgent)
+ {
+ log.Error(String.Format("Packet debug for {0} {1} set to {2}",
+ scenePrescence.Firstname,
+ scenePrescence.Lastname,
+ newDebug));
+
+ scenePrescence.ControllingClient.SetDebug(newDebug);
+ }
+ }
+ }
+ });
}
public List GetCurrentSceneAvatars()
@@ -209,19 +207,19 @@ namespace OpenSim.Region.Environment.Scenes
List avatars = new List();
ForEachCurrentScene(delegate(Scene scene)
- {
- foreach (EntityBase entity in scene.Entities.Values)
- {
- if (entity is ScenePresence)
- {
- ScenePresence scenePrescence = entity as ScenePresence;
- if (!scenePrescence.IsChildAgent)
{
- avatars.Add(scenePrescence);
- }
- }
- }
- });
+ foreach (EntityBase entity in scene.Entities.Values)
+ {
+ if (entity is ScenePresence)
+ {
+ ScenePresence scenePrescence = entity as ScenePresence;
+ if (!scenePrescence.IsChildAgent)
+ {
+ avatars.Add(scenePrescence);
+ }
+ }
+ }
+ });
return avatars;
}
@@ -242,11 +240,11 @@ namespace OpenSim.Region.Environment.Scenes
public void SetCurrentSceneTimePhase(int timePhase)
{
ForEachCurrentScene(delegate(Scene scene)
- {
- scene.SetTimePhase(
- timePhase)
- ;
- });
+ {
+ scene.SetTimePhase(
+ timePhase)
+ ;
+ });
}
@@ -260,11 +258,11 @@ namespace OpenSim.Region.Environment.Scenes
ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); });
}
- public bool TryGetAvatar( LLUUID avatarId, out ScenePresence avatar )
+ public bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar)
{
foreach (Scene scene in m_localScenes)
{
- if( scene.TryGetAvatar( avatarId, out avatar ))
+ if (scene.TryGetAvatar(avatarId, out avatar))
{
return true;
}
@@ -311,9 +309,9 @@ namespace OpenSim.Region.Environment.Scenes
return false;
}
- public void ForEachScene(Action action )
+ public void ForEachScene(Action action)
{
- m_localScenes.ForEach( action );
+ m_localScenes.ForEach(action);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 4603902..4d439b2 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -34,7 +34,6 @@ using System.Xml;
using Axiom.Math;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Physics.Manager;
@@ -270,7 +269,7 @@ namespace OpenSim.Region.Environment.Scenes
StringReader sr = new StringReader(xmlData);
XmlTextReader reader = new XmlTextReader(sr);
reader.Read();
-
+
reader.ReadStartElement("SceneObjectGroup");
m_rootPart = SceneObjectPart.FromXml(reader);
@@ -285,14 +284,14 @@ namespace OpenSim.Region.Environment.Scenes
if (reader.Name == "SceneObjectPart")
{
SceneObjectPart Part = SceneObjectPart.FromXml(reader);
- AddPart(Part);
+ AddPart(Part);
}
break;
case XmlNodeType.EndElement:
- reader.Read();
+ reader.Read();
break;
}
- more = !reader.EOF;
+ more = !reader.EOF;
}
reader.Close();
sr.Close();
@@ -424,13 +423,13 @@ namespace OpenSim.Region.Environment.Scenes
PrimitiveBaseShape pbs = dupe.RootPart.Shape;
dupe.RootPart.PhysActor = m_scene.PhysScene.AddPrimShape(
- dupe.RootPart.Name,
- pbs,
- new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, dupe.RootPart.AbsolutePosition.Z),
- new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z),
- new Axiom.Math.Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X,
- dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z));
-
+ dupe.RootPart.Name,
+ pbs,
+ new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y,
+ dupe.RootPart.AbsolutePosition.Z),
+ new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z),
+ new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X,
+ dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z));
}
List partList = new List(m_parts.Values);
@@ -951,14 +950,15 @@ namespace OpenSim.Region.Environment.Scenes
}
if (m_rootPart.PhysActor != null)
{
- this.m_scene.PhysScene.RemovePrim(m_rootPart.PhysActor);
+ m_scene.PhysScene.RemovePrim(m_rootPart.PhysActor);
m_rootPart.PhysActor = m_scene.PhysScene.AddPrimShape(
- m_rootPart.Name,
- m_rootPart.Shape,
- new PhysicsVector(m_rootPart.AbsolutePosition.X, m_rootPart.AbsolutePosition.Y, m_rootPart.AbsolutePosition.Z),
- new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z),
- new Axiom.Math.Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X,
- m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z));
+ m_rootPart.Name,
+ m_rootPart.Shape,
+ new PhysicsVector(m_rootPart.AbsolutePosition.X, m_rootPart.AbsolutePosition.Y,
+ m_rootPart.AbsolutePosition.Z),
+ new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z),
+ new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X,
+ m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z));
}
}
@@ -1001,7 +1001,7 @@ namespace OpenSim.Region.Environment.Scenes
AbsolutePosition = pos;
ScheduleGroupForTerseUpdate();
- m_scene.EventManager.TriggerGroupMove(this.UUID, pos);
+ m_scene.EventManager.TriggerGroupMove(UUID, pos);
}
///
@@ -1350,7 +1350,7 @@ namespace OpenSim.Region.Environment.Scenes
public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient)
{
- m_scene.EventManager.TriggerGroupGrab(this.UUID, offsetPos, remoteClient.AgentId);
+ m_scene.EventManager.TriggerGroupGrab(UUID, offsetPos, remoteClient.AgentId);
}
public void DeleteGroup()
@@ -1377,4 +1377,4 @@ namespace OpenSim.Region.Environment.Scenes
Text = text;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 3e104e3..387f573 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -33,12 +33,10 @@ using System.Xml.Serialization;
using Axiom.Math;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes.Scripting;
using OpenSim.Region.Physics.Manager;
-using OpenSim.Region.Environment.Types;
namespace OpenSim.Region.Environment.Scenes
{
@@ -49,8 +47,7 @@ namespace OpenSim.Region.Environment.Scenes
private string m_inventoryFileName = "";
private LLUUID m_folderID = LLUUID.Zero;
- [XmlIgnore]
- public PhysicsActor PhysActor = null;
+ [XmlIgnore] public PhysicsActor PhysActor = null;
protected Dictionary TaskInventory = new Dictionary();
@@ -68,10 +65,8 @@ namespace OpenSim.Region.Environment.Scenes
protected byte[] m_particleSystem = new byte[0];
- [XmlIgnore]
- public uint TimeStampFull = 0;
- [XmlIgnore]
- public uint TimeStampTerse = 0;
+ [XmlIgnore] public uint TimeStampFull = 0;
+ [XmlIgnore] public uint TimeStampTerse = 0;
protected SceneObjectGroup m_parentGroup;
@@ -124,7 +119,7 @@ namespace OpenSim.Region.Environment.Scenes
set { m_name = value; }
}
- protected LLObject.ObjectFlags m_flags =0;
+ protected LLObject.ObjectFlags m_flags = 0;
public uint ObjectFlags
{
@@ -132,7 +127,7 @@ namespace OpenSim.Region.Environment.Scenes
set { m_flags = (LLObject.ObjectFlags) value; }
}
- protected LLObject.MaterialType m_material =0;
+ protected LLObject.MaterialType m_material = 0;
public byte Material
{
@@ -712,7 +707,7 @@ namespace OpenSim.Region.Environment.Scenes
List avatars = m_parentGroup.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
- avatars[i].QueuePartForUpdate(this);
+ avatars[i].QueuePartForUpdate(this);
}
}
@@ -774,13 +769,13 @@ namespace OpenSim.Region.Environment.Scenes
List avatars = m_parentGroup.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
- avatars[i].QueuePartForUpdate(this);
+ avatars[i].QueuePartForUpdate(this);
}
}
public void AddTerseUpdateToAvatar(ScenePresence presence)
{
- presence.QueuePartForUpdate(this);
+ presence.QueuePartForUpdate(this);
}
///
@@ -927,4 +922,4 @@ namespace OpenSim.Region.Environment.Scenes
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs
index 8ed4e87..f43a9fc 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Scenes
public void LoadAnims()
{
//OpenSim.Framework.Console.MainLog.Instance.Verbose("Avatar.cs:LoadAnims() - Loading avatar animations");
- using( XmlTextReader reader = new XmlTextReader("data/avataranimations.xml") )
+ using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
{
XmlDocument doc = new XmlDocument();
doc.Load(reader);
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 6ed50b7..527eb22 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -30,11 +30,10 @@ using System.Collections.Generic;
using Axiom.Math;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
-using OpenSim.Region.Physics.Manager;
+using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Types;
+using OpenSim.Region.Physics.Manager;
namespace OpenSim.Region.Environment.Scenes
{
@@ -116,18 +115,21 @@ namespace OpenSim.Region.Environment.Scenes
}
private readonly ulong m_regionHandle;
+
public ulong RegionHandle
{
get { return m_regionHandle; }
}
private readonly string m_firstname;
+
public string Firstname
{
get { return m_firstname; }
}
private readonly string m_lastname;
+
public string Lastname
{
get { return m_lastname; }
@@ -210,6 +212,7 @@ namespace OpenSim.Region.Environment.Scenes
}
private bool m_isChildAgent = true;
+
public bool IsChildAgent
{
get { return m_isChildAgent; }
@@ -217,6 +220,7 @@ namespace OpenSim.Region.Environment.Scenes
}
private uint m_parentID = 0;
+
public uint ParentID
{
get { return m_parentID; }
@@ -227,7 +231,8 @@ namespace OpenSim.Region.Environment.Scenes
#region Constructor(s)
- public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, AvatarWearable[] wearables)
+ public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams,
+ AvatarWearable[] wearables)
{
m_scene = world;
m_uuid = client.AgentId;
@@ -309,24 +314,24 @@ namespace OpenSim.Region.Environment.Scenes
if (update.LastFullUpdateTime < part.TimeStampFull)
{
//need to do a full update
- part.SendFullUpdate(this.ControllingClient);
- update.LastFullUpdateTime = (uint)Util.UnixTimeSinceEpoch();
+ part.SendFullUpdate(ControllingClient);
+ update.LastFullUpdateTime = (uint) Util.UnixTimeSinceEpoch();
updateCount++;
}
else if (update.LastTerseUpdateTime < part.TimeStampTerse)
{
- part.SendTerseUpdate(this.ControllingClient);
- update.LastTerseUpdateTime = (uint)Util.UnixTimeSinceEpoch();
+ part.SendTerseUpdate(ControllingClient);
+ update.LastTerseUpdateTime = (uint) Util.UnixTimeSinceEpoch();
updateCount++;
}
}
else
{
//never been sent to client before so do full update
- part.SendFullUpdate(this.ControllingClient);
+ part.SendFullUpdate(ControllingClient);
ScenePartUpdate update = new ScenePartUpdate();
update.FullID = part.UUID;
- update.LastFullUpdateTime = (uint)Util.UnixTimeSinceEpoch();
+ update.LastFullUpdateTime = (uint) Util.UnixTimeSinceEpoch();
m_updateTimes.Add(part.UUID, update);
updateCount++;
}
@@ -339,7 +344,6 @@ namespace OpenSim.Region.Environment.Scenes
}
}
-
#region Status Methods
public void MakeRootAgent(LLVector3 pos, bool isFlying)
@@ -368,10 +372,10 @@ namespace OpenSim.Region.Environment.Scenes
private void RemoveFromPhysicalScene()
{
- if (this.PhysicsActor != null)
+ if (PhysicsActor != null)
{
- m_scene.PhysScene.RemoveAvatar(this.PhysicsActor);
- this.PhysicsActor = null;
+ m_scene.PhysScene.RemoveAvatar(PhysicsActor);
+ PhysicsActor = null;
}
}
@@ -432,7 +436,7 @@ namespace OpenSim.Region.Environment.Scenes
m_isChildAgent = false;
//this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
- this.MakeRootAgent(this.AbsolutePosition, false);
+ MakeRootAgent(AbsolutePosition, false);
}
}
@@ -457,13 +461,13 @@ namespace OpenSim.Region.Environment.Scenes
Vector3 agent_control_v3 = new Vector3(0, 0, 0);
Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
bool oldflying = PhysicsActor.Flying;
- PhysicsActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0);
+ PhysicsActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0);
if (PhysicsActor.Flying != oldflying)
{
update_movementflag = true;
}
- if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
+ if ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
{
StandUp();
update_movementflag = true;
@@ -477,23 +481,23 @@ namespace OpenSim.Region.Environment.Scenes
if (m_parentID == 0)
{
- foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof(Dir_ControlFlags)))
+ foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags)))
{
- if ((flags & (uint)DCF) != 0)
+ if ((flags & (uint) DCF) != 0)
{
DCFlagKeyPressed = true;
agent_control_v3 += Dir_Vectors[i];
- if ((m_movementflag & (uint)DCF) == 0)
+ if ((m_movementflag & (uint) DCF) == 0)
{
- m_movementflag += (byte)(uint)DCF;
+ m_movementflag += (byte) (uint) DCF;
update_movementflag = true;
}
}
else
{
- if ((m_movementflag & (uint)DCF) != 0)
+ if ((m_movementflag & (uint) DCF) != 0)
{
- m_movementflag -= (byte)(uint)DCF;
+ m_movementflag -= (byte) (uint) DCF;
update_movementflag = true;
}
}
@@ -580,10 +584,10 @@ namespace OpenSim.Region.Environment.Scenes
}
NewForce newVelocity = new NewForce();
- Vector3 direc = rotation * vec;
+ Vector3 direc = rotation*vec;
direc.Normalize();
- direc = direc * ((0.03f) * 128f);
+ direc = direc*((0.03f)*128f);
if (m_physicsActor.Flying)
direc *= 4;
@@ -692,8 +696,6 @@ namespace OpenSim.Region.Environment.Scenes
}
-
-
///
///
///
@@ -701,7 +703,8 @@ namespace OpenSim.Region.Environment.Scenes
public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
{
remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid,
- LocalId, AbsolutePosition, m_textureEntry.ToBytes(), m_parentID);
+ LocalId, AbsolutePosition, m_textureEntry.ToBytes(),
+ m_parentID);
}
public void SendFullUpdateToAllClients()
@@ -784,7 +787,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
{
avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, m_visualParams,
- m_textureEntry.ToBytes());
+ m_textureEntry.ToBytes());
}
///
@@ -798,10 +801,7 @@ namespace OpenSim.Region.Environment.Scenes
AnimationSeq = seq;
LLUUID sourceAgentId = m_controllingClient.AgentId;
- m_scene.Broadcast(delegate(IClientAPI client)
- {
- client.SendAnimation(animID, seq, sourceAgentId);
- });
+ m_scene.Broadcast(delegate(IClientAPI client) { client.SendAnimation(animID, seq, sourceAgentId); });
}
///
@@ -842,9 +842,9 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 vel = Velocity;
float timeStep = 0.1f;
- pos2.X = pos2.X + (vel.X * timeStep);
- pos2.Y = pos2.Y + (vel.Y * timeStep);
- pos2.Z = pos2.Z + (vel.Z * timeStep);
+ pos2.X = pos2.X + (vel.X*timeStep);
+ pos2.Y = pos2.Y + (vel.Y*timeStep);
+ pos2.Z = pos2.Z + (vel.Z*timeStep);
if ((pos2.X < 0) || (pos2.X > 256))
{
@@ -889,7 +889,7 @@ namespace OpenSim.Region.Environment.Scenes
}
LLVector3 vel = m_velocity;
- ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury * 256));
+ ulong neighbourHandle = Helpers.UIntsToLong((uint) (neighbourx*256), (uint) (neighboury*256));
RegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
if (neighbourRegion != null)
{
@@ -901,7 +901,7 @@ namespace OpenSim.Region.Environment.Scenes
AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
string capsPath = Util.GetCapsURL(m_controllingClient.AgentId);
m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint,
- capsPath);
+ capsPath);
MakeChildAgent();
m_scene.SendKillObject(m_localId);
m_scene.NotifyMyCoarseLocationChange();
@@ -980,7 +980,6 @@ namespace OpenSim.Region.Environment.Scenes
LastFullUpdateTime = 0;
LastTerseUpdateTime = 0;
}
-
}
@@ -997,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes
new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
AbsolutePosition.Z);
- m_physicsActor = scene.AddAvatar(this.Firstname + "." + this.Lastname, pVec);
+ m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec);
}
internal void Close()
@@ -1008,7 +1007,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetWearable(int wearableId, AvatarWearable wearable)
{
m_wearables[wearableId] = wearable;
- SendOurAppearance( m_controllingClient );
+ SendOurAppearance(m_controllingClient);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs
index 01c1d65..cb000c4 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs
@@ -43,4 +43,4 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
LLVector3 AbsolutePosition { get; }
void SetText(string text, Vector3 color, double alpha);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs
index 2fb3e78..c1bf72b 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs
@@ -85,4 +85,4 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/StorageManager.cs b/OpenSim/Region/Environment/StorageManager.cs
index 42048ea..11f0ce0 100644
--- a/OpenSim/Region/Environment/StorageManager.cs
+++ b/OpenSim/Region/Environment/StorageManager.cs
@@ -78,4 +78,4 @@ namespace OpenSim.Region.Environment
//TODO: Add checking and warning to make sure it initialised.
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Types/BasicQuadTreeNode.cs b/OpenSim/Region/Environment/Types/BasicQuadTreeNode.cs
index 942ec4d..70b957e 100644
--- a/OpenSim/Region/Environment/Types/BasicQuadTreeNode.cs
+++ b/OpenSim/Region/Environment/Types/BasicQuadTreeNode.cs
@@ -44,7 +44,8 @@ namespace OpenSim.Region.Environment.Types
//private int m_quadNumber;
private string m_quadID;
- public BasicQuadTreeNode(BasicQuadTreeNode parent, string quadID, short leftX, short leftY, short width, short height)
+ public BasicQuadTreeNode(BasicQuadTreeNode parent, string quadID, short leftX, short leftY, short width,
+ short height)
{
m_parent = parent;
m_quadID = quadID;
@@ -66,9 +67,9 @@ namespace OpenSim.Region.Environment.Types
}
else
{
- if (obj.AbsolutePosition.X < (m_leftX + (m_width / 2)))
+ if (obj.AbsolutePosition.X < (m_leftX + (m_width/2)))
{
- if (obj.AbsolutePosition.Y < (m_leftY + (m_height / 2)))
+ if (obj.AbsolutePosition.Y < (m_leftY + (m_height/2)))
{
m_childNodes[0].AddObject(obj);
}
@@ -79,7 +80,7 @@ namespace OpenSim.Region.Environment.Types
}
else
{
- if (obj.AbsolutePosition.Y < (m_leftY + (m_height / 2)))
+ if (obj.AbsolutePosition.Y < (m_leftY + (m_height/2)))
{
m_childNodes[1].AddObject(obj);
}
@@ -96,10 +97,18 @@ namespace OpenSim.Region.Environment.Types
if (m_childNodes == null)
{
m_childNodes = new BasicQuadTreeNode[4];
- m_childNodes[0] = new BasicQuadTreeNode(this, m_quadID + "1/", m_leftX, m_leftY, (short)(m_width / 2), (short)(m_height / 2));
- m_childNodes[1] = new BasicQuadTreeNode(this, m_quadID + "2/", (short)(m_leftX + (m_width / 2)), m_leftY, (short)(m_width / 2), (short)(m_height / 2));
- m_childNodes[2] = new BasicQuadTreeNode(this, m_quadID + "3/", m_leftX, (short)(m_leftY + (m_height / 2)), (short)(m_width / 2), (short)(m_height / 2));
- m_childNodes[3] = new BasicQuadTreeNode(this, m_quadID + "4/", (short)(m_leftX + (m_width / 2)), (short)(m_height + (m_height / 2)), (short)(m_width / 2), (short)(m_height / 2));
+ m_childNodes[0] =
+ new BasicQuadTreeNode(this, m_quadID + "1/", m_leftX, m_leftY, (short) (m_width/2),
+ (short) (m_height/2));
+ m_childNodes[1] =
+ new BasicQuadTreeNode(this, m_quadID + "2/", (short) (m_leftX + (m_width/2)), m_leftY,
+ (short) (m_width/2), (short) (m_height/2));
+ m_childNodes[2] =
+ new BasicQuadTreeNode(this, m_quadID + "3/", m_leftX, (short) (m_leftY + (m_height/2)),
+ (short) (m_width/2), (short) (m_height/2));
+ m_childNodes[3] =
+ new BasicQuadTreeNode(this, m_quadID + "4/", (short) (m_leftX + (m_width/2)),
+ (short) (m_height + (m_height/2)), (short) (m_width/2), (short) (m_height/2));
}
else
{
@@ -118,9 +127,9 @@ namespace OpenSim.Region.Environment.Types
}
else
{
- if (x < m_leftX + (m_width / 2))
+ if (x < m_leftX + (m_width/2))
{
- if (y < m_leftY + (m_height / 2))
+ if (y < m_leftY + (m_height/2))
{
return m_childNodes[0].GetObjectsFrom(x, y);
}
@@ -131,7 +140,7 @@ namespace OpenSim.Region.Environment.Types
}
else
{
- if (y < m_leftY + (m_height / 2))
+ if (y < m_leftY + (m_height/2))
{
return m_childNodes[1].GetObjectsFrom(x, y);
}
@@ -172,9 +181,9 @@ namespace OpenSim.Region.Environment.Types
}
else
{
- if (x < m_leftX + (m_width / 2))
+ if (x < m_leftX + (m_width/2))
{
- if (y < m_leftY + (m_height / 2))
+ if (y < m_leftY + (m_height/2))
{
return m_childNodes[0].GetNodeID(x, y);
}
@@ -185,7 +194,7 @@ namespace OpenSim.Region.Environment.Types
}
else
{
- if (y < m_leftY + (m_height / 2))
+ if (y < m_leftY + (m_height/2))
{
return m_childNodes[1].GetNodeID(x, y);
}
@@ -211,7 +220,8 @@ namespace OpenSim.Region.Environment.Types
List outBounds = new List();
foreach (SceneObjectGroup group in m_objects)
{
- if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) && ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
+ if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) &&
+ ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
{
//still in bounds
}
@@ -235,7 +245,8 @@ namespace OpenSim.Region.Environment.Types
public void PassUp(SceneObjectGroup group)
{
- if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) && ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
+ if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) &&
+ ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
{
AddObject(group);
}
@@ -255,4 +266,4 @@ namespace OpenSim.Region.Environment.Types
return retVal;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Types/UpdateQueue.cs b/OpenSim/Region/Environment/Types/UpdateQueue.cs
index 442e9d5..0648476 100644
--- a/OpenSim/Region/Environment/Types/UpdateQueue.cs
+++ b/OpenSim/Region/Environment/Types/UpdateQueue.cs
@@ -76,4 +76,4 @@ namespace OpenSim.Region.Environment.Types
return part;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
index f5a080f..bfd9d06 100644
--- a/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
+++ b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
@@ -26,60 +26,69 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Region.Environment.Scenes;
-using Axiom.Math;
using libsecondlife;
using OpenSim.Framework;
-using OpenSim.Framework.Interfaces;
+using OpenSim.Region.Environment.Scenes;
namespace SimpleApp
{
public class ComplexObject : SceneObjectGroup
{
private LLQuaternion m_rotationDirection;
-
+
private class RotatingWheel : SceneObjectPart
{
private LLQuaternion m_rotationDirection;
- public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection)
- : base(regionHandle, parent, ownerID, localID, new CylinderShape( 0.5f, 0.2f ), groupPosition, offsetPosition )
+ public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID,
+ LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection)
+ : base(
+ regionHandle, parent, ownerID, localID, new CylinderShape(0.5f, 0.2f), groupPosition, offsetPosition
+ )
{
- m_rotationDirection = rotationDirection;
+ m_rotationDirection = rotationDirection;
}
public override void UpdateMovement()
{
- UpdateRotation(RotationOffset * m_rotationDirection);
+ UpdateRotation(RotationOffset*m_rotationDirection);
}
}
public override void UpdateMovement()
{
- UpdateGroupRotation(GroupRotation * m_rotationDirection);
-
+ UpdateGroupRotation(GroupRotation*m_rotationDirection);
+
base.UpdateMovement();
}
-
-
- public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos )
- : base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default )
+
+ public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos)
+ : base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default)
{
m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f);
- AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 0.75f), new LLQuaternion(0.05f,0,0)));
- AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -0.75f), new LLQuaternion(-0.05f,0,0)));
+ AddPart(
+ new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 0.75f),
+ new LLQuaternion(0.05f, 0, 0)));
+ AddPart(
+ new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -0.75f),
+ new LLQuaternion(-0.05f, 0, 0)));
+
+ AddPart(
+ new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0.75f, 0),
+ new LLQuaternion(0.5f, 0, 0.05f)));
+ AddPart(
+ new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, -0.75f, 0),
+ new LLQuaternion(-0.5f, 0, -0.05f)));
- AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0.75f,0), new LLQuaternion(0.5f, 0, 0.05f)));
- AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, -0.75f,0), new LLQuaternion(-0.5f, 0, -0.05f)));
+ AddPart(
+ new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0.75f, 0, 0),
+ new LLQuaternion(0, 0.5f, 0.05f)));
+ AddPart(
+ new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(-0.75f, 0, 0),
+ new LLQuaternion(0, -0.5f, -0.05f)));
- AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0.75f, 0, 0), new LLQuaternion(0, 0.5f, 0.05f)));
- AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(-0.75f, 0, 0), new LLQuaternion(0, -0.5f, -0.05f)));
-
UpdateParentIDs();
}
@@ -88,12 +97,12 @@ namespace SimpleApp
m_parts.Remove(part.UUID);
remoteClient.SendKillObject(m_regionHandle, part.LocalID);
remoteClient.AddMoney(1);
- remoteClient.SendChatMessage("Poof!", 1, this.AbsolutePosition, "Party Party", LLUUID.Zero);
+ remoteClient.SendChatMessage("Poof!", 1, AbsolutePosition, "Party Party", LLUUID.Zero);
}
- public override void OnGrabGroup( LLVector3 offsetPos, IClientAPI remoteClient)
+ public override void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient)
{
- if( m_parts.Count == 1 )
+ if (m_parts.Count == 1)
{
m_parts.Remove(m_rootPart.UUID);
m_scene.RemoveEntity(this);
@@ -103,4 +112,4 @@ namespace SimpleApp
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs
index 0f833ea..cbc4dea 100644
--- a/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs
+++ b/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs
@@ -27,37 +27,34 @@
*/
using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Region.Environment.Scenes;
+using System.Diagnostics;
using libsecondlife;
using OpenSim.Framework;
-using System.Timers;
-using System.Diagnostics;
+using OpenSim.Region.Environment.Scenes;
namespace SimpleApp
{
public class CpuCounterObject : SceneObjectGroup
{
private PerformanceCounter m_counter;
-
- public CpuCounterObject(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos )
- : base(world, regionHandle, ownerID, localID, pos, BoxShape.Default )
+
+ public CpuCounterObject(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos)
+ : base(world, regionHandle, ownerID, localID, pos, BoxShape.Default)
{
String objectName = "Processor";
String counterName = "% Processor Time";
String instanceName = "_Total";
-
+
m_counter = new PerformanceCounter(objectName, counterName, instanceName);
}
- public override void UpdateMovement( )
+ public override void UpdateMovement()
{
- float cpu = m_counter.NextValue() / 40f;
- LLVector3 size = new LLVector3(cpu, cpu, cpu);
+ float cpu = m_counter.NextValue()/40f;
+ LLVector3 size = new LLVector3(cpu, cpu, cpu);
//rootPrimitive.ResizeGoup( size );
-
+
base.UpdateMovement();
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs b/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs
index 746340f..7b1420b 100644
--- a/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs
+++ b/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs
@@ -27,14 +27,10 @@
*/
using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Region.Environment.Scenes;
+using System.IO;
using libsecondlife;
using OpenSim.Framework;
-using System.Timers;
-using System.Diagnostics;
-using System.IO;
+using OpenSim.Region.Environment.Scenes;
namespace SimpleApp
{
@@ -43,9 +39,7 @@ namespace SimpleApp
public FileSystemObject(Scene world, FileInfo fileInfo, LLVector3 pos)
: base(world, world.RegionInfo.RegionHandle, LLUUID.Zero, world.NextLocalId, pos, BoxShape.Default)
{
-
-
- float size = (float)Math.Pow((double)fileInfo.Length, (double)1 / 3) / 5;
+ float size = (float) Math.Pow((double) fileInfo.Length, (double) 1/3)/5;
// rootPrimitive.ResizeGoup(new LLVector3(size, size, size));
Text = fileInfo.Name;
ScheduleGroupForFullUpdate();
@@ -56,4 +50,4 @@ namespace SimpleApp
base.Update();
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 03e0f98..f7fdbb5 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -26,16 +26,14 @@
*
*/
+using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Framework;
using OpenSim.Framework;
using OpenSim.Region.Environment.Scenes;
-using System;
namespace SimpleApp
{
@@ -126,13 +124,15 @@ namespace SimpleApp
#pragma warning restore 67
private LLUUID myID = LLUUID.Random();
- public MyNpcCharacter( EventManager eventManager )
+
+ public MyNpcCharacter(EventManager eventManager)
{
- // startPos = new LLVector3(128, (float)(Util.RandomClass.NextDouble()*100), 2);
+ // startPos = new LLVector3(128, (float)(Util.RandomClass.NextDouble()*100), 2);
eventManager.OnFrame += Update;
}
- private LLVector3 startPos = new LLVector3(128, 128,2);
+ private LLVector3 startPos = new LLVector3(128, 128, 2);
+
public virtual LLVector3 StartPos
{
get { return startPos; }
@@ -155,92 +155,218 @@ namespace SimpleApp
}
private string lastName = "NPC" + Util.RandomClass.Next(1, 1000);
+
public virtual string LastName
{
get { return lastName; }
}
- public virtual void OutPacket(Packet newPack) { }
- public virtual void SendWearables(AvatarWearable[] wearables) { }
- public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) { }
- public virtual void SendStartPingCheck(byte seq) { }
- public virtual void SendKillObject(ulong regionHandle, uint localID) { }
- public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) { }
- public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) { }
- public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) { }
- public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) { }
- public virtual void SendLayerData(float[] map) { }
- public virtual void SendLayerData(int px, int py, float[] map) { }
- public virtual void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) { }
- public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) { }
- public virtual AgentCircuitData RequestClientInfo() { return new AgentCircuitData(); }
- public virtual void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL) { }
- public virtual void SendMapBlock(List mapBlocks) { }
- public virtual void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) { }
- public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL) { }
- public virtual void SendTeleportCancel() { }
- public virtual void SendTeleportLocationStart() { }
- public virtual void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) { }
-
- public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID) { }
- public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity, LLQuaternion rotation) { }
- public virtual void SendCoarseLocationUpdate(List CoarseLocations) { }
-
- public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) { }
-
- public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem, LLQuaternion rotation) { }
- public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation) { }
-
- public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items) { }
- public virtual void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) { }
- public virtual void SendInventoryItemUpdate(InventoryItemBase Item) { }
- public virtual void SendRemoveInventoryItem(LLUUID itemID) { }
- public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) { }
- public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) { }
-
- public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname) { }
-
- public virtual void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID) { }
- public virtual void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags) { }
-
- public void SendAlertMessage(string message) { }
- public void SendAgentAlertMessage(string message, bool modal) { }
- public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url) { }
+ public virtual void OutPacket(Packet newPack)
+ {
+ }
+
+ public virtual void SendWearables(AvatarWearable[] wearables)
+ {
+ }
+
+ public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry)
+ {
+ }
+
+ public virtual void SendStartPingCheck(byte seq)
+ {
+ }
+
+ public virtual void SendKillObject(ulong regionHandle, uint localID)
+ {
+ }
+
+ public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId)
+ {
+ }
+
+ public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName,
+ LLUUID fromAgentID)
+ {
+ }
+
+ public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName,
+ LLUUID fromAgentID)
+ {
+ }
+
+ public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent,
+ LLUUID imSessionID, string fromName, byte dialog, uint timeStamp)
+ {
+ }
+
+ public virtual void SendLayerData(float[] map)
+ {
+ }
+
+ public virtual void SendLayerData(int px, int py, float[] map)
+ {
+ }
+
+ public virtual void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look)
+ {
+ }
+
+ public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint)
+ {
+ }
+
+ public virtual AgentCircuitData RequestClientInfo()
+ {
+ return new AgentCircuitData();
+ }
+
+ public virtual void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt,
+ IPEndPoint newRegionExternalEndPoint, string capsURL)
+ {
+ }
+
+ public virtual void SendMapBlock(List mapBlocks)
+ {
+ }
+
+ public virtual void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags)
+ {
+ }
+
+ public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint,
+ uint locationID, uint flags, string capsURL)
+ {
+ }
+
+ public virtual void SendTeleportCancel()
+ {
+ }
+
+ public virtual void SendTeleportLocationStart()
+ {
+ }
+
+ public virtual void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance)
+ {
+ }
+
+ public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID,
+ uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID)
+ {
+ }
+
+ public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID,
+ LLVector3 position, LLVector3 velocity, LLQuaternion rotation)
+ {
+ }
+
+ public virtual void SendCoarseLocationUpdate(List CoarseLocations)
+ {
+ }
+
+ public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint)
+ {
+ }
+
+ public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID,
+ PrimitiveBaseShape primShape, LLVector3 pos, uint flags,
+ LLUUID objectID, LLUUID ownerID, string text, uint parentID,
+ byte[] particleSystem, LLQuaternion rotation)
+ {
+ }
+
+ public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID,
+ LLVector3 position, LLQuaternion rotation)
+ {
+ }
+
+ public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items)
+ {
+ }
+
+ public virtual void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item)
+ {
+ }
+
+ public virtual void SendInventoryItemUpdate(InventoryItemBase Item)
+ {
+ }
+
+ public virtual void SendRemoveInventoryItem(LLUUID itemID)
+ {
+ }
+
+ public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName)
+ {
+ }
+
+ public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data)
+ {
+ }
+
+ public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname)
+ {
+ }
+
+ public virtual void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID)
+ {
+ }
+
+ public virtual void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain,
+ byte flags)
+ {
+ }
+
+ public void SendAlertMessage(string message)
+ {
+ }
+
+ public void SendAgentAlertMessage(string message, bool modal)
+ {
+ }
+
+ public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message,
+ string url)
+ {
+ }
public virtual void SendRegionHandshake(RegionInfo regionInfo)
{
if (OnRegionHandShakeReply != null)
{
- this.OnRegionHandShakeReply(this);
+ OnRegionHandShakeReply(this);
}
if (OnCompleteMovementToRegion != null)
{
- this.OnCompleteMovementToRegion();
+ OnCompleteMovementToRegion();
}
}
- private void Update( )
+ private void Update()
{
Encoding enc = Encoding.ASCII;
- if (this.OnAgentUpdate != null)
+ if (OnAgentUpdate != null)
{
- this.OnAgentUpdate(this, movementFlag, bodyDirection);
+ OnAgentUpdate(this, movementFlag, bodyDirection);
}
- if (this.flyState == 0)
+ if (flyState == 0)
{
- movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG;
+ movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY |
+ (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG;
flyState = 1;
}
- else if (this.flyState == 1)
+ else if (flyState == 1)
{
- movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS;
+ movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY |
+ (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS;
flyState = 2;
}
else
{
- movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY;
+ movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY;
flyState = 0;
}
@@ -251,15 +377,14 @@ namespace SimpleApp
ChatFromViewerArgs args = new ChatFromViewerArgs();
args.Message = "Kinda quiet around here, isn't it?";
args.Channel = 0;
- args.From = this.FirstName + " " + this.LastName;
+ args.From = FirstName + " " + LastName;
args.Position = new LLVector3(128, 128, 26);
args.Sender = this;
args.Type = ChatTypeEnum.Shout;
- this.OnChatFromViewer(this, args);
+ OnChatFromViewer(this, args);
}
count = -1;
-
}
count++;
@@ -270,9 +395,19 @@ namespace SimpleApp
return false;
}
- public void SendViewerTime(int phase) { }
- public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID) { }
- public void SetDebug(int newDebug) { }
+ public void SendViewerTime(int phase)
+ {
+ }
+
+ public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember,
+ string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL,
+ LLUUID partnerID)
+ {
+ }
+
+ public void SetDebug(int newDebug)
+ {
+ }
public void InPacket(Packet NewPack)
{
@@ -281,22 +416,17 @@ namespace SimpleApp
public void Close()
{
}
-
+
private uint m_circuitCode;
+
public uint CircuitCode
{
- get
- {
- return m_circuitCode;
- }
- set
- {
- m_circuitCode = value;
- }
+ get { return m_circuitCode; }
+ set { m_circuitCode = value; }
}
public void SendLogoutPacket()
{
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
index 9a7b340..c616f6a 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
@@ -31,13 +31,9 @@ using libsecondlife;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Servers;
-using OpenSim.Framework;
-
-using OpenSim.Region.Environment.Scenes;
-using OpenSim.Region.Terrain;
using OpenSim.Region.Environment;
+using OpenSim.Region.Environment.Scenes;
using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence;
namespace SimpleApp
@@ -46,8 +42,10 @@ namespace SimpleApp
{
private List m_avatars;
- public MyWorld( RegionInfo regionInfo, AgentCircuitManager authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer, ModuleLoader moduleLoader)
- : base( regionInfo, authen, commsMan, assetCach, storeMan, httpServer, moduleLoader, false)
+ public MyWorld(RegionInfo regionInfo, AgentCircuitManager authen, CommunicationsManager commsMan,
+ AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer,
+ ModuleLoader moduleLoader)
+ : base(regionInfo, authen, commsMan, assetCach, storeMan, httpServer, moduleLoader, false)
{
m_avatars = new List();
}
@@ -58,32 +56,30 @@ namespace SimpleApp
for (int i = 0; i < 65536; i++)
{
- int x = i % 256;
- int y = i / 256;
+ int x = i%256;
+ int y = i/256;
map[i] = 25f;
}
- this.Terrain.GetHeights1D(map);
- this.CreateTerrainTexture();
+ Terrain.GetHeights1D(map);
+ CreateTerrainTexture();
}
- override public void AddNewClient(IClientAPI client, bool child)
+ public override void AddNewClient(IClientAPI client, bool child)
{
SubscribeToClientEvents(client);
- ScenePresence avatar = CreateAndAddScenePresence(client, child );
+ ScenePresence avatar = CreateAndAddScenePresence(client, child);
avatar.AbsolutePosition = new LLVector3(128, 128, 26);
LLVector3 pos = new LLVector3(128, 128, 128);
- client.OnCompleteMovementToRegion += delegate()
- {
- client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero );
- };
+ client.OnCompleteMovementToRegion +=
+ delegate() { client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero); };
client.SendRegionHandshake(m_regInfo);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 72aaf6b..b37c2ee 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -31,23 +31,23 @@ using System.Collections.Generic;
using System.IO;
using System.Net;
using libsecondlife;
+using Nini.Config;
+using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
-using OpenSim.Framework;
using OpenSim.Region.ClientStack;
using OpenSim.Region.Communications.Local;
using OpenSim.Region.Environment;
using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Physics.Manager;
-using Nini.Config;
namespace SimpleApp
{
- class Program : RegionApplicationBase, conscmd_callback
+ internal class Program : RegionApplicationBase, conscmd_callback
{
private ModuleLoader m_moduleLoader;
private IConfigSource m_config;
-
+
protected override LogBase CreateLog()
{
return new LogBase(null, "SimpleApp", this, true);
@@ -57,45 +57,51 @@ namespace SimpleApp
{
StartLog();
- m_networkServersInfo = new NetworkServersInfo( 1000, 1000 );
+ m_networkServersInfo = new NetworkServersInfo(1000, 1000);
LocalAssetServer assetServer = new LocalAssetServer();
m_assetCache = new AssetCache(assetServer);
}
-
+
public void Run()
{
base.StartUp();
-
+
LocalInventoryService inventoryService = new LocalInventoryService();
- LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService);
+ LocalUserServices userService =
+ new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX,
+ m_networkServersInfo.DefaultHomeLocY, inventoryService);
LocalBackEndServices backendService = new LocalBackEndServices();
- CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService, false);
+ CommunicationsLocal localComms =
+ new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService,
+ backendService, backendService, false);
m_commsManager = localComms;
- LocalLoginService loginService = new LocalLoginService(userService, "", localComms, m_networkServersInfo, false);
+ LocalLoginService loginService =
+ new LocalLoginService(userService, "", localComms, m_networkServersInfo, false);
loginService.OnLoginToRegion += backendService.AddNewSession;
m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod);
m_log.Notice(m_log.LineInfo);
-
- IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), m_networkServersInfo.HttpListenerPort);
+
+ IPEndPoint internalEndPoint =
+ new IPEndPoint(IPAddress.Parse("127.0.0.1"), m_networkServersInfo.HttpListenerPort);
RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost");
regionInfo.DataStore = "simpleapp_datastore.yap";
-
+
UDPServer udpServer;
- m_moduleLoader = new ModuleLoader( m_log, m_config );
+ m_moduleLoader = new ModuleLoader(m_log, m_config);
m_moduleLoader.LoadDefaultSharedModules();
Scene scene = SetupScene(regionInfo, out udpServer);
m_moduleLoader.InitialiseSharedModules(scene);
-
+
scene.SetModuleInterfaces();
scene.StartTimer();
@@ -104,18 +110,22 @@ namespace SimpleApp
m_moduleLoader.PostInitialise();
m_moduleLoader.ClearCache();
-
+
udpServer.ServerListener();
-
+
LLVector3 pos = new LLVector3(110, 129, 27);
- SceneObjectGroup sceneObject = new CpuCounterObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(), pos + new LLVector3( 1f, 1f, 1f ));
+ SceneObjectGroup sceneObject =
+ new CpuCounterObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(),
+ pos + new LLVector3(1f, 1f, 1f));
scene.AddEntity(sceneObject);
for (int i = 0; i < 27; i++)
{
- LLVector3 posOffset = new LLVector3( (i%3)*4, (i%9)/3 * 4, (i/9) * 4 );
- ComplexObject complexObject = new ComplexObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(), pos + posOffset );
+ LLVector3 posOffset = new LLVector3((i%3)*4, (i%9)/3*4, (i/9)*4);
+ ComplexObject complexObject =
+ new ComplexObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(),
+ pos + posOffset);
scene.AddEntity(complexObject);
}
@@ -128,45 +138,48 @@ namespace SimpleApp
List avatars = scene.GetAvatars();
foreach (ScenePresence avatar in avatars)
{
- avatar.AbsolutePosition = new LLVector3((float)OpenSim.Framework.Util.RandomClass.Next(100,200), (float)OpenSim.Framework.Util.RandomClass.Next(30, 200), 2);
+ avatar.AbsolutePosition =
+ new LLVector3((float) Util.RandomClass.Next(100, 200), (float) Util.RandomClass.Next(30, 200), 2);
}
-
-
- DirectoryInfo dirInfo = new DirectoryInfo( "." );
+
+ DirectoryInfo dirInfo = new DirectoryInfo(".");
float x = 0;
float z = 0;
-
- foreach( FileInfo fileInfo in dirInfo.GetFiles())
+
+ foreach (FileInfo fileInfo in dirInfo.GetFiles())
{
LLVector3 filePos = new LLVector3(100 + x, 129, 27 + z);
x = x + 2;
- if( x > 50 )
+ if (x > 50)
{
x = 0;
z = z + 2;
}
-
- FileSystemObject fileObject = new FileSystemObject( scene, fileInfo, filePos );
+
+ FileSystemObject fileObject = new FileSystemObject(scene, fileInfo, filePos);
scene.AddEntity(fileObject);
}
-
+
m_log.Notice("Press enter to quit.");
- m_log.ReadLine();
+ m_log.ReadLine();
}
- protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager)
+ protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
+ AgentCircuitManager circuitManager)
{
- return new MyWorld(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer, new ModuleLoader( m_log, m_config ));
+ return
+ new MyWorld(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer,
+ new ModuleLoader(m_log, m_config));
}
protected override StorageManager CreateStorageManager(RegionInfo regionInfo)
{
return new StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp");
}
-
- protected override PhysicsScene GetPhysicsScene( )
+
+ protected override PhysicsScene GetPhysicsScene()
{
return GetPhysicsScene("basicphysics");
}
@@ -185,11 +198,11 @@ namespace SimpleApp
#endregion
- static void Main(string[] args)
+ private static void Main(string[] args)
{
Program app = new Program();
app.Run();
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Examples/SimpleApp/Properties/AssemblyInfo.cs b/OpenSim/Region/Examples/SimpleApp/Properties/AssemblyInfo.cs
index 2250613..a5c8f05 100644
--- a/OpenSim/Region/Examples/SimpleApp/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Properties/AssemblyInfo.cs
@@ -1,24 +1,28 @@
-using System.Reflection;
+using System.Reflection;
using System.Runtime.InteropServices;
+
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("SimpleApp")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Playahead AB")]
-[assembly: AssemblyProduct("SimpleApp")]
-[assembly: AssemblyCopyright("Copyright © Playahead AB 2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+
+[assembly : AssemblyTitle("SimpleApp")]
+[assembly : AssemblyDescription("")]
+[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyCompany("Playahead AB")]
+[assembly : AssemblyProduct("SimpleApp")]
+[assembly : AssemblyCopyright("Copyright © Playahead AB 2007")]
+[assembly : AssemblyTrademark("")]
+[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
+
+[assembly : ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("a5cfa45f-5acf-4b2e-9c50-1dd1fd7608ee")]
+
+[assembly : Guid("a5cfa45f-5acf-4b2e-9c50-1dd1fd7608ee")]
// Version information for an assembly consists of the following four values:
//
@@ -27,5 +31,6 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly : AssemblyVersion("1.0.0.0")]
+[assembly : AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs
index d4b27fc..176fc7b 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp
return ".cs";
}
- private Dictionary LoadDotNetScript(CodeDomProvider compiler, string filename)
+ private Dictionary LoadDotNetScript(CodeDomProvider compiler, string filename)
{
CompilerParameters compilerParams = new CompilerParameters();
CompilerResults compilerResults;
@@ -66,15 +66,16 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp
}
else
{
- Dictionary scripts = new Dictionary();
-
+ Dictionary scripts = new Dictionary();
+
foreach (Type pluginType in compilerResults.CompiledAssembly.GetExportedTypes())
{
Type testInterface = pluginType.GetInterface("IScript", true);
if (testInterface != null)
{
- IScript script = (IScript)compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString());
+ IScript script =
+ (IScript) compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString());
string scriptName = "C#/" + script.Name;
Console.WriteLine("Script: " + scriptName + " loaded.");
@@ -94,10 +95,10 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp
return null;
}
- public Dictionary compile(string filename)
+ public Dictionary compile(string filename)
{
CSharpCodeProvider csharpProvider = new CSharpCodeProvider();
return LoadDotNetScript(csharpProvider, filename);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs
index 7ae4658..2d684d1 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs
@@ -26,19 +26,13 @@
*
*/
-using OpenSim.Framework.Console;
-using OpenSim.Framework;
-using OpenSim.Region.Environment;
using OpenSim.Region.Environment.Scenes;
-using System.Collections.Generic;
-using libsecondlife;
-
namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
{
public class LSLExportScript : IScript
{
- ScriptInfo script;
+ private ScriptInfo script;
public string Name
{
@@ -48,11 +42,11 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
public void Initialise(ScriptInfo scriptInfo)
{
script = scriptInfo;
-
+
script.events.OnPluginConsole += new EventManager.OnPluginConsoleDelegate(ProcessConsoleMsg);
}
- void ProcessConsoleMsg(string[] args)
+ private void ProcessConsoleMsg(string[] args)
{
/*if (args[0].ToLower() == "lslexport")
{
@@ -79,7 +73,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
}*/
}
- string processPrimitiveToString(OpenSim.Region.Environment.Scenes.SceneObjectPart prim)
+ private string processPrimitiveToString(SceneObjectPart prim)
{
/*string desc = prim.Description;
string name = prim.Name;
@@ -97,4 +91,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
return "";
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JScript/JScriptEngine.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JScript/JScriptEngine.cs
index 4bde721..ea0e92a 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JScript/JScriptEngine.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JScript/JScriptEngine.cs
@@ -74,7 +74,8 @@ namespace OpenSim.Region.ExtensionsScriptModule.JScript
if (testInterface != null)
{
- IScript script = (IScript)compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString());
+ IScript script =
+ (IScript) compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString());
string scriptName = "JS.NET/" + script.Name;
Console.WriteLine("Script: " + scriptName + " loaded.");
@@ -100,4 +101,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.JScript
return LoadDotNetScript(jscriptProvider, filename);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/ClassInstance.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/ClassInstance.cs
index 6100c67..3f09099 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/ClassInstance.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/ClassInstance.cs
@@ -25,9 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
using System.Collections.Generic;
-using System.Text;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
@@ -40,7 +38,6 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public ClassInstance()
{
-
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/ClassRecord.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/ClassRecord.cs
index 5c3629c..3bcc824 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/ClassRecord.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/ClassRecord.cs
@@ -26,9 +26,8 @@
*
*/
using System;
-using System.IO;
using System.Collections.Generic;
-using System.Text;
+using System.IO;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes;
@@ -56,7 +55,6 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public ClassRecord()
{
-
}
public ClassInstance CreateNewInstance()
@@ -72,7 +70,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
Console.WriteLine("loading script " + fileName);
FileStream fs = File.OpenRead(fileName);
- this.LoadClassFromBytes(ReadFully(fs));
+ LoadClassFromBytes(ReadFully(fs));
fs.Close();
}
@@ -80,9 +78,9 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
int i = 0;
i += 4;
- m_minorVersion = (ushort)((data[i++] << 8) + data[i++]);
- m_majorVersion = (ushort)((data[i++] << 8) + data[i++]);
- m_constantPoolCount = (ushort)((data[i++] << 8) + data[i++]);
+ m_minorVersion = (ushort) ((data[i++] << 8) + data[i++]);
+ m_majorVersion = (ushort) ((data[i++] << 8) + data[i++]);
+ m_constantPoolCount = (ushort) ((data[i++] << 8) + data[i++]);
Console.WriteLine("there should be " + m_constantPoolCount + " items in the pool");
for (int count = 0; count < (m_constantPoolCount - 1); count++)
{
@@ -92,13 +90,13 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
//Console.WriteLine("start position is: " + i);
switch (pooltype)
{
- case 1: //Utf8
- ushort uLength = (ushort)((data[i++] << 8) + data[i++]);
+ case 1: //Utf8
+ ushort uLength = (ushort) ((data[i++] << 8) + data[i++]);
// Console.WriteLine("new utf8 type, length is " + uLength);
PoolUtf8 utf8 = new PoolUtf8();
utf8.readValue(data, ref i, uLength);
- this.m_constantsPool.Add(utf8);
+ m_constantsPool.Add(utf8);
break;
case 3: //Int
break;
@@ -107,53 +105,53 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
case 7: //Class
PoolClass pClass = new PoolClass(this);
pClass.readValue(data, ref i);
- this.m_constantsPool.Add(pClass);
+ m_constantsPool.Add(pClass);
break;
case 9: //FieldRef
PoolFieldRef pField = new PoolFieldRef(this);
pField.readValue(data, ref i);
- this.m_constantsPool.Add(pField);
+ m_constantsPool.Add(pField);
break;
case 10: //Method
PoolMethodRef pMeth = new PoolMethodRef(this);
pMeth.readValue(data, ref i);
- this.m_constantsPool.Add(pMeth);
+ m_constantsPool.Add(pMeth);
break;
- case 12: //NamedType
+ case 12: //NamedType
PoolNamedType pNamed = new PoolNamedType(this);
pNamed.readValue(data, ref i);
- this.m_constantsPool.Add(pNamed);
+ m_constantsPool.Add(pNamed);
break;
}
}
- m_accessFlags = (ushort)((data[i++] << 8) + data[i++]);
- m_thisClass = (ushort)((data[i++] << 8) + data[i++]);
- m_supperClass = (ushort)((data[i++] << 8) + data[i++]);
+ m_accessFlags = (ushort) ((data[i++] << 8) + data[i++]);
+ m_thisClass = (ushort) ((data[i++] << 8) + data[i++]);
+ m_supperClass = (ushort) ((data[i++] << 8) + data[i++]);
- if (this.m_constantsPool[this.m_thisClass - 1] is PoolClass)
+ if (m_constantsPool[m_thisClass - 1] is PoolClass)
{
- this.MClass = ((PoolClass)this.m_constantsPool[this.m_thisClass - 1]);
+ MClass = ((PoolClass) m_constantsPool[m_thisClass - 1]);
}
- m_interfaceCount = (ushort)((data[i++] << 8) + data[i++]);
+ m_interfaceCount = (ushort) ((data[i++] << 8) + data[i++]);
//should now read in the info for each interface
- m_fieldCount = (ushort)((data[i++] << 8) + data[i++]);
+ m_fieldCount = (ushort) ((data[i++] << 8) + data[i++]);
//should now read in the info for each field
for (int count = 0; count < m_fieldCount; count++)
{
FieldInfo fieldInf = new FieldInfo(this);
fieldInf.ReadData(data, ref i);
- this.m_fieldList.Add(fieldInf);
+ m_fieldList.Add(fieldInf);
}
- m_methodCount = (ushort)((data[i++] << 8) + data[i++]);
+ m_methodCount = (ushort) ((data[i++] << 8) + data[i++]);
for (int count = 0; count < m_methodCount; count++)
{
MethodInfo methInf = new MethodInfo(this);
methInf.ReadData(data, ref i);
- this.m_methodsList.Add(methInf);
+ m_methodsList.Add(methInf);
}
}
@@ -161,7 +159,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
for (int count = 0; count < m_methodCount; count++)
{
- this.m_methodsList[count].AddMethodCode(memory);
+ m_methodsList[count].AddMethodCode(memory);
}
}
@@ -169,12 +167,12 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
for (int count = 0; count < m_methodCount; count++)
{
- if (this.m_constantsPool[this.m_methodsList[count].NameIndex - 1] is PoolUtf8)
+ if (m_constantsPool[m_methodsList[count].NameIndex - 1] is PoolUtf8)
{
- if (((PoolUtf8)this.m_constantsPool[this.m_methodsList[count].NameIndex - 1]).Value == methodName)
+ if (((PoolUtf8) m_constantsPool[m_methodsList[count].NameIndex - 1]).Value == methodName)
{
//Console.WriteLine("found method: " + ((PoolUtf8)this._constantsPool[this._methodsList[count].NameIndex - 1]).Value);
- thread.SetPC(this.m_methodsList[count].CodePointer);
+ thread.SetPC(m_methodsList[count].CodePointer);
return true;
}
}
@@ -191,7 +189,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
for (int i = 0; i < m_constantsPool.Count; i++)
{
- this.m_constantsPool[i].Print();
+ m_constantsPool[i].Print();
}
Console.WriteLine("Access flags: " + m_accessFlags);
@@ -201,16 +199,16 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
for (int count = 0; count < m_fieldCount; count++)
{
Console.WriteLine();
- this.m_fieldList[count].Print();
+ m_fieldList[count].Print();
}
for (int count = 0; count < m_methodCount; count++)
{
Console.WriteLine();
- this.m_methodsList[count].Print();
+ m_methodsList[count].Print();
}
- Console.WriteLine("class name is " + this.MClass.Name.Value);
+ Console.WriteLine("class name is " + MClass.Name.Value);
}
public static byte[] ReadFully(Stream stream)
@@ -229,11 +227,11 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
}
#region nested classes
+
public class PoolItem
{
public virtual void Print()
{
-
}
}
@@ -245,21 +243,21 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
for (int i = 0; i < length; i++)
{
- int a = (int)data[pointer++];
+ int a = (int) data[pointer++];
if ((a & 0x80) == 0)
{
- Value = Value + (char)a;
+ Value = Value + (char) a;
}
else if ((a & 0x20) == 0)
{
- int b = (int)data[pointer++];
- Value = Value + (char)(((a & 0x1f) << 6) + (b & 0x3f));
+ int b = (int) data[pointer++];
+ Value = Value + (char) (((a & 0x1f) << 6) + (b & 0x3f));
}
else
{
- int b = (int)data[pointer++];
- int c = (int)data[pointer++];
- Value = Value + (char)(((a & 0xf) << 12) + ((b & 0x3f) << 6) + (c & 0x3f));
+ int b = (int) data[pointer++];
+ int c = (int) data[pointer++];
+ Value = Value + (char) (((a & 0xf) << 12) + ((b & 0x3f) << 6) + (c & 0x3f));
}
}
}
@@ -272,7 +270,6 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
private class PoolInt : PoolItem
{
-
}
public class PoolClass : PoolItem
@@ -289,15 +286,14 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void readValue(byte[] data, ref int pointer)
{
- namePointer = (ushort)((data[pointer++] << 8) + data[pointer++]);
+ namePointer = (ushort) ((data[pointer++] << 8) + data[pointer++]);
}
public override void Print()
{
- this.Name = ((PoolUtf8)this.parent.m_constantsPool[namePointer - 1]);
+ Name = ((PoolUtf8) parent.m_constantsPool[namePointer - 1]);
Console.Write("Class type: " + namePointer);
- Console.WriteLine(" // " + ((PoolUtf8)this.parent.m_constantsPool[namePointer - 1]).Value);
-
+ Console.WriteLine(" // " + ((PoolUtf8) parent.m_constantsPool[namePointer - 1]).Value);
}
}
@@ -316,14 +312,14 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void readValue(byte[] data, ref int pointer)
{
- classPointer = (ushort)((data[pointer++] << 8) + data[pointer++]);
- nameTypePointer = (ushort)((data[pointer++] << 8) + data[pointer++]);
+ classPointer = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ nameTypePointer = (ushort) ((data[pointer++] << 8) + data[pointer++]);
}
public override void Print()
{
- this.mNameType = ((PoolNamedType)this.parent.m_constantsPool[nameTypePointer - 1]);
- this.mClass = ((PoolClass)this.parent.m_constantsPool[classPointer - 1]);
+ mNameType = ((PoolNamedType) parent.m_constantsPool[nameTypePointer - 1]);
+ mClass = ((PoolClass) parent.m_constantsPool[classPointer - 1]);
Console.WriteLine("FieldRef type: " + classPointer + " , " + nameTypePointer);
}
}
@@ -343,14 +339,14 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void readValue(byte[] data, ref int pointer)
{
- classPointer = (ushort)((data[pointer++] << 8) + data[pointer++]);
- nameTypePointer = (ushort)((data[pointer++] << 8) + data[pointer++]);
+ classPointer = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ nameTypePointer = (ushort) ((data[pointer++] << 8) + data[pointer++]);
}
public override void Print()
{
- this.mNameType = ((PoolNamedType)this.parent.m_constantsPool[nameTypePointer - 1]);
- this.mClass = ((PoolClass)this.parent.m_constantsPool[classPointer - 1]);
+ mNameType = ((PoolNamedType) parent.m_constantsPool[nameTypePointer - 1]);
+ mClass = ((PoolClass) parent.m_constantsPool[classPointer - 1]);
Console.WriteLine("MethodRef type: " + classPointer + " , " + nameTypePointer);
}
}
@@ -370,16 +366,16 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void readValue(byte[] data, ref int pointer)
{
- namePointer = (ushort)((data[pointer++] << 8) + data[pointer++]);
- typePointer = (ushort)((data[pointer++] << 8) + data[pointer++]);
+ namePointer = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ typePointer = (ushort) ((data[pointer++] << 8) + data[pointer++]);
}
public override void Print()
{
- Name = ((PoolUtf8)this.parent.m_constantsPool[namePointer - 1]);
- Type = ((PoolUtf8)this.parent.m_constantsPool[typePointer - 1]);
+ Name = ((PoolUtf8) parent.m_constantsPool[namePointer - 1]);
+ Type = ((PoolUtf8) parent.m_constantsPool[typePointer - 1]);
Console.Write("Named type: " + namePointer + " , " + typePointer);
- Console.WriteLine(" // " + ((PoolUtf8)this.parent.m_constantsPool[namePointer - 1]).Value);
+ Console.WriteLine(" // " + ((PoolUtf8) parent.m_constantsPool[namePointer - 1]).Value);
}
}
@@ -402,23 +398,23 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void AddMethodCode(MethodMemory memory)
{
- Array.Copy(this.Attributes[0].Code, 0, memory.MethodBuffer, memory.NextMethodPC, this.Attributes[0].Code.Length);
+ Array.Copy(Attributes[0].Code, 0, memory.MethodBuffer, memory.NextMethodPC, Attributes[0].Code.Length);
memory.Methodcount++;
- this.CodePointer = memory.NextMethodPC;
- memory.NextMethodPC += this.Attributes[0].Code.Length;
+ CodePointer = memory.NextMethodPC;
+ memory.NextMethodPC += Attributes[0].Code.Length;
}
public void ReadData(byte[] data, ref int pointer)
{
- AccessFlags = (ushort)((data[pointer++] << 8) + data[pointer++]);
- NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
- DescriptorIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
- AttributeCount = (ushort)((data[pointer++] << 8) + data[pointer++]);
+ AccessFlags = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ NameIndex = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ DescriptorIndex = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ AttributeCount = (ushort) ((data[pointer++] << 8) + data[pointer++]);
for (int i = 0; i < AttributeCount; i++)
{
- MethodAttribute attri = new MethodAttribute(this.parent);
+ MethodAttribute attri = new MethodAttribute(parent);
attri.ReadData(data, ref pointer);
- this.Attributes.Add(attri);
+ Attributes.Add(attri);
}
}
@@ -426,12 +422,14 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
Console.WriteLine("Method Info Struct: ");
Console.WriteLine("AccessFlags: " + AccessFlags);
- Console.WriteLine("NameIndex: " + NameIndex + " // " + ((PoolUtf8)this.parent.m_constantsPool[NameIndex - 1]).Value);
- Console.WriteLine("DescriptorIndex: " + DescriptorIndex + " // " + ((PoolUtf8)this.parent.m_constantsPool[DescriptorIndex - 1]).Value);
+ Console.WriteLine("NameIndex: " + NameIndex + " // " +
+ ((PoolUtf8) parent.m_constantsPool[NameIndex - 1]).Value);
+ Console.WriteLine("DescriptorIndex: " + DescriptorIndex + " // " +
+ ((PoolUtf8) parent.m_constantsPool[DescriptorIndex - 1]).Value);
Console.WriteLine("Attribute Count:" + AttributeCount);
for (int i = 0; i < AttributeCount; i++)
{
- this.Attributes[i].Print();
+ Attributes[i].Print();
}
}
@@ -457,30 +455,35 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void ReadData(byte[] data, ref int pointer)
{
- NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
- Length = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
- MaxStack = (ushort)((data[pointer++] << 8) + data[pointer++]);
- MaxLocals = (ushort)((data[pointer++] << 8) + data[pointer++]);
- CodeLength = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
+ NameIndex = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ Length =
+ (Int32)
+ ((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
+ MaxStack = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ MaxLocals = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ CodeLength =
+ (Int32)
+ ((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
Code = new byte[CodeLength];
for (int i = 0; i < CodeLength; i++)
{
Code[i] = data[pointer++];
}
- ExceptionTableLength = (ushort)((data[pointer++] << 8) + data[pointer++]);
- SubAttributeCount = (ushort)((data[pointer++] << 8) + data[pointer++]);
+ ExceptionTableLength = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ SubAttributeCount = (ushort) ((data[pointer++] << 8) + data[pointer++]);
for (int i = 0; i < SubAttributeCount; i++)
{
- SubAttribute subAttri = new SubAttribute(this.parent);
+ SubAttribute subAttri = new SubAttribute(parent);
subAttri.ReadData(data, ref pointer);
- this.SubAttributes.Add(subAttri);
+ SubAttributes.Add(subAttri);
}
}
public void Print()
{
Console.WriteLine("Method Attribute: ");
- Console.WriteLine("Name Index: " + NameIndex + " // " + ((PoolUtf8)this.parent.m_constantsPool[NameIndex - 1]).Value);
+ Console.WriteLine("Name Index: " + NameIndex + " // " +
+ ((PoolUtf8) parent.m_constantsPool[NameIndex - 1]).Value);
Console.WriteLine("Length: " + Length);
Console.WriteLine("MaxStack: " + MaxStack);
Console.WriteLine("MaxLocals: " + MaxLocals);
@@ -492,7 +495,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
Console.WriteLine("SubAttributes: " + SubAttributeCount);
for (int i = 0; i < SubAttributeCount; i++)
{
- this.SubAttributes[i].Print();
+ SubAttributes[i].Print();
}
}
@@ -511,8 +514,11 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void ReadData(byte[] data, ref int pointer)
{
- NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
- Length = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
+ NameIndex = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ Length =
+ (Int32)
+ ((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) +
+ data[pointer++]);
Data = new byte[Length];
for (int i = 0; i < Length; i++)
{
@@ -522,18 +528,17 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void Print()
{
- Console.WriteLine("SubAttribute: NameIndex: " + NameIndex + " // " + ((PoolUtf8)this.parent.m_constantsPool[NameIndex - 1]).Value);
+ Console.WriteLine("SubAttribute: NameIndex: " + NameIndex + " // " +
+ ((PoolUtf8) parent.m_constantsPool[NameIndex - 1]).Value);
}
-
}
}
-
}
+
private class InterfaceInfo
{
public void ReadData(byte[] data, ref int i)
{
-
}
}
@@ -554,15 +559,15 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void ReadData(byte[] data, ref int pointer)
{
- AccessFlags = (ushort)((data[pointer++] << 8) + data[pointer++]);
- NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
- DescriptorIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
- AttributeCount = (ushort)((data[pointer++] << 8) + data[pointer++]);
+ AccessFlags = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ NameIndex = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ DescriptorIndex = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ AttributeCount = (ushort) ((data[pointer++] << 8) + data[pointer++]);
for (int i = 0; i < AttributeCount; i++)
{
- FieldAttribute attri = new FieldAttribute(this.parent);
+ FieldAttribute attri = new FieldAttribute(parent);
attri.ReadData(data, ref pointer);
- this.Attributes.Add(attri);
+ Attributes.Add(attri);
}
}
@@ -570,29 +575,30 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
Console.WriteLine("Field Info Struct: ");
Console.WriteLine("AccessFlags: " + AccessFlags);
- Console.WriteLine("NameIndex: " + NameIndex + " // " + ((PoolUtf8)this.parent.m_constantsPool[NameIndex - 1]).Value);
- Console.WriteLine("DescriptorIndex: " + DescriptorIndex + " // " + ((PoolUtf8)this.parent.m_constantsPool[DescriptorIndex - 1]).Value);
+ Console.WriteLine("NameIndex: " + NameIndex + " // " +
+ ((PoolUtf8) parent.m_constantsPool[NameIndex - 1]).Value);
+ Console.WriteLine("DescriptorIndex: " + DescriptorIndex + " // " +
+ ((PoolUtf8) parent.m_constantsPool[DescriptorIndex - 1]).Value);
Console.WriteLine("Attribute Count:" + AttributeCount);
//if static, add to static field list
// if (this.AccessFlags == 9) //public and static
- if ((this.AccessFlags & 0x08) != 0)
+ if ((AccessFlags & 0x08) != 0)
{
- switch (((PoolUtf8)this.parent.m_constantsPool[DescriptorIndex - 1]).Value)
+ switch (((PoolUtf8) parent.m_constantsPool[DescriptorIndex - 1]).Value)
{
case "I":
Int newin = new Int();
- this.parent.StaticFields.Add(((PoolUtf8)this.parent.m_constantsPool[NameIndex - 1]).Value, newin);
+ parent.StaticFields.Add(((PoolUtf8) parent.m_constantsPool[NameIndex - 1]).Value, newin);
break;
case "F":
Float newfl = new Float();
- this.parent.StaticFields.Add(((PoolUtf8)this.parent.m_constantsPool[NameIndex - 1]).Value, newfl);
+ parent.StaticFields.Add(((PoolUtf8) parent.m_constantsPool[NameIndex - 1]).Value, newfl);
break;
}
-
}
for (int i = 0; i < AttributeCount; i++)
{
- this.Attributes[i].Print();
+ Attributes[i].Print();
}
}
@@ -611,8 +617,10 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void ReadData(byte[] data, ref int pointer)
{
- NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
- Length = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
+ NameIndex = (ushort) ((data[pointer++] << 8) + data[pointer++]);
+ Length =
+ (Int32)
+ ((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
Data = new byte[Length];
for (int i = 0; i < Length; i++)
{
@@ -622,7 +630,8 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void Print()
{
- Console.WriteLine("FieldAttribute: NameIndex: " + NameIndex + " // " + ((PoolUtf8)this.parent.m_constantsPool[NameIndex - 1]).Value);
+ Console.WriteLine("FieldAttribute: NameIndex: " + NameIndex + " // " +
+ ((PoolUtf8) parent.m_constantsPool[NameIndex - 1]).Value);
}
}
}
@@ -631,10 +640,9 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
public void ReadData(byte[] data, ref int i)
{
-
}
}
- #endregion
+ #endregion
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Heap.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Heap.cs
index c76767a..9876caa 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Heap.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Heap.cs
@@ -25,9 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
using System.Collections.Generic;
-using System.Text;
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
@@ -37,7 +35,6 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public Heap()
{
-
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Logic.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Logic.cs
index 6b8930e..b172562 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Logic.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Logic.cs
@@ -25,9 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes;
@@ -42,304 +39,313 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
bool result = false;
switch (opcode)
{
- case (byte)(byte)OpCode.iconst_m1:
+ case (byte) (byte) OpCode.iconst_m1:
Int m_int = new Int();
m_int.mValue = -1;
- this.m_thread.m_currentFrame.OpStack.Push(m_int);
+ m_thread.m_currentFrame.OpStack.Push(m_int);
result = true;
break;
- case (byte)(byte)OpCode.iconst_0:
+ case (byte) (byte) OpCode.iconst_0:
m_int = new Int();
m_int.mValue = 0;
- this.m_thread.m_currentFrame.OpStack.Push(m_int);
+ m_thread.m_currentFrame.OpStack.Push(m_int);
result = true;
break;
- case (byte)(byte)OpCode.iconst_1:
+ case (byte) (byte) OpCode.iconst_1:
m_int = new Int();
m_int.mValue = 1;
- this.m_thread.m_currentFrame.OpStack.Push(m_int);
+ m_thread.m_currentFrame.OpStack.Push(m_int);
result = true;
break;
- case (byte)(byte)OpCode.iconst_2:
+ case (byte) (byte) OpCode.iconst_2:
m_int = new Int();
m_int.mValue = 2;
- this.m_thread.m_currentFrame.OpStack.Push(m_int);
+ m_thread.m_currentFrame.OpStack.Push(m_int);
result = true;
break;
- case (byte)(byte)OpCode.iconst_3:
+ case (byte) (byte) OpCode.iconst_3:
m_int = new Int();
m_int.mValue = 3;
- this.m_thread.m_currentFrame.OpStack.Push(m_int);
+ m_thread.m_currentFrame.OpStack.Push(m_int);
break;
- case (byte)(byte)OpCode.iconst_4:
+ case (byte) (byte) OpCode.iconst_4:
m_int = new Int();
m_int.mValue = 4;
- this.m_thread.m_currentFrame.OpStack.Push(m_int);
+ m_thread.m_currentFrame.OpStack.Push(m_int);
result = true;
break;
- case (byte)OpCode.iconst_5:
+ case (byte) OpCode.iconst_5:
m_int = new Int();
m_int.mValue = 5;
- this.m_thread.m_currentFrame.OpStack.Push(m_int);
+ m_thread.m_currentFrame.OpStack.Push(m_int);
result = true;
break;
- case (byte)OpCode.fconst_0:
+ case (byte) OpCode.fconst_0:
Float m_float = new Float();
m_float.mValue = 0.0f;
- this.m_thread.m_currentFrame.OpStack.Push(m_float);
+ m_thread.m_currentFrame.OpStack.Push(m_float);
result = true;
break;
- case (byte)OpCode.fconst_1:
+ case (byte) OpCode.fconst_1:
m_float = new Float();
m_float.mValue = 1.0f;
- this.m_thread.m_currentFrame.OpStack.Push(m_float);
+ m_thread.m_currentFrame.OpStack.Push(m_float);
result = true;
break;
- case (byte)OpCode.fconst_2:
+ case (byte) OpCode.fconst_2:
m_float = new Float();
m_float.mValue = 2.0f;
- this.m_thread.m_currentFrame.OpStack.Push(m_float);
+ m_thread.m_currentFrame.OpStack.Push(m_float);
result = true;
break;
- case (byte)OpCode.bipush: //is this right? this should be pushing a byte onto stack not int?
- int pushvalue = (int)GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC];
+ case (byte) OpCode.bipush: //is this right? this should be pushing a byte onto stack not int?
+ int pushvalue = (int) GlobalMemory.MethodArea.MethodBuffer[m_thread.PC];
Int pushInt = new Int();
pushInt.mValue = pushvalue;
- this.m_thread.m_currentFrame.OpStack.Push(pushInt);
- this.m_thread.PC++;
+ m_thread.m_currentFrame.OpStack.Push(pushInt);
+ m_thread.PC++;
result = true;
break;
- case (byte)OpCode.sipush:
- short pushvalue2 = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC + 1]);
+ case (byte) OpCode.sipush:
+ short pushvalue2 =
+ (short)
+ ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) +
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]);
Int pushInt2 = new Int();
pushInt2.mValue = pushvalue2;
- this.m_thread.m_currentFrame.OpStack.Push(pushInt2);
- this.m_thread.PC += 2;
+ m_thread.m_currentFrame.OpStack.Push(pushInt2);
+ m_thread.PC += 2;
result = true;
break;
- case (byte)OpCode.fload:
- short findex1 = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC]));
+ case (byte) OpCode.fload:
+ short findex1 = (short) ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC]));
Float fload = new Float();
- if (this.m_thread.m_currentFrame.LocalVariables[findex1] != null)
+ if (m_thread.m_currentFrame.LocalVariables[findex1] != null)
{
- if (this.m_thread.m_currentFrame.LocalVariables[findex1] is Float)
+ if (m_thread.m_currentFrame.LocalVariables[findex1] is Float)
{
- fload.mValue = ((Float)this.m_thread.m_currentFrame.LocalVariables[findex1]).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(fload);
+ fload.mValue = ((Float) m_thread.m_currentFrame.LocalVariables[findex1]).mValue;
+ m_thread.m_currentFrame.OpStack.Push(fload);
}
}
- this.m_thread.PC++;
+ m_thread.PC++;
result = true;
break;
- case (byte)OpCode.iload_0:
- if (this.m_thread.m_currentFrame.LocalVariables[0] != null)
+ case (byte) OpCode.iload_0:
+ if (m_thread.m_currentFrame.LocalVariables[0] != null)
{
- if (this.m_thread.m_currentFrame.LocalVariables[0] is Int)
+ if (m_thread.m_currentFrame.LocalVariables[0] is Int)
{
Int newInt = new Int();
- newInt.mValue = ((Int)this.m_thread.m_currentFrame.LocalVariables[0]).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(newInt);
+ newInt.mValue = ((Int) m_thread.m_currentFrame.LocalVariables[0]).mValue;
+ m_thread.m_currentFrame.OpStack.Push(newInt);
}
}
result = true;
break;
- case (byte)OpCode.iload_1:
- if (this.m_thread.m_currentFrame.LocalVariables[1] != null)
+ case (byte) OpCode.iload_1:
+ if (m_thread.m_currentFrame.LocalVariables[1] != null)
{
- if (this.m_thread.m_currentFrame.LocalVariables[1] is Int)
+ if (m_thread.m_currentFrame.LocalVariables[1] is Int)
{
Int newInt = new Int();
- newInt.mValue = ((Int)this.m_thread.m_currentFrame.LocalVariables[1]).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(newInt);
+ newInt.mValue = ((Int) m_thread.m_currentFrame.LocalVariables[1]).mValue;
+ m_thread.m_currentFrame.OpStack.Push(newInt);
}
}
result = true;
break;
- case (byte)OpCode.fload_0:
- if (this.m_thread.m_currentFrame.LocalVariables[0] != null)
+ case (byte) OpCode.fload_0:
+ if (m_thread.m_currentFrame.LocalVariables[0] != null)
{
- if (this.m_thread.m_currentFrame.LocalVariables[0] is Float)
+ if (m_thread.m_currentFrame.LocalVariables[0] is Float)
{
Float newfloat = new Float();
- newfloat.mValue = ((Float)this.m_thread.m_currentFrame.LocalVariables[0]).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(newfloat);
+ newfloat.mValue = ((Float) m_thread.m_currentFrame.LocalVariables[0]).mValue;
+ m_thread.m_currentFrame.OpStack.Push(newfloat);
}
}
result = true;
break;
- case (byte)OpCode.fload_1:
- if (this.m_thread.m_currentFrame.LocalVariables[1] != null)
+ case (byte) OpCode.fload_1:
+ if (m_thread.m_currentFrame.LocalVariables[1] != null)
{
- if (this.m_thread.m_currentFrame.LocalVariables[1] is Float)
+ if (m_thread.m_currentFrame.LocalVariables[1] is Float)
{
Float newfloat = new Float();
- newfloat.mValue = ((Float)this.m_thread.m_currentFrame.LocalVariables[1]).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(newfloat);
+ newfloat.mValue = ((Float) m_thread.m_currentFrame.LocalVariables[1]).mValue;
+ m_thread.m_currentFrame.OpStack.Push(newfloat);
}
}
result = true;
break;
- case (byte)OpCode.fload_2:
- if (this.m_thread.m_currentFrame.LocalVariables[2] != null)
+ case (byte) OpCode.fload_2:
+ if (m_thread.m_currentFrame.LocalVariables[2] != null)
{
- if (this.m_thread.m_currentFrame.LocalVariables[2] is Float)
+ if (m_thread.m_currentFrame.LocalVariables[2] is Float)
{
Float newfloat = new Float();
- newfloat.mValue = ((Float)this.m_thread.m_currentFrame.LocalVariables[2]).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(newfloat);
+ newfloat.mValue = ((Float) m_thread.m_currentFrame.LocalVariables[2]).mValue;
+ m_thread.m_currentFrame.OpStack.Push(newfloat);
}
}
result = true;
break;
- case (byte)OpCode.fload_3:
- if (this.m_thread.m_currentFrame.LocalVariables[3] != null)
+ case (byte) OpCode.fload_3:
+ if (m_thread.m_currentFrame.LocalVariables[3] != null)
{
- if (this.m_thread.m_currentFrame.LocalVariables[3] is Float)
+ if (m_thread.m_currentFrame.LocalVariables[3] is Float)
{
Float newfloat = new Float();
- newfloat.mValue = ((Float)this.m_thread.m_currentFrame.LocalVariables[3]).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(newfloat);
+ newfloat.mValue = ((Float) m_thread.m_currentFrame.LocalVariables[3]).mValue;
+ m_thread.m_currentFrame.OpStack.Push(newfloat);
}
}
result = true;
break;
- case (byte)OpCode.istore:
- short findex3 = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC]));
- BaseType istor = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.istore:
+ short findex3 = (short) ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC]));
+ BaseType istor = m_thread.m_currentFrame.OpStack.Pop();
if (istor is Int)
{
- this.m_thread.m_currentFrame.LocalVariables[findex3] = (Int)istor;
+ m_thread.m_currentFrame.LocalVariables[findex3] = (Int) istor;
}
- this.m_thread.PC++;
+ m_thread.PC++;
result = true;
break;
- case (byte)OpCode.fstore:
- short findex = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC]));
- BaseType fstor = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.fstore:
+ short findex = (short) ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC]));
+ BaseType fstor = m_thread.m_currentFrame.OpStack.Pop();
if (fstor is Float)
{
- this.m_thread.m_currentFrame.LocalVariables[findex] = (Float)fstor;
+ m_thread.m_currentFrame.LocalVariables[findex] = (Float) fstor;
}
- this.m_thread.PC++;
+ m_thread.PC++;
result = true;
break;
- case (byte)OpCode.istore_0:
- BaseType baset = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.istore_0:
+ BaseType baset = m_thread.m_currentFrame.OpStack.Pop();
if (baset is Int)
{
- this.m_thread.m_currentFrame.LocalVariables[0] = (Int)baset;
+ m_thread.m_currentFrame.LocalVariables[0] = (Int) baset;
}
result = true;
break;
- case (byte)OpCode.istore_1:
- baset = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.istore_1:
+ baset = m_thread.m_currentFrame.OpStack.Pop();
if (baset is Int)
{
- this.m_thread.m_currentFrame.LocalVariables[1] = (Int)baset;
+ m_thread.m_currentFrame.LocalVariables[1] = (Int) baset;
}
result = true;
break;
- case (byte)OpCode.fstore_0:
- baset = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.fstore_0:
+ baset = m_thread.m_currentFrame.OpStack.Pop();
if (baset is Float)
{
- this.m_thread.m_currentFrame.LocalVariables[0] = (Float)baset;
+ m_thread.m_currentFrame.LocalVariables[0] = (Float) baset;
}
result = true;
break;
- case (byte)OpCode.fstore_1:
- baset = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.fstore_1:
+ baset = m_thread.m_currentFrame.OpStack.Pop();
if (baset is Float)
{
- this.m_thread.m_currentFrame.LocalVariables[1] = (Float)baset;
+ m_thread.m_currentFrame.LocalVariables[1] = (Float) baset;
}
result = true;
break;
- case (byte)OpCode.fstore_2:
- baset = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.fstore_2:
+ baset = m_thread.m_currentFrame.OpStack.Pop();
if (baset is Float)
{
- this.m_thread.m_currentFrame.LocalVariables[2] = (Float)baset;
+ m_thread.m_currentFrame.LocalVariables[2] = (Float) baset;
}
result = true;
break;
- case (byte)OpCode.fstore_3:
- baset = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.fstore_3:
+ baset = m_thread.m_currentFrame.OpStack.Pop();
if (baset is Float)
{
- this.m_thread.m_currentFrame.LocalVariables[3] = (Float)baset;
+ m_thread.m_currentFrame.LocalVariables[3] = (Float) baset;
}
result = true;
break;
- case (byte)OpCode.pop:
- this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.pop:
+ m_thread.m_currentFrame.OpStack.Pop();
result = true;
break;
- case (byte)OpCode.fadd:
- BaseType bf2 = this.m_thread.m_currentFrame.OpStack.Pop();
- BaseType bf1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.fadd:
+ BaseType bf2 = m_thread.m_currentFrame.OpStack.Pop();
+ BaseType bf1 = m_thread.m_currentFrame.OpStack.Pop();
if (bf1 is Float && bf2 is Float)
{
Float nflt = new Float();
- nflt.mValue = ((Float)bf1).mValue + ((Float)bf2).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(nflt);
+ nflt.mValue = ((Float) bf1).mValue + ((Float) bf2).mValue;
+ m_thread.m_currentFrame.OpStack.Push(nflt);
}
result = true;
break;
- case (byte)OpCode.fsub:
- BaseType bsf2 = this.m_thread.m_currentFrame.OpStack.Pop();
- BaseType bsf1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.fsub:
+ BaseType bsf2 = m_thread.m_currentFrame.OpStack.Pop();
+ BaseType bsf1 = m_thread.m_currentFrame.OpStack.Pop();
if (bsf1 is Float && bsf2 is Float)
{
Float resf = new Float();
- resf.mValue = ((Float)bsf1).mValue - ((Float)bsf2).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(resf);
+ resf.mValue = ((Float) bsf1).mValue - ((Float) bsf2).mValue;
+ m_thread.m_currentFrame.OpStack.Push(resf);
}
result = true;
break;
- case (byte)OpCode.imul: //check the order of the two values off the stack is correct
- BaseType bs2 = this.m_thread.m_currentFrame.OpStack.Pop();
- BaseType bs1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.imul: //check the order of the two values off the stack is correct
+ BaseType bs2 = m_thread.m_currentFrame.OpStack.Pop();
+ BaseType bs1 = m_thread.m_currentFrame.OpStack.Pop();
if (bs1 is Int && bs2 is Int)
{
Int nInt = new Int();
- nInt.mValue = ((Int)bs1).mValue * ((Int)bs2).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(nInt);
+ nInt.mValue = ((Int) bs1).mValue*((Int) bs2).mValue;
+ m_thread.m_currentFrame.OpStack.Push(nInt);
}
result = true;
break;
- case (byte)OpCode.iinc:
- if (this.m_thread.m_currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC]] != null)
+ case (byte) OpCode.iinc:
+ if (m_thread.m_currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[m_thread.PC]] !=
+ null)
{
- if (this.m_thread.m_currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC]] is Int)
+ if (
+ m_thread.m_currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[m_thread.PC]
+ ] is Int)
{
- ((Int)this.m_thread.m_currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC]]).mValue += (sbyte)GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC + 1];
+ ((Int)
+ m_thread.m_currentFrame.LocalVariables[
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC]]).mValue +=
+ (sbyte) GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1];
}
}
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
result = true;
break;
- case (byte)OpCode.f2i:
- BaseType conv1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.f2i:
+ BaseType conv1 = m_thread.m_currentFrame.OpStack.Pop();
if (conv1 is Float)
{
Int newconv = new Int();
- newconv.mValue = (int)((Float)conv1).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(newconv);
+ newconv.mValue = (int) ((Float) conv1).mValue;
+ m_thread.m_currentFrame.OpStack.Push(newconv);
}
result = true;
break;
- case (byte)OpCode.fcmpl:
- BaseType flcom2 = this.m_thread.m_currentFrame.OpStack.Pop();
- BaseType flcom1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.fcmpl:
+ BaseType flcom2 = m_thread.m_currentFrame.OpStack.Pop();
+ BaseType flcom1 = m_thread.m_currentFrame.OpStack.Pop();
if (flcom1 is Float && flcom2 is Float)
{
Int compres = new Int();
- if (((Float)flcom1).mValue < ((Float)flcom2).mValue)
+ if (((Float) flcom1).mValue < ((Float) flcom2).mValue)
{
compres.mValue = -1;
}
- else if (((Float)flcom1).mValue > ((Float)flcom2).mValue)
+ else if (((Float) flcom1).mValue > ((Float) flcom2).mValue)
{
compres.mValue = 1;
}
@@ -347,21 +353,21 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
compres.mValue = 0;
}
- this.m_thread.m_currentFrame.OpStack.Push(compres);
+ m_thread.m_currentFrame.OpStack.Push(compres);
}
result = true;
break;
- case (byte)OpCode.fcmpg:
- flcom2 = this.m_thread.m_currentFrame.OpStack.Pop();
- flcom1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.fcmpg:
+ flcom2 = m_thread.m_currentFrame.OpStack.Pop();
+ flcom1 = m_thread.m_currentFrame.OpStack.Pop();
if (flcom1 is Float && flcom2 is Float)
{
Int compres = new Int();
- if (((Float)flcom1).mValue < ((Float)flcom2).mValue)
+ if (((Float) flcom1).mValue < ((Float) flcom2).mValue)
{
compres.mValue = -1;
}
- else if (((Float)flcom1).mValue > ((Float)flcom2).mValue)
+ else if (((Float) flcom1).mValue > ((Float) flcom2).mValue)
{
compres.mValue = 1;
}
@@ -369,128 +375,169 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
compres.mValue = 0;
}
- this.m_thread.m_currentFrame.OpStack.Push(compres);
+ m_thread.m_currentFrame.OpStack.Push(compres);
}
result = true;
break;
- case (byte)OpCode.ifge:
- short compareoffset2 = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC + 1]);
- BaseType compe1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.ifge:
+ short compareoffset2 =
+ (short)
+ ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) +
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]);
+ BaseType compe1 = m_thread.m_currentFrame.OpStack.Pop();
if (compe1 is Int)
{
- if (((Int)compe1).mValue >= 0)
+ if (((Int) compe1).mValue >= 0)
{
- this.m_thread.PC += -1 + compareoffset2;
+ m_thread.PC += -1 + compareoffset2;
}
else
{
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
}
}
else
{
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
}
result = true;
break;
- case (byte)OpCode.ifle:
- short compareoffset1 = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC + 1]);
- BaseType comp1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.ifle:
+ short compareoffset1 =
+ (short)
+ ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) +
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]);
+ BaseType comp1 = m_thread.m_currentFrame.OpStack.Pop();
if (comp1 is Int)
{
- if (((Int)comp1).mValue <= 0)
+ if (((Int) comp1).mValue <= 0)
{
- this.m_thread.PC += -1 + compareoffset1;
+ m_thread.PC += -1 + compareoffset1;
}
else
{
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
}
}
else
{
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
}
result = true;
break;
- case (byte)OpCode.if_icmpge:
- short compareoffset = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC + 1]);
- BaseType bc2 = this.m_thread.m_currentFrame.OpStack.Pop();
- BaseType bc1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.if_icmpge:
+ short compareoffset =
+ (short)
+ ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) +
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]);
+ BaseType bc2 = m_thread.m_currentFrame.OpStack.Pop();
+ BaseType bc1 = m_thread.m_currentFrame.OpStack.Pop();
if (bc1 is Int && bc2 is Int)
{
//Console.WriteLine("comparing " + ((Int)bc1).mValue + " and " + ((Int)bc2).mValue);
- if (((Int)bc1).mValue >= ((Int)bc2).mValue)
+ if (((Int) bc1).mValue >= ((Int) bc2).mValue)
{
// Console.WriteLine("branch compare true , offset is " +compareoffset);
// Console.WriteLine("current PC is " + this._mThread.PC);
- this.m_thread.PC += -1 + compareoffset;
+ m_thread.PC += -1 + compareoffset;
//Console.WriteLine("new PC is " + this._mThread.PC);
}
else
{
//Console.WriteLine("branch compare false");
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
}
}
else
{
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
}
result = true;
break;
- case (byte)OpCode.if_icmple:
- short compareloffset = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC + 1]);
- BaseType bcl2 = this.m_thread.m_currentFrame.OpStack.Pop();
- BaseType bcl1 = this.m_thread.m_currentFrame.OpStack.Pop();
+ case (byte) OpCode.if_icmple:
+ short compareloffset =
+ (short)
+ ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) +
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]);
+ BaseType bcl2 = m_thread.m_currentFrame.OpStack.Pop();
+ BaseType bcl1 = m_thread.m_currentFrame.OpStack.Pop();
if (bcl1 is Int && bcl2 is Int)
{
//Console.WriteLine("comparing " + ((Int)bcl1).mValue + " and " + ((Int)bcl2).mValue);
- if (((Int)bcl1).mValue <= ((Int)bcl2).mValue)
+ if (((Int) bcl1).mValue <= ((Int) bcl2).mValue)
{
// Console.WriteLine("branch compare true , offset is " + compareloffset);
// Console.WriteLine("current PC is " + this._mThread.PC);
- this.m_thread.PC += -1 + compareloffset;
+ m_thread.PC += -1 + compareloffset;
// Console.WriteLine("new PC is " + this._mThread.PC);
}
else
{
//Console.WriteLine("branch compare false");
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
}
}
else
{
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
}
result = true;
break;
- case (byte)OpCode._goto:
- short offset = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC + 1]);
- this.m_thread.PC += -1 + offset;
+ case (byte) OpCode._goto:
+ short offset =
+ (short)
+ ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) +
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]);
+ m_thread.PC += -1 + offset;
result = true;
break;
- case (byte)OpCode.getstatic:
- short fieldrefIndex = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC + 1]);
- if (this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1] is ClassRecord.PoolFieldRef)
+ case (byte) OpCode.getstatic:
+ short fieldrefIndex =
+ (short)
+ ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) +
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]);
+ if (m_thread.currentClass.m_constantsPool[fieldrefIndex - 1] is ClassRecord.PoolFieldRef)
{
- if (((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mClass.Name.Value == this.m_thread.currentClass.MClass.Name.Value)
+ if (
+ ((ClassRecord.PoolFieldRef) m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).
+ mClass.Name.Value == m_thread.currentClass.MClass.Name.Value)
{
//from this class
- if (this.m_thread.currentClass.StaticFields.ContainsKey(((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value))
+ if (
+ m_thread.currentClass.StaticFields.ContainsKey(
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value))
{
- if (this.m_thread.currentClass.StaticFields[((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value] is Float)
+ if (
+ m_thread.currentClass.StaticFields[
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.
+ Value] is Float)
{
Float retFloat = new Float();
- retFloat.mValue = ((Float)this.m_thread.currentClass.StaticFields[((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value]).mValue;
- this.m_thread.m_currentFrame.OpStack.Push(retFloat);
+ retFloat.mValue =
+ ((Float)
+ m_thread.currentClass.StaticFields[
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.
+ Name.Value]).mValue;
+ m_thread.m_currentFrame.OpStack.Push(retFloat);
}
- else if (this.m_thread.currentClass.StaticFields[((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value] is Int)
+ else if (
+ m_thread.currentClass.StaticFields[
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.
+ Name.Value] is Int)
{
Int retInt = new Int();
- retInt.mValue = ((Int)this.m_thread.currentClass.StaticFields[((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value]).mValue;
+ retInt.mValue =
+ ((Int)
+ m_thread.currentClass.StaticFields[
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).
+ mNameType.Name.Value]).mValue;
// Console.WriteLine("getting static field, " + retInt.mValue);
- this.m_thread.m_currentFrame.OpStack.Push(retInt);
+ m_thread.m_currentFrame.OpStack.Push(retInt);
}
}
}
@@ -499,36 +546,58 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
//get from a different class
}
}
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
result = true;
break;
- case (byte)OpCode.putstatic:
- fieldrefIndex = (short)((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC + 1]);
- BaseType addstatic = this.m_thread.m_currentFrame.OpStack.Pop();
- if (this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1] is ClassRecord.PoolFieldRef)
+ case (byte) OpCode.putstatic:
+ fieldrefIndex =
+ (short)
+ ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) +
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]);
+ BaseType addstatic = m_thread.m_currentFrame.OpStack.Pop();
+ if (m_thread.currentClass.m_constantsPool[fieldrefIndex - 1] is ClassRecord.PoolFieldRef)
{
- if (((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mClass.Name.Value == this.m_thread.currentClass.MClass.Name.Value)
+ if (
+ ((ClassRecord.PoolFieldRef) m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).
+ mClass.Name.Value == m_thread.currentClass.MClass.Name.Value)
{
// this class
- if (this.m_thread.currentClass.StaticFields.ContainsKey(((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value))
+ if (
+ m_thread.currentClass.StaticFields.ContainsKey(
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value))
{
if (addstatic is Float)
{
- if (this.m_thread.currentClass.StaticFields[((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value] is Float)
+ if (
+ m_thread.currentClass.StaticFields[
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.
+ Name.Value] is Float)
{
Float newf = new Float();
- newf.mValue = ((Float)addstatic).mValue;
- this.m_thread.currentClass.StaticFields[((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value] = newf;
+ newf.mValue = ((Float) addstatic).mValue;
+ m_thread.currentClass.StaticFields[
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.
+ Name.Value] = newf;
}
}
else if (addstatic is Int)
{
- if (this.m_thread.currentClass.StaticFields[((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value] is Int)
+ if (
+ m_thread.currentClass.StaticFields[
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.
+ Name.Value] is Int)
{
//Console.WriteLine("setting static field to " + ((Int)addstatic).mValue);
Int newi = new Int();
- newi.mValue = ((Int)addstatic).mValue;
- this.m_thread.currentClass.StaticFields[((ClassRecord.PoolFieldRef)this.m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.Name.Value] = newi;
+ newi.mValue = ((Int) addstatic).mValue;
+ m_thread.currentClass.StaticFields[
+ ((ClassRecord.PoolFieldRef)
+ m_thread.currentClass.m_constantsPool[fieldrefIndex - 1]).mNameType.
+ Name.Value] = newi;
}
}
}
@@ -538,10 +607,9 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
// a different class
}
}
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
result = true;
break;
-
}
return result;
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs
index a5bd48b..b27630a 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs
@@ -25,15 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Framework;
-using OpenSim.Framework;
-using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
-using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
partial class Thread
@@ -46,10 +37,15 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
switch (opcode)
{
case 184:
- short refIndex = (short) ((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC+1]);
- if (this.m_thread.currentClass.m_constantsPool[refIndex - 1] is ClassRecord.PoolMethodRef)
+ short refIndex =
+ (short)
+ ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) +
+ GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]);
+ if (m_thread.currentClass.m_constantsPool[refIndex - 1] is ClassRecord.PoolMethodRef)
{
- string typ = ((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mNameType.Type.Value;
+ string typ =
+ ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]).
+ mNameType.Type.Value;
string typeparam = "";
string typereturn = "";
int firstbrak = 0;
@@ -58,16 +54,22 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
secondbrak = typ.LastIndexOf(')');
typeparam = typ.Substring(firstbrak + 1, secondbrak - firstbrak - 1);
typereturn = typ.Substring(secondbrak + 1, typ.Length - secondbrak - 1);
- if (((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mClass.Name.Value == this.m_thread.currentClass.MClass.Name.Value)
+ if (
+ ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]).mClass
+ .Name.Value == m_thread.currentClass.MClass.Name.Value)
{
//calling a method in this class
if (typeparam.Length == 0)
{
- this.m_thread.JumpToStaticVoidMethod(((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mNameType.Name.Value, (this.m_thread.PC + 2));
+ m_thread.JumpToStaticVoidMethod(
+ ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1])
+ .mNameType.Name.Value, (m_thread.PC + 2));
}
else
{
- this.m_thread.JumpToStaticParamMethod(((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mNameType.Name.Value, typeparam, (this.m_thread.PC + 2));
+ m_thread.JumpToStaticParamMethod(
+ ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1])
+ .mNameType.Name.Value, typeparam, (m_thread.PC + 2));
}
}
else
@@ -75,15 +77,19 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
//calling a method of a different class
// OpenSimAPI Class
- if (((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mClass.Name.Value == "OpenSimAPI")
+ if (
+ ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]).
+ mClass.Name.Value == "OpenSimAPI")
{
- this.m_thread.scriptInfo.api.CallMethod(((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mNameType.Name.Value, null);
+ m_thread.scriptInfo.api.CallMethod(
+ ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1])
+ .mNameType.Name.Value, null);
}
}
}
else
{
- this.m_thread.PC += 2;
+ m_thread.PC += 2;
}
result = true;
break;
@@ -93,4 +99,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Return.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Return.cs
index 5a42285..2814720 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Return.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Return.cs
@@ -25,10 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
partial class Thread
@@ -37,4 +33,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs
index 698a518..4e7351e 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs
@@ -26,8 +26,6 @@
*
*/
using System;
-using System.Collections.Generic;
-using System.Text;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes;
@@ -47,77 +45,77 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public bool Excute()
{
bool run = true;
- byte currentOpCode = GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC++];
- // Console.WriteLine("opCode is: " + currentOpCode);
+ byte currentOpCode = GlobalMemory.MethodArea.MethodBuffer[m_thread.PC++];
+ // Console.WriteLine("opCode is: " + currentOpCode);
bool handled = false;
- handled = this.IsLogicOpCode(currentOpCode);
+ handled = IsLogicOpCode(currentOpCode);
if (!handled)
{
- handled = this.IsMethodOpCode(currentOpCode);
+ handled = IsMethodOpCode(currentOpCode);
}
if (!handled)
{
if (currentOpCode == 172)
{
- if (this.m_thread.stack.StackFrames.Count > 1)
+ if (m_thread.stack.StackFrames.Count > 1)
{
Console.WriteLine("returning int from function");
- int retPC1 = this.m_thread.m_currentFrame.ReturnPC;
- BaseType bas1 = this.m_thread.m_currentFrame.OpStack.Pop();
- this.m_thread.stack.StackFrames.Pop();
- this.m_thread.m_currentFrame = this.m_thread.stack.StackFrames.Peek();
- this.m_thread.PC = retPC1;
+ int retPC1 = m_thread.m_currentFrame.ReturnPC;
+ BaseType bas1 = m_thread.m_currentFrame.OpStack.Pop();
+ m_thread.stack.StackFrames.Pop();
+ m_thread.m_currentFrame = m_thread.stack.StackFrames.Peek();
+ m_thread.PC = retPC1;
if (bas1 is Int)
{
- this.m_thread.m_currentFrame.OpStack.Push((Int)bas1);
+ m_thread.m_currentFrame.OpStack.Push((Int) bas1);
}
}
else
{
- // Console.WriteLine("No parent function so ending program");
- this.m_thread.stack.StackFrames.Pop();
+ // Console.WriteLine("No parent function so ending program");
+ m_thread.stack.StackFrames.Pop();
run = false;
}
handled = true;
}
if (currentOpCode == 174)
{
- if (this.m_thread.stack.StackFrames.Count > 1)
+ if (m_thread.stack.StackFrames.Count > 1)
{
Console.WriteLine("returning float from function");
- int retPC1 = this.m_thread.m_currentFrame.ReturnPC;
- BaseType bas1 = this.m_thread.m_currentFrame.OpStack.Pop();
- this.m_thread.stack.StackFrames.Pop();
- this.m_thread.m_currentFrame = this.m_thread.stack.StackFrames.Peek();
- this.m_thread.PC = retPC1;
+ int retPC1 = m_thread.m_currentFrame.ReturnPC;
+ BaseType bas1 = m_thread.m_currentFrame.OpStack.Pop();
+ m_thread.stack.StackFrames.Pop();
+ m_thread.m_currentFrame = m_thread.stack.StackFrames.Peek();
+ m_thread.PC = retPC1;
if (bas1 is Float)
{
- this.m_thread.m_currentFrame.OpStack.Push((Float)bas1);
+ m_thread.m_currentFrame.OpStack.Push((Float) bas1);
}
}
else
{
- // Console.WriteLine("No parent function so ending program");
- this.m_thread.stack.StackFrames.Pop();
+ // Console.WriteLine("No parent function so ending program");
+ m_thread.stack.StackFrames.Pop();
run = false;
}
handled = true;
}
if (currentOpCode == 177)
{
- if (this.m_thread.stack.StackFrames.Count > 1)
+ if (m_thread.stack.StackFrames.Count > 1)
{
Console.WriteLine("returning from function");
- int retPC = this.m_thread.m_currentFrame.ReturnPC;
- this.m_thread.stack.StackFrames.Pop();
- this.m_thread.m_currentFrame = this.m_thread.stack.StackFrames.Peek();
- this.m_thread.PC = retPC;
+ int retPC = m_thread.m_currentFrame.ReturnPC;
+ m_thread.stack.StackFrames.Pop();
+ m_thread.m_currentFrame = m_thread.stack.StackFrames.Peek();
+ m_thread.PC = retPC;
}
else
{
- // Console.WriteLine("No parent function so ending program");
- this.m_thread.stack.StackFrames.Pop();
+ // Console.WriteLine("No parent function so ending program");
+ m_thread.stack.StackFrames.Pop();
run = false;
}
handled = true;
@@ -128,8 +126,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
Console.WriteLine("opcode " + currentOpCode + " not been handled ");
}
return run;
-
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/MainMemory.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/MainMemory.cs
index 34d4fc5..adad1a8 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/MainMemory.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/MainMemory.cs
@@ -25,21 +25,17 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
public class MainMemory
{
public Heap HeapArea;
public MethodMemory MethodArea;
-
+
public MainMemory()
{
MethodArea = new MethodMemory();
HeapArea = new Heap();
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/MethodMemory.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/MethodMemory.cs
index f470583..86df4c2 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/MethodMemory.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/MethodMemory.cs
@@ -25,9 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
using System.Collections.Generic;
-using System.Text;
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
@@ -43,4 +41,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
MethodBuffer = new byte[20000];
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Object.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Object.cs
index 21e467a..1d9cabb 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Object.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Object.cs
@@ -25,13 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
public class Object
{
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/OpCodes.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/OpCodes.cs
index 9fcec49..616b64e 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/OpCodes.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/OpCodes.cs
@@ -26,10 +26,6 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
public enum OpCode : byte
@@ -81,4 +77,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
getstatic = 178,
putstatic = 179
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Stack.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Stack.cs
index 56e02ff..4f6c1e7 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Stack.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Stack.cs
@@ -25,9 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
using System.Collections.Generic;
-using System.Text;
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
@@ -39,4 +37,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/StackFrame.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/StackFrame.cs
index a5f9029..306a70d 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/StackFrame.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/StackFrame.cs
@@ -25,9 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
using System.Collections.Generic;
-using System.Text;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
@@ -44,6 +42,5 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
LocalVariables = new BaseType[20];
}
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Thread.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Thread.cs
index b810676..64093ef 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Thread.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Thread.cs
@@ -25,15 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
+using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes;
-using OpenSim.Framework;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Region.Environment.Scenes;
-using OpenSim.Region.ExtensionsScriptModule;
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
@@ -55,8 +49,8 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public Thread()
{
- this.m_Interpreter = new Interpreter(this);
- this.stack = new Stack();
+ m_Interpreter = new Interpreter(this);
+ stack = new Stack();
}
public void SetPC(int methodpointer)
@@ -68,15 +62,15 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public void StartMethod(ClassRecord rec, string methName)
{
m_currentFrame = new StackFrame();
- this.stack.StackFrames.Push(m_currentFrame);
- this.currentClass = rec;
+ stack.StackFrames.Push(m_currentFrame);
+ currentClass = rec;
currentClass.StartMethod(this, methName);
}
- public void StartMethod( string methName)
+ public void StartMethod(string methName)
{
m_currentFrame = new StackFrame();
- this.stack.StackFrames.Push(m_currentFrame);
+ stack.StackFrames.Push(m_currentFrame);
currentClass.StartMethod(this, methName);
}
@@ -84,7 +78,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{
m_currentFrame = new StackFrame();
m_currentFrame.ReturnPC = returnPC;
- this.stack.StackFrames.Push(m_currentFrame);
+ stack.StackFrames.Push(m_currentFrame);
currentClass.StartMethod(this, methName);
}
@@ -95,25 +89,23 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
BaseType bs1 = m_currentFrame.OpStack.Pop();
m_currentFrame = new StackFrame();
m_currentFrame.ReturnPC = returnPC;
- this.stack.StackFrames.Push(m_currentFrame);
- m_currentFrame.LocalVariables[0] = ((Int)bs1);
+ stack.StackFrames.Push(m_currentFrame);
+ m_currentFrame.LocalVariables[0] = ((Int) bs1);
currentClass.StartMethod(this, methName);
}
if (param == "F")
{
-
}
}
public void JumpToClassStaticVoidMethod(string className, string methName, int returnPC)
{
-
}
public bool Excute()
{
excutionCounter++;
- return this.m_Interpreter.Excute();
+ return m_Interpreter.Excute();
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JavaEngine.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JavaEngine.cs
index 0f0ff16..ea99626 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JavaEngine.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JavaEngine.cs
@@ -26,11 +26,7 @@
*
*/
-using System;
using System.Collections.Generic;
-using System.Text;
-
-using OpenSim.Region.ExtensionsScriptModule;
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine
{
@@ -53,4 +49,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine
return returns;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/OpenSimJVM.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/OpenSimJVM.cs
index b1258f6..274932a 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/OpenSimJVM.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/OpenSimJVM.cs
@@ -27,15 +27,11 @@
*/
using System;
using System.Collections.Generic;
-using System.Text;
+using System.Diagnostics;
using System.IO;
-using System.Threading;
-using OpenSim.Framework;
-using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM;
-using Thread = OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM.Thread;
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine
{
@@ -45,14 +41,14 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine
private BlockingQueue CompileScripts = new BlockingQueue();
private MainMemory _mainMemory;
- ScriptInfo scriptInfo;
+ private ScriptInfo scriptInfo;
public void Initialise(ScriptInfo info)
{
scriptInfo = info;
_mainMemory = new MainMemory();
- Thread.GlobalMemory = this._mainMemory;
+ Thread.GlobalMemory = _mainMemory;
Thread.World = info.world;
CompileScript();
@@ -60,33 +56,33 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine
scriptInfo.events.OnNewPresence += new EventManager.OnNewPresenceDelegate(events_OnNewPresence);
}
- void events_OnNewPresence(ScenePresence presence)
+ private void events_OnNewPresence(ScenePresence presence)
{
- for (int i = 0; i < this._threads.Count; i++)
+ for (int i = 0; i < _threads.Count; i++)
{
- if (!this._threads[i].running)
+ if (!_threads[i].running)
{
- this._threads[i].StartMethod("OnNewPresence");
+ _threads[i].StartMethod("OnNewPresence");
bool run = true;
while (run)
{
- run = this._threads[i].Excute();
+ run = _threads[i].Excute();
}
}
}
}
- void events_OnFrame()
+ private void events_OnFrame()
{
- for (int i = 0; i < this._threads.Count; i++)
+ for (int i = 0; i < _threads.Count; i++)
{
- if (!this._threads[i].running)
+ if (!_threads[i].running)
{
- this._threads[i].StartMethod("OnFrame");
+ _threads[i].StartMethod("OnFrame");
bool run = true;
while (run)
{
- run = this._threads[i].Excute();
+ run = _threads[i].Excute();
}
}
}
@@ -103,12 +99,12 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine
CompileInfo comp = new CompileInfo();
comp.script = script;
comp.scriptName = script;
- this.CompileScripts.Enqueue(comp);
+ CompileScripts.Enqueue(comp);
}
public void CompileScript()
{
- CompileInfo comp = this.CompileScripts.Dequeue();
+ CompileInfo comp = CompileScripts.Dequeue();
string script = comp.script;
string scriptName = comp.scriptName;
try
@@ -121,13 +117,13 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine
tw.Close();
//now compile
- System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("javac.exe", "*.java");
+ ProcessStartInfo psi = new ProcessStartInfo("javac.exe", "*.java");
// psi.RedirectStandardOutput = true;
- psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
+ psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.UseShellExecute = false;
- System.Diagnostics.Process javacomp;
- javacomp = System.Diagnostics.Process.Start(psi);
+ Process javacomp;
+ javacomp = Process.Start(psi);
javacomp.WaitForExit();
@@ -136,17 +132,17 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine
class1.LoadClassFromFile(scriptName + ".class");
class1.PrintToConsole();
//Console.WriteLine();
- this._mainMemory.MethodArea.Classes.Add(class1);
- class1.AddMethodsToMemory(this._mainMemory.MethodArea);
+ _mainMemory.MethodArea.Classes.Add(class1);
+ class1.AddMethodsToMemory(_mainMemory.MethodArea);
Thread newThread = new Thread();
- this._threads.Add(newThread);
+ _threads.Add(newThread);
newThread.currentClass = class1;
newThread.scriptInfo = scriptInfo;
//now delete the created files
- System.IO.File.Delete(scriptName + ".java");
- System.IO.File.Delete(scriptName + ".class");
+ File.Delete(scriptName + ".java");
+ File.Delete(scriptName + ".class");
//this.OnFrame();
}
catch (Exception e)
@@ -164,8 +160,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine
public CompileInfo()
{
-
}
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/ArrayReference.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/ArrayReference.cs
index a36ad77..3c82952 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/ArrayReference.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/ArrayReference.cs
@@ -26,13 +26,9 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types
{
- public class ArrayReference :BaseType
+ public class ArrayReference : BaseType
{
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/ObjectReference.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/ObjectReference.cs
index 5921446..4026c10 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/ObjectReference.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/ObjectReference.cs
@@ -26,10 +26,6 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types
{
public class ObjectReference : BaseType
@@ -38,7 +34,6 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types
public ObjectReference()
{
-
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Byte.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Byte.cs
index aa59681..de1aa87 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Byte.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Byte.cs
@@ -26,14 +26,9 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes
{
public class Byte : BaseType
{
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Char.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Char.cs
index 1cef150..0e17057 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Char.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Char.cs
@@ -26,14 +26,9 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes
{
public class Char : BaseType
{
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Float.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Float.cs
index 0614dfd..ce8648c 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Float.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Float.cs
@@ -26,11 +26,6 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes
{
public class Float : BaseType
@@ -39,7 +34,6 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes
public Float()
{
-
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Int.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Int.cs
index 35f9822..251b736 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Int.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/Types/PrimitiveTypes/Int.cs
@@ -26,11 +26,6 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types;
-
namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes
{
public class Int : BaseType
@@ -39,7 +34,6 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes
public Int()
{
-
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/Script.cs b/OpenSim/Region/ExtensionsScriptModule/Script.cs
index 251b8c3..5f85799 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Script.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Script.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
public class TestScript : IScript
{
- ScriptInfo script;
+ private ScriptInfo script;
public string Name
{
@@ -51,14 +51,14 @@ namespace OpenSim.Region.ExtensionsScriptModule
script.events.OnNewPresence += events_OnNewPresence;
}
- void events_OnNewPresence(ScenePresence presence)
+ private void events_OnNewPresence(ScenePresence presence)
{
script.logger.Verbose("Hello " + presence.Firstname.ToString() + "!");
}
- void events_OnFrame()
+ private void events_OnFrame()
{
//script.logger.Verbose("Hello World!");
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptAPI.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptAPI.cs
index 39dc878..9384efa 100644
--- a/OpenSim/Region/ExtensionsScriptModule/ScriptAPI.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/ScriptAPI.cs
@@ -27,24 +27,21 @@
*/
using System;
-using System.Collections.Generic;
-using System.Text;
+using OpenSim.Region.Environment.Scenes;
using Key = libsecondlife.LLUUID;
using Rotation = libsecondlife.LLQuaternion;
using Vector = libsecondlife.LLVector3;
using LSLList = System.Collections.Generic.List;
-using OpenSim.Region.Environment.Scenes;
-
namespace OpenSim.Region.ExtensionsScriptModule
{
// This class is to be used for engines which may not be able to access the Scene directly.
// Scene access is preffered, but obviously not possible on some non-.NET languages.
public class ScriptAPI
{
- Scene scene;
- ScriptInterpretedAPI interpretedAPI;
+ private Scene scene;
+ private ScriptInterpretedAPI interpretedAPI;
public ScriptAPI(Scene world, Key taskID)
{
@@ -57,4 +54,4 @@ namespace OpenSim.Region.ExtensionsScriptModule
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptInfo.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptInfo.cs
index aaadd1f..cfa3c8e 100644
--- a/OpenSim/Region/ExtensionsScriptModule/ScriptInfo.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/ScriptInfo.cs
@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+using libsecondlife;
using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Scenes;
@@ -52,12 +53,12 @@ namespace OpenSim.Region.ExtensionsScriptModule
world = scene;
events = world.EventManager;
logger = MainLog.Instance;
- api = new ScriptAPI(world, libsecondlife.LLUUID.Zero);
+ api = new ScriptAPI(world, LLUUID.Zero);
}
- public void CreateTaskAPI(libsecondlife.LLUUID task)
+ public void CreateTaskAPI(LLUUID task)
{
api = new ScriptAPI(world, task);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs
index eb85dbe..2895c4e 100644
--- a/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs
@@ -27,26 +27,25 @@
*/
using System;
-using System.Collections.Generic;
using System.Text;
+using Axiom.Math;
+using OpenSim.Framework.Console;
+using OpenSim.Region.Environment.LandManagement;
+using OpenSim.Region.Environment.Scenes;
using Key = libsecondlife.LLUUID;
using Rotation = libsecondlife.LLQuaternion;
using Vector = libsecondlife.LLVector3;
using LSLList = System.Collections.Generic.List;
-using OpenSim.Region.Environment.Scenes;
-using OpenSim.Region.Environment.LandManagement;
-using libsecondlife;
-
namespace OpenSim.Region.ExtensionsScriptModule
{
///
/// A class inteded to act as an API for LSL-styled interpreted languages
///
/// Avoid at all costs. This should ONLY be used for LSL.
- class ScriptInterpretedAPI
+ internal class ScriptInterpretedAPI
{
- protected LLUUID m_object;
+ protected Key m_object;
protected Scene m_scene;
///
@@ -78,7 +77,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
///
/// The scene the object is located in
/// The specific member being 'occupied' by the script
- public ScriptInterpretedAPI(Scene world, libsecondlife.LLUUID member)
+ public ScriptInterpretedAPI(Scene world, Key member)
{
m_scene = world;
m_object = member;
@@ -96,7 +95,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
public float osAcos(float val)
{
- return (float)Math.Acos(val);
+ return (float) Math.Acos(val);
}
[Obsolete("Unimplemented")]
@@ -105,14 +104,15 @@ namespace OpenSim.Region.ExtensionsScriptModule
Vector myPosition = Task.AbsolutePosition;
Land myParcel = Scene.LandManager.getLandObject(myPosition.X, myPosition.Y);
- OpenSim.Framework.Console.MainLog.Instance.Warn("script", "Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)");
+ MainLog.Instance.Warn("script",
+ "Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)");
return;
}
[Obsolete("Unimplemented")]
public void osAdjustSoundVolume(float volume)
{
- OpenSim.Framework.Console.MainLog.Instance.Warn("script", "Unimplemented function called by script: osAdjustSoundVolume(float volume)");
+ MainLog.Instance.Warn("script", "Unimplemented function called by script: osAdjustSoundVolume(float volume)");
return;
}
@@ -125,8 +125,8 @@ namespace OpenSim.Region.ExtensionsScriptModule
[Obsolete("Unimplemented")]
public float osAngleBetween(Rotation a, Rotation b)
{
- Axiom.Math.Quaternion axA = new Axiom.Math.Quaternion(a.W, a.X, a.Y, a.Z);
- Axiom.Math.Quaternion axB = new Axiom.Math.Quaternion(b.W, b.X, b.Y, b.Z);
+ Quaternion axA = new Quaternion(a.W, a.X, a.Y, a.Z);
+ Quaternion axB = new Quaternion(b.W, b.X, b.Y, b.Z);
return 0;
}
@@ -145,12 +145,12 @@ namespace OpenSim.Region.ExtensionsScriptModule
public float osAsin(float val)
{
- return (float)Math.Asin(val);
+ return (float) Math.Asin(val);
}
public float osAtan2(float x, float y)
{
- return (float)Math.Atan2(x, y);
+ return (float) Math.Atan2(x, y);
}
[Obsolete("Unimplemented")]
@@ -178,10 +178,10 @@ namespace OpenSim.Region.ExtensionsScriptModule
public Rotation osAxes2Rot(Vector fwd, Vector left, Vector up)
{
- Axiom.Math.Quaternion axQ = new Axiom.Math.Quaternion();
- Axiom.Math.Vector3 axFwd = new Axiom.Math.Vector3(fwd.X, fwd.Y, fwd.Z);
- Axiom.Math.Vector3 axLeft = new Axiom.Math.Vector3(left.X, left.Y, left.Z);
- Axiom.Math.Vector3 axUp = new Axiom.Math.Vector3(up.X, up.Y, up.Z);
+ Quaternion axQ = new Quaternion();
+ Vector3 axFwd = new Vector3(fwd.X, fwd.Y, fwd.Z);
+ Vector3 axLeft = new Vector3(left.X, left.Y, left.Z);
+ Vector3 axUp = new Vector3(up.X, up.Y, up.Z);
axQ.FromAxes(axFwd, axLeft, axUp);
@@ -190,14 +190,14 @@ namespace OpenSim.Region.ExtensionsScriptModule
public Rotation osAxisAngle2Rot(Vector axis, float angle)
{
- Axiom.Math.Quaternion axQ = Axiom.Math.Quaternion.FromAngleAxis(angle, new Axiom.Math.Vector3(axis.X, axis.Y, axis.Z));
+ Quaternion axQ = Quaternion.FromAngleAxis(angle, new Vector3(axis.X, axis.Y, axis.Z));
return new Rotation(axQ.x, axQ.y, axQ.z, axQ.w);
}
public string osBase64ToString(string str)
{
- Encoding enc = System.Text.Encoding.UTF8;
+ Encoding enc = Encoding.UTF8;
return enc.GetString(Convert.FromBase64String(str));
}
@@ -223,7 +223,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
public int osCeil(float val)
{
- return (int)Math.Ceiling(val);
+ return (int) Math.Ceiling(val);
}
[Obsolete("Unimplemented")]
@@ -252,13 +252,13 @@ namespace OpenSim.Region.ExtensionsScriptModule
public float osCos(float theta)
{
- return (float)Math.Cos(theta);
+ return (float) Math.Cos(theta);
}
public void osCreateLink(Key target, int parent)
{
- if(Scene.Entities[target] is SceneObjectGroup)
- Task.LinkToGroup((SceneObjectGroup)Scene.Entities[target]);
+ if (Scene.Entities[target] is SceneObjectGroup)
+ Task.LinkToGroup((SceneObjectGroup) Scene.Entities[target]);
return;
}
@@ -292,4 +292,4 @@ namespace OpenSim.Region.ExtensionsScriptModule
return;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedEvents.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedEvents.cs
index 068df33..44feaff 100644
--- a/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedEvents.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedEvents.cs
@@ -26,19 +26,14 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Region.Environment.Scenes;
-using libsecondlife;
using Key = libsecondlife.LLUUID;
namespace OpenSim.Region.ExtensionsScriptModule
{
-
public class ScriptInterpretedEvents
{
public delegate void OnTouchStartDelegate(Key user);
+
public event OnTouchStartDelegate OnTouchStart;
@@ -48,4 +43,4 @@ namespace OpenSim.Region.ExtensionsScriptModule
OnTouchStart(user);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs
index 95ab2ca..2778e9c 100644
--- a/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs
@@ -26,27 +26,28 @@
*
*/
using System.Collections.Generic;
+using Nini.Config;
using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.ExtensionsScriptModule.CSharp;
using OpenSim.Region.ExtensionsScriptModule.JScript;
using OpenSim.Region.ExtensionsScriptModule.JVMEngine;
-using Nini.Config;
namespace OpenSim.Region.ExtensionsScriptModule
{
public class ScriptManager : IRegionModule, IExtensionScriptModule
{
- readonly List scripts = new List();
- Scene m_scene;
- readonly Dictionary compilers = new Dictionary();
+ private readonly List scripts = new List();
+ private Scene m_scene;
+ private readonly Dictionary compilers = new Dictionary();
private void LoadFromCompiler(Dictionary compiledscripts)
{
foreach (KeyValuePair script in compiledscripts)
{
- ScriptInfo scriptInfo = new ScriptInfo(m_scene); // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
+ ScriptInfo scriptInfo = new ScriptInfo(m_scene);
+ // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
MainLog.Instance.Verbose("Loading " + script.Key);
script.Value.Initialise(scriptInfo);
scripts.Add(script.Value);
@@ -70,7 +71,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
public void Initialise(Scene scene, IConfigSource config)
{
- OpenSim.Framework.Console.MainLog.Instance.Verbose("SCRIPTMODULE", "Initialising Extensions Scripting Module");
+ MainLog.Instance.Verbose("SCRIPTMODULE", "Initialising Extensions Scripting Module");
m_scene = scene;
m_scene.RegisterModuleInterface(this);
@@ -78,12 +79,10 @@ namespace OpenSim.Region.ExtensionsScriptModule
public void PostInitialise()
{
-
}
public void Close()
{
-
}
public string Name
@@ -92,8 +91,8 @@ namespace OpenSim.Region.ExtensionsScriptModule
}
public bool IsSharedModule
-{
- get { return false; }
+ {
+ get { return false; }
}
public bool Compile(string filename)
@@ -127,7 +126,8 @@ namespace OpenSim.Region.ExtensionsScriptModule
public bool AddPreCompiledScript(IScript script)
{
MainLog.Instance.Verbose("Loading script " + script.Name);
- ScriptInfo scriptInfo = new ScriptInfo(m_scene); // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
+ ScriptInfo scriptInfo = new ScriptInfo(m_scene);
+ // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
script.Initialise(scriptInfo);
scripts.Add(script);
@@ -141,9 +141,9 @@ namespace OpenSim.Region.ExtensionsScriptModule
bool AddPreCompiledScript(IScript script);
}
- interface IScriptCompiler
+ internal interface IScriptCompiler
{
Dictionary compile(string filename);
string FileExt();
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs
index 2d4d898..a8f1de1 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs
@@ -27,24 +27,26 @@
*/
using System.Reflection;
using System.Runtime.InteropServices;
+
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
-[assembly: AssemblyTitle("PhysXplugin")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("PhysXplugin")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly : AssemblyTitle("PhysXplugin")]
+[assembly : AssemblyDescription("")]
+[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyCompany("")]
+[assembly : AssemblyProduct("PhysXplugin")]
+[assembly : AssemblyCopyright("")]
+[assembly : AssemblyTrademark("")]
+[assembly : AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
-[assembly: ComVisible(false)]
+
+[assembly : ComVisible(false)]
// The assembly version has following format :
//
@@ -53,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
-[assembly: AssemblyVersion("1.0.*")]
+[assembly : AssemblyVersion("1.0.*")]
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
index 95e6095..b412818 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
@@ -39,7 +39,6 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
{
public BasicPhysicsPlugin()
{
-
}
public bool Init()
@@ -59,7 +58,6 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
public void Dispose()
{
-
}
}
@@ -70,7 +68,6 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
public BasicScene()
{
-
}
public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
@@ -83,17 +80,15 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
public override void RemovePrim(PhysicsActor prim)
{
-
}
public override void RemoveAvatar(PhysicsActor actor)
{
- BasicActor act = (BasicActor)actor;
+ BasicActor act = (BasicActor) actor;
if (_actors.Contains(act))
{
_actors.Remove(act);
}
-
}
/*
@@ -102,7 +97,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
return null;
}
*/
- public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, PhysicsVector size, Quaternion rotation)
+
+ public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position,
+ PhysicsVector size, Quaternion rotation)
{
return null;
}
@@ -112,8 +109,8 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
{
foreach (BasicActor actor in _actors)
{
- actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep);
- actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep);
+ actor.Position.X = actor.Position.X + (actor.Velocity.X*timeStep);
+ actor.Position.Y = actor.Position.Y + (actor.Velocity.Y*timeStep);
if (actor.Position.Y < 0)
{
actor.Position.Y = 0.1F;
@@ -132,17 +129,18 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
actor.Position.X = 255.9F;
}
- float height = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1.0f;
+ float height = _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 1.0f;
if (actor.Flying)
{
- if (actor.Position.Z + (actor.Velocity.Z * timeStep) < _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 2)
+ if (actor.Position.Z + (actor.Velocity.Z*timeStep) <
+ _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 2)
{
actor.Position.Z = height;
actor.Velocity.Z = 0;
}
else
{
- actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep);
+ actor.Position.Z = actor.Position.Z + (actor.Velocity.Z*timeStep);
}
}
else
@@ -150,32 +148,26 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
actor.Position.Z = height;
actor.Velocity.Z = 0;
}
-
-
}
}
public override void GetResults()
{
-
}
public override bool IsThreaded
{
- get
- {
- return (false); // for now we won't be multithreaded
+ get { return (false); // for now we won't be multithreaded
}
}
public override void SetTerrain(float[] heightMap)
{
- this._heightMap = heightMap;
+ _heightMap = heightMap;
}
public override void DeleteTerrain()
{
-
}
}
@@ -185,6 +177,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
private PhysicsVector _velocity;
private PhysicsVector _acceleration;
private bool flying;
+
public BasicActor()
{
_velocity = new PhysicsVector();
@@ -194,97 +187,56 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
public override bool Flying
{
- get
- {
- return flying;
- }
- set
- {
- flying = value;
- }
+ get { return flying; }
+ set { flying = value; }
}
public override PhysicsVector Position
{
- get
- {
- return _position;
- }
- set
- {
- _position = value;
- }
+ get { return _position; }
+ set { _position = value; }
}
public override PhysicsVector Size
{
- get
- {
- return new PhysicsVector(0, 0, 0);
- }
- set
- {
- }
+ get { return new PhysicsVector(0, 0, 0); }
+ set { }
}
public override PhysicsVector Velocity
{
- get
- {
- return _velocity;
- }
- set
- {
- _velocity = value;
- }
+ get { return _velocity; }
+ set { _velocity = value; }
}
public override Quaternion Orientation
{
- get
- {
- return Quaternion.Identity;
- }
- set
- {
-
- }
+ get { return Quaternion.Identity; }
+ set { }
}
public override PhysicsVector Acceleration
{
- get
- {
- return _acceleration;
- }
-
+ get { return _acceleration; }
}
public override bool Kinematic
{
- get
- {
- return true;
- }
- set
- {
-
- }
+ get { return true; }
+ set { }
}
+
public void SetAcceleration(PhysicsVector accel)
{
- this._acceleration = accel;
+ _acceleration = accel;
}
public override void AddForce(PhysicsVector force)
{
-
}
public override void SetMomentum(PhysicsVector momentum)
{
-
}
}
-
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/BulletXPlugin/AssemblyInfo.cs b/OpenSim/Region/Physics/BulletXPlugin/AssemblyInfo.cs
index 0180917..c8596f7 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/AssemblyInfo.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@@ -27,24 +27,26 @@
*/
using System.Reflection;
using System.Runtime.InteropServices;
+
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
-[assembly: AssemblyTitle("BulletXPlugin")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("BulletXPlugin")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly : AssemblyTitle("BulletXPlugin")]
+[assembly : AssemblyDescription("")]
+[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyCompany("")]
+[assembly : AssemblyProduct("BulletXPlugin")]
+[assembly : AssemblyCopyright("")]
+[assembly : AssemblyTrademark("")]
+[assembly : AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
-[assembly: ComVisible(false)]
+
+[assembly : ComVisible(false)]
// The assembly version has following format :
//
@@ -53,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly : AssemblyVersion("1.0.0.0")]
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index 9fdc017..1658e2d 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -27,6 +27,7 @@
*/
#region Copyright
+
/*
* Copyright (c) Contributors, http://www.openmetaverse.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
@@ -54,18 +55,21 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
#endregion
+
#region References
+
using System;
using System.Collections.Generic;
-using OpenSim.Region.Physics.Manager;
-using OpenSim.Framework;
-using Axiom.Math;
-using AxiomQuaternion = Axiom.Math.Quaternion;
-//Specific References for BulletXPlugin
using MonoXnaCompactMaths;
+using OpenSim.Framework;
+using OpenSim.Region.Physics.Manager;
using XnaDevRu.BulletX;
using XnaDevRu.BulletX.Dynamics;
+using AxiomQuaternion = Axiom.Math.Quaternion;
+using BoxShape=XnaDevRu.BulletX.BoxShape;
+//Specific References for BulletXPlugin
#endregion
@@ -80,27 +84,31 @@ namespace OpenSim.Region.Physics.BulletXPlugin
{
}
}
+
///
/// BulletXConversions are called now BulletXMaths
/// This Class converts objects and types for BulletX and give some operations
///
- public class BulletXMaths
+ public class BulletXMaths
{
//Vector3
- public static MonoXnaCompactMaths.Vector3 PhysicsVectorToXnaVector3(PhysicsVector physicsVector)
+ public static Vector3 PhysicsVectorToXnaVector3(PhysicsVector physicsVector)
{
- return new MonoXnaCompactMaths.Vector3(physicsVector.X, physicsVector.Y, physicsVector.Z);
+ return new Vector3(physicsVector.X, physicsVector.Y, physicsVector.Z);
}
- public static PhysicsVector XnaVector3ToPhysicsVector(MonoXnaCompactMaths.Vector3 xnaVector3)
+
+ public static PhysicsVector XnaVector3ToPhysicsVector(Vector3 xnaVector3)
{
return new PhysicsVector(xnaVector3.X, xnaVector3.Y, xnaVector3.Z);
}
+
//Quaternion
- public static MonoXnaCompactMaths.Quaternion AxiomQuaternionToXnaQuaternion(AxiomQuaternion axiomQuaternion)
+ public static Quaternion AxiomQuaternionToXnaQuaternion(AxiomQuaternion axiomQuaternion)
{
- return new MonoXnaCompactMaths.Quaternion(axiomQuaternion.x, axiomQuaternion.y, axiomQuaternion.z, axiomQuaternion.w);
+ return new Quaternion(axiomQuaternion.x, axiomQuaternion.y, axiomQuaternion.z, axiomQuaternion.w);
}
- public static AxiomQuaternion XnaQuaternionToAxiomQuaternion(MonoXnaCompactMaths.Quaternion xnaQuaternion)
+
+ public static AxiomQuaternion XnaQuaternionToAxiomQuaternion(Quaternion xnaQuaternion)
{
return new AxiomQuaternion(xnaQuaternion.W, xnaQuaternion.X, xnaQuaternion.Y, xnaQuaternion.Z);
}
@@ -110,70 +118,79 @@ namespace OpenSim.Region.Physics.BulletXPlugin
//- GetRotation (class MatrixOperations)
//- GetElement (class MathHelper)
//- SetElement (class MathHelper)
- internal static void SetRotation(ref Matrix m, MonoXnaCompactMaths.Quaternion q)
+ internal static void SetRotation(ref Matrix m, Quaternion q)
{
float d = q.LengthSquared();
- float s = 2f / d;
- float xs = q.X * s, ys = q.Y * s, zs = q.Z * s;
- float wx = q.W * xs, wy = q.W * ys, wz = q.W * zs;
- float xx = q.X * xs, xy = q.X * ys, xz = q.X * zs;
- float yy = q.Y * ys, yz = q.Y * zs, zz = q.Z * zs;
+ float s = 2f/d;
+ float xs = q.X*s, ys = q.Y*s, zs = q.Z*s;
+ float wx = q.W*xs, wy = q.W*ys, wz = q.W*zs;
+ float xx = q.X*xs, xy = q.X*ys, xz = q.X*zs;
+ float yy = q.Y*ys, yz = q.Y*zs, zz = q.Z*zs;
m = new Matrix(1 - (yy + zz), xy - wz, xz + wy, 0,
- xy + wz, 1 - (xx + zz), yz - wx, 0,
- xz - wy, yz + wx, 1 - (xx + yy), 0,
- m.M41, m.M42, m.M43, 1);
+ xy + wz, 1 - (xx + zz), yz - wx, 0,
+ xz - wy, yz + wx, 1 - (xx + yy), 0,
+ m.M41, m.M42, m.M43, 1);
}
- internal static MonoXnaCompactMaths.Quaternion GetRotation(Matrix m)
+
+ internal static Quaternion GetRotation(Matrix m)
{
- MonoXnaCompactMaths.Quaternion q = new MonoXnaCompactMaths.Quaternion();
+ Quaternion q = new Quaternion();
float trace = m.M11 + m.M22 + m.M33;
if (trace > 0)
{
- float s = (float)Math.Sqrt(trace + 1);
- q.W = s * 0.5f;
- s = 0.5f / s;
+ float s = (float) Math.Sqrt(trace + 1);
+ q.W = s*0.5f;
+ s = 0.5f/s;
- q.X = (m.M32 - m.M23) * s;
- q.Y = (m.M13 - m.M31) * s;
- q.Z = (m.M21 - m.M12) * s;
+ q.X = (m.M32 - m.M23)*s;
+ q.Y = (m.M13 - m.M31)*s;
+ q.Z = (m.M21 - m.M12)*s;
}
else
{
- int i = m.M11 < m.M22 ?
- (m.M22 < m.M33 ? 2 : 1) :
- (m.M11 < m.M33 ? 2 : 0);
- int j = (i + 1) % 3;
- int k = (i + 2) % 3;
-
- float s = (float)Math.Sqrt(GetElement(m, i, i) - GetElement(m, j, j) - GetElement(m, k, k) + 1);
- SetElement(ref q, i, s * 0.5f);
- s = 0.5f / s;
-
- q.W = (GetElement(m, k, j) - GetElement(m, j, k)) * s;
- SetElement(ref q, j, (GetElement(m, j, i) + GetElement(m, i, j)) * s);
- SetElement(ref q, k, (GetElement(m, k, i) + GetElement(m, i, k)) * s);
+ int i = m.M11 < m.M22
+ ?
+ (m.M22 < m.M33 ? 2 : 1)
+ :
+ (m.M11 < m.M33 ? 2 : 0);
+ int j = (i + 1)%3;
+ int k = (i + 2)%3;
+
+ float s = (float) Math.Sqrt(GetElement(m, i, i) - GetElement(m, j, j) - GetElement(m, k, k) + 1);
+ SetElement(ref q, i, s*0.5f);
+ s = 0.5f/s;
+
+ q.W = (GetElement(m, k, j) - GetElement(m, j, k))*s;
+ SetElement(ref q, j, (GetElement(m, j, i) + GetElement(m, i, j))*s);
+ SetElement(ref q, k, (GetElement(m, k, i) + GetElement(m, i, k))*s);
}
return q;
}
- internal static float SetElement(ref MonoXnaCompactMaths.Quaternion q, int index, float value)
+
+ internal static float SetElement(ref Quaternion q, int index, float value)
{
switch (index)
{
case 0:
- q.X = value; break;
+ q.X = value;
+ break;
case 1:
- q.Y = value; break;
+ q.Y = value;
+ break;
case 2:
- q.Z = value; break;
+ q.Z = value;
+ break;
case 3:
- q.W = value; break;
+ q.W = value;
+ break;
}
return 0;
}
+
internal static float GetElement(Matrix mat, int row, int col)
{
switch (row)
@@ -187,7 +204,8 @@ namespace OpenSim.Region.Physics.BulletXPlugin
return mat.M12;
case 2:
return mat.M13;
- } break;
+ }
+ break;
case 1:
switch (col)
{
@@ -197,7 +215,8 @@ namespace OpenSim.Region.Physics.BulletXPlugin
return mat.M22;
case 2:
return mat.M23;
- } break;
+ }
+ break;
case 2:
switch (col)
{
@@ -207,12 +226,14 @@ namespace OpenSim.Region.Physics.BulletXPlugin
return mat.M32;
case 2:
return mat.M33;
- } break;
+ }
+ break;
}
return 0;
}
}
+
///
/// PhysicsPlugin Class for BulletX
///
@@ -223,10 +244,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin
public BulletXPlugin()
{
}
+
public bool Init()
{
return true;
}
+
public PhysicsScene GetScene()
{
if (_mScene == null)
@@ -235,20 +258,24 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
return (_mScene);
}
+
public string GetName()
{
- return ("modified_BulletX");//Changed!! "BulletXEngine" To "modified_BulletX"
+ return ("modified_BulletX"); //Changed!! "BulletXEngine" To "modified_BulletX"
}
+
public void Dispose()
{
}
}
+
///
/// PhysicsScene Class for BulletX
///
public class BulletXScene : PhysicsScene
{
#region BulletXScene Fields
+
public DiscreteDynamicsWorld ddWorld;
private CollisionDispatcher cDispatcher;
private OverlappingPairCache opCache;
@@ -271,33 +298,58 @@ namespace OpenSim.Region.Physics.BulletXPlugin
private List _characters = new List();
private List _prims = new List();
- public static float Gravity { get { return gravity; } }
- public static float HeightLevel0 { get { return heightLevel0; } }
- public static float HeightLevel1 { get { return heightLevel1; } }
- public static float LowGravityFactor { get { return lowGravityFactor; } }
- public static int MaxXY { get { return maxXY; } }
- public static int MaxZ { get { return maxZ; } }
+ public static float Gravity
+ {
+ get { return gravity; }
+ }
+
+ public static float HeightLevel0
+ {
+ get { return heightLevel0; }
+ }
+
+ public static float HeightLevel1
+ {
+ get { return heightLevel1; }
+ }
+
+ public static float LowGravityFactor
+ {
+ get { return lowGravityFactor; }
+ }
+
+ public static int MaxXY
+ {
+ get { return maxXY; }
+ }
+
+ public static int MaxZ
+ {
+ get { return maxZ; }
+ }
private List _forgottenRigidBodies = new List();
internal string is_ex_message = "Can't remove rigidBody!: ";
+
#endregion
public BulletXScene()
{
cDispatcher = new CollisionDispatcher();
- MonoXnaCompactMaths.Vector3 worldMinDim = new MonoXnaCompactMaths.Vector3((float)minXY, (float)minXY, (float)minZ);
- MonoXnaCompactMaths.Vector3 worldMaxDim = new MonoXnaCompactMaths.Vector3((float)maxXY, (float)maxXY, (float)maxZ);
+ Vector3 worldMinDim = new Vector3((float) minXY, (float) minXY, (float) minZ);
+ Vector3 worldMaxDim = new Vector3((float) maxXY, (float) maxXY, (float) maxZ);
opCache = new AxisSweep3(worldMinDim, worldMaxDim, maxHandles);
sicSolver = new SequentialImpulseConstraintSolver();
lock (BulletXLock)
{
ddWorld = new DiscreteDynamicsWorld(cDispatcher, opCache, sicSolver);
- ddWorld.Gravity = new MonoXnaCompactMaths.Vector3(0, 0, -gravity);
+ ddWorld.Gravity = new Vector3(0, 0, -gravity);
}
//this._heightmap = new float[65536];
}
- public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
+
+ public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
{
PhysicsVector pos = new PhysicsVector();
pos.X = position.X;
@@ -311,6 +363,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
return newAv;
}
+
public override void RemoveAvatar(PhysicsActor actor)
{
if (actor is BulletXCharacter)
@@ -319,20 +372,22 @@ namespace OpenSim.Region.Physics.BulletXPlugin
{
try
{
- ddWorld.RemoveRigidBody(((BulletXCharacter)actor).RigidBody);
+ ddWorld.RemoveRigidBody(((BulletXCharacter) actor).RigidBody);
}
catch (Exception ex)
{
BulletXMessage(is_ex_message + ex.Message, true);
- ((BulletXCharacter)actor).RigidBody.ActivationState = ActivationState.DisableSimulation;
- AddForgottenRigidBody(((BulletXCharacter)actor).RigidBody);
+ ((BulletXCharacter) actor).RigidBody.ActivationState = ActivationState.DisableSimulation;
+ AddForgottenRigidBody(((BulletXCharacter) actor).RigidBody);
}
- _characters.Remove((BulletXCharacter)actor);
+ _characters.Remove((BulletXCharacter) actor);
}
GC.Collect();
}
}
- public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, PhysicsVector size, AxiomQuaternion rotation)
+
+ public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position,
+ PhysicsVector size, AxiomQuaternion rotation)
{
PhysicsActor result;
@@ -358,11 +413,14 @@ namespace OpenSim.Region.Physics.BulletXPlugin
return result;
}
- public PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Axiom.Math.Quaternion rotation)
+
+ public PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, AxiomQuaternion rotation)
{
return AddPrim("", position, size, rotation, null, null);
}
- public PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, AxiomQuaternion rotation, Mesh mesh, PrimitiveBaseShape pbs)
+
+ public PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, AxiomQuaternion rotation,
+ Mesh mesh, PrimitiveBaseShape pbs)
{
BulletXPrim newPrim = null;
lock (BulletXLock)
@@ -372,6 +430,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
return newPrim;
}
+
public override void RemovePrim(PhysicsActor prim)
{
if (prim is BulletXPrim)
@@ -380,19 +439,20 @@ namespace OpenSim.Region.Physics.BulletXPlugin
{
try
{
- ddWorld.RemoveRigidBody(((BulletXPrim)prim).RigidBody);
+ ddWorld.RemoveRigidBody(((BulletXPrim) prim).RigidBody);
}
catch (Exception ex)
{
BulletXMessage(is_ex_message + ex.Message, true);
- ((BulletXPrim)prim).RigidBody.ActivationState = ActivationState.DisableSimulation;
- AddForgottenRigidBody(((BulletXPrim)prim).RigidBody);
+ ((BulletXPrim) prim).RigidBody.ActivationState = ActivationState.DisableSimulation;
+ AddForgottenRigidBody(((BulletXPrim) prim).RigidBody);
}
- _prims.Remove((BulletXPrim)prim);
+ _prims.Remove((BulletXPrim) prim);
}
GC.Collect();
}
}
+
public override void Simulate(float timeStep)
{
lock (BulletXLock)
@@ -408,6 +468,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
UpdateKineticsForAll();
}
}
+
private void MoveAllObjects(float timeStep)
{
foreach (BulletXCharacter actor in _characters)
@@ -418,6 +479,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
{
}
}
+
private void ValidateHeightForAll()
{
float _height;
@@ -431,7 +493,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
foreach (BulletXPrim prim in _prims)
{
//_height = HeightValue(prim.RigidBodyPosition);
- _height = _simFlatPlanet.HeightValue(prim.RigidBodyPosition);
+ _height = _simFlatPlanet.HeightValue(prim.RigidBodyPosition);
prim.ValidateHeight(_height);
//if (_simFlatPlanet.heightIsNotValid(prim.RigidBodyPosition, out _height)) prim.ValidateHeight(_height);
}
@@ -444,6 +506,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
// prim.ValidateHeight(0);
//}
}
+
private void UpdateKineticsForAll()
{
//UpdatePosition > UpdateKinetics.
@@ -458,17 +521,17 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
//if(this._simFlatPlanet!=null) this._simFlatPlanet.Restore();
}
+
public override void GetResults()
{
-
}
+
public override bool IsThreaded
{
- get
- {
- return (false); // for now we won't be multithreaded
+ get { return (false); // for now we won't be multithreaded
}
}
+
public override void SetTerrain(float[] heightMap)
{
////As the same as ODE, heightmap (x,y) must be swapped for BulletX
@@ -494,41 +557,44 @@ namespace OpenSim.Region.Physics.BulletXPlugin
DeleteTerrain();
//There is a BulletXLock inside the constructor of BulletXPlanet
//this._simFlatPlanet = new BulletXPlanet(this, swappedHeightMap);
- this._simFlatPlanet = new BulletXPlanet(this, heightMap);
+ _simFlatPlanet = new BulletXPlanet(this, heightMap);
//this._heightmap = heightMap;
}
+
public override void DeleteTerrain()
{
- if (this._simFlatPlanet != null)
+ if (_simFlatPlanet != null)
{
lock (BulletXLock)
{
try
{
- ddWorld.RemoveRigidBody(this._simFlatPlanet.RigidBody);
+ ddWorld.RemoveRigidBody(_simFlatPlanet.RigidBody);
}
catch (Exception ex)
{
BulletXMessage(is_ex_message + ex.Message, true);
- this._simFlatPlanet.RigidBody.ActivationState = ActivationState.DisableSimulation;
- AddForgottenRigidBody(this._simFlatPlanet.RigidBody);
+ _simFlatPlanet.RigidBody.ActivationState = ActivationState.DisableSimulation;
+ AddForgottenRigidBody(_simFlatPlanet.RigidBody);
}
}
- this._simFlatPlanet = null;
+ _simFlatPlanet = null;
GC.Collect();
BulletXMessage("Terrain erased!", false);
}
//this._heightmap = null;
}
+
internal void AddForgottenRigidBody(RigidBody forgottenRigidBody)
{
_forgottenRigidBodies.Add(forgottenRigidBody);
}
+
private void RemoveForgottenRigidBodies()
{
RigidBody forgottenRigidBody;
int nRigidBodies = _forgottenRigidBodies.Count;
- for(int i = nRigidBodies - 1; i >= 0; i--)
+ for (int i = nRigidBodies - 1; i >= 0; i--)
{
forgottenRigidBody = _forgottenRigidBodies[i];
try
@@ -544,10 +610,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
GC.Collect();
}
+
internal void BulletXMessage(string message, bool isWarning)
{
PhysicsPluginManager.PhysicsPluginMessage("[Modified BulletX]:\t" + message, isWarning);
}
+
//temp
//private float HeightValue(MonoXnaCompactMaths.Vector3 position)
//{
@@ -559,10 +627,11 @@ namespace OpenSim.Region.Physics.BulletXPlugin
// height = this._heightmap[li_y * 256 + li_x];
// if (height < 0) height = 0;
// else if (height > maxZ) height = maxZ;
-
+
// return height;
//}
}
+
///
/// PhysicsActor Character Class for BulletX
///
@@ -576,21 +645,24 @@ namespace OpenSim.Region.Physics.BulletXPlugin
private bool flying;
private RigidBody rigidBody;
- public MonoXnaCompactMaths.Vector3 RigidBodyPosition
+ public Vector3 RigidBodyPosition
{
- get { return this.rigidBody.CenterOfMassPosition; }
+ get { return rigidBody.CenterOfMassPosition; }
}
+
public BulletXCharacter(BulletXScene parent_scene, PhysicsVector pos)
: this("", parent_scene, pos)
{
}
+
public BulletXCharacter(String avName, BulletXScene parent_scene, PhysicsVector pos)
: this(avName, parent_scene, pos, new PhysicsVector(), new PhysicsVector(), new PhysicsVector(),
- AxiomQuaternion.Identity)
+ AxiomQuaternion.Identity)
{
}
+
public BulletXCharacter(String avName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector velocity,
- PhysicsVector size, PhysicsVector acceleration, AxiomQuaternion orientation)
+ PhysicsVector size, PhysicsVector acceleration, AxiomQuaternion orientation)
{
//This fields will be removed. They're temporal
float _sizeX = 0.5f;
@@ -622,23 +694,23 @@ namespace OpenSim.Region.Physics.BulletXPlugin
//For now, like ODE, collisionShape = sphere of radious = 1.0
CollisionShape _collisionShape = new SphereShape(1.0f);
DefaultMotionState _motionState = new DefaultMotionState(_startTransform, _centerOfMassOffset);
- MonoXnaCompactMaths.Vector3 _localInertia = new MonoXnaCompactMaths.Vector3();
+ Vector3 _localInertia = new Vector3();
_collisionShape.CalculateLocalInertia(_mass, out _localInertia); //Always when mass > 0
- rigidBody = new RigidBody(_mass, _motionState, _collisionShape, _localInertia, _linearDamping, _angularDamping, _friction, _restitution);
+ rigidBody =
+ new RigidBody(_mass, _motionState, _collisionShape, _localInertia, _linearDamping, _angularDamping,
+ _friction, _restitution);
//rigidBody.ActivationState = ActivationState.DisableDeactivation;
//It's seems that there are a bug with rigidBody constructor and its CenterOfMassPosition
- MonoXnaCompactMaths.Vector3 _vDebugTranslation;
+ Vector3 _vDebugTranslation;
_vDebugTranslation = _startTransform.Translation - rigidBody.CenterOfMassPosition;
rigidBody.Translate(_vDebugTranslation);
parent_scene.ddWorld.AddRigidBody(rigidBody);
}
}
+
public override PhysicsVector Position
{
- get
- {
- return _position;
- }
+ get { return _position; }
set
{
lock (BulletXScene.BulletXLock)
@@ -648,12 +720,10 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
}
}
+
public override PhysicsVector Velocity
{
- get
- {
- return _velocity;
- }
+ get { return _velocity; }
set
{
lock (BulletXScene.BulletXLock)
@@ -663,12 +733,10 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
}
}
+
public override PhysicsVector Size
{
- get
- {
- return _size;
- }
+ get { return _size; }
set
{
lock (BulletXScene.BulletXLock)
@@ -677,19 +745,15 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
}
}
+
public override PhysicsVector Acceleration
{
- get
- {
- return _acceleration;
- }
+ get { return _acceleration; }
}
+
public override AxiomQuaternion Orientation
{
- get
- {
- return _orientation;
- }
+ get { return _orientation; }
set
{
lock (BulletXScene.BulletXLock)
@@ -698,24 +762,18 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
}
}
+
public RigidBody RigidBody
{
- get
- {
- return rigidBody;
- }
+ get { return rigidBody; }
}
+
public override bool Flying
{
- get
- {
- return flying;
- }
- set
- {
- flying = value;
- }
+ get { return flying; }
+ set { flying = value; }
}
+
public void SetAcceleration(PhysicsVector accel)
{
lock (BulletXScene.BulletXLock)
@@ -723,116 +781,121 @@ namespace OpenSim.Region.Physics.BulletXPlugin
_acceleration = accel;
}
}
+
public override bool Kinematic
{
- get
- {
- return false;
- }
- set
- {
-
- }
+ get { return false; }
+ set { }
}
+
public override void AddForce(PhysicsVector force)
{
-
}
+
public override void SetMomentum(PhysicsVector momentum)
{
-
}
+
internal void Move(float timeStep)
{
- MonoXnaCompactMaths.Vector3 vec = new MonoXnaCompactMaths.Vector3();
+ Vector3 vec = new Vector3();
//At this point it's supossed that:
//_velocity == rigidBody.LinearVelocity
- vec.X = this._velocity.X;
- vec.Y = this._velocity.Y;
- vec.Z = this._velocity.Z;
+ vec.X = _velocity.X;
+ vec.Y = _velocity.Y;
+ vec.Z = _velocity.Z;
if ((vec.X != 0.0f) || (vec.Y != 0.0f) || (vec.Z != 0.0f)) rigidBody.Activate();
if (flying)
{
//Antigravity with movement
- if (this._position.Z <= BulletXScene.HeightLevel0)
+ if (_position.Z <= BulletXScene.HeightLevel0)
{
- vec.Z += BulletXScene.Gravity * timeStep;
+ vec.Z += BulletXScene.Gravity*timeStep;
}
- //Lowgravity with movement
- else if ((this._position.Z > BulletXScene.HeightLevel0)
- && (this._position.Z <= BulletXScene.HeightLevel1))
+ //Lowgravity with movement
+ else if ((_position.Z > BulletXScene.HeightLevel0)
+ && (_position.Z <= BulletXScene.HeightLevel1))
{
- vec.Z += BulletXScene.Gravity * timeStep * (1.0f - BulletXScene.LowGravityFactor);
+ vec.Z += BulletXScene.Gravity*timeStep*(1.0f - BulletXScene.LowGravityFactor);
}
- //Lowgravity with...
- else if (this._position.Z > BulletXScene.HeightLevel1)
+ //Lowgravity with...
+ else if (_position.Z > BulletXScene.HeightLevel1)
{
if (vec.Z > 0) //no movement
- vec.Z = BulletXScene.Gravity * timeStep * (1.0f - BulletXScene.LowGravityFactor);
+ vec.Z = BulletXScene.Gravity*timeStep*(1.0f - BulletXScene.LowGravityFactor);
else
- vec.Z += BulletXScene.Gravity * timeStep * (1.0f - BulletXScene.LowGravityFactor);
-
+ vec.Z += BulletXScene.Gravity*timeStep*(1.0f - BulletXScene.LowGravityFactor);
}
}
rigidBody.LinearVelocity = vec;
}
+
//This validation is very basic
internal void ValidateHeight(float heighmapPositionValue)
{
- if (rigidBody.CenterOfMassPosition.Z < heighmapPositionValue + _size.Z / 2.0f)
+ if (rigidBody.CenterOfMassPosition.Z < heighmapPositionValue + _size.Z/2.0f)
{
Matrix m = rigidBody.WorldTransform;
- MonoXnaCompactMaths.Vector3 v3 = m.Translation;
- v3.Z = heighmapPositionValue + _size.Z / 2.0f;
+ Vector3 v3 = m.Translation;
+ v3.Z = heighmapPositionValue + _size.Z/2.0f;
m.Translation = v3;
rigidBody.WorldTransform = m;
//When an Avie touch the ground it's vertical velocity it's reduced to ZERO
- Speed(new PhysicsVector(this.rigidBody.LinearVelocity.X, this.rigidBody.LinearVelocity.Y, 0.0f));
+ Speed(new PhysicsVector(rigidBody.LinearVelocity.X, rigidBody.LinearVelocity.Y, 0.0f));
}
}
+
internal void UpdateKinetics()
{
- this._position = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.CenterOfMassPosition);
- this._velocity = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.LinearVelocity);
+ _position = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.CenterOfMassPosition);
+ _velocity = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.LinearVelocity);
//Orientation it seems that it will be the default.
ReOrient();
}
#region Methods for updating values of RigidBody
+
private void Translate()
{
- Translate(this._position);
+ Translate(_position);
}
+
private void Translate(PhysicsVector _newPos)
{
- MonoXnaCompactMaths.Vector3 _translation;
+ Vector3 _translation;
_translation = BulletXMaths.PhysicsVectorToXnaVector3(_newPos) - rigidBody.CenterOfMassPosition;
rigidBody.Translate(_translation);
}
+
private void Speed()
{
- Speed(this._velocity);
+ Speed(_velocity);
}
+
private void Speed(PhysicsVector _newSpeed)
{
- MonoXnaCompactMaths.Vector3 _speed;
+ Vector3 _speed;
_speed = BulletXMaths.PhysicsVectorToXnaVector3(_newSpeed);
rigidBody.LinearVelocity = _speed;
}
+
private void ReOrient()
{
- ReOrient(this._orientation);
+ ReOrient(_orientation);
}
+
private void ReOrient(AxiomQuaternion _newOrient)
{
- MonoXnaCompactMaths.Quaternion _newOrientation;
+ Quaternion _newOrientation;
_newOrientation = BulletXMaths.AxiomQuaternionToXnaQuaternion(_newOrient);
Matrix _comTransform = rigidBody.CenterOfMassTransform;
BulletXMaths.SetRotation(ref _comTransform, _newOrientation);
rigidBody.CenterOfMassTransform = _comTransform;
}
+
#endregion
}
+
///
/// PhysicsActor Prim Class for BulletX
///
@@ -851,27 +914,32 @@ namespace OpenSim.Region.Physics.BulletXPlugin
//_physical value will be linked with the prim object value
private Boolean _physical = false;
- public MonoXnaCompactMaths.Vector3 RigidBodyPosition
+ public Vector3 RigidBodyPosition
{
- get { return this.rigidBody.CenterOfMassPosition; }
+ get { return rigidBody.CenterOfMassPosition; }
}
+
public BulletXPrim(BulletXScene parent_scene, PhysicsVector pos, PhysicsVector size, AxiomQuaternion rotation)
: this("", parent_scene, pos, new PhysicsVector(), size, new PhysicsVector(), rotation, null, null)
{
}
- public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector size,
- AxiomQuaternion rotation, Mesh mesh, PrimitiveBaseShape pbs)
+
+ public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector size,
+ AxiomQuaternion rotation, Mesh mesh, PrimitiveBaseShape pbs)
: this(primName, parent_scene, pos, new PhysicsVector(), size, new PhysicsVector(), rotation, mesh, pbs)
{
}
- public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector velocity, PhysicsVector size,
- PhysicsVector aceleration, AxiomQuaternion rotation, Mesh mesh, PrimitiveBaseShape pbs)
+
+ public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector velocity,
+ PhysicsVector size,
+ PhysicsVector aceleration, AxiomQuaternion rotation, Mesh mesh, PrimitiveBaseShape pbs)
{
if ((size.X == 0) || (size.Y == 0) || (size.Z == 0)) throw new Exception("Size 0");
if (rotation.Norm == 0f) rotation = AxiomQuaternion.Identity;
_position = pos;
- if (_physical) _velocity = velocity; else _velocity = new PhysicsVector();
+ if (_physical) _velocity = velocity;
+ else _velocity = new PhysicsVector();
_size = size;
_acceleration = aceleration;
_orientation = rotation;
@@ -889,26 +957,26 @@ namespace OpenSim.Region.Physics.BulletXPlugin
{
_startTransform.Translation = BulletXMaths.PhysicsVectorToXnaVector3(pos);
//For now all prims are boxes
- CollisionShape _collisionShape = new XnaDevRu.BulletX.BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(_size) / 2.0f);
+ CollisionShape _collisionShape = new BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(_size)/2.0f);
DefaultMotionState _motionState = new DefaultMotionState(_startTransform, _centerOfMassOffset);
- MonoXnaCompactMaths.Vector3 _localInertia = new MonoXnaCompactMaths.Vector3();
- if(_physical) _collisionShape.CalculateLocalInertia(Mass, out _localInertia); //Always when mass > 0
- rigidBody = new RigidBody(Mass, _motionState, _collisionShape, _localInertia, _linearDamping, _angularDamping, _friction, _restitution);
+ Vector3 _localInertia = new Vector3();
+ if (_physical) _collisionShape.CalculateLocalInertia(Mass, out _localInertia); //Always when mass > 0
+ rigidBody =
+ new RigidBody(Mass, _motionState, _collisionShape, _localInertia, _linearDamping, _angularDamping,
+ _friction, _restitution);
//rigidBody.ActivationState = ActivationState.DisableDeactivation;
//It's seems that there are a bug with rigidBody constructor and its CenterOfMassPosition
- MonoXnaCompactMaths.Vector3 _vDebugTranslation;
+ Vector3 _vDebugTranslation;
_vDebugTranslation = _startTransform.Translation - rigidBody.CenterOfMassPosition;
rigidBody.Translate(_vDebugTranslation);
//---
parent_scene.ddWorld.AddRigidBody(rigidBody);
}
}
+
public override PhysicsVector Position
{
- get
- {
- return _position;
- }
+ get { return _position; }
set
{
lock (BulletXScene.BulletXLock)
@@ -918,12 +986,10 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
}
}
+
public override PhysicsVector Velocity
{
- get
- {
- return _velocity;
- }
+ get { return _velocity; }
set
{
lock (BulletXScene.BulletXLock)
@@ -941,12 +1007,10 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
}
}
+
public override PhysicsVector Size
{
- get
- {
- return _size;
- }
+ get { return _size; }
set
{
lock (BulletXScene.BulletXLock)
@@ -956,19 +1020,15 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
}
}
+
public override PhysicsVector Acceleration
{
- get
- {
- return _acceleration;
- }
+ get { return _acceleration; }
}
+
public override AxiomQuaternion Orientation
{
- get
- {
- return _orientation;
- }
+ get { return _orientation; }
set
{
lock (BulletXScene.BulletXLock)
@@ -978,43 +1038,34 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
}
}
+
public float Mass
{
get
{
//For now all prims are boxes
- return (_physical ? 1 : 0) * _density * _size.X * _size.Y * _size.Z;
+ return (_physical ? 1 : 0)*_density*_size.X*_size.Y*_size.Z;
}
}
+
public RigidBody RigidBody
{
- get
- {
- return rigidBody;
- }
+ get { return rigidBody; }
}
+
public override bool Flying
{
- get
- {
- return false; //no flying prims for you
- }
- set
- {
-
+ get { return false; //no flying prims for you
}
+ set { }
}
+
public Boolean Physical
{
- get
- {
- return _physical;
- }
- set
- {
- _physical = value;
- }
+ get { return _physical; }
+ set { _physical = value; }
}
+
public void SetAcceleration(PhysicsVector accel)
{
lock (BulletXScene.BulletXLock)
@@ -1022,6 +1073,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
_acceleration = accel;
}
}
+
public override bool Kinematic
{
get
@@ -1034,36 +1086,38 @@ namespace OpenSim.Region.Physics.BulletXPlugin
//this._prim.Kinematic = value;
}
}
+
public override void AddForce(PhysicsVector force)
{
-
}
+
public override void SetMomentum(PhysicsVector momentum)
{
-
}
+
internal void ValidateHeight(float heighmapPositionValue)
{
- if (rigidBody.CenterOfMassPosition.Z < heighmapPositionValue + _size.Z / 2.0f)
+ if (rigidBody.CenterOfMassPosition.Z < heighmapPositionValue + _size.Z/2.0f)
{
Matrix m = rigidBody.WorldTransform;
- MonoXnaCompactMaths.Vector3 v3 = m.Translation;
- v3.Z = heighmapPositionValue + _size.Z / 2.0f;
+ Vector3 v3 = m.Translation;
+ v3.Z = heighmapPositionValue + _size.Z/2.0f;
m.Translation = v3;
rigidBody.WorldTransform = m;
//When a Prim touch the ground it's vertical velocity it's reduced to ZERO
//Static objects don't have linear velocity
- if(_physical)
- Speed(new PhysicsVector(this.rigidBody.LinearVelocity.X, this.rigidBody.LinearVelocity.Y, 0.0f));
+ if (_physical)
+ Speed(new PhysicsVector(rigidBody.LinearVelocity.X, rigidBody.LinearVelocity.Y, 0.0f));
}
}
+
internal void UpdateKinetics()
{
if (_physical) //Updates properties. Prim updates its properties physically
{
- this._position = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.CenterOfMassPosition);
- this._velocity = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.LinearVelocity);
- this._orientation = BulletXMaths.XnaQuaternionToAxiomQuaternion(rigidBody.Orientation);
+ _position = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.CenterOfMassPosition);
+ _velocity = BulletXMaths.XnaVector3ToPhysicsVector(rigidBody.LinearVelocity);
+ _orientation = BulletXMaths.XnaQuaternionToAxiomQuaternion(rigidBody.Orientation);
}
else //Doesn't updates properties. That's a cancel
{
@@ -1074,35 +1128,41 @@ namespace OpenSim.Region.Physics.BulletXPlugin
}
#region Methods for updating values of RigidBody
+
private void Translate()
{
- Translate(this._position);
+ Translate(_position);
}
+
private void Translate(PhysicsVector _newPos)
{
- MonoXnaCompactMaths.Vector3 _translation;
+ Vector3 _translation;
_translation = BulletXMaths.PhysicsVectorToXnaVector3(_newPos) - rigidBody.CenterOfMassPosition;
rigidBody.Translate(_translation);
}
+
private void Speed()
{
- Speed(this._velocity);
+ Speed(_velocity);
}
+
private void Speed(PhysicsVector _newSpeed)
{
- MonoXnaCompactMaths.Vector3 _speed;
+ Vector3 _speed;
_speed = BulletXMaths.PhysicsVectorToXnaVector3(_newSpeed);
rigidBody.LinearVelocity = _speed;
}
+
private void ReSize()
{
- ReSize(this._size);
+ ReSize(_size);
}
+
private void ReSize(PhysicsVector _newSize)
{
//I wonder to know how to resize with a simple instruction in BulletX. It seems that for now there isn't
//so i have to do it manually. That's recreating rigidbody
- MonoXnaCompactMaths.Vector3 _newsize;
+ Vector3 _newsize;
_newsize = BulletXMaths.PhysicsVectorToXnaVector3(_newSize);
if ((_newsize.X == 0) || (_newsize.Y == 0) || (_newsize.Z == 0)) throw new Exception("Size 0");
@@ -1114,67 +1174,77 @@ namespace OpenSim.Region.Physics.BulletXPlugin
Matrix _startTransform = Matrix.Identity;
Matrix _centerOfMassOffset = Matrix.Identity;
RigidBody _tmpRigidBody;
- _startTransform.Translation = BulletXMaths.PhysicsVectorToXnaVector3(this._position);
+ _startTransform.Translation = BulletXMaths.PhysicsVectorToXnaVector3(_position);
//For now all prims are boxes
- CollisionShape _collisionShape = new XnaDevRu.BulletX.BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(_newSize) / 2.0f);
+ CollisionShape _collisionShape = new BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(_newSize)/2.0f);
DefaultMotionState _motionState = new DefaultMotionState(_startTransform, _centerOfMassOffset);
- MonoXnaCompactMaths.Vector3 _localInertia = new MonoXnaCompactMaths.Vector3();
+ Vector3 _localInertia = new Vector3();
if (_physical) _collisionShape.CalculateLocalInertia(Mass, out _localInertia); //Always when mass > 0
- _tmpRigidBody = new RigidBody(Mass, _motionState, _collisionShape, _localInertia, _linearDamping, _angularDamping, _friction, _restitution);
+ _tmpRigidBody =
+ new RigidBody(Mass, _motionState, _collisionShape, _localInertia, _linearDamping, _angularDamping,
+ _friction, _restitution);
//rigidBody.ActivationState = ActivationState.DisableDeactivation;
//It's seems that there are a bug with rigidBody constructor and its CenterOfMassPosition
- MonoXnaCompactMaths.Vector3 _vDebugTranslation;
+ Vector3 _vDebugTranslation;
_vDebugTranslation = _startTransform.Translation - rigidBody.CenterOfMassPosition;
_tmpRigidBody.Translate(_vDebugTranslation);
//---
//There is a bug when trying to remove a rigidBody that is colliding with something..
try
{
- this._parent_scene.ddWorld.RemoveRigidBody(rigidBody);
+ _parent_scene.ddWorld.RemoveRigidBody(rigidBody);
}
- catch(Exception ex)
+ catch (Exception ex)
{
- this._parent_scene.BulletXMessage(this._parent_scene.is_ex_message + ex.Message, true);
+ _parent_scene.BulletXMessage(_parent_scene.is_ex_message + ex.Message, true);
rigidBody.ActivationState = ActivationState.DisableSimulation;
- this._parent_scene.AddForgottenRigidBody(rigidBody);
+ _parent_scene.AddForgottenRigidBody(rigidBody);
}
rigidBody = _tmpRigidBody;
- this._parent_scene.ddWorld.AddRigidBody(rigidBody);
- if (_physical) Speed();//Static objects don't have linear velocity
+ _parent_scene.ddWorld.AddRigidBody(rigidBody);
+ if (_physical) Speed(); //Static objects don't have linear velocity
ReOrient();
GC.Collect();
}
+
private void ReOrient()
{
- ReOrient(this._orientation);
+ ReOrient(_orientation);
}
+
private void ReOrient(AxiomQuaternion _newOrient)
{
- MonoXnaCompactMaths.Quaternion _newOrientation;
+ Quaternion _newOrientation;
_newOrientation = BulletXMaths.AxiomQuaternionToXnaQuaternion(_newOrient);
Matrix _comTransform = rigidBody.CenterOfMassTransform;
BulletXMaths.SetRotation(ref _comTransform, _newOrientation);
rigidBody.CenterOfMassTransform = _comTransform;
}
- #endregion
+ #endregion
}
+
///
/// This Class manage a HeighField as a RigidBody. This is for to be added in the BulletXScene
///
internal class BulletXPlanet
{
private PhysicsVector _staticPosition;
- private PhysicsVector _staticVelocity;
+ private PhysicsVector _staticVelocity;
private AxiomQuaternion _staticOrientation;
private float _mass;
private BulletXScene _parentscene;
internal float[] _heightField;
private RigidBody _flatPlanet;
- internal RigidBody RigidBody { get { return _flatPlanet; } }
+
+ internal RigidBody RigidBody
+ {
+ get { return _flatPlanet; }
+ }
+
internal BulletXPlanet(BulletXScene parent_scene, float[] heightField)
{
- _staticPosition = new PhysicsVector(BulletXScene.MaxXY / 2, BulletXScene.MaxXY/2, 0);
+ _staticPosition = new PhysicsVector(BulletXScene.MaxXY/2, BulletXScene.MaxXY/2, 0);
_staticVelocity = new PhysicsVector();
_staticOrientation = AxiomQuaternion.Identity;
_mass = 0; //No active
@@ -1193,40 +1263,45 @@ namespace OpenSim.Region.Physics.BulletXPlugin
try
{
_startTransform.Translation = BulletXMaths.PhysicsVectorToXnaVector3(_staticPosition);
- CollisionShape _collisionShape = new HeightfieldTerrainShape(BulletXScene.MaxXY, BulletXScene.MaxXY, _heightField, (float)BulletXScene.MaxZ, 2, true, false);
+ CollisionShape _collisionShape =
+ new HeightfieldTerrainShape(BulletXScene.MaxXY, BulletXScene.MaxXY, _heightField,
+ (float) BulletXScene.MaxZ, 2, true, false);
DefaultMotionState _motionState = new DefaultMotionState(_startTransform, _centerOfMassOffset);
- MonoXnaCompactMaths.Vector3 _localInertia = new MonoXnaCompactMaths.Vector3();
+ Vector3 _localInertia = new Vector3();
//_collisionShape.CalculateLocalInertia(_mass, out _localInertia); //Always when mass > 0
- _flatPlanet = new RigidBody(_mass, _motionState, _collisionShape, _localInertia, _linearDamping, _angularDamping, _friction, _restitution);
+ _flatPlanet =
+ new RigidBody(_mass, _motionState, _collisionShape, _localInertia, _linearDamping,
+ _angularDamping, _friction, _restitution);
//It's seems that there are a bug with rigidBody constructor and its CenterOfMassPosition
- MonoXnaCompactMaths.Vector3 _vDebugTranslation;
+ Vector3 _vDebugTranslation;
_vDebugTranslation = _startTransform.Translation - _flatPlanet.CenterOfMassPosition;
_flatPlanet.Translate(_vDebugTranslation);
parent_scene.ddWorld.AddRigidBody(_flatPlanet);
}
catch (Exception ex)
{
- this._parentscene.BulletXMessage(ex.Message, true);
+ _parentscene.BulletXMessage(ex.Message, true);
}
}
- this._parentscene.BulletXMessage("BulletXPlanet created.", false);
+ _parentscene.BulletXMessage("BulletXPlanet created.", false);
}
- internal float HeightValue(MonoXnaCompactMaths.Vector3 position)
+
+ internal float HeightValue(Vector3 position)
{
int li_x, li_y;
float height;
- li_x = (int)Math.Round(position.X);
+ li_x = (int) Math.Round(position.X);
if (li_x < 0) li_x = 0;
if (li_x >= BulletXScene.MaxXY) li_x = BulletXScene.MaxXY - 1;
- li_y = (int)Math.Round(position.Y);
+ li_y = (int) Math.Round(position.Y);
if (li_y < 0) li_y = 0;
if (li_y >= BulletXScene.MaxXY) li_y = BulletXScene.MaxXY - 1;
- height = ((HeightfieldTerrainShape)this._flatPlanet.CollisionShape).getHeightFieldValue(li_x, li_y);
+ height = ((HeightfieldTerrainShape) _flatPlanet.CollisionShape).getHeightFieldValue(li_x, li_y);
if (height < 0) height = 0;
else if (height > BulletXScene.MaxZ) height = BulletXScene.MaxZ;
return height;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/Manager/AssemblyInfo.cs b/OpenSim/Region/Physics/Manager/AssemblyInfo.cs
index 2355e91..c213b64 100644
--- a/OpenSim/Region/Physics/Manager/AssemblyInfo.cs
+++ b/OpenSim/Region/Physics/Manager/AssemblyInfo.cs
@@ -27,24 +27,26 @@
*/
using System.Reflection;
using System.Runtime.InteropServices;
+
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
-[assembly: AssemblyTitle("PhysicsManager")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("PhysicsManager")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly : AssemblyTitle("PhysicsManager")]
+[assembly : AssemblyDescription("")]
+[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyCompany("")]
+[assembly : AssemblyProduct("PhysicsManager")]
+[assembly : AssemblyCopyright("")]
+[assembly : AssemblyTrademark("")]
+[assembly : AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
-[assembly: ComVisible(false)]
+
+[assembly : ComVisible(false)]
// The assembly version has following format :
//
@@ -53,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
-[assembly: AssemblyVersion("1.0.*")]
+[assembly : AssemblyVersion("1.0.*")]
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
index 0fa7455..b59c13a 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -30,7 +30,9 @@ using Axiom.Math;
namespace OpenSim.Region.Physics.Manager
{
public delegate void PositionUpdate(PhysicsVector position);
+
public delegate void VelocityUpdate(PhysicsVector velocity);
+
public delegate void OrientationUpdate(Quaternion orientation);
public abstract class PhysicsActor
@@ -43,52 +45,22 @@ namespace OpenSim.Region.Physics.Manager
public static PhysicsActor Null
{
- get
- {
- return new NullPhysicsActor();
- }
+ get { return new NullPhysicsActor(); }
}
- public abstract PhysicsVector Size
- {
- get;
- set;
- }
+ public abstract PhysicsVector Size { get; set; }
- public abstract PhysicsVector Position
- {
- get;
- set;
- }
+ public abstract PhysicsVector Position { get; set; }
- public abstract PhysicsVector Velocity
- {
- get;
- set;
- }
+ public abstract PhysicsVector Velocity { get; set; }
- public abstract PhysicsVector Acceleration
- {
- get;
- }
+ public abstract PhysicsVector Acceleration { get; }
- public abstract Quaternion Orientation
- {
- get;
- set;
- }
+ public abstract Quaternion Orientation { get; set; }
- public abstract bool Flying
- {
- get;
- set;
- }
+ public abstract bool Flying { get; set; }
- public abstract bool Kinematic
- {
- get;
- set;
- }
+ public abstract bool Kinematic { get; set; }
public abstract void AddForce(PhysicsVector force);
@@ -99,50 +71,26 @@ namespace OpenSim.Region.Physics.Manager
{
public override PhysicsVector Position
{
- get
- {
- return PhysicsVector.Zero;
- }
- set
- {
- return;
- }
+ get { return PhysicsVector.Zero; }
+ set { return; }
}
public override PhysicsVector Size
{
- get
- {
- return PhysicsVector.Zero;
- }
- set
- {
- return;
- }
+ get { return PhysicsVector.Zero; }
+ set { return; }
}
public override PhysicsVector Velocity
{
- get
- {
- return PhysicsVector.Zero;
- }
- set
- {
- return;
- }
+ get { return PhysicsVector.Zero; }
+ set { return; }
}
public override Quaternion Orientation
{
- get
- {
- return Quaternion.Identity;
- }
- set
- {
-
- }
+ get { return Quaternion.Identity; }
+ set { }
}
public override PhysicsVector Acceleration
@@ -152,26 +100,14 @@ namespace OpenSim.Region.Physics.Manager
public override bool Flying
{
- get
- {
- return false;
- }
- set
- {
- return;
- }
+ get { return false; }
+ set { return; }
}
public override bool Kinematic
{
- get
- {
- return true;
- }
- set
- {
- return;
- }
+ get { return true; }
+ set { return; }
}
public override void AddForce(PhysicsVector force)
@@ -184,4 +120,4 @@ namespace OpenSim.Region.Physics.Manager
return;
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index 81bc938..09ebf29 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -33,77 +33,77 @@ using OpenSim.Framework.Console;
namespace OpenSim.Region.Physics.Manager
{
- ///
- /// Description of MyClass.
- ///
- public class PhysicsPluginManager
- {
- private Dictionary _plugins=new Dictionary();
-
- public PhysicsPluginManager()
- {
-
- }
-
- public PhysicsScene GetPhysicsScene(string engineName)
- {
+ ///
+ /// Description of MyClass.
+ ///
+ public class PhysicsPluginManager
+ {
+ private Dictionary _plugins = new Dictionary();
+
+ public PhysicsPluginManager()
+ {
+ }
+
+ public PhysicsScene GetPhysicsScene(string engineName)
+ {
if (String.IsNullOrEmpty(engineName))
{
return PhysicsScene.Null;
}
- if(_plugins.ContainsKey(engineName))
- {
- MainLog.Instance.Verbose("PHYSICS","creating "+engineName);
- return _plugins[engineName].GetScene();
- }
- else
+ if (_plugins.ContainsKey(engineName))
+ {
+ MainLog.Instance.Verbose("PHYSICS", "creating " + engineName);
+ return _plugins[engineName].GetScene();
+ }
+ else
{
MainLog.Instance.Warn("PHYSICS", "couldn't find physicsEngine: {0}", engineName);
- throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}",engineName));
- }
- }
-
- public void LoadPlugins()
- {
- string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory ,"Physics");
- string[] pluginFiles = Directory.GetFiles(path, "*.dll");
-
+ throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}", engineName));
+ }
+ }
+
+ public void LoadPlugins()
+ {
+ string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Physics");
+ string[] pluginFiles = Directory.GetFiles(path, "*.dll");
+
- for(int i= 0; i";
+ return "<" + X + "," + Y + "," + Z + ">";
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/OdePlugin/AssemblyInfo.cs b/OpenSim/Region/Physics/OdePlugin/AssemblyInfo.cs
index 3f840cc..d110a17 100644
--- a/OpenSim/Region/Physics/OdePlugin/AssemblyInfo.cs
+++ b/OpenSim/Region/Physics/OdePlugin/AssemblyInfo.cs
@@ -27,24 +27,26 @@
*/
using System.Reflection;
using System.Runtime.InteropServices;
+
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
-[assembly: AssemblyTitle("RealPhysXplugin")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("RealPhysXplugin")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly : AssemblyTitle("RealPhysXplugin")]
+[assembly : AssemblyDescription("")]
+[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyCompany("")]
+[assembly : AssemblyProduct("RealPhysXplugin")]
+[assembly : AssemblyCopyright("")]
+[assembly : AssemblyTrademark("")]
+[assembly : AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
-[assembly: ComVisible(false)]
+
+[assembly : ComVisible(false)]
// The assembly version has following format :
//
@@ -53,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
-[assembly: AssemblyVersion("1.0.*")]
+[assembly : AssemblyVersion("1.0.*")]
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/OdePlugin/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/OdePlugin/Meshing/HelperTypes.cs
index 2ace097..13184e2 100644
--- a/OpenSim/Region/Physics/OdePlugin/Meshing/HelperTypes.cs
+++ b/OpenSim/Region/Physics/OdePlugin/Meshing/HelperTypes.cs
@@ -27,10 +27,9 @@
*/
using System;
-using System.Globalization;
-using System.Diagnostics;
using System.Collections.Generic;
-
+using System.Diagnostics;
+using System.Globalization;
using OpenSim.Region.Physics.Manager;
public class Vertex : IComparable
@@ -76,8 +75,6 @@ public class Vertex : IComparable
{
return me.CompareTo(other) < 0;
}
-
-
}
public class Simplex : IComparable
@@ -122,8 +119,7 @@ public class Simplex : IComparable
return 0;
}
-
-};
+} ;
public class Triangle
{
@@ -131,9 +127,9 @@ public class Triangle
public Vertex v2;
public Vertex v3;
- float radius_square;
- float cx;
- float cy;
+ private float radius_square;
+ private float cx;
+ private float cy;
public Triangle(Vertex _v1, Vertex _v2, Vertex _v3)
{
@@ -149,18 +145,18 @@ public class Triangle
float dx, dy;
float dd;
- dx = x - this.cx;
- dy = y - this.cy;
+ dx = x - cx;
+ dy = y - cy;
- dd = dx * dx + dy * dy;
- if (dd < this.radius_square)
+ dd = dx*dx + dy*dy;
+ if (dd < radius_square)
return true;
else
return false;
}
- void CalcCircle()
+ private void CalcCircle()
{
// Calculate the center and the radius of a circle given by three points p1, p2, p3
// It is assumed, that the triangles vertices are already set correctly
@@ -198,8 +194,8 @@ public class Triangle
p3y = v3.point.Y;
/* calc helping values first */
- c1 = (p1x * p1x + p1y * p1y - p2x * p2x - p2y * p2y) / 2;
- c2 = (p1x * p1x + p1y * p1y - p3x * p3x - p3y * p3y) / 2;
+ c1 = (p1x*p1x + p1y*p1y - p2x*p2x - p2y*p2y)/2;
+ c2 = (p1x*p1x + p1y*p1y - p3x*p3x - p3y*p3y)/2;
v1x = p1x - p2x;
v1y = p1y - p2y;
@@ -207,35 +203,34 @@ public class Triangle
v2x = p1x - p3x;
v2y = p1y - p3y;
- z = (c1 * v2x - c2 * v1x);
- n = (v1y * v2x - v2y * v1x);
+ z = (c1*v2x - c2*v1x);
+ n = (v1y*v2x - v2y*v1x);
- if (n == 0.0) // This is no triangle, i.e there are (at least) two points at the same location
+ if (n == 0.0) // This is no triangle, i.e there are (at least) two points at the same location
{
radius_square = 0.0f;
return;
}
- this.cy = (float)(z / n);
+ cy = (float) (z/n);
if (v2x != 0.0)
{
- this.cx = (float)((c2 - v2y * this.cy) / v2x);
+ cx = (float) ((c2 - v2y*cy)/v2x);
}
else if (v1x != 0.0)
{
- this.cx = (float)((c1 - v1y * this.cy) / v1x);
+ cx = (float) ((c1 - v1y*cy)/v1x);
}
else
{
Debug.Assert(false, "Malformed triangle"); /* Both terms zero means nothing good */
}
- rx = (p1x - this.cx);
- ry = (p1y - this.cy);
-
- this.radius_square = (float)(rx * rx + ry * ry);
+ rx = (p1x - cx);
+ ry = (p1y - cy);
+ radius_square = (float) (rx*rx + ry*ry);
}
public List GetSimplices()
@@ -254,17 +249,18 @@ public class Triangle
public override String ToString()
{
-
NumberFormatInfo nfi = new NumberFormatInfo();
nfi.CurrencyDecimalDigits = 2;
nfi.CurrencyDecimalSeparator = ".";
- String s1 = "<" + v1.point.X.ToString(nfi) + "," + v1.point.Y.ToString(nfi) + "," + v1.point.Z.ToString(nfi) + ">";
- String s2 = "<" + v2.point.X.ToString(nfi) + "," + v2.point.Y.ToString(nfi) + "," + v2.point.Z.ToString(nfi) + ">";
- String s3 = "<" + v3.point.X.ToString(nfi) + "," + v3.point.Y.ToString(nfi) + "," + v3.point.Z.ToString(nfi) + ">";
+ String s1 = "<" + v1.point.X.ToString(nfi) + "," + v1.point.Y.ToString(nfi) + "," + v1.point.Z.ToString(nfi) +
+ ">";
+ String s2 = "<" + v2.point.X.ToString(nfi) + "," + v2.point.Y.ToString(nfi) + "," + v2.point.Z.ToString(nfi) +
+ ">";
+ String s3 = "<" + v3.point.X.ToString(nfi) + "," + v3.point.Y.ToString(nfi) + "," + v3.point.Z.ToString(nfi) +
+ ">";
return s1 + ";" + s2 + ";" + s3;
-
}
public PhysicsVector getNormal()
@@ -281,12 +277,12 @@ public class Triangle
// Cross product for normal
PhysicsVector n = new PhysicsVector();
float nx, ny, nz;
- n.X = e1.Y * e2.Z - e1.Z * e2.Y;
- n.Y = e1.Z * e2.X - e1.X * e2.Z;
- n.Z = e1.X * e2.Y - e1.Y * e2.X;
+ n.X = e1.Y*e2.Z - e1.Z*e2.Y;
+ n.Y = e1.Z*e2.X - e1.X*e2.Z;
+ n.Z = e1.X*e2.Y - e1.Y*e2.X;
// Length
- float l = (float)Math.Sqrt(n.X * n.X + n.Y * n.Y + n.Z * n.Z);
+ float l = (float) Math.Sqrt(n.X*n.X + n.Y*n.Y + n.Z*n.Z);
// Normalized "normal"
n.X /= l;
@@ -303,6 +299,4 @@ public class Triangle
v1 = v2;
v2 = vt;
}
-}
-
-
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/OdePlugin/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/OdePlugin/Meshing/Meshmerizer.cs
index dd18e24..46de15e 100644
--- a/OpenSim/Region/Physics/OdePlugin/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/OdePlugin/Meshing/Meshmerizer.cs
@@ -27,12 +27,8 @@
*/
using System;
-using System.Globalization;
-using System.Diagnostics;
using System.Collections.Generic;
-using System.Text;
using System.Runtime.InteropServices;
-
using OpenSim.Framework;
using OpenSim.Region.Physics.Manager;
@@ -75,14 +71,14 @@ namespace OpenSim.Region.Physics.OdePlugin
public float[] getVertexListAsFloat()
{
- float[] result = new float[vertices.Count * 3];
+ float[] result = new float[vertices.Count*3];
for (int i = 0; i < vertices.Count; i++)
{
Vertex v = vertices[i];
PhysicsVector point = v.point;
- result[3 * i + 0] = point.X;
- result[3 * i + 1] = point.Y;
- result[3 * i + 2] = point.Z;
+ result[3*i + 0] = point.X;
+ result[3*i + 1] = point.Y;
+ result[3*i + 2] = point.Z;
}
GCHandle.Alloc(result, GCHandleType.Pinned);
return result;
@@ -90,13 +86,13 @@ namespace OpenSim.Region.Physics.OdePlugin
public int[] getIndexListAsInt()
{
- int[] result = new int[triangles.Count * 3];
+ int[] result = new int[triangles.Count*3];
for (int i = 0; i < triangles.Count; i++)
{
Triangle t = triangles[i];
- result[3 * i + 0] = vertices.IndexOf(t.v1);
- result[3 * i + 1] = vertices.IndexOf(t.v2);
- result[3 * i + 2] = vertices.IndexOf(t.v3);
+ result[3*i + 0] = vertices.IndexOf(t.v1);
+ result[3*i + 1] = vertices.IndexOf(t.v2);
+ result[3*i + 2] = vertices.IndexOf(t.v3);
}
GCHandle.Alloc(result, GCHandleType.Pinned);
return result;
@@ -110,16 +106,13 @@ namespace OpenSim.Region.Physics.OdePlugin
foreach (Triangle t in newMesh.triangles)
Add(t);
-
}
}
-
public class Meshmerizer
{
-
- static List FindInfluencedTriangles(List triangles, Vertex v)
+ private static List FindInfluencedTriangles(List triangles, Vertex v)
{
List influenced = new List();
foreach (Triangle t in triangles)
@@ -133,9 +126,10 @@ namespace OpenSim.Region.Physics.OdePlugin
}
return influenced;
}
-
-
- static void InsertVertices(List vertices, int usedForSeed, List triangles, List innerBorders)
+
+
+ private static void InsertVertices(List vertices, int usedForSeed, List triangles,
+ List innerBorders)
{
// This is a variant of the delaunay algorithm
// each time a new vertex is inserted, all triangles that are influenced by it are deleted
@@ -143,7 +137,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// It is not very time efficient but easy to implement.
int iCurrentVertex;
- int iMaxVertex=vertices.Count;
+ int iMaxVertex = vertices.Count;
for (iCurrentVertex = usedForSeed; iCurrentVertex < iMaxVertex; iCurrentVertex++)
{
// Background: A triangle mesh fulfills the delaunay condition if (iff!)
@@ -154,8 +148,8 @@ namespace OpenSim.Region.Physics.OdePlugin
// do not fulfill this condition with respect to the new triangle
// Find the triangles that are influenced by the new vertex
- Vertex v=vertices[iCurrentVertex];
- List influencedTriangles=FindInfluencedTriangles(triangles, v);
+ Vertex v = vertices[iCurrentVertex];
+ List influencedTriangles = FindInfluencedTriangles(triangles, v);
List simplices = new List();
@@ -175,10 +169,10 @@ namespace OpenSim.Region.Physics.OdePlugin
// Look for duplicate simplices here.
// Remember, they are directly side by side in the list right now
int iSimplex;
- List innerSimplices=new List();
+ List innerSimplices = new List();
for (iSimplex = 1; iSimplex < simplices.Count; iSimplex++) // Startindex=1, so we can refer backwards
{
- if (simplices[iSimplex - 1].CompareTo(simplices[iSimplex])==0)
+ if (simplices[iSimplex - 1].CompareTo(simplices[iSimplex]) == 0)
{
innerSimplices.Add(simplices[iSimplex - 1]);
innerSimplices.Add(simplices[iSimplex]);
@@ -187,7 +181,7 @@ namespace OpenSim.Region.Physics.OdePlugin
foreach (Simplex s in innerSimplices)
{
- simplices.Remove(s);
+ simplices.Remove(s);
}
// each simplex still in the list belongs to the hull of the region in question
@@ -210,7 +204,7 @@ namespace OpenSim.Region.Physics.OdePlugin
foreach (Triangle t in triangles)
{
if (
- innerBorders.Contains(vertices.IndexOf(t.v1))
+ innerBorders.Contains(vertices.IndexOf(t.v1))
&& innerBorders.Contains(vertices.IndexOf(t.v2))
&& innerBorders.Contains(vertices.IndexOf(t.v3))
)
@@ -223,18 +217,18 @@ namespace OpenSim.Region.Physics.OdePlugin
}
- static Mesh CreateBoxMeshX(PrimitiveBaseShape primShape, PhysicsVector size)
- // Builds the x (+ and -) surfaces of a box shaped prim
+ private static Mesh CreateBoxMeshX(PrimitiveBaseShape primShape, PhysicsVector size)
+ // Builds the x (+ and -) surfaces of a box shaped prim
{
UInt16 hollowFactor = primShape.ProfileHollow;
Mesh meshMX = new Mesh();
// Surface 0, -X
- meshMX.Add(new Vertex("-X-Y-Z", -size.X / 2.0f, -size.Y / 2.0f, -size.Z / 2.0f));
- meshMX.Add(new Vertex("-X+Y-Z", -size.X / 2.0f, +size.Y / 2.0f, -size.Z / 2.0f));
- meshMX.Add(new Vertex("-X-Y+Z", -size.X / 2.0f, -size.Y / 2.0f, +size.Z / 2.0f));
- meshMX.Add(new Vertex("-X+Y+Z", -size.X / 2.0f, +size.Y / 2.0f, +size.Z / 2.0f));
+ meshMX.Add(new Vertex("-X-Y-Z", -size.X/2.0f, -size.Y/2.0f, -size.Z/2.0f));
+ meshMX.Add(new Vertex("-X+Y-Z", -size.X/2.0f, +size.Y/2.0f, -size.Z/2.0f));
+ meshMX.Add(new Vertex("-X-Y+Z", -size.X/2.0f, -size.Y/2.0f, +size.Z/2.0f));
+ meshMX.Add(new Vertex("-X+Y+Z", -size.X/2.0f, +size.Y/2.0f, +size.Z/2.0f));
meshMX.Add(new Triangle(meshMX.vertices[0], meshMX.vertices[2], meshMX.vertices[1]));
meshMX.Add(new Triangle(meshMX.vertices[1], meshMX.vertices[2], meshMX.vertices[3]));
@@ -242,10 +236,10 @@ namespace OpenSim.Region.Physics.OdePlugin
Mesh meshPX = new Mesh();
// Surface 1, +X
- meshPX.Add(new Vertex("+X-Y-Z", +size.X / 2.0f, -size.Y / 2.0f, -size.Z / 2.0f));
- meshPX.Add(new Vertex("+X+Y-Z", +size.X / 2.0f, +size.Y / 2.0f, -size.Z / 2.0f));
- meshPX.Add(new Vertex("+X-Y+Z", +size.X / 2.0f, -size.Y / 2.0f, +size.Z / 2.0f));
- meshPX.Add(new Vertex("+X+Y+Z", +size.X / 2.0f, +size.Y / 2.0f, +size.Z / 2.0f));
+ meshPX.Add(new Vertex("+X-Y-Z", +size.X/2.0f, -size.Y/2.0f, -size.Z/2.0f));
+ meshPX.Add(new Vertex("+X+Y-Z", +size.X/2.0f, +size.Y/2.0f, -size.Z/2.0f));
+ meshPX.Add(new Vertex("+X-Y+Z", +size.X/2.0f, -size.Y/2.0f, +size.Z/2.0f));
+ meshPX.Add(new Vertex("+X+Y+Z", +size.X/2.0f, +size.Y/2.0f, +size.Z/2.0f));
meshPX.Add(new Triangle(meshPX.vertices[0], meshPX.vertices[1], meshPX.vertices[2]));
@@ -254,17 +248,17 @@ namespace OpenSim.Region.Physics.OdePlugin
if (hollowFactor > 0)
{
- float hollowFactorF = (float)hollowFactor / (float)50000;
+ float hollowFactorF = (float) hollowFactor/(float) 50000;
Vertex IPP;
Vertex IPM;
Vertex IMP;
Vertex IMM;
- IPP = new Vertex("Inner-X+Y+Z", -size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, +size.Z / 2.0f);
- IPM = new Vertex("Inner-X+Y-Z", -size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, -size.Z / 2.0f);
- IMP = new Vertex("Inner-X-Y+Z", -size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, +size.Z / 2.0f);
- IMM = new Vertex("Inner-X-Y-Z", -size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, -size.Z / 2.0f);
+ IPP = new Vertex("Inner-X+Y+Z", -size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, +size.Z/2.0f);
+ IPM = new Vertex("Inner-X+Y-Z", -size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, -size.Z/2.0f);
+ IMP = new Vertex("Inner-X-Y+Z", -size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, +size.Z/2.0f);
+ IMM = new Vertex("Inner-X-Y-Z", -size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, -size.Z/2.0f);
meshMX.Add(IPP);
meshMX.Add(IPM);
@@ -280,11 +274,10 @@ namespace OpenSim.Region.Physics.OdePlugin
}
-
- IPP = new Vertex("Inner+X+Y+Z", +size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, +size.Z / 2.0f);
- IPM = new Vertex("Inner+X+Y-Z", +size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, -size.Z / 2.0f);
- IMP = new Vertex("Inner+X-Y+Z", +size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, +size.Z / 2.0f);
- IMM = new Vertex("Inner+X-Y-Z", +size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, -size.Z / 2.0f);
+ IPP = new Vertex("Inner+X+Y+Z", +size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, +size.Z/2.0f);
+ IPM = new Vertex("Inner+X+Y-Z", +size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, -size.Z/2.0f);
+ IMP = new Vertex("Inner+X-Y+Z", +size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, +size.Z/2.0f);
+ IMM = new Vertex("Inner+X-Y-Z", +size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, -size.Z/2.0f);
meshPX.Add(IPP);
meshPX.Add(IPM);
@@ -308,18 +301,17 @@ namespace OpenSim.Region.Physics.OdePlugin
}
-
- static Mesh CreateBoxMeshY(PrimitiveBaseShape primShape, PhysicsVector size)
- // Builds the y (+ and -) surfaces of a box shaped prim
+ private static Mesh CreateBoxMeshY(PrimitiveBaseShape primShape, PhysicsVector size)
+ // Builds the y (+ and -) surfaces of a box shaped prim
{
UInt16 hollowFactor = primShape.ProfileHollow;
// (M)inus Y
Mesh MeshMY = new Mesh();
- MeshMY.Add(new Vertex("-X-Y-Z", -size.X / 2.0f, -size.Y / 2.0f, -size.Z / 2.0f));
- MeshMY.Add(new Vertex("+X-Y-Z", +size.X / 2.0f, -size.Y / 2.0f, -size.Z / 2.0f));
- MeshMY.Add(new Vertex("-X-Y+Z", -size.X / 2.0f, -size.Y / 2.0f, +size.Z / 2.0f));
- MeshMY.Add(new Vertex("+X-Y+Z", +size.X / 2.0f, -size.Y / 2.0f, +size.Z / 2.0f));
+ MeshMY.Add(new Vertex("-X-Y-Z", -size.X/2.0f, -size.Y/2.0f, -size.Z/2.0f));
+ MeshMY.Add(new Vertex("+X-Y-Z", +size.X/2.0f, -size.Y/2.0f, -size.Z/2.0f));
+ MeshMY.Add(new Vertex("-X-Y+Z", -size.X/2.0f, -size.Y/2.0f, +size.Z/2.0f));
+ MeshMY.Add(new Vertex("+X-Y+Z", +size.X/2.0f, -size.Y/2.0f, +size.Z/2.0f));
MeshMY.Add(new Triangle(MeshMY.vertices[0], MeshMY.vertices[1], MeshMY.vertices[2]));
MeshMY.Add(new Triangle(MeshMY.vertices[2], MeshMY.vertices[1], MeshMY.vertices[3]));
@@ -327,27 +319,27 @@ namespace OpenSim.Region.Physics.OdePlugin
// (P)lus Y
Mesh MeshPY = new Mesh();
- MeshPY.Add(new Vertex("-X+Y-Z", -size.X / 2.0f, +size.Y / 2.0f, -size.Z / 2.0f));
- MeshPY.Add(new Vertex("+X+Y-Z", +size.X / 2.0f, +size.Y / 2.0f, -size.Z / 2.0f));
- MeshPY.Add(new Vertex("-X+Y+Z", -size.X / 2.0f, +size.Y / 2.0f, +size.Z / 2.0f));
- MeshPY.Add(new Vertex("+X+Y+Z", +size.X / 2.0f, +size.Y / 2.0f, +size.Z / 2.0f));
+ MeshPY.Add(new Vertex("-X+Y-Z", -size.X/2.0f, +size.Y/2.0f, -size.Z/2.0f));
+ MeshPY.Add(new Vertex("+X+Y-Z", +size.X/2.0f, +size.Y/2.0f, -size.Z/2.0f));
+ MeshPY.Add(new Vertex("-X+Y+Z", -size.X/2.0f, +size.Y/2.0f, +size.Z/2.0f));
+ MeshPY.Add(new Vertex("+X+Y+Z", +size.X/2.0f, +size.Y/2.0f, +size.Z/2.0f));
MeshPY.Add(new Triangle(MeshPY.vertices[1], MeshPY.vertices[0], MeshPY.vertices[2]));
MeshPY.Add(new Triangle(MeshPY.vertices[1], MeshPY.vertices[2], MeshPY.vertices[3]));
if (hollowFactor > 0)
{
- float hollowFactorF = (float)hollowFactor / (float)50000;
+ float hollowFactorF = (float) hollowFactor/(float) 50000;
Vertex IPP;
Vertex IPM;
Vertex IMP;
Vertex IMM;
- IPP = new Vertex("Inner+X-Y+Z", +size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, +size.Z / 2.0f);
- IPM = new Vertex("Inner+X-Y-Z", +size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, -size.Z / 2.0f);
- IMP = new Vertex("Inner-X-Y+Z", -size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, +size.Z / 2.0f);
- IMM = new Vertex("Inner-X-Y-Z", -size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, -size.Z / 2.0f);
+ IPP = new Vertex("Inner+X-Y+Z", +size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, +size.Z/2.0f);
+ IPM = new Vertex("Inner+X-Y-Z", +size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, -size.Z/2.0f);
+ IMP = new Vertex("Inner-X-Y+Z", -size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, +size.Z/2.0f);
+ IMM = new Vertex("Inner-X-Y-Z", -size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, -size.Z/2.0f);
MeshMY.Add(IPP);
MeshMY.Add(IPM);
@@ -363,11 +355,10 @@ namespace OpenSim.Region.Physics.OdePlugin
}
-
- IPP = new Vertex("Inner+X+Y+Z", +size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, +size.Z / 2.0f);
- IPM=new Vertex("Inner+X+Y-Z", +size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, -size.Z / 2.0f);
- IMP=new Vertex("Inner-X+Y+Z", -size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, +size.Z / 2.0f);
- IMM=new Vertex("Inner-X+Y-Z", -size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, -size.Z / 2.0f);
+ IPP = new Vertex("Inner+X+Y+Z", +size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, +size.Z/2.0f);
+ IPM = new Vertex("Inner+X+Y-Z", +size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, -size.Z/2.0f);
+ IMP = new Vertex("Inner-X+Y+Z", -size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, +size.Z/2.0f);
+ IMM = new Vertex("Inner-X+Y-Z", -size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, -size.Z/2.0f);
MeshPY.Add(IPP);
MeshPY.Add(IPM);
@@ -381,9 +372,6 @@ namespace OpenSim.Region.Physics.OdePlugin
{
PhysicsVector n = t.getNormal();
}
-
-
-
}
@@ -393,9 +381,9 @@ namespace OpenSim.Region.Physics.OdePlugin
return result;
}
-
- static Mesh CreateBoxMeshZ(PrimitiveBaseShape primShape, PhysicsVector size)
- // Builds the z (+ and -) surfaces of a box shaped prim
+
+ private static Mesh CreateBoxMeshZ(PrimitiveBaseShape primShape, PhysicsVector size)
+ // Builds the z (+ and -) surfaces of a box shaped prim
{
UInt16 hollowFactor = primShape.ProfileHollow;
@@ -403,10 +391,10 @@ namespace OpenSim.Region.Physics.OdePlugin
// (M)inus Z
Mesh MZ = new Mesh();
- MZ.Add(new Vertex("-X-Y-Z", -size.X / 2.0f, -size.Y / 2.0f, -size.Z / 2.0f));
- MZ.Add(new Vertex("+X-Y-Z", +size.X / 2.0f, -size.Y / 2.0f, -size.Z / 2.0f));
- MZ.Add(new Vertex("-X+Y-Z", -size.X / 2.0f, +size.Y / 2.0f, -size.Z / 2.0f));
- MZ.Add(new Vertex("+X+Y-Z", +size.X / 2.0f, +size.Y / 2.0f, -size.Z / 2.0f));
+ MZ.Add(new Vertex("-X-Y-Z", -size.X/2.0f, -size.Y/2.0f, -size.Z/2.0f));
+ MZ.Add(new Vertex("+X-Y-Z", +size.X/2.0f, -size.Y/2.0f, -size.Z/2.0f));
+ MZ.Add(new Vertex("-X+Y-Z", -size.X/2.0f, +size.Y/2.0f, -size.Z/2.0f));
+ MZ.Add(new Vertex("+X+Y-Z", +size.X/2.0f, +size.Y/2.0f, -size.Z/2.0f));
MZ.Add(new Triangle(MZ.vertices[1], MZ.vertices[0], MZ.vertices[2]));
@@ -415,10 +403,10 @@ namespace OpenSim.Region.Physics.OdePlugin
// (P)lus Z
Mesh PZ = new Mesh();
- PZ.Add(new Vertex("-X-Y+Z", -size.X / 2.0f, -size.Y / 2.0f, 0.0f));
- PZ.Add(new Vertex("+X-Y+Z", +size.X / 2.0f, -size.Y / 2.0f, 0.0f));
- PZ.Add(new Vertex("-X+Y+Z", -size.X / 2.0f, +size.Y / 2.0f, 0.0f));
- PZ.Add(new Vertex("+X+Y+Z", +size.X / 2.0f, +size.Y / 2.0f, 0.0f));
+ PZ.Add(new Vertex("-X-Y+Z", -size.X/2.0f, -size.Y/2.0f, 0.0f));
+ PZ.Add(new Vertex("+X-Y+Z", +size.X/2.0f, -size.Y/2.0f, 0.0f));
+ PZ.Add(new Vertex("-X+Y+Z", -size.X/2.0f, +size.Y/2.0f, 0.0f));
+ PZ.Add(new Vertex("+X+Y+Z", +size.X/2.0f, +size.Y/2.0f, 0.0f));
// Surface 5, +Z
PZ.Add(new Triangle(PZ.vertices[0], PZ.vertices[1], PZ.vertices[2]));
@@ -426,12 +414,12 @@ namespace OpenSim.Region.Physics.OdePlugin
if (hollowFactor > 0)
{
- float hollowFactorF = (float)hollowFactor / (float)50000;
+ float hollowFactorF = (float) hollowFactor/(float) 50000;
- MZ.Add(new Vertex("-X-Y-Z", -size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, 0.0f));
- MZ.Add(new Vertex("-X+Y-Z", +size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, 0.0f));
- MZ.Add(new Vertex("-X-Y+Z", -size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, 0.0f));
- MZ.Add(new Vertex("-X+Y+Z", +size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, 0.0f));
+ MZ.Add(new Vertex("-X-Y-Z", -size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, 0.0f));
+ MZ.Add(new Vertex("-X+Y-Z", +size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, 0.0f));
+ MZ.Add(new Vertex("-X-Y+Z", -size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, 0.0f));
+ MZ.Add(new Vertex("-X+Y+Z", +size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, 0.0f));
List innerBorders = new List();
innerBorders.Add(4);
@@ -441,10 +429,10 @@ namespace OpenSim.Region.Physics.OdePlugin
InsertVertices(MZ.vertices, 4, MZ.triangles, innerBorders);
- PZ.Add(new Vertex("-X-Y-Z", -size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, 0.0f));
- PZ.Add(new Vertex("-X+Y-Z", +size.X * hollowFactorF / 2.0f, -size.Y * hollowFactorF / 2.0f, 0.0f));
- PZ.Add(new Vertex("-X-Y+Z", -size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, 0.0f));
- PZ.Add(new Vertex("-X+Y+Z", +size.X * hollowFactorF / 2.0f, +size.Y * hollowFactorF / 2.0f, 0.0f));
+ PZ.Add(new Vertex("-X-Y-Z", -size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, 0.0f));
+ PZ.Add(new Vertex("-X+Y-Z", +size.X*hollowFactorF/2.0f, -size.Y*hollowFactorF/2.0f, 0.0f));
+ PZ.Add(new Vertex("-X-Y+Z", -size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, 0.0f));
+ PZ.Add(new Vertex("-X+Y+Z", +size.X*hollowFactorF/2.0f, +size.Y*hollowFactorF/2.0f, 0.0f));
innerBorders = new List();
innerBorders.Add(4);
@@ -453,16 +441,15 @@ namespace OpenSim.Region.Physics.OdePlugin
innerBorders.Add(7);
InsertVertices(PZ.vertices, 4, PZ.triangles, innerBorders);
-
}
foreach (Vertex v in PZ.vertices)
{
- v.point.Z = size.Z / 2.0f;
+ v.point.Z = size.Z/2.0f;
}
foreach (Vertex v in MZ.vertices)
{
- v.point.Z = -size.Z / 2.0f;
+ v.point.Z = -size.Z/2.0f;
}
foreach (Triangle t in MZ.triangles)
@@ -486,15 +473,14 @@ namespace OpenSim.Region.Physics.OdePlugin
return result;
}
- static Mesh CreateBoxMesh(PrimitiveBaseShape primShape, PhysicsVector size)
+ private static Mesh CreateBoxMesh(PrimitiveBaseShape primShape, PhysicsVector size)
{
Mesh result = new Mesh();
-
- Mesh MeshX = Meshmerizer.CreateBoxMeshX(primShape, size);
- Mesh MeshY = Meshmerizer.CreateBoxMeshY(primShape, size);
- Mesh MeshZ = Meshmerizer.CreateBoxMeshZ(primShape, size);
+ Mesh MeshX = CreateBoxMeshX(primShape, size);
+ Mesh MeshY = CreateBoxMeshY(primShape, size);
+ Mesh MeshZ = CreateBoxMeshZ(primShape, size);
result.Append(MeshX);
result.Append(MeshY);
@@ -504,64 +490,63 @@ namespace OpenSim.Region.Physics.OdePlugin
}
- public static void CalcNormals(Mesh mesh)
+ public static void CalcNormals(Mesh mesh)
{
int iTriangles = mesh.triangles.Count;
mesh.normals = new float[iTriangles*3];
- int i=0;
+ int i = 0;
foreach (Triangle t in mesh.triangles)
{
-
float ux, uy, uz;
float vx, vy, vz;
float wx, wy, wz;
- ux = t.v1.point.X;
- uy = t.v1.point.Y;
- uz = t.v1.point.Z;
+ ux = t.v1.point.X;
+ uy = t.v1.point.Y;
+ uz = t.v1.point.Z;
- vx = t.v2.point.X;
- vy = t.v2.point.Y;
- vz = t.v2.point.Z;
+ vx = t.v2.point.X;
+ vy = t.v2.point.Y;
+ vz = t.v2.point.Z;
- wx = t.v3.point.X;
- wy = t.v3.point.Y;
- wz = t.v3.point.Z;
+ wx = t.v3.point.X;
+ wy = t.v3.point.Y;
+ wz = t.v3.point.Z;
- // Vectors for edges
- float e1x, e1y, e1z;
- float e2x, e2y, e2z;
+ // Vectors for edges
+ float e1x, e1y, e1z;
+ float e2x, e2y, e2z;
- e1x = ux - vx;
- e1y = uy - vy;
- e1z = uz - vz;
+ e1x = ux - vx;
+ e1y = uy - vy;
+ e1z = uz - vz;
- e2x = ux - wx;
- e2y = uy - wy;
- e2z = uz - wz;
+ e2x = ux - wx;
+ e2y = uy - wy;
+ e2z = uz - wz;
- // Cross product for normal
- float nx, ny, nz;
- nx = e1y * e2z - e1z * e2y;
- ny = e1z * e2x - e1x * e2z;
- nz = e1x * e2y - e1y * e2x;
+ // Cross product for normal
+ float nx, ny, nz;
+ nx = e1y*e2z - e1z*e2y;
+ ny = e1z*e2x - e1x*e2z;
+ nz = e1x*e2y - e1y*e2x;
- // Length
- float l = (float)Math.Sqrt(nx * nx + ny * ny + nz * nz);
+ // Length
+ float l = (float) Math.Sqrt(nx*nx + ny*ny + nz*nz);
- // Normalized "normal"
- nx /= l;
- ny /= l;
- nz /= l;
+ // Normalized "normal"
+ nx /= l;
+ ny /= l;
+ nz /= l;
mesh.normals[i] = nx;
mesh.normals[i + 1] = ny;
mesh.normals[i + 2] = nz;
- i+=3;
+ i += 3;
}
}
@@ -572,18 +557,15 @@ namespace OpenSim.Region.Physics.OdePlugin
switch (primShape.ProfileShape)
{
case ProfileShape.Square:
- mesh=CreateBoxMesh(primShape, size);
+ mesh = CreateBoxMesh(primShape, size);
CalcNormals(mesh);
break;
default:
- mesh=null;
+ mesh = null;
break;
}
return mesh;
-
}
}
-}
-
-
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index a20452f..c9af6dd 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -25,19 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
using System;
-using System.Threading;
using System.Collections.Generic;
-
-using libsecondlife;
-
using Axiom.Math;
using Ode.NET;
using OpenSim.Framework;
-using OpenSim.Framework.Console;
using OpenSim.Region.Physics.Manager;
-
namespace OpenSim.Region.Physics.OdePlugin
{
///
@@ -49,7 +44,6 @@ namespace OpenSim.Region.Physics.OdePlugin
public OdePlugin()
{
-
}
public bool Init()
@@ -73,7 +67,6 @@ namespace OpenSim.Region.Physics.OdePlugin
public void Dispose()
{
-
}
}
@@ -82,17 +75,17 @@ namespace OpenSim.Region.Physics.OdePlugin
private static float ODE_STEPSIZE = 0.004f;
private static bool RENDER_FLAG = false;
private IntPtr contactgroup;
- private IntPtr LandGeom=(IntPtr)0;
+ private IntPtr LandGeom = (IntPtr) 0;
private double[] _heightmap;
private d.NearCallback nearCallback;
public d.TriCallback triCallback;
public d.TriArrayCallback triArrayCallback;
private List _characters = new List();
private List _prims = new List();
- public Dictionary geom_name_map=new Dictionary();
+ public Dictionary geom_name_map = new Dictionary();
private d.ContactGeom[] contacts = new d.ContactGeom[30];
private d.Contact contact;
- private float step_time=0.0f;
+ private float step_time = 0.0f;
public IntPtr world;
public IntPtr space;
public static Object OdeLock = new Object();
@@ -140,7 +133,7 @@ namespace OpenSim.Region.Physics.OdePlugin
return;
d.GeomClassID id = d.GeomGetClass(g1);
- if (id==d.GeomClassID.TriMeshClass)
+ if (id == d.GeomClassID.TriMeshClass)
{
String name1 = null;
String name2 = null;
@@ -163,7 +156,6 @@ namespace OpenSim.Region.Physics.OdePlugin
IntPtr joint = d.JointCreateContact(world, contactgroup, ref contact);
d.JointAttach(joint, b1, b2);
}
-
}
private void collision_optimized()
@@ -171,7 +163,8 @@ namespace OpenSim.Region.Physics.OdePlugin
foreach (OdeCharacter chr in _characters)
{
d.SpaceCollide2(space, chr.Shell, IntPtr.Zero, nearCallback);
- foreach (OdeCharacter ch2 in _characters) /// should be a separate space -- lots of avatars will be N**2 slow
+ foreach (OdeCharacter ch2 in _characters)
+ /// should be a separate space -- lots of avatars will be N**2 slow
{
d.SpaceCollide2(chr.Shell, ch2.Shell, IntPtr.Zero, nearCallback);
}
@@ -193,8 +186,8 @@ namespace OpenSim.Region.Physics.OdePlugin
{
lock (OdeLock)
{
- ((OdeCharacter)actor).Destroy();
- _characters.Remove((OdeCharacter)actor);
+ ((OdeCharacter) actor).Destroy();
+ _characters.Remove((OdeCharacter) actor);
}
}
@@ -204,13 +197,14 @@ namespace OpenSim.Region.Physics.OdePlugin
{
lock (OdeLock)
{
- d.GeomDestroy(((OdePrim)prim).prim_geom);
- _prims.Remove((OdePrim)prim);
+ d.GeomDestroy(((OdePrim) prim).prim_geom);
+ _prims.Remove((OdePrim) prim);
}
}
}
- PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation, Mesh mesh, PrimitiveBaseShape pbs)
+ private PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation,
+ Mesh mesh, PrimitiveBaseShape pbs)
{
PhysicsVector pos = new PhysicsVector();
pos.X = position.X;
@@ -235,7 +229,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
- public int TriArrayCallback(System.IntPtr trimesh, System.IntPtr refObject, int[] triangleIndex, int triCount)
+ public int TriArrayCallback(IntPtr trimesh, IntPtr refObject, int[] triangleIndex, int triCount)
{
/* String name1 = null;
String name2 = null;
@@ -254,15 +248,14 @@ namespace OpenSim.Region.Physics.OdePlugin
return 1;
}
- public int TriCallback(System.IntPtr trimesh, System.IntPtr refObject, int triangleIndex)
+ public int TriCallback(IntPtr trimesh, IntPtr refObject, int triangleIndex)
{
-
String name1 = null;
String name2 = null;
if (!geom_name_map.TryGetValue(trimesh, out name1))
{
- name1 = "null";
+ name1 = "null";
}
if (!geom_name_map.TryGetValue(refObject, out name2))
{
@@ -282,11 +275,12 @@ namespace OpenSim.Region.Physics.OdePlugin
}
- public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, PhysicsVector size, Quaternion rotation)
+ public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position,
+ PhysicsVector size, Quaternion rotation)
{
PhysicsActor result;
- switch(pbs.ProfileShape)
+ switch (pbs.ProfileShape)
{
case ProfileShape.Square:
/// support simple box & hollow box now; later, more shapes
@@ -310,7 +304,6 @@ namespace OpenSim.Region.Physics.OdePlugin
}
-
public override void Simulate(float timeStep)
{
step_time += timeStep;
@@ -327,11 +320,12 @@ namespace OpenSim.Region.Physics.OdePlugin
Vector3 rx, ry, rz;
p.Orientation.ToAxes(out rx, out ry, out rz);
Console.WriteLine("RENDER: block; " + p.Size.X + ", " + p.Size.Y + ", " + p.Size.Z + "; " +
- " 0, 0, 1; " + //shape, size, color
- (p.Position.X - 128.0f) + ", " + (p.Position.Y - 128.0f) + ", " + (p.Position.Z - 33.0f) + "; " + // position
- rx.x + "," + ry.x + "," + rz.x + ", " + // rotation
- rx.y + "," + ry.y + "," + rz.y + ", " +
- rx.z + "," + ry.z + "," + rz.z);
+ " 0, 0, 1; " + //shape, size, color
+ (p.Position.X - 128.0f) + ", " + (p.Position.Y - 128.0f) + ", " +
+ (p.Position.Z - 33.0f) + "; " + // position
+ rx.x + "," + ry.x + "," + rz.x + ", " + // rotation
+ rx.y + "," + ry.y + "," + rz.y + ", " +
+ rx.z + "," + ry.z + "," + rz.z);
}
}
int i = 0;
@@ -357,22 +351,27 @@ namespace OpenSim.Region.Physics.OdePlugin
float Zoff = -33.0f;
d.Matrix3 temp = d.BodyGetRotation(actor.Body);
Console.WriteLine("RENDER: cylinder; " + // shape
- OdeCharacter.CAPSULE_RADIUS + ", " + OdeCharacter.CAPSULE_LENGTH + //size
- "; 0, 1, 0; " + // color
- (actor.Position.X - 128.0f) + ", " + (actor.Position.Y - 128.0f) + ", " + (actor.Position.Z + Zoff) + "; " + // position
- temp.M00 + "," + temp.M10 + "," + temp.M20 + ", " + // rotation
- temp.M01 + "," + temp.M11 + "," + temp.M21 + ", " +
- temp.M02 + "," + temp.M12 + "," + temp.M22);
- d.Vector3 caphead; d.BodyGetRelPointPos(actor.Body, 0, 0, OdeCharacter.CAPSULE_LENGTH * .5f, out caphead);
- d.Vector3 capfoot; d.BodyGetRelPointPos(actor.Body, 0, 0, -OdeCharacter.CAPSULE_LENGTH * .5f, out capfoot);
+ OdeCharacter.CAPSULE_RADIUS + ", " + OdeCharacter.CAPSULE_LENGTH + //size
+ "; 0, 1, 0; " + // color
+ (actor.Position.X - 128.0f) + ", " + (actor.Position.Y - 128.0f) + ", " +
+ (actor.Position.Z + Zoff) + "; " + // position
+ temp.M00 + "," + temp.M10 + "," + temp.M20 + ", " + // rotation
+ temp.M01 + "," + temp.M11 + "," + temp.M21 + ", " +
+ temp.M02 + "," + temp.M12 + "," + temp.M22);
+ d.Vector3 caphead;
+ d.BodyGetRelPointPos(actor.Body, 0, 0, OdeCharacter.CAPSULE_LENGTH*.5f, out caphead);
+ d.Vector3 capfoot;
+ d.BodyGetRelPointPos(actor.Body, 0, 0, -OdeCharacter.CAPSULE_LENGTH*.5f, out capfoot);
Console.WriteLine("RENDER: sphere; " + OdeCharacter.CAPSULE_RADIUS + // shape, size
- "; 1, 0, 1; " + //color
- (caphead.X - 128.0f) + ", " + (caphead.Y - 128.0f) + ", " + (caphead.Z + Zoff) + "; " + // position
- "1,0,0, 0,1,0, 0,0,1"); // rotation
+ "; 1, 0, 1; " + //color
+ (caphead.X - 128.0f) + ", " + (caphead.Y - 128.0f) + ", " + (caphead.Z + Zoff) +
+ "; " + // position
+ "1,0,0, 0,1,0, 0,0,1"); // rotation
Console.WriteLine("RENDER: sphere; " + OdeCharacter.CAPSULE_RADIUS + // shape, size
- "; 1, 0, 0; " + //color
- (capfoot.X - 128.0f) + ", " + (capfoot.Y - 128.0f) + ", " + (capfoot.Z + Zoff) + "; " + // position
- "1,0,0, 0,1,0, 0,0,1"); // rotation
+ "; 1, 0, 0; " + //color
+ (capfoot.X - 128.0f) + ", " + (capfoot.Y - 128.0f) + ", " + (capfoot.Z + Zoff) +
+ "; " + // position
+ "1,0,0, 0,1,0, 0,0,1"); // rotation
}
}
}
@@ -380,14 +379,11 @@ namespace OpenSim.Region.Physics.OdePlugin
public override void GetResults()
{
-
}
public override bool IsThreaded
{
- get
- {
- return (false); // for now we won't be multithreaded
+ get { return (false); // for now we won't be multithreaded
}
}
@@ -400,21 +396,21 @@ namespace OpenSim.Region.Physics.OdePlugin
{
for (int y = 0; y < 258; y++)
{
- int xx = x-1;
+ int xx = x - 1;
if (xx < 0) xx = 0;
if (xx > 255) xx = 255;
- int yy = y-1;
+ int yy = y - 1;
if (yy < 0) yy = 0;
if (yy > 255) yy = 255;
- double val = (double)heightMap[yy * 256 + xx];
- _heightmap[x * 258 + y] = val;
+ double val = (double) heightMap[yy*256 + xx];
+ _heightmap[x*258 + y] = val;
}
}
lock (OdeLock)
{
- if (!(LandGeom == (IntPtr)0))
+ if (!(LandGeom == (IntPtr) 0))
{
d.SpaceRemove(space, LandGeom);
}
@@ -422,7 +418,7 @@ namespace OpenSim.Region.Physics.OdePlugin
d.GeomHeightfieldDataBuildDouble(HeightmapData, _heightmap, 0, 258, 258, 258, 258, 1.0f, 0.0f, 2.0f, 0);
d.GeomHeightfieldDataSetBounds(HeightmapData, 256, 256);
LandGeom = d.CreateHeightfield(space, HeightmapData, 1);
- this.geom_name_map[LandGeom]="Terrain";
+ geom_name_map[LandGeom] = "Terrain";
d.Matrix3 R = new d.Matrix3();
@@ -430,7 +426,7 @@ namespace OpenSim.Region.Physics.OdePlugin
Quaternion q2 = Quaternion.FromAngleAxis(1.5707f, new Vector3(0, 1, 0));
//Axiom.Math.Quaternion q3 = Axiom.Math.Quaternion.FromAngleAxis(3.14f, new Axiom.Math.Vector3(0, 0, 1));
- q1 = q1 * q2;
+ q1 = q1*q2;
//q1 = q1 * q3;
Vector3 v3 = new Vector3();
float angle = 0;
@@ -444,7 +440,6 @@ namespace OpenSim.Region.Physics.OdePlugin
public override void DeleteTerrain()
{
-
}
}
@@ -452,12 +447,12 @@ namespace OpenSim.Region.Physics.OdePlugin
{
private PhysicsVector _position;
private d.Vector3 _zeroPosition;
- private bool _zeroFlag=false;
+ private bool _zeroFlag = false;
private PhysicsVector _velocity;
private PhysicsVector _target_velocity;
private PhysicsVector _acceleration;
- private static float PID_D=4000.0f;
- private static float PID_P=7000.0f;
+ private static float PID_D = 4000.0f;
+ private static float PID_P = 7000.0f;
private static float POSTURE_SERVO = 10000.0f;
public static float CAPSULE_RADIUS = 0.5f;
public static float CAPSULE_LENGTH = 0.9f;
@@ -484,28 +479,18 @@ namespace OpenSim.Region.Physics.OdePlugin
d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
d.GeomSetBody(Shell, Body);
}
- parent_scene.geom_name_map[Shell]=avName;
-
+ parent_scene.geom_name_map[Shell] = avName;
}
public override bool Flying
{
- get
- {
- return flying;
- }
- set
- {
- flying = value;
- }
+ get { return flying; }
+ set { flying = value; }
}
public override PhysicsVector Position
{
- get
- {
- return _position;
- }
+ get { return _position; }
set
{
lock (OdeScene.OdeLock)
@@ -518,60 +503,34 @@ namespace OpenSim.Region.Physics.OdePlugin
public override PhysicsVector Size
{
- get
- {
- return new PhysicsVector(0,0,0);
- }
- set
- {
- }
+ get { return new PhysicsVector(0, 0, 0); }
+ set { }
}
public override PhysicsVector Velocity
{
- get
- {
- return _velocity;
- }
- set
- {
- _target_velocity = value;
- }
+ get { return _velocity; }
+ set { _target_velocity = value; }
}
public override bool Kinematic
{
- get
- {
- return false;
- }
- set
- {
-
- }
+ get { return false; }
+ set { }
}
public override Quaternion Orientation
{
- get
- {
- return Quaternion.Identity;
- }
- set
- {
-
- }
+ get { return Quaternion.Identity; }
+ set { }
}
public override PhysicsVector Acceleration
{
- get
- {
- return _acceleration;
- }
-
+ get { return _acceleration; }
}
+
public void SetAcceleration(PhysicsVector accel)
{
_acceleration = accel;
@@ -579,12 +538,10 @@ namespace OpenSim.Region.Physics.OdePlugin
public override void AddForce(PhysicsVector force)
{
-
}
public override void SetMomentum(PhysicsVector momentum)
{
-
}
public void Move(float timeStep)
@@ -603,28 +560,28 @@ namespace OpenSim.Region.Physics.OdePlugin
_zeroPosition = d.BodyGetPosition(Body);
}
d.Vector3 pos = d.BodyGetPosition(Body);
- vec.X = (_target_velocity.X - vel.X) * PID_D + (_zeroPosition.X - pos.X) * PID_P;
- vec.Y = (_target_velocity.Y - vel.Y) * PID_D + (_zeroPosition.Y - pos.Y) * PID_P;
+ vec.X = (_target_velocity.X - vel.X)*PID_D + (_zeroPosition.X - pos.X)*PID_P;
+ vec.Y = (_target_velocity.Y - vel.Y)*PID_D + (_zeroPosition.Y - pos.Y)*PID_P;
if (flying)
{
- vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P;
+ vec.Z = (_target_velocity.Z - vel.Z)*PID_D + (_zeroPosition.Z - pos.Z)*PID_P;
}
}
else
{
_zeroFlag = false;
- vec.X = (_target_velocity.X - vel.X) * PID_D;
- vec.Y = (_target_velocity.Y - vel.Y) * PID_D;
+ vec.X = (_target_velocity.X - vel.X)*PID_D;
+ vec.Y = (_target_velocity.Y - vel.Y)*PID_D;
if (flying)
{
- vec.Z = (_target_velocity.Z - vel.Z) * PID_D;
+ vec.Z = (_target_velocity.Z - vel.Z)*PID_D;
}
}
if (flying)
{
vec.Z += 10.0f;
}
- d.BodyAddForce(this.Body, vec.X, vec.Y, vec.Z);
+ d.BodyAddForce(Body, vec.X, vec.Y, vec.Z);
// ok -- let's stand up straight!
d.Vector3 feet;
@@ -634,7 +591,7 @@ namespace OpenSim.Region.Physics.OdePlugin
float posture = head.Z - feet.Z;
// restoring force proportional to lack of posture:
- float servo = (2.5f-posture) * POSTURE_SERVO;
+ float servo = (2.5f - posture)*POSTURE_SERVO;
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f);
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f);
}
@@ -650,9 +607,9 @@ namespace OpenSim.Region.Physics.OdePlugin
if (vec.X > 255.95f) vec.X = 255.95f;
if (vec.Y > 255.95f) vec.Y = 255.95f;
- this._position.X = vec.X;
- this._position.Y = vec.Y;
- this._position.Z = vec.Z;
+ _position.X = vec.X;
+ _position.Y = vec.Y;
+ _position.Z = vec.Z;
if (_zeroFlag)
{
@@ -673,9 +630,9 @@ namespace OpenSim.Region.Physics.OdePlugin
{
lock (OdeScene.OdeLock)
{
- d.GeomDestroy(this.Shell);
- this._parent_scene.geom_name_map.Remove(this.Shell);
- d.BodyDestroy(this.Body);
+ d.GeomDestroy(Shell);
+ _parent_scene.geom_name_map.Remove(Shell);
+ d.BodyDestroy(Body);
}
}
}
@@ -693,7 +650,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public IntPtr prim_geom;
public IntPtr _triMeshData;
- public OdePrim(String primName, OdeScene parent_scene, PhysicsVector pos, PhysicsVector size,
+ public OdePrim(String primName, OdeScene parent_scene, PhysicsVector pos, PhysicsVector size,
Quaternion rotation, Mesh mesh, PrimitiveBaseShape pbs)
{
_velocity = new PhysicsVector();
@@ -707,7 +664,7 @@ namespace OpenSim.Region.Physics.OdePlugin
lock (OdeScene.OdeLock)
{
- if (mesh!=null)
+ if (mesh != null)
{
setMesh(parent_scene, mesh);
}
@@ -723,20 +680,22 @@ namespace OpenSim.Region.Physics.OdePlugin
myrot.Y = rotation.y;
myrot.Z = rotation.z;
d.GeomSetQuaternion(prim_geom, ref myrot);
- parent_scene.geom_name_map[prim_geom] = primName; // don't do .add() here; old geoms get recycled with the same hash
+ parent_scene.geom_name_map[prim_geom] = primName;
+ // don't do .add() here; old geoms get recycled with the same hash
}
}
- public void setMesh(OdeScene parent_scene, Mesh mesh)
+ public void setMesh(OdeScene parent_scene, Mesh mesh)
{
float[] vertexList = mesh.getVertexListAsFloat(); // Note, that vertextList is pinned in memory
int[] indexList = mesh.getIndexListAsInt(); // Also pinned, needs release after usage
- int VertexCount = vertexList.GetLength(0) / 3;
+ int VertexCount = vertexList.GetLength(0)/3;
int IndexCount = indexList.GetLength(0);
_triMeshData = d.GeomTriMeshDataCreate();
- d.GeomTriMeshDataBuildSimple(_triMeshData, vertexList, 3 * sizeof(float), VertexCount, indexList, IndexCount, 3 * sizeof(int));
+ d.GeomTriMeshDataBuildSimple(_triMeshData, vertexList, 3*sizeof (float), VertexCount, indexList, IndexCount,
+ 3*sizeof (int));
d.GeomTriMeshDataPreprocess(_triMeshData);
prim_geom = d.CreateTriMesh(parent_scene.space, _triMeshData, parent_scene.triCallback, null, null);
@@ -744,21 +703,14 @@ namespace OpenSim.Region.Physics.OdePlugin
public override bool Flying
{
- get
- {
- return false; //no flying prims for you
- }
- set
- {
+ get { return false; //no flying prims for you
}
+ set { }
}
public override PhysicsVector Position
{
- get
- {
- return _position;
- }
+ get { return _position; }
set
{
_position = value;
@@ -771,10 +723,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public override PhysicsVector Size
{
- get
- {
- return _size;
- }
+ get { return _size; }
set
{
_size = value;
@@ -798,33 +747,19 @@ namespace OpenSim.Region.Physics.OdePlugin
public override PhysicsVector Velocity
{
- get
- {
- return _velocity;
- }
- set
- {
- _velocity = value;
- }
+ get { return _velocity; }
+ set { _velocity = value; }
}
public override bool Kinematic
{
- get
- {
- return false;
- }
- set
- {
- }
+ get { return false; }
+ set { }
}
public override Quaternion Orientation
{
- get
- {
- return _orientation;
- }
+ get { return _orientation; }
set
{
_orientation = value;
@@ -842,15 +777,12 @@ namespace OpenSim.Region.Physics.OdePlugin
public override PhysicsVector Acceleration
{
- get
- {
- return _acceleration;
- }
+ get { return _acceleration; }
}
public void SetAcceleration(PhysicsVector accel)
{
- this._acceleration = accel;
+ _acceleration = accel;
}
public override void AddForce(PhysicsVector force)
@@ -861,4 +793,4 @@ namespace OpenSim.Region.Physics.OdePlugin
{
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs b/OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs
index 3f840cc..d110a17 100644
--- a/OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs
+++ b/OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs
@@ -27,24 +27,26 @@
*/
using System.Reflection;
using System.Runtime.InteropServices;
+
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
-[assembly: AssemblyTitle("RealPhysXplugin")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("RealPhysXplugin")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly : AssemblyTitle("RealPhysXplugin")]
+[assembly : AssemblyDescription("")]
+[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyCompany("")]
+[assembly : AssemblyProduct("RealPhysXplugin")]
+[assembly : AssemblyCopyright("")]
+[assembly : AssemblyTrademark("")]
+[assembly : AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
-[assembly: ComVisible(false)]
+
+[assembly : ComVisible(false)]
// The assembly version has following format :
//
@@ -53,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
-[assembly: AssemblyVersion("1.0.*")]
+[assembly : AssemblyVersion("1.0.*")]
\ No newline at end of file
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
index a7cef88..4896359 100644
--- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
+++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
@@ -34,102 +34,99 @@ using Quaternion=Axiom.Math.Quaternion;
namespace OpenSim.Region.Physics.PhysXPlugin
{
- ///
- /// Will be the PhysX plugin but for now will be a very basic physics engine
- ///
- public class PhysXPlugin : IPhysicsPlugin
- {
- private PhysXScene _mScene;
-
- public PhysXPlugin()
- {
-
- }
-
- public bool Init()
- {
- return true;
- }
-
- public PhysicsScene GetScene()
- {
- if(_mScene == null)
- {
- _mScene = new PhysXScene();
- }
- return(_mScene);
- }
-
- public string GetName()
- {
- return("RealPhysX");
- }
-
- public void Dispose()
- {
-
- }
- }
-
- public class PhysXScene :PhysicsScene
- {
- private List _characters = new List();
- private List _prims = new List();
- private float[] _heightMap = null;
- private NxPhysicsSDK mySdk;
- private NxScene scene;
-
- public PhysXScene()
- {
- mySdk = NxPhysicsSDK.CreateSDK();
- Console.WriteLine("Sdk created - now creating scene");
- scene = mySdk.CreateScene();
-
- }
-
- public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
- {
- Vec3 pos = new Vec3();
- pos.X = position.X;
- pos.Y = position.Y;
- pos.Z = position.Z;
- PhysXCharacter act = new PhysXCharacter( scene.AddCharacter(pos));
+ ///
+ /// Will be the PhysX plugin but for now will be a very basic physics engine
+ ///
+ public class PhysXPlugin : IPhysicsPlugin
+ {
+ private PhysXScene _mScene;
+
+ public PhysXPlugin()
+ {
+ }
+
+ public bool Init()
+ {
+ return true;
+ }
+
+ public PhysicsScene GetScene()
+ {
+ if (_mScene == null)
+ {
+ _mScene = new PhysXScene();
+ }
+ return (_mScene);
+ }
+
+ public string GetName()
+ {
+ return ("RealPhysX");
+ }
+
+ public void Dispose()
+ {
+ }
+ }
+
+ public class PhysXScene : PhysicsScene
+ {
+ private List _characters = new List();
+ private List _prims = new List();
+ private float[] _heightMap = null;
+ private NxPhysicsSDK mySdk;
+ private NxScene scene;
+
+ public PhysXScene()
+ {
+ mySdk = NxPhysicsSDK.CreateSDK();
+ Console.WriteLine("Sdk created - now creating scene");
+ scene = mySdk.CreateScene();
+ }
+
+ public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
+ {
+ Vec3 pos = new Vec3();
+ pos.X = position.X;
+ pos.Y = position.Y;
+ pos.Z = position.Z;
+ PhysXCharacter act = new PhysXCharacter(scene.AddCharacter(pos));
act.Position = position;
- _characters.Add(act);
- return act;
- }
+ _characters.Add(act);
+ return act;
+ }
public override void RemovePrim(PhysicsActor prim)
{
-
}
public override void RemoveAvatar(PhysicsActor actor)
{
+ }
+ private PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation)
+ {
+ Vec3 pos = new Vec3();
+ pos.X = position.X;
+ pos.Y = position.Y;
+ pos.Z = position.Z;
+ Vec3 siz = new Vec3();
+ siz.X = size.X;
+ siz.Y = size.Y;
+ siz.Z = size.Z;
+ PhysXPrim act = new PhysXPrim(scene.AddNewBox(pos, siz));
+ _prims.Add(act);
+ return act;
}
-
- PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation)
- {
- Vec3 pos = new Vec3();
- pos.X = position.X;
- pos.Y = position.Y;
- pos.Z = position.Z;
- Vec3 siz = new Vec3();
- siz.X = size.X;
- siz.Y = size.Y;
- siz.Z = size.Z;
- PhysXPrim act = new PhysXPrim( scene.AddNewBox(pos, siz));
- _prims.Add(act);
- return act;
- }
- public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, PhysicsVector size, Quaternion rotation)
+
+ public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position,
+ PhysicsVector size, Quaternion rotation)
{
return AddPrim(position, size, rotation);
}
- public override void Simulate(float timeStep)
- {
+ public override void Simulate(float timeStep)
+ {
try
{
foreach (PhysXCharacter actor in _characters)
@@ -149,309 +146,237 @@ namespace OpenSim.Region.Physics.PhysXPlugin
{
Console.WriteLine(e.Message);
}
-
- }
-
- public override void GetResults()
- {
-
- }
-
- public override bool IsThreaded
- {
- get
- {
- return(false); // for now we won't be multithreaded
- }
- }
-
- public override void SetTerrain(float[] heightMap)
- {
- if (this._heightMap != null)
+ }
+
+ public override void GetResults()
+ {
+ }
+
+ public override bool IsThreaded
+ {
+ get { return (false); // for now we won't be multithreaded
+ }
+ }
+
+ public override void SetTerrain(float[] heightMap)
+ {
+ if (_heightMap != null)
{
Console.WriteLine("PhysX - deleting old terrain");
- this.scene.DeleteTerrain();
+ scene.DeleteTerrain();
}
- this._heightMap = heightMap;
- this.scene.AddTerrain(heightMap);
- }
+ _heightMap = heightMap;
+ scene.AddTerrain(heightMap);
+ }
public override void DeleteTerrain()
{
- this.scene.DeleteTerrain();
- }
+ scene.DeleteTerrain();
+ }
}
-
- public class PhysXCharacter : PhysicsActor
- {
- private PhysicsVector _position;
- private PhysicsVector _velocity;
- private PhysicsVector _acceleration;
- private NxCharacter _character;
- private bool flying;
- private float gravityAccel;
-
- public PhysXCharacter(NxCharacter character)
- {
- _velocity = new PhysicsVector();
- _position = new PhysicsVector();
- _acceleration = new PhysicsVector();
- _character = character;
- }
-
- public override bool Flying
- {
- get
- {
- return flying;
- }
- set
- {
- flying = value;
- }
- }
-
- public override PhysicsVector Position
- {
- get
- {
- return _position;
- }
- set
- {
- _position = value;
+
+ public class PhysXCharacter : PhysicsActor
+ {
+ private PhysicsVector _position;
+ private PhysicsVector _velocity;
+ private PhysicsVector _acceleration;
+ private NxCharacter _character;
+ private bool flying;
+ private float gravityAccel;
+
+ public PhysXCharacter(NxCharacter character)
+ {
+ _velocity = new PhysicsVector();
+ _position = new PhysicsVector();
+ _acceleration = new PhysicsVector();
+ _character = character;
+ }
+
+ public override bool Flying
+ {
+ get { return flying; }
+ set { flying = value; }
+ }
+
+ public override PhysicsVector Position
+ {
+ get { return _position; }
+ set
+ {
+ _position = value;
Vec3 ps = new Vec3();
ps.X = value.X;
ps.Y = value.Y;
ps.Z = value.Z;
- this._character.Position = ps;
- }
- }
+ _character.Position = ps;
+ }
+ }
public override PhysicsVector Size
{
- get
+ get { return new PhysicsVector(0, 0, 0); }
+ set { }
+ }
+
+ public override PhysicsVector Velocity
+ {
+ get { return _velocity; }
+ set { _velocity = value; }
+ }
+
+ public override bool Kinematic
+ {
+ get { return false; }
+ set { }
+ }
+
+ public override Quaternion Orientation
+ {
+ get { return Quaternion.Identity; }
+ set { }
+ }
+
+ public override PhysicsVector Acceleration
+ {
+ get { return _acceleration; }
+ }
+
+ public void SetAcceleration(PhysicsVector accel)
+ {
+ _acceleration = accel;
+ }
+
+ public override void AddForce(PhysicsVector force)
+ {
+ }
+
+ public override void SetMomentum(PhysicsVector momentum)
+ {
+ }
+
+ public void Move(float timeStep)
+ {
+ Vec3 vec = new Vec3();
+ vec.X = _velocity.X*timeStep;
+ vec.Y = _velocity.Y*timeStep;
+ if (flying)
{
- return new PhysicsVector(0,0,0);
+ vec.Z = (_velocity.Z)*timeStep;
}
- set
+ else
+ {
+ gravityAccel += -9.8f;
+ vec.Z = (gravityAccel + _velocity.Z)*timeStep;
+ }
+ int res = _character.Move(vec);
+ if (res == 1)
{
+ gravityAccel = 0;
}
}
- public override PhysicsVector Velocity
- {
- get
- {
- return _velocity;
- }
- set
- {
- _velocity = value;
- }
- }
-
- public override bool Kinematic
- {
- get
- {
- return false;
- }
- set
- {
-
- }
- }
-
- public override Quaternion Orientation
- {
- get
- {
- return Quaternion.Identity;
- }
- set
- {
-
- }
- }
-
- public override PhysicsVector Acceleration
- {
- get
- {
- return _acceleration;
- }
-
- }
- public void SetAcceleration (PhysicsVector accel)
- {
- this._acceleration = accel;
- }
-
- public override void AddForce(PhysicsVector force)
- {
-
- }
-
- public override void SetMomentum(PhysicsVector momentum)
- {
-
- }
-
- public void Move(float timeStep)
- {
- Vec3 vec = new Vec3();
- vec.X = this._velocity.X * timeStep;
- vec.Y = this._velocity.Y * timeStep;
- if(flying)
- {
- vec.Z = ( this._velocity.Z) * timeStep;
- }
- else
- {
- gravityAccel+= -9.8f;
- vec.Z = (gravityAccel + this._velocity.Z) * timeStep;
- }
- int res = this._character.Move(vec);
- if(res == 1)
- {
- gravityAccel = 0;
- }
- }
-
- public void UpdatePosition()
- {
- Vec3 vec = this._character.Position;
- this._position.X = vec.X;
- this._position.Y = vec.Y;
- this._position.Z = vec.Z;
- }
- }
-
- public class PhysXPrim : PhysicsActor
- {
- private PhysicsVector _position;
- private PhysicsVector _velocity;
- private PhysicsVector _acceleration;
- private NxActor _prim;
-
- public PhysXPrim(NxActor prim)
- {
- _velocity = new PhysicsVector();
- _position = new PhysicsVector();
- _acceleration = new PhysicsVector();
- _prim = prim;
- }
- public override bool Flying
- {
- get
- {
- return false; //no flying prims for you
- }
- set
- {
-
- }
- }
- public override PhysicsVector Position
- {
- get
- {
- PhysicsVector pos = new PhysicsVector();
- Vec3 vec = this._prim.Position;
- pos.X = vec.X;
- pos.Y = vec.Y;
- pos.Z = vec.Z;
- return pos;
-
- }
- set
- {
- PhysicsVector vec = value;
- Vec3 pos = new Vec3();
- pos.X = vec.X;
- pos.Y = vec.Y;
- pos.Z = vec.Z;
- this._prim.Position = pos;
- }
- }
- public override PhysicsVector Size
+ public void UpdatePosition()
+ {
+ Vec3 vec = _character.Position;
+ _position.X = vec.X;
+ _position.Y = vec.Y;
+ _position.Z = vec.Z;
+ }
+ }
+
+ public class PhysXPrim : PhysicsActor
+ {
+ private PhysicsVector _position;
+ private PhysicsVector _velocity;
+ private PhysicsVector _acceleration;
+ private NxActor _prim;
+
+ public PhysXPrim(NxActor prim)
+ {
+ _velocity = new PhysicsVector();
+ _position = new PhysicsVector();
+ _acceleration = new PhysicsVector();
+ _prim = prim;
+ }
+
+ public override bool Flying
+ {
+ get { return false; //no flying prims for you
+ }
+ set { }
+ }
+
+ public override PhysicsVector Position
{
get
{
- return new PhysicsVector(0, 0, 0);
+ PhysicsVector pos = new PhysicsVector();
+ Vec3 vec = _prim.Position;
+ pos.X = vec.X;
+ pos.Y = vec.Y;
+ pos.Z = vec.Z;
+ return pos;
}
set
{
+ PhysicsVector vec = value;
+ Vec3 pos = new Vec3();
+ pos.X = vec.X;
+ pos.Y = vec.Y;
+ pos.Z = vec.Z;
+ _prim.Position = pos;
}
}
- public override PhysicsVector Velocity
- {
- get
- {
- return _velocity;
- }
- set
- {
- _velocity = value;
- }
- }
-
- public override bool Kinematic
- {
- get
- {
- return this._prim.Kinematic;
- }
- set
- {
- this._prim.Kinematic = value;
- }
- }
-
- public override Quaternion Orientation
- {
- get
- {
- Quaternion res = new Quaternion();
- PhysXWrapper.Quaternion quat = this._prim.GetOrientation();
- res.w = quat.W;
- res.x = quat.X;
- res.y = quat.Y;
- res.z = quat.Z;
- return res;
- }
- set
- {
-
- }
- }
-
- public override PhysicsVector Acceleration
- {
- get
- {
- return _acceleration;
- }
-
- }
- public void SetAcceleration (PhysicsVector accel)
- {
- this._acceleration = accel;
- }
-
- public override void AddForce(PhysicsVector force)
- {
-
- }
-
- public override void SetMomentum(PhysicsVector momentum)
- {
-
- }
-
-
- }
-
-}
+ public override PhysicsVector Size
+ {
+ get { return new PhysicsVector(0, 0, 0); }
+ set { }
+ }
+
+ public override PhysicsVector Velocity
+ {
+ get { return _velocity; }
+ set { _velocity = value; }
+ }
+
+ public override bool Kinematic
+ {
+ get { return _prim.Kinematic; }
+ set { _prim.Kinematic = value; }
+ }
+
+ public override Quaternion Orientation
+ {
+ get
+ {
+ Quaternion res = new Quaternion();
+ PhysXWrapper.Quaternion quat = _prim.GetOrientation();
+ res.w = quat.W;
+ res.x = quat.X;
+ res.y = quat.Y;
+ res.z = quat.Z;
+ return res;
+ }
+ set { }
+ }
+
+ public override PhysicsVector Acceleration
+ {
+ get { return _acceleration; }
+ }
+
+ public void SetAcceleration(PhysicsVector accel)
+ {
+ _acceleration = accel;
+ }
+
+ public override void AddForce(PhysicsVector force)
+ {
+ }
+
+ public override void SetMomentum(PhysicsVector momentum)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/Executor.cs b/OpenSim/Region/ScriptEngine/Common/Executor.cs
index a2148ea..c656e01 100644
--- a/OpenSim/Region/ScriptEngine/Common/Executor.cs
+++ b/OpenSim/Region/ScriptEngine/Common/Executor.cs
@@ -28,7 +28,6 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.Reflection;
using System.Runtime.Remoting.Lifetime;
@@ -53,7 +52,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{
//Console.WriteLine("Executor: InitializeLifetimeService()");
// return null;
- ILease lease = (ILease)base.InitializeLifetimeService();
+ ILease lease = (ILease) base.InitializeLifetimeService();
if (lease.CurrentState == LeaseState.Initial)
{
@@ -75,56 +74,56 @@ namespace OpenSim.Region.ScriptEngine.Common
// Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead!
//try
//{
- if (m_Running == false)
- {
- // Script is inactive, do not execute!
- return;
- }
+ if (m_Running == false)
+ {
+ // Script is inactive, do not execute!
+ return;
+ }
- string EventName = m_Script.State() + "_event_" + FunctionName;
+ string EventName = m_Script.State() + "_event_" + FunctionName;
- //type.InvokeMember(EventName, BindingFlags.InvokeMethod, null, m_Script, args);
+ //type.InvokeMember(EventName, BindingFlags.InvokeMethod, null, m_Script, args);
- //Console.WriteLine("ScriptEngine Executor.ExecuteEvent: \"" + EventName + "\"");
+ //Console.WriteLine("ScriptEngine Executor.ExecuteEvent: \"" + EventName + "\"");
- if (Events.ContainsKey(EventName) == false)
+ if (Events.ContainsKey(EventName) == false)
+ {
+ // Not found, create
+ Type type = m_Script.GetType();
+ try
{
- // Not found, create
- Type type = m_Script.GetType();
- try
- {
- MethodInfo mi = type.GetMethod(EventName);
- Events.Add(EventName, mi);
- }
- catch
- {
- // Event name not found, cache it as not found
- Events.Add(EventName, null);
- }
+ MethodInfo mi = type.GetMethod(EventName);
+ Events.Add(EventName, mi);
}
-
- // Get event
- MethodInfo ev = null;
- Events.TryGetValue(EventName, out ev);
-
- if (ev == null) // No event by that name!
+ catch
{
- //Console.WriteLine("ScriptEngine Can not find any event named: \"" + EventName + "\"");
- return;
+ // Event name not found, cache it as not found
+ Events.Add(EventName, null);
}
+ }
+
+ // Get event
+ MethodInfo ev = null;
+ Events.TryGetValue(EventName, out ev);
+
+ if (ev == null) // No event by that name!
+ {
+ //Console.WriteLine("ScriptEngine Can not find any event named: \"" + EventName + "\"");
+ return;
+ }
- // Found
- //try
- //{
- // Invoke it
- ev.Invoke(m_Script, args);
+ // Found
+ //try
+ //{
+ // Invoke it
+ ev.Invoke(m_Script, args);
- //}
- //catch (Exception e)
- //{
- // // TODO: Send to correct place
- // Console.WriteLine("ScriptEngine Exception attempting to executing script function: " + e.ToString());
- //}
+ //}
+ //catch (Exception e)
+ //{
+ // // TODO: Send to correct place
+ // Console.WriteLine("ScriptEngine Exception attempting to executing script function: " + e.ToString());
+ //}
//}
@@ -136,8 +135,5 @@ namespace OpenSim.Region.ScriptEngine.Common
{
m_Running = false;
}
-
-
}
-
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/IScript.cs b/OpenSim/Region/ScriptEngine/Common/IScript.cs
index df0e824..08c0e9c 100644
--- a/OpenSim/Region/ScriptEngine/Common/IScript.cs
+++ b/OpenSim/Region/ScriptEngine/Common/IScript.cs
@@ -26,10 +26,6 @@
*
*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace OpenSim.Region.ScriptEngine.Common
{
public interface IScript
@@ -37,4 +33,4 @@ namespace OpenSim.Region.ScriptEngine.Common
string State();
Executor Exec { get; }
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
index ff5c6bf..9cba882 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
@@ -26,15 +26,12 @@
*
*/
/* Original code: Tedd Hansen */
-using System;
using System.Collections.Generic;
-using System.Text;
namespace OpenSim.Region.ScriptEngine.Common
{
public interface LSL_BuiltIn_Commands_Interface
{
-
string State();
double llSin(double f);
@@ -404,7 +401,9 @@ namespace OpenSim.Region.ScriptEngine.Common
//wiki: llSetTextureAnim(integer mode, integer face, integer sizex, integer sizey, double start, double length, double rate)
void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate);
//wiki: llTriggerSoundLimited(string sound, double volume, vector top_north_east, vector bottom_south_west)
- void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, LSL_Types.Vector3 bottom_south_west);
+ void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east,
+ LSL_Types.Vector3 bottom_south_west);
+
//wiki: llEjectFromLand(key pest)
void llEjectFromLand(string pest);
void llParseString2List();
@@ -437,7 +436,7 @@ namespace OpenSim.Region.ScriptEngine.Common
//wiki: double llGetRegionFPS()
double llGetRegionFPS();
//wiki: llParticleSystem(List
public AppDomain CurrentAppDomain;
+
///
/// Number of scripts loaded into AppDomain
///
public int ScriptsLoaded;
+
///
/// Number of dead scripts
///
public int ScriptsWaitingUnload;
}
+
///
/// Current AppDomain
///
private AppDomainStructure currentAD;
+
private object getLock = new object(); // Mutex
private object freeLock = new object(); // Mutex
@@ -94,22 +93,23 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
{
// Add it to AppDomains list and empty current
appDomains.Add(currentAD);
- currentAD = null;
+ currentAD = null;
}
// No current
if (currentAD == null)
{
// Create a new current AppDomain
currentAD = new AppDomainStructure();
- currentAD.CurrentAppDomain = PrepareNewAppDomain();
+ currentAD.CurrentAppDomain = PrepareNewAppDomain();
}
- Console.WriteLine("Scripts loaded in this Appdomain: " + currentAD.ScriptsLoaded);
+ Console.WriteLine("Scripts loaded in this Appdomain: " + currentAD.ScriptsLoaded);
return currentAD;
} // lock
}
private int AppDomainNameCount;
+
///
/// Create and prepare a new AppDomain for scripts
///
@@ -130,12 +130,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
AppDomain AD = AppDomain.CreateDomain("ScriptAppDomain_" + AppDomainNameCount, null, ads);
- Console.WriteLine("Loading: " + AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll").ToString());
+ Console.WriteLine("Loading: " +
+ AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll").ToString());
AD.Load(AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll"));
// Return the new AppDomain
return AD;
-
}
///
@@ -146,7 +146,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
lock (freeLock)
{
// Go through all
- foreach (AppDomainStructure ads in new System.Collections.ArrayList(appDomains))
+ foreach (AppDomainStructure ads in new ArrayList(appDomains))
{
// Don't process current AppDomain
if (ads.CurrentAppDomain != currentAD.CurrentAppDomain)
@@ -164,23 +164,25 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// Unload
AppDomain.Unload(ads.CurrentAppDomain);
#if DEBUG
- Console.WriteLine("AppDomain unload freed " + (m - GC.GetTotalMemory(true)) + " bytes of memory");
+ Console.WriteLine("AppDomain unload freed " + (m - GC.GetTotalMemory(true)) +
+ " bytes of memory");
#endif
}
}
} // foreach
} // lock
}
-
- public OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadScript(string FileName)
+ public LSL_BaseClass LoadScript(string FileName)
{
// Find next available AppDomain to put it in
AppDomainStructure FreeAppDomain = GetFreeAppDomain();
-
+
Console.WriteLine("Loading into AppDomain: " + FileName);
- LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script");
+ LSL_BaseClass mbrt =
+ (LSL_BaseClass)
+ FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script");
//Console.WriteLine("ScriptEngine AppDomainManager: is proxy={0}", RemotingServices.IsTransparentProxy(mbrt));
FreeAppDomain.ScriptsLoaded++;
@@ -207,7 +209,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
}
// Lopp through all AppDomains
- foreach (AppDomainStructure ads in new System.Collections.ArrayList(appDomains))
+ foreach (AppDomainStructure ads in new ArrayList(appDomains))
{
if (ads.CurrentAppDomain == ad)
{
@@ -219,10 +221,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
} // lock
UnloadAppDomains(); // Outsite lock, has its own GetLock
-
-
}
-
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs
index 49ce8b8..e04a9ed 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs
@@ -26,34 +26,30 @@
*
*/
/* Original code: Tedd Hansen */
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace OpenSim.Region.ScriptEngine.DotNetEngine
{
public static class Common
{
- static public bool debug = true;
- static public ScriptEngine mySE;
+ public static bool debug = true;
+ public static ScriptEngine mySE;
//public delegate void SendToDebugEventDelegate(string Message);
//public delegate void SendToLogEventDelegate(string Message);
//static public event SendToDebugEventDelegate SendToDebugEvent;
//static public event SendToLogEventDelegate SendToLogEvent;
- static public void SendToDebug(string Message)
+ public static void SendToDebug(string Message)
{
//if (Debug == true)
mySE.Log.Verbose("ScriptEngine", "Debug: " + Message);
//SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
}
- static public void SendToLog(string Message)
+
+ public static void SendToLog(string Message)
{
//if (Debug == true)
mySE.Log.Verbose("ScriptEngine", "LOG: " + Message);
//SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
}
}
-
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index a2eee66..7f452e0 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -27,16 +27,13 @@
*/
using System;
-using System.Collections.Generic;
-using System.Text;
-using System.IO;
-using Microsoft.CSharp;
using System.CodeDom.Compiler;
+using System.IO;
using System.Reflection;
+using Microsoft.CSharp;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{
-
public class Compiler
{
private LSL2CSConverter LSL_Converter = new LSL2CSConverter();
@@ -45,7 +42,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
//private ICodeCompiler icc = codeProvider.CreateCompiler();
public string CompileFromFile(string LSOFileName)
{
- switch (System.IO.Path.GetExtension(LSOFileName).ToLower())
+ switch (Path.GetExtension(LSOFileName).ToLower())
{
case ".txt":
case ".lsl":
@@ -58,6 +55,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
throw new Exception("Unknown script type.");
}
}
+
///
/// Converts script from LSL to CS and calls CompileFromCSText
///
@@ -67,13 +65,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{
if (Script.Substring(0, 4).ToLower() == "//c#")
{
- return CompileFromCSText( Script );
+ return CompileFromCSText(Script);
}
else
{
return CompileFromCSText(LSL_Converter.Convert(Script));
}
}
+
///
/// Compile CS script to .Net assembly (.dll)
///
@@ -81,14 +80,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
/// Filename to .dll assembly
public string CompileFromCSText(string Script)
{
-
-
// Output assembly name
scriptCompileCounter++;
string OutFile = Path.Combine("ScriptEngines", "Script_" + scriptCompileCounter + ".dll");
try
{
- System.IO.File.Delete(OutFile);
+ File.Delete(OutFile);
}
catch (Exception e)
{
@@ -99,12 +96,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
// DEBUG - write source to disk
try
{
- File.WriteAllText(Path.Combine("ScriptEngines", "debug_" + Path.GetFileNameWithoutExtension(OutFile) + ".cs"), Script);
+ File.WriteAllText(
+ Path.Combine("ScriptEngines", "debug_" + Path.GetFileNameWithoutExtension(OutFile) + ".cs"), Script);
+ }
+ catch
+ {
}
- catch { }
// Do actual compile
- System.CodeDom.Compiler.CompilerParameters parameters = new CompilerParameters();
+ CompilerParameters parameters = new CompilerParameters();
parameters.IncludeDebugInformation = true;
// Add all available assemblies
foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
@@ -114,11 +114,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
}
string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
- string rootPathSE = Path.GetDirectoryName(this.GetType().Assembly.Location);
+ string rootPathSE = Path.GetDirectoryName(GetType().Assembly.Location);
//Console.WriteLine("Assembly location: " + rootPath);
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Common.dll"));
parameters.ReferencedAssemblies.Add(Path.Combine(rootPathSE, "OpenSim.Region.ScriptEngine.DotNetEngine.dll"));
-
+
//parameters.ReferencedAssemblies.Add("OpenSim.Region.Environment");
parameters.GenerateExecutable = false;
parameters.OutputAssembly = OutFile;
@@ -129,13 +129,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
// TODO: Return errors to user somehow
if (results.Errors.Count > 0)
{
-
string errtext = "";
foreach (CompilerError CompErr in results.Errors)
{
errtext += "Line number " + (CompErr.Line - 1) +
- ", Error Number: " + CompErr.ErrorNumber +
- ", '" + CompErr.ErrorText + "'\r\n";
+ ", Error Number: " + CompErr.ErrorNumber +
+ ", '" + CompErr.ErrorText + "'\r\n";
}
throw new Exception(errtext);
}
@@ -143,6 +142,5 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
return OutFile;
}
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
index 18eeaa3..0c28617 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
@@ -26,9 +26,7 @@
*
*/
-using System;
using System.Collections.Generic;
-using System.Text;
using System.Text.RegularExpressions;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
@@ -51,9 +49,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
dataTypes.Add("rotation", "LSL_Types.Quaternion");
dataTypes.Add("list", "list");
dataTypes.Add("null", "null");
-
}
-
+
public string Convert(string Script)
{
string Return = "";
@@ -81,7 +78,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
int quote_replaced_count = 0;
for (int p = 0; p < Script.Length; p++)
{
-
C = Script.Substring(p, 1);
while (true)
{
@@ -99,10 +95,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
if (quote == "")
{
// We didn't replace quote, probably because of empty string?
- _Script += quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]);
+ _Script += quote_replacement_string +
+ quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]);
}
// We just left a quote
- quotes.Add(quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]), quote);
+ quotes.Add(
+ quote_replacement_string +
+ quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]), quote);
quote = "";
}
break;
@@ -112,7 +111,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{
// We are not inside a quote
quote_replaced = false;
-
}
else
{
@@ -120,7 +118,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
if (!quote_replaced)
{
// Replace quote
- _Script += quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]);
+ _Script += quote_replacement_string +
+ quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]);
quote_replaced = true;
}
quote += C;
@@ -141,7 +140,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
//
-
//
// PROCESS STATES
// Remove state definitions and add state names to start of each event within state
@@ -170,7 +168,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
if (ilevel == 1 && lastlevel == 0)
{
// 0 => 1: Get last
- Match m = Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
+ Match m =
+ Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{",
+ RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
in_state = false;
if (m.Success)
@@ -179,7 +179,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
in_state = true;
current_statename = m.Groups[1].Captures[0].Value;
//Console.WriteLine("Current statename: " + current_statename);
- cache = Regex.Replace(cache, @"(?(?![a-zA-Z_]+)\s*)" + @"([a-zA-Z_]+)(?[^a-zA-Z_\(\)]*){", "${s1}${s2}", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
+ cache =
+ Regex.Replace(cache,
+ @"(?(?![a-zA-Z_]+)\s*)" + @"([a-zA-Z_]+)(?[^a-zA-Z_\(\)]*){",
+ "${s1}${s2}",
+ RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
}
ret += cache;
cache = "";
@@ -196,7 +200,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
// void dataserver(key query_id, string data) {
//cache = Regex.Replace(cache, @"([^a-zA-Z_]\s*)((?!if|switch|for)[a-zA-Z_]+\s*\([^\)]*\)[^{]*{)", "$1" + "" + "$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
//Console.WriteLine("Replacing using statename: " + current_statename);
- cache = Regex.Replace(cache, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1public " + current_statename + "_event_$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
+ cache =
+ Regex.Replace(cache,
+ @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)",
+ @"$1public " + current_statename + "_event_$2",
+ RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
}
ret += cache;
@@ -216,32 +224,48 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
ret = "";
-
foreach (string key in dataTypes.Keys)
{
string val;
dataTypes.TryGetValue(key, out val);
// Replace CAST - (integer) with (int)
- Script = Regex.Replace(Script, @"\(" + key + @"\)", @"(" + val + ")", RegexOptions.Compiled | RegexOptions.Multiline);
+ Script =
+ Regex.Replace(Script, @"\(" + key + @"\)", @"(" + val + ")",
+ RegexOptions.Compiled | RegexOptions.Multiline);
// Replace return types and function variables - integer a() and f(integer a, integer a)
- Script = Regex.Replace(Script, @"(^|;|}|[\(,])(\s*)" + key + @"(\s*)", @"$1$2" + val + "$3", RegexOptions.Compiled | RegexOptions.Multiline);
+ Script =
+ Regex.Replace(Script, @"(^|;|}|[\(,])(\s*)" + key + @"(\s*)", @"$1$2" + val + "$3",
+ RegexOptions.Compiled | RegexOptions.Multiline);
}
// Add "void" in front of functions that needs it
- Script = Regex.Replace(Script, @"^(\s*public\s+)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1void $2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
+ Script =
+ Regex.Replace(Script,
+ @"^(\s*public\s+)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)",
+ @"$1void $2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
// Replace and
- Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Quaternion($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
- Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Vector3($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
+ Script =
+ Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Quaternion($1)",
+ RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
+ Script =
+ Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Vector3($1)",
+ RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
// Replace List []'s
- Script = Regex.Replace(Script, @"\[([^\]]*)\]", @"List.Parse($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
+ Script =
+ Regex.Replace(Script, @"\[([^\]]*)\]", @"List.Parse($1)",
+ RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
// Replace (string) to .ToString() //
- Script = Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.ToString()", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
- Script = Regex.Replace(Script, @"\((float|int)\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.Parse($2)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
+ Script =
+ Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.ToString()",
+ RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
+ Script =
+ Regex.Replace(Script, @"\((float|int)\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.Parse($2)",
+ RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
// REPLACE BACK QUOTES
@@ -256,7 +280,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
// Add namespace, class name and inheritance
Return = "" +
- "using OpenSim.Region.ScriptEngine.Common;";
+ "using OpenSim.Region.ScriptEngine.Common;";
//"using System; " +
//"using System.Collections.Generic; " +
//"using System.Text; " +
@@ -278,17 +302,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
Return += "" +
- "namespace SecondLife { ";
- Return += "" +
- //"[Serializable] " +
- "public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass { ";
+ "namespace SecondLife { ";
+ Return += "" +
+ //"[Serializable] " +
+ "public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass { ";
Return += @"public Script() { } ";
Return += Script;
Return += "} }\r\n";
return Return;
}
-
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
index ea05efc..f2774d6 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
@@ -28,476 +28,1788 @@
using System;
using System.Collections.Generic;
-using System.Text;
-using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler;
-using OpenSim.Region.ScriptEngine.Common;
-using System.Threading;
-using System.Reflection;
using System.Runtime.Remoting.Lifetime;
+using System.Threading;
+using OpenSim.Region.ScriptEngine.Common;
using integer = System.Int32;
using key = System.String;
using vector = OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3;
using rotation = OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion;
-namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
-{
- //[Serializable]
- public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript
- {
+namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
+{
+ //[Serializable]
+ public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript
+ {
+ // Object never expires
+ public override Object InitializeLifetimeService()
+ {
+ //Console.WriteLine("LSL_BaseClass: InitializeLifetimeService()");
+ // return null;
+ ILease lease = (ILease) base.InitializeLifetimeService();
+
+ if (lease.CurrentState == LeaseState.Initial)
+ {
+ lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1);
+ //lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
+ //lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
+ }
+ return lease;
+ }
+
+
+ private Executor m_Exec;
+
+ public Executor Exec
+ {
+ get
+ {
+ if (m_Exec == null)
+ m_Exec = new Executor(this);
+ return m_Exec;
+ }
+ }
+
+ public LSL_BuiltIn_Commands_Interface m_LSL_Functions;
+ public string SourceCode = "";
+
+ public LSL_BaseClass()
+ {
+ }
+
+ public string State()
+ {
+ return m_LSL_Functions.State();
+ }
+
+
+ public void Start(LSL_BuiltIn_Commands_Interface LSL_Functions)
+ {
+ m_LSL_Functions = LSL_Functions;
+
+ //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called.");
+
+ // Get this AppDomain's settings and display some of them.
+ AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation;
+ Console.WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}",
+ ads.ApplicationName,
+ ads.ApplicationBase,
+ ads.ConfigurationFile
+ );
+
+ // Display the name of the calling AppDomain and the name
+ // of the second domain.
+ // NOTE: The application's thread has transitioned between
+ // AppDomains.
+ Console.WriteLine("Calling to '{0}'.",
+ Thread.GetDomain().FriendlyName
+ );
+
+ return;
+ }
+
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ // They are only forwarders to LSL_BuiltIn_Commands.cs
+ //
+ public double llSin(double f)
+ {
+ return m_LSL_Functions.llSin(f);
+ }
+
+ public double llCos(double f)
+ {
+ return m_LSL_Functions.llCos(f);
+ }
+
+ public double llTan(double f)
+ {
+ return m_LSL_Functions.llTan(f);
+ }
+
+ public double llAtan2(double x, double y)
+ {
+ return m_LSL_Functions.llAtan2(x, y);
+ }
+
+ public double llSqrt(double f)
+ {
+ return m_LSL_Functions.llSqrt(f);
+ }
+
+ public double llPow(double fbase, double fexponent)
+ {
+ return m_LSL_Functions.llPow(fbase, fexponent);
+ }
+
+ public int llAbs(int i)
+ {
+ return m_LSL_Functions.llAbs(i);
+ }
+
+ public double llFabs(double f)
+ {
+ return m_LSL_Functions.llFabs(f);
+ }
+
+ public double llFrand(double mag)
+ {
+ return m_LSL_Functions.llFrand(mag);
+ }
+
+ public int llFloor(double f)
+ {
+ return m_LSL_Functions.llFloor(f);
+ }
+
+ public int llCeil(double f)
+ {
+ return m_LSL_Functions.llCeil(f);
+ }
+
+ public int llRound(double f)
+ {
+ return m_LSL_Functions.llRound(f);
+ }
+
+ public double llVecMag(vector v)
+ {
+ return m_LSL_Functions.llVecMag(v);
+ }
+
+ public vector llVecNorm(vector v)
+ {
+ return m_LSL_Functions.llVecNorm(v);
+ }
+
+ public double llVecDist(vector a, vector b)
+ {
+ return m_LSL_Functions.llVecDist(a, b);
+ }
+
+ public vector llRot2Euler(rotation r)
+ {
+ return m_LSL_Functions.llRot2Euler(r);
+ }
+
+ public rotation llEuler2Rot(vector v)
+ {
+ return m_LSL_Functions.llEuler2Rot(v);
+ }
+
+ public rotation llAxes2Rot(vector fwd, vector left, vector up)
+ {
+ return m_LSL_Functions.llAxes2Rot(fwd, left, up);
+ }
+
+ public vector llRot2Fwd(rotation r)
+ {
+ return m_LSL_Functions.llRot2Fwd(r);
+ }
+
+ public vector llRot2Left(rotation r)
+ {
+ return m_LSL_Functions.llRot2Left(r);
+ }
+
+ public vector llRot2Up(rotation r)
+ {
+ return m_LSL_Functions.llRot2Up(r);
+ }
+
+ public rotation llRotBetween(vector start, vector end)
+ {
+ return m_LSL_Functions.llRotBetween(start, end);
+ }
+
+ public void llWhisper(int channelID, string text)
+ {
+ m_LSL_Functions.llWhisper(channelID, text);
+ }
+
+ public void llSay(int channelID, string text)
+ {
+ m_LSL_Functions.llSay(channelID, text);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public void llShout(int channelID, string text)
+ {
+ m_LSL_Functions.llShout(channelID, text);
+ }
+
+ public int llListen(int channelID, string name, string ID, string msg)
+ {
+ return m_LSL_Functions.llListen(channelID, name, ID, msg);
+ }
+
+ public void llListenControl(int number, int active)
+ {
+ m_LSL_Functions.llListenControl(number, active);
+ }
+
+ public void llListenRemove(int number)
+ {
+ m_LSL_Functions.llListenRemove(number);
+ }
+
+ public void llSensor(string name, string id, int type, double range, double arc)
+ {
+ m_LSL_Functions.llSensor(name, id, type, range, arc);
+ }
+
+ public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate)
+ {
+ m_LSL_Functions.llSensorRepeat(name, id, type, range, arc, rate);
+ }
+
+ public void llSensorRemove()
+ {
+ m_LSL_Functions.llSensorRemove();
+ }
+
+ public string llDetectedName(int number)
+ {
+ return m_LSL_Functions.llDetectedName(number);
+ }
+
+ public string llDetectedKey(int number)
+ {
+ return m_LSL_Functions.llDetectedKey(number);
+ }
+
+ public string llDetectedOwner(int number)
+ {
+ return m_LSL_Functions.llDetectedOwner(number);
+ }
+
+ public int llDetectedType(int number)
+ {
+ return m_LSL_Functions.llDetectedType(number);
+ }
+
+ public vector llDetectedPos(int number)
+ {
+ return m_LSL_Functions.llDetectedPos(number);
+ }
+
+ public vector llDetectedVel(int number)
+ {
+ return m_LSL_Functions.llDetectedVel(number);
+ }
+
+ public vector llDetectedGrab(int number)
+ {
+ return m_LSL_Functions.llDetectedGrab(number);
+ }
+
+ public rotation llDetectedRot(int number)
+ {
+ return m_LSL_Functions.llDetectedRot(number);
+ }
+
+ public int llDetectedGroup(int number)
+ {
+ return m_LSL_Functions.llDetectedGroup(number);
+ }
+
+ public int llDetectedLinkNumber(int number)
+ {
+ return m_LSL_Functions.llDetectedLinkNumber(number);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public void llDie()
+ {
+ m_LSL_Functions.llDie();
+ }
+
+ public double llGround(vector offset)
+ {
+ return m_LSL_Functions.llGround(offset);
+ }
+
+ public double llCloud(vector offset)
+ {
+ return m_LSL_Functions.llCloud(offset);
+ }
+
+ public vector llWind(vector offset)
+ {
+ return m_LSL_Functions.llWind(offset);
+ }
+
+ public void llSetStatus(int status, int value)
+ {
+ m_LSL_Functions.llSetStatus(status, value);
+ }
+
+ public int llGetStatus(int status)
+ {
+ return m_LSL_Functions.llGetStatus(status);
+ }
+
+ public void llSetScale(vector scale)
+ {
+ m_LSL_Functions.llSetScale(scale);
+ }
+
+ public vector llGetScale()
+ {
+ return m_LSL_Functions.llGetScale();
+ }
+
+ public void llSetColor(vector color, int face)
+ {
+ m_LSL_Functions.llSetColor(color, face);
+ }
+
+ public double llGetAlpha(int face)
+ {
+ return m_LSL_Functions.llGetAlpha(face);
+ }
+
+ public void llSetAlpha(double alpha, int face)
+ {
+ m_LSL_Functions.llSetAlpha(alpha, face);
+ }
+
+ public vector llGetColor(int face)
+ {
+ return m_LSL_Functions.llGetColor(face);
+ }
+
+ public void llSetTexture(string texture, int face)
+ {
+ m_LSL_Functions.llSetTexture(texture, face);
+ }
+
+ public void llScaleTexture(double u, double v, int face)
+ {
+ m_LSL_Functions.llScaleTexture(u, v, face);
+ }
+
+ public void llOffsetTexture(double u, double v, int face)
+ {
+ m_LSL_Functions.llOffsetTexture(u, v, face);
+ }
+
+ public void llRotateTexture(double rotation, int face)
+ {
+ m_LSL_Functions.llRotateTexture(rotation, face);
+ }
+
+ public string llGetTexture(int face)
+ {
+ return m_LSL_Functions.llGetTexture(face);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public void llSetPos(vector pos)
+ {
+ m_LSL_Functions.llSetPos(pos);
+ }
+
+ public vector llGetPos()
+ {
+ return m_LSL_Functions.llGetPos();
+ }
+
+ public vector llGetLocalPos()
+ {
+ return m_LSL_Functions.llGetLocalPos();
+ }
+
+ public void llSetRot(rotation rot)
+ {
+ m_LSL_Functions.llSetRot(rot);
+ }
+
+ public rotation llGetRot()
+ {
+ return m_LSL_Functions.llGetRot();
+ }
+
+ public rotation llGetLocalRot()
+ {
+ return m_LSL_Functions.llGetLocalRot();
+ }
+
+ public void llSetForce(vector force, int local)
+ {
+ m_LSL_Functions.llSetForce(force, local);
+ }
+
+ public vector llGetForce()
+ {
+ return m_LSL_Functions.llGetForce();
+ }
+
+ public int llTarget(vector position, double range)
+ {
+ return m_LSL_Functions.llTarget(position, range);
+ }
+
+ public void llTargetRemove(int number)
+ {
+ m_LSL_Functions.llTargetRemove(number);
+ }
+
+ public int llRotTarget(rotation rot, double error)
+ {
+ return m_LSL_Functions.llRotTarget(rot, error);
+ }
+
+ public void llRotTargetRemove(int number)
+ {
+ m_LSL_Functions.llRotTargetRemove(number);
+ }
+
+ public void llMoveToTarget(vector target, double tau)
+ {
+ m_LSL_Functions.llMoveToTarget(target, tau);
+ }
+
+ public void llStopMoveToTarget()
+ {
+ m_LSL_Functions.llStopMoveToTarget();
+ }
+
+ public void llApplyImpulse(vector force, int local)
+ {
+ m_LSL_Functions.llApplyImpulse(force, local);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public void llApplyRotationalImpulse(vector force, int local)
+ {
+ m_LSL_Functions.llApplyRotationalImpulse(force, local);
+ }
+
+ public void llSetTorque(vector torque, int local)
+ {
+ m_LSL_Functions.llSetTorque(torque, local);
+ }
+
+ public vector llGetTorque()
+ {
+ return m_LSL_Functions.llGetTorque();
+ }
+
+ public void llSetForceAndTorque(vector force, vector torque, int local)
+ {
+ m_LSL_Functions.llSetForceAndTorque(force, torque, local);
+ }
+
+ public vector llGetVel()
+ {
+ return m_LSL_Functions.llGetVel();
+ }
+
+ public vector llGetAccel()
+ {
+ return m_LSL_Functions.llGetAccel();
+ }
+
+ public vector llGetOmega()
+ {
+ return m_LSL_Functions.llGetOmega();
+ }
+
+ public double llGetTimeOfDay()
+ {
+ return m_LSL_Functions.llGetTimeOfDay();
+ }
+
+ public double llGetWallclock()
+ {
+ return m_LSL_Functions.llGetWallclock();
+ }
+
+ public double llGetTime()
+ {
+ return m_LSL_Functions.llGetTime();
+ }
+
+ public void llResetTime()
+ {
+ m_LSL_Functions.llResetTime();
+ }
+
+ public double llGetAndResetTime()
+ {
+ return m_LSL_Functions.llGetAndResetTime();
+ }
+
+ public void llSound()
+ {
+ m_LSL_Functions.llSound();
+ }
+
+ public void llPlaySound(string sound, double volume)
+ {
+ m_LSL_Functions.llPlaySound(sound, volume);
+ }
+
+ public void llLoopSound(string sound, double volume)
+ {
+ m_LSL_Functions.llLoopSound(sound, volume);
+ }
+
+ public void llLoopSoundMaster(string sound, double volume)
+ {
+ m_LSL_Functions.llLoopSoundMaster(sound, volume);
+ }
+
+ public void llLoopSoundSlave(string sound, double volume)
+ {
+ m_LSL_Functions.llLoopSoundSlave(sound, volume);
+ }
+
+ public void llPlaySoundSlave(string sound, double volume)
+ {
+ m_LSL_Functions.llPlaySoundSlave(sound, volume);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public void llTriggerSound(string sound, double volume)
+ {
+ m_LSL_Functions.llTriggerSound(sound, volume);
+ }
+
+ public void llStopSound()
+ {
+ m_LSL_Functions.llStopSound();
+ }
+
+ public void llPreloadSound(string sound)
+ {
+ m_LSL_Functions.llPreloadSound(sound);
+ }
+
+ public string llGetSubString(string src, int start, int end)
+ {
+ return m_LSL_Functions.llGetSubString(src, start, end);
+ }
+
+ public string llDeleteSubString(string src, int start, int end)
+ {
+ return m_LSL_Functions.llDeleteSubString(src, start, end);
+ }
+
+ public string llInsertString(string dst, int position, string src)
+ {
+ return m_LSL_Functions.llInsertString(dst, position, src);
+ }
+
+ public string llToUpper(string source)
+ {
+ return m_LSL_Functions.llToUpper(source);
+ }
+
+ public string llToLower(string source)
+ {
+ return m_LSL_Functions.llToLower(source);
+ }
+
+ public int llGiveMoney(string destination, int amount)
+ {
+ return m_LSL_Functions.llGiveMoney(destination, amount);
+ }
+
+ public void llMakeExplosion()
+ {
+ m_LSL_Functions.llMakeExplosion();
+ }
+
+ public void llMakeFountain()
+ {
+ m_LSL_Functions.llMakeFountain();
+ }
+
+ public void llMakeSmoke()
+ {
+ m_LSL_Functions.llMakeSmoke();
+ }
+
+ public void llMakeFire()
+ {
+ m_LSL_Functions.llMakeFire();
+ }
+
+ public void llRezObject(string inventory, vector pos, rotation rot, int param)
+ {
+ m_LSL_Functions.llRezObject(inventory, pos, rot, param);
+ }
+
+ public void llLookAt(vector target, double strength, double damping)
+ {
+ m_LSL_Functions.llLookAt(target, strength, damping);
+ }
+
+ public void llStopLookAt()
+ {
+ m_LSL_Functions.llStopLookAt();
+ }
+
+ public void llSetTimerEvent(double sec)
+ {
+ m_LSL_Functions.llSetTimerEvent(sec);
+ }
+
+ public void llSleep(double sec)
+ {
+ m_LSL_Functions.llSleep(sec);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public double llGetMass()
+ {
+ return m_LSL_Functions.llGetMass();
+ }
+
+ public void llCollisionFilter(string name, string id, int accept)
+ {
+ m_LSL_Functions.llCollisionFilter(name, id, accept);
+ }
+
+ public void llTakeControls(int controls, int accept, int pass_on)
+ {
+ m_LSL_Functions.llTakeControls(controls, accept, pass_on);
+ }
+
+ public void llReleaseControls()
+ {
+ m_LSL_Functions.llReleaseControls();
+ }
+
+ public void llAttachToAvatar(int attachment)
+ {
+ m_LSL_Functions.llAttachToAvatar(attachment);
+ }
+
+ public void llDetachFromAvatar()
+ {
+ m_LSL_Functions.llDetachFromAvatar();
+ }
+
+ public void llTakeCamera()
+ {
+ m_LSL_Functions.llTakeCamera();
+ }
+
+ public void llReleaseCamera()
+ {
+ m_LSL_Functions.llReleaseCamera();
+ }
+
+ public string llGetOwner()
+ {
+ return m_LSL_Functions.llGetOwner();
+ }
+
+ public void llInstantMessage(string user, string message)
+ {
+ m_LSL_Functions.llInstantMessage(user, message);
+ }
+
+ public void llEmail(string address, string subject, string message)
+ {
+ m_LSL_Functions.llEmail(address, subject, message);
+ }
+
+ public void llGetNextEmail(string address, string subject)
+ {
+ m_LSL_Functions.llGetNextEmail(address, subject);
+ }
+
+ public string llGetKey()
+ {
+ return m_LSL_Functions.llGetKey();
+ }
+
+ public void llSetBuoyancy(double buoyancy)
+ {
+ m_LSL_Functions.llSetBuoyancy(buoyancy);
+ }
+
+ public void llSetHoverHeight(double height, int water, double tau)
+ {
+ m_LSL_Functions.llSetHoverHeight(height, water, tau);
+ }
+
+ public void llStopHover()
+ {
+ m_LSL_Functions.llStopHover();
+ }
+
+ public void llMinEventDelay(double delay)
+ {
+ m_LSL_Functions.llMinEventDelay(delay);
+ }
+
+ public void llSoundPreload()
+ {
+ m_LSL_Functions.llSoundPreload();
+ }
+
+ public void llRotLookAt(rotation target, double strength, double damping)
+ {
+ m_LSL_Functions.llRotLookAt(target, strength, damping);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public int llStringLength(string str)
+ {
+ return m_LSL_Functions.llStringLength(str);
+ }
+
+ public void llStartAnimation(string anim)
+ {
+ m_LSL_Functions.llStartAnimation(anim);
+ }
+
+ public void llStopAnimation(string anim)
+ {
+ m_LSL_Functions.llStopAnimation(anim);
+ }
+
+ public void llPointAt()
+ {
+ m_LSL_Functions.llPointAt();
+ }
+
+ public void llStopPointAt()
+ {
+ m_LSL_Functions.llStopPointAt();
+ }
+
+ public void llTargetOmega(vector axis, double spinrate, double gain)
+ {
+ m_LSL_Functions.llTargetOmega(axis, spinrate, gain);
+ }
+
+ public int llGetStartParameter()
+ {
+ return m_LSL_Functions.llGetStartParameter();
+ }
+
+ public void llGodLikeRezObject(string inventory, vector pos)
+ {
+ m_LSL_Functions.llGodLikeRezObject(inventory, pos);
+ }
+
+ public void llRequestPermissions(string agent, int perm)
+ {
+ m_LSL_Functions.llRequestPermissions(agent, perm);
+ }
+
+ public string llGetPermissionsKey()
+ {
+ return m_LSL_Functions.llGetPermissionsKey();
+ }
+
+ public int llGetPermissions()
+ {
+ return m_LSL_Functions.llGetPermissions();
+ }
+
+ public int llGetLinkNumber()
+ {
+ return m_LSL_Functions.llGetLinkNumber();
+ }
+
+ public void llSetLinkColor(int linknumber, vector color, int face)
+ {
+ m_LSL_Functions.llSetLinkColor(linknumber, color, face);
+ }
+
+ public void llCreateLink(string target, int parent)
+ {
+ m_LSL_Functions.llCreateLink(target, parent);
+ }
+
+ public void llBreakLink(int linknum)
+ {
+ m_LSL_Functions.llBreakLink(linknum);
+ }
+
+ public void llBreakAllLinks()
+ {
+ m_LSL_Functions.llBreakAllLinks();
+ }
+
+ public string llGetLinkKey(int linknum)
+ {
+ return m_LSL_Functions.llGetLinkKey(linknum);
+ }
+
+ public void llGetLinkName(int linknum)
+ {
+ m_LSL_Functions.llGetLinkName(linknum);
+ }
+
+ public int llGetInventoryNumber(int type)
+ {
+ return m_LSL_Functions.llGetInventoryNumber(type);
+ }
+
+ public string llGetInventoryName(int type, int number)
+ {
+ return m_LSL_Functions.llGetInventoryName(type, number);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public void llSetScriptState(string name, int run)
+ {
+ m_LSL_Functions.llSetScriptState(name, run);
+ }
+
+ public double llGetEnergy()
+ {
+ return m_LSL_Functions.llGetEnergy();
+ }
+
+ public void llGiveInventory(string destination, string inventory)
+ {
+ m_LSL_Functions.llGiveInventory(destination, inventory);
+ }
+
+ public void llRemoveInventory(string item)
+ {
+ m_LSL_Functions.llRemoveInventory(item);
+ }
+
+ public void llSetText(string text, vector color, double alpha)
+ {
+ m_LSL_Functions.llSetText(text, color, alpha);
+ }
+
+ public double llWater(vector offset)
+ {
+ return m_LSL_Functions.llWater(offset);
+ }
+
+ public void llPassTouches(int pass)
+ {
+ m_LSL_Functions.llPassTouches(pass);
+ }
+
+ public string llRequestAgentData(string id, int data)
+ {
+ return m_LSL_Functions.llRequestAgentData(id, data);
+ }
+
+ public string llRequestInventoryData(string name)
+ {
+ return m_LSL_Functions.llRequestInventoryData(name);
+ }
+
+ public void llSetDamage(double damage)
+ {
+ m_LSL_Functions.llSetDamage(damage);
+ }
+
+ public void llTeleportAgentHome(string agent)
+ {
+ m_LSL_Functions.llTeleportAgentHome(agent);
+ }
+
+ public void llModifyLand(int action, int brush)
+ {
+ m_LSL_Functions.llModifyLand(action, brush);
+ }
+
+ public void llCollisionSound(string impact_sound, double impact_volume)
+ {
+ m_LSL_Functions.llCollisionSound(impact_sound, impact_volume);
+ }
+
+ public void llCollisionSprite(string impact_sprite)
+ {
+ m_LSL_Functions.llCollisionSprite(impact_sprite);
+ }
+
+ public string llGetAnimation(string id)
+ {
+ return m_LSL_Functions.llGetAnimation(id);
+ }
+
+ public void llResetScript()
+ {
+ m_LSL_Functions.llResetScript();
+ }
+
+ public void llMessageLinked(int linknum, int num, string str, string id)
+ {
+ m_LSL_Functions.llMessageLinked(linknum, num, str, id);
+ }
+
+ public void llPushObject(string target, vector impulse, vector ang_impulse, int local)
+ {
+ m_LSL_Functions.llPushObject(target, impulse, ang_impulse, local);
+ }
+
+ public void llPassCollisions(int pass)
+ {
+ m_LSL_Functions.llPassCollisions(pass);
+ }
+
+ public string llGetScriptName()
+ {
+ return m_LSL_Functions.llGetScriptName();
+ }
+
+ public int llGetNumberOfSides()
+ {
+ return m_LSL_Functions.llGetNumberOfSides();
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public rotation llAxisAngle2Rot(vector axis, double angle)
+ {
+ return m_LSL_Functions.llAxisAngle2Rot(axis, angle);
+ }
+
+ public vector llRot2Axis(rotation rot)
+ {
+ return m_LSL_Functions.llRot2Axis(rot);
+ }
+
+ public void llRot2Angle()
+ {
+ m_LSL_Functions.llRot2Angle();
+ }
+
+ public double llAcos(double val)
+ {
+ return m_LSL_Functions.llAcos(val);
+ }
+
+ public double llAsin(double val)
+ {
+ return m_LSL_Functions.llAsin(val);
+ }
+
+ public double llAngleBetween(rotation a, rotation b)
+ {
+ return m_LSL_Functions.llAngleBetween(a, b);
+ }
+
+ public string llGetInventoryKey(string name)
+ {
+ return m_LSL_Functions.llGetInventoryKey(name);
+ }
+
+ public void llAllowInventoryDrop(int add)
+ {
+ m_LSL_Functions.llAllowInventoryDrop(add);
+ }
+
+ public vector llGetSunDirection()
+ {
+ return m_LSL_Functions.llGetSunDirection();
+ }
+
+ public vector llGetTextureOffset(int face)
+ {
+ return m_LSL_Functions.llGetTextureOffset(face);
+ }
+
+ public vector llGetTextureScale(int side)
+ {
+ return m_LSL_Functions.llGetTextureScale(side);
+ }
+
+ public double llGetTextureRot(int side)
+ {
+ return m_LSL_Functions.llGetTextureRot(side);
+ }
+
+ public int llSubStringIndex(string source, string pattern)
+ {
+ return m_LSL_Functions.llSubStringIndex(source, pattern);
+ }
+
+ public string llGetOwnerKey(string id)
+ {
+ return m_LSL_Functions.llGetOwnerKey(id);
+ }
+
+ public vector llGetCenterOfMass()
+ {
+ return m_LSL_Functions.llGetCenterOfMass();
+ }
+
+ public List llListSort(List src, int stride, int ascending)
+ {
+ return m_LSL_Functions.llListSort(src, stride, ascending);
+ }
+
+ public int llGetListLength(List src)
+ {
+ return m_LSL_Functions.llGetListLength(src);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public int llList2Integer(List src, int index)
+ {
+ return m_LSL_Functions.llList2Integer(src, index);
+ }
+
+ public double llList2double(List src, int index)
+ {
+ return m_LSL_Functions.llList2double(src, index);
+ }
+
+ public string llList2String(List src, int index)
+ {
+ return m_LSL_Functions.llList2String(src, index);
+ }
+
+ public string llList2Key(List src, int index)
+ {
+ return m_LSL_Functions.llList2Key(src, index);
+ }
+
+ public vector llList2Vector(List src, int index)
+ {
+ return m_LSL_Functions.llList2Vector(src, index);
+ }
+
+ public rotation llList2Rot(List src, int index)
+ {
+ return m_LSL_Functions.llList2Rot(src, index);
+ }
+
+ public List llList2List(List src, int start, int end)
+ {
+ return m_LSL_Functions.llList2List(src, start, end);
+ }
+
+ public List llDeleteSubList(List src, int start, int end)
+ {
+ return m_LSL_Functions.llDeleteSubList(src, start, end);
+ }
+
+ public int llGetListEntryType(List src, int index)
+ {
+ return m_LSL_Functions.llGetListEntryType(src, index);
+ }
+
+ public string llList2CSV(List src)
+ {
+ return m_LSL_Functions.llList2CSV(src);
+ }
+
+ public List llCSV2List(string src)
+ {
+ return m_LSL_Functions.llCSV2List(src);
+ }
+
+ public List llListRandomize(List src, int stride)
+ {
+ return m_LSL_Functions.llListRandomize(src, stride);
+ }
+
+ public List llList2ListStrided(List src, int start, int end, int stride)
+ {
+ return m_LSL_Functions.llList2ListStrided(src, start, end, stride);
+ }
+
+ public vector llGetRegionCorner()
+ {
+ return m_LSL_Functions.llGetRegionCorner();
+ }
+
+ public List llListInsertList(List dest, List src, int start)
+ {
+ return m_LSL_Functions.llListInsertList(dest, src, start);
+ }
+
+ public int llListFindList(List src, List test)
+ {
+ return m_LSL_Functions.llListFindList(src, test);
+ }
+
+ public string llGetObjectName()
+ {
+ return m_LSL_Functions.llGetObjectName();
+ }
+
+ public void llSetObjectName(string name)
+ {
+ m_LSL_Functions.llSetObjectName(name);
+ }
+
+ public string llGetDate()
+ {
+ return m_LSL_Functions.llGetDate();
+ }
+
+ public int llEdgeOfWorld(vector pos, vector dir)
+ {
+ return m_LSL_Functions.llEdgeOfWorld(pos, dir);
+ }
+
+ public int llGetAgentInfo(string id)
+ {
+ return m_LSL_Functions.llGetAgentInfo(id);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public void llAdjustSoundVolume(double volume)
+ {
+ m_LSL_Functions.llAdjustSoundVolume(volume);
+ }
+
+ public void llSetSoundQueueing(int queue)
+ {
+ m_LSL_Functions.llSetSoundQueueing(queue);
+ }
+
+ public void llSetSoundRadius(double radius)
+ {
+ m_LSL_Functions.llSetSoundRadius(radius);
+ }
+
+ public string llKey2Name(string id)
+ {
+ return m_LSL_Functions.llKey2Name(id);
+ }
+
+ public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
+ {
+ m_LSL_Functions.llSetTextureAnim(mode, face, sizex, sizey, start, length, rate);
+ }
+
+ public void llTriggerSoundLimited(string sound, double volume, vector top_north_east, vector bottom_south_west)
+ {
+ m_LSL_Functions.llTriggerSoundLimited(sound, volume, top_north_east, bottom_south_west);
+ }
+
+ public void llEjectFromLand(string pest)
+ {
+ m_LSL_Functions.llEjectFromLand(pest);
+ }
+
+ public void llParseString2List()
+ {
+ m_LSL_Functions.llParseString2List();
+ }
+
+ public int llOverMyLand(string id)
+ {
+ return m_LSL_Functions.llOverMyLand(id);
+ }
+
+ public string llGetLandOwnerAt(vector pos)
+ {
+ return m_LSL_Functions.llGetLandOwnerAt(pos);
+ }
+
+ public string llGetNotecardLine(string name, int line)
+ {
+ return m_LSL_Functions.llGetNotecardLine(name, line);
+ }
+
+ public vector llGetAgentSize(string id)
+ {
+ return m_LSL_Functions.llGetAgentSize(id);
+ }
+
+ public int llSameGroup(string agent)
+ {
+ return m_LSL_Functions.llSameGroup(agent);
+ }
+
+ public void llUnSit(string id)
+ {
+ m_LSL_Functions.llUnSit(id);
+ }
+
+ public vector llGroundSlope(vector offset)
+ {
+ return m_LSL_Functions.llGroundSlope(offset);
+ }
+
+ public vector llGroundNormal(vector offset)
+ {
+ return m_LSL_Functions.llGroundNormal(offset);
+ }
+
+ public vector llGroundContour(vector offset)
+ {
+ return m_LSL_Functions.llGroundContour(offset);
+ }
+
+ public int llGetAttached()
+ {
+ return m_LSL_Functions.llGetAttached();
+ }
+
+ public int llGetFreeMemory()
+ {
+ return m_LSL_Functions.llGetFreeMemory();
+ }
+
+ public string llGetRegionName()
+ {
+ return m_LSL_Functions.llGetRegionName();
+ }
+
+ public double llGetRegionTimeDilation()
+ {
+ return m_LSL_Functions.llGetRegionTimeDilation();
+ }
+
+ public double llGetRegionFPS()
+ {
+ return m_LSL_Functions.llGetRegionFPS();
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public void llParticleSystem(List rules)
+ {
+ m_LSL_Functions.llParticleSystem(rules);
+ }
+
+ public void llGroundRepel(double height, int water, double tau)
+ {
+ m_LSL_Functions.llGroundRepel(height, water, tau);
+ }
+
+ public void llGiveInventoryList()
+ {
+ m_LSL_Functions.llGiveInventoryList();
+ }
+
+ public void llSetVehicleType(int type)
+ {
+ m_LSL_Functions.llSetVehicleType(type);
+ }
+
+ public void llSetVehicledoubleParam(int param, double value)
+ {
+ m_LSL_Functions.llSetVehicledoubleParam(param, value);
+ }
+
+ public void llSetVehicleVectorParam(int param, vector vec)
+ {
+ m_LSL_Functions.llSetVehicleVectorParam(param, vec);
+ }
+
+ public void llSetVehicleRotationParam(int param, rotation rot)
+ {
+ m_LSL_Functions.llSetVehicleRotationParam(param, rot);
+ }
+
+ public void llSetVehicleFlags(int flags)
+ {
+ m_LSL_Functions.llSetVehicleFlags(flags);
+ }
+
+ public void llRemoveVehicleFlags(int flags)
+ {
+ m_LSL_Functions.llRemoveVehicleFlags(flags);
+ }
+
+ public void llSitTarget(vector offset, rotation rot)
+ {
+ m_LSL_Functions.llSitTarget(offset, rot);
+ }
+
+ public string llAvatarOnSitTarget()
+ {
+ return m_LSL_Functions.llAvatarOnSitTarget();
+ }
+
+ public void llAddToLandPassList(string avatar, double hours)
+ {
+ m_LSL_Functions.llAddToLandPassList(avatar, hours);
+ }
+
+ public void llSetTouchText(string text)
+ {
+ m_LSL_Functions.llSetTouchText(text);
+ }
+
+ public void llSetSitText(string text)
+ {
+ m_LSL_Functions.llSetSitText(text);
+ }
+
+ public void llSetCameraEyeOffset(vector offset)
+ {
+ m_LSL_Functions.llSetCameraEyeOffset(offset);
+ }
+
+ public void llSetCameraAtOffset(vector offset)
+ {
+ m_LSL_Functions.llSetCameraAtOffset(offset);
+ }
+
+ public void llDumpList2String()
+ {
+ m_LSL_Functions.llDumpList2String();
+ }
+
+ public void llScriptDanger(vector pos)
+ {
+ m_LSL_Functions.llScriptDanger(pos);
+ }
+
+ public void llDialog(string avatar, string message, List buttons, int chat_channel)
+ {
+ m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel);
+ }
+
+ public void llVolumeDetect(int detect)
+ {
+ m_LSL_Functions.llVolumeDetect(detect);
+ }
+
+ public void llResetOtherScript(string name)
+ {
+ m_LSL_Functions.llResetOtherScript(name);
+ }
+
+ public int llGetScriptState(string name)
+ {
+ return m_LSL_Functions.llGetScriptState(name);
+ }
+
+ public void llRemoteLoadScript()
+ {
+ m_LSL_Functions.llRemoteLoadScript();
+ }
+
+ public void llSetRemoteScriptAccessPin(int pin)
+ {
+ m_LSL_Functions.llSetRemoteScriptAccessPin(pin);
+ }
+
+ public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param)
+ {
+ m_LSL_Functions.llRemoteLoadScriptPin(target, name, pin, running, start_param);
+ }
+
+ //
+ // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
+ //
+ public void llOpenRemoteDataChannel()
+ {
+ m_LSL_Functions.llOpenRemoteDataChannel();
+ }
+
+ public string llSendRemoteData(string channel, string dest, int idata, string sdata)
+ {
+ return m_LSL_Functions.llSendRemoteData(channel, dest, idata, sdata);
+ }
+
+ public void llRemoteDataReply(string channel, string message_id, string sdata, int idata)
+ {
+ m_LSL_Functions.llRemoteDataReply(channel, message_id, sdata, idata);
+ }
+
+ public void llCloseRemoteDataChannel(string channel)
+ {
+ m_LSL_Functions.llCloseRemoteDataChannel(channel);
+ }
+
+ public string llMD5String(string src, int nonce)
+ {
+ return m_LSL_Functions.llMD5String(src, nonce);
+ }
+
+ public void llSetPrimitiveParams(List rules)
+ {
+ m_LSL_Functions.llSetPrimitiveParams(rules);
+ }
+
+ public string llStringToBase64(string str)
+ {
+ return m_LSL_Functions.llStringToBase64(str);
+ }
+
+ public string llBase64ToString(string str)
+ {
+ return m_LSL_Functions.llBase64ToString(str);
+ }
+
+ public void llXorBase64Strings()
+ {
+ m_LSL_Functions.llXorBase64Strings();
+ }
+
+ public void llRemoteDataSetRegion()
+ {
+ m_LSL_Functions.llRemoteDataSetRegion();
+ }
+
+ public double llLog10(double val)
+ {
+ return m_LSL_Functions.llLog10(val);
+ }
- // Object never expires
- public override Object InitializeLifetimeService()
+ public double llLog(double val)
{
- //Console.WriteLine("LSL_BaseClass: InitializeLifetimeService()");
- // return null;
- ILease lease = (ILease)base.InitializeLifetimeService();
+ return m_LSL_Functions.llLog(val);
+ }
- if (lease.CurrentState == LeaseState.Initial)
- {
- lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1);
- //lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
- //lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
- }
- return lease;
+ public List llGetAnimationList(string id)
+ {
+ return m_LSL_Functions.llGetAnimationList(id);
}
+ public void llSetParcelMusicURL(string url)
+ {
+ m_LSL_Functions.llSetParcelMusicURL(url);
+ }
- private Executor m_Exec;
- public Executor Exec
+ public vector llGetRootPosition()
{
- get
- {
- if (m_Exec == null)
- m_Exec = new Executor(this);
- return m_Exec;
- }
+ return m_LSL_Functions.llGetRootPosition();
}
- public LSL_BuiltIn_Commands_Interface m_LSL_Functions;
- public string SourceCode = "";
+ public rotation llGetRootRotation()
+ {
+ return m_LSL_Functions.llGetRootRotation();
+ }
- public LSL_BaseClass()
+ public string llGetObjectDesc()
{
+ return m_LSL_Functions.llGetObjectDesc();
}
- public string State()
+
+ public void llSetObjectDesc(string desc)
{
- return m_LSL_Functions.State();
+ m_LSL_Functions.llSetObjectDesc(desc);
}
+ public string llGetCreator()
+ {
+ return m_LSL_Functions.llGetCreator();
+ }
- public void Start(LSL_BuiltIn_Commands_Interface LSL_Functions)
+ public string llGetTimestamp()
{
- m_LSL_Functions = LSL_Functions;
+ return m_LSL_Functions.llGetTimestamp();
+ }
- //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called.");
+ public void llSetLinkAlpha(int linknumber, double alpha, int face)
+ {
+ m_LSL_Functions.llSetLinkAlpha(linknumber, alpha, face);
+ }
- // Get this AppDomain's settings and display some of them.
- AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation;
- Console.WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}",
- ads.ApplicationName,
- ads.ApplicationBase,
- ads.ConfigurationFile
- );
+ public int llGetNumberOfPrims()
+ {
+ return m_LSL_Functions.llGetNumberOfPrims();
+ }
- // Display the name of the calling AppDomain and the name
- // of the second domain.
- // NOTE: The application's thread has transitioned between
- // AppDomains.
- Console.WriteLine("Calling to '{0}'.",
- Thread.GetDomain().FriendlyName
- );
+ public string llGetNumberOfNotecardLines(string name)
+ {
+ return m_LSL_Functions.llGetNumberOfNotecardLines(name);
+ }
- return;
+ public List llGetBoundingBox(string obj)
+ {
+ return m_LSL_Functions.llGetBoundingBox(obj);
}
+ public vector llGetGeometricCenter()
+ {
+ return m_LSL_Functions.llGetGeometricCenter();
+ }
+ public void llGetPrimitiveParams()
+ {
+ m_LSL_Functions.llGetPrimitiveParams();
+ }
//
// DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
//
- // They are only forwarders to LSL_BuiltIn_Commands.cs
- //
- public double llSin(double f) { return m_LSL_Functions.llSin(f); }
- public double llCos(double f) { return m_LSL_Functions.llCos(f); }
- public double llTan(double f) { return m_LSL_Functions.llTan(f); }
- public double llAtan2(double x, double y) { return m_LSL_Functions.llAtan2(x, y); }
- public double llSqrt(double f) { return m_LSL_Functions.llSqrt(f); }
- public double llPow(double fbase, double fexponent) { return m_LSL_Functions.llPow(fbase, fexponent); }
- public int llAbs(int i) { return m_LSL_Functions.llAbs(i); }
- public double llFabs(double f) { return m_LSL_Functions.llFabs(f); }
- public double llFrand(double mag) { return m_LSL_Functions.llFrand(mag); }
- public int llFloor(double f) { return m_LSL_Functions.llFloor(f); }
- public int llCeil(double f) { return m_LSL_Functions.llCeil(f); }
- public int llRound(double f) { return m_LSL_Functions.llRound(f); }
- public double llVecMag(LSL_Types.Vector3 v) { return m_LSL_Functions.llVecMag(v); }
- public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) { return m_LSL_Functions.llVecNorm(v); }
- public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b) { return m_LSL_Functions.llVecDist(a, b); }
- public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Euler(r); }
- public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) { return m_LSL_Functions.llEuler2Rot(v); }
- public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) { return m_LSL_Functions.llAxes2Rot(fwd, left, up); }
- public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Fwd(r); }
- public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Left(r); }
- public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Up(r); }
- public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 start, LSL_Types.Vector3 end) { return m_LSL_Functions.llRotBetween(start, end); }
- public void llWhisper(int channelID, string text) { m_LSL_Functions.llWhisper(channelID, text); }
- public void llSay(int channelID, string text) { m_LSL_Functions.llSay(channelID, text); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public void llShout(int channelID, string text) { m_LSL_Functions.llShout(channelID, text); }
- public int llListen(int channelID, string name, string ID, string msg) { return m_LSL_Functions.llListen(channelID, name, ID, msg); }
- public void llListenControl(int number, int active) { m_LSL_Functions.llListenControl(number, active); }
- public void llListenRemove(int number) { m_LSL_Functions.llListenRemove(number); }
- public void llSensor(string name, string id, int type, double range, double arc) { m_LSL_Functions.llSensor(name, id, type, range, arc); }
- public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) { m_LSL_Functions.llSensorRepeat(name, id, type, range, arc, rate); }
- public void llSensorRemove() { m_LSL_Functions.llSensorRemove(); }
- public string llDetectedName(int number) { return m_LSL_Functions.llDetectedName(number); }
- public string llDetectedKey(int number) { return m_LSL_Functions.llDetectedKey(number); }
- public string llDetectedOwner(int number) { return m_LSL_Functions.llDetectedOwner(number); }
- public int llDetectedType(int number) { return m_LSL_Functions.llDetectedType(number); }
- public LSL_Types.Vector3 llDetectedPos(int number) { return m_LSL_Functions.llDetectedPos(number); }
- public LSL_Types.Vector3 llDetectedVel(int number) { return m_LSL_Functions.llDetectedVel(number); }
- public LSL_Types.Vector3 llDetectedGrab(int number) { return m_LSL_Functions.llDetectedGrab(number); }
- public LSL_Types.Quaternion llDetectedRot(int number) { return m_LSL_Functions.llDetectedRot(number); }
- public int llDetectedGroup(int number) { return m_LSL_Functions.llDetectedGroup(number); }
- public int llDetectedLinkNumber(int number) { return m_LSL_Functions.llDetectedLinkNumber(number); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public void llDie() { m_LSL_Functions.llDie(); }
- public double llGround(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGround(offset); }
- public double llCloud(LSL_Types.Vector3 offset) { return m_LSL_Functions.llCloud(offset); }
- public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset) { return m_LSL_Functions.llWind(offset); }
- public void llSetStatus(int status, int value) { m_LSL_Functions.llSetStatus(status, value); }
- public int llGetStatus(int status) { return m_LSL_Functions.llGetStatus(status); }
- public void llSetScale(LSL_Types.Vector3 scale) { m_LSL_Functions.llSetScale(scale); }
- public LSL_Types.Vector3 llGetScale() { return m_LSL_Functions.llGetScale(); }
- public void llSetColor(LSL_Types.Vector3 color, int face) { m_LSL_Functions.llSetColor(color, face); }
- public double llGetAlpha(int face) { return m_LSL_Functions.llGetAlpha(face); }
- public void llSetAlpha(double alpha, int face) { m_LSL_Functions.llSetAlpha(alpha, face); }
- public LSL_Types.Vector3 llGetColor(int face) { return m_LSL_Functions.llGetColor(face); }
- public void llSetTexture(string texture, int face) { m_LSL_Functions.llSetTexture(texture, face); }
- public void llScaleTexture(double u, double v, int face) { m_LSL_Functions.llScaleTexture(u, v, face); }
- public void llOffsetTexture(double u, double v, int face) { m_LSL_Functions.llOffsetTexture(u, v, face); }
- public void llRotateTexture(double rotation, int face) { m_LSL_Functions.llRotateTexture(rotation, face); }
- public string llGetTexture(int face) { return m_LSL_Functions.llGetTexture(face); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public void llSetPos(LSL_Types.Vector3 pos) { m_LSL_Functions.llSetPos(pos); }
- public LSL_Types.Vector3 llGetPos() { return m_LSL_Functions.llGetPos(); }
- public LSL_Types.Vector3 llGetLocalPos() { return m_LSL_Functions.llGetLocalPos(); }
- public void llSetRot(LSL_Types.Quaternion rot) { m_LSL_Functions.llSetRot(rot); }
- public LSL_Types.Quaternion llGetRot() { return m_LSL_Functions.llGetRot(); }
- public LSL_Types.Quaternion llGetLocalRot() { return m_LSL_Functions.llGetLocalRot(); }
- public void llSetForce(LSL_Types.Vector3 force, int local) { m_LSL_Functions.llSetForce(force, local); }
- public LSL_Types.Vector3 llGetForce() { return m_LSL_Functions.llGetForce(); }
- public int llTarget(LSL_Types.Vector3 position, double range) { return m_LSL_Functions.llTarget(position, range); }
- public void llTargetRemove(int number) { m_LSL_Functions.llTargetRemove(number); }
- public int llRotTarget(LSL_Types.Quaternion rot, double error) { return m_LSL_Functions.llRotTarget(rot, error); }
- public void llRotTargetRemove(int number) { m_LSL_Functions.llRotTargetRemove(number); }
- public void llMoveToTarget(LSL_Types.Vector3 target, double tau) { m_LSL_Functions.llMoveToTarget(target, tau); }
- public void llStopMoveToTarget() { m_LSL_Functions.llStopMoveToTarget(); }
- public void llApplyImpulse(LSL_Types.Vector3 force, int local) { m_LSL_Functions.llApplyImpulse(force, local); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) { m_LSL_Functions.llApplyRotationalImpulse(force, local); }
- public void llSetTorque(LSL_Types.Vector3 torque, int local) { m_LSL_Functions.llSetTorque(torque, local); }
- public LSL_Types.Vector3 llGetTorque() { return m_LSL_Functions.llGetTorque(); }
- public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local) { m_LSL_Functions.llSetForceAndTorque(force, torque, local); }
- public LSL_Types.Vector3 llGetVel() { return m_LSL_Functions.llGetVel(); }
- public LSL_Types.Vector3 llGetAccel() { return m_LSL_Functions.llGetAccel(); }
- public LSL_Types.Vector3 llGetOmega() { return m_LSL_Functions.llGetOmega(); }
- public double llGetTimeOfDay() { return m_LSL_Functions.llGetTimeOfDay(); }
- public double llGetWallclock() { return m_LSL_Functions.llGetWallclock(); }
- public double llGetTime() { return m_LSL_Functions.llGetTime(); }
- public void llResetTime() { m_LSL_Functions.llResetTime(); }
- public double llGetAndResetTime() { return m_LSL_Functions.llGetAndResetTime(); }
- public void llSound() { m_LSL_Functions.llSound(); }
- public void llPlaySound(string sound, double volume) { m_LSL_Functions.llPlaySound(sound, volume); }
- public void llLoopSound(string sound, double volume) { m_LSL_Functions.llLoopSound(sound, volume); }
- public void llLoopSoundMaster(string sound, double volume) { m_LSL_Functions.llLoopSoundMaster(sound, volume); }
- public void llLoopSoundSlave(string sound, double volume) { m_LSL_Functions.llLoopSoundSlave(sound, volume); }
- public void llPlaySoundSlave(string sound, double volume) { m_LSL_Functions.llPlaySoundSlave(sound, volume); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public void llTriggerSound(string sound, double volume) { m_LSL_Functions.llTriggerSound(sound, volume); }
- public void llStopSound() { m_LSL_Functions.llStopSound(); }
- public void llPreloadSound(string sound) { m_LSL_Functions.llPreloadSound(sound); }
- public string llGetSubString(string src, int start, int end) { return m_LSL_Functions.llGetSubString(src, start, end); }
- public string llDeleteSubString(string src, int start, int end) { return m_LSL_Functions.llDeleteSubString(src, start, end); }
- public string llInsertString(string dst, int position, string src) { return m_LSL_Functions.llInsertString(dst, position, src); }
- public string llToUpper(string source) { return m_LSL_Functions.llToUpper(source); }
- public string llToLower(string source) { return m_LSL_Functions.llToLower(source); }
- public int llGiveMoney(string destination, int amount) { return m_LSL_Functions.llGiveMoney(destination, amount); }
- public void llMakeExplosion() { m_LSL_Functions.llMakeExplosion(); }
- public void llMakeFountain() { m_LSL_Functions.llMakeFountain(); }
- public void llMakeSmoke() { m_LSL_Functions.llMakeSmoke(); }
- public void llMakeFire() { m_LSL_Functions.llMakeFire(); }
- public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) { m_LSL_Functions.llRezObject(inventory, pos, rot, param); }
- public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) { m_LSL_Functions.llLookAt(target, strength, damping); }
- public void llStopLookAt() { m_LSL_Functions.llStopLookAt(); }
- public void llSetTimerEvent(double sec) { m_LSL_Functions.llSetTimerEvent(sec); }
- public void llSleep(double sec) { m_LSL_Functions.llSleep(sec); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public double llGetMass() { return m_LSL_Functions.llGetMass(); }
- public void llCollisionFilter(string name, string id, int accept) { m_LSL_Functions.llCollisionFilter(name, id, accept); }
- public void llTakeControls(int controls, int accept, int pass_on) { m_LSL_Functions.llTakeControls(controls, accept, pass_on); }
- public void llReleaseControls() { m_LSL_Functions.llReleaseControls(); }
- public void llAttachToAvatar(int attachment) { m_LSL_Functions.llAttachToAvatar(attachment); }
- public void llDetachFromAvatar() { m_LSL_Functions.llDetachFromAvatar(); }
- public void llTakeCamera() { m_LSL_Functions.llTakeCamera(); }
- public void llReleaseCamera() { m_LSL_Functions.llReleaseCamera(); }
- public string llGetOwner() { return m_LSL_Functions.llGetOwner(); }
- public void llInstantMessage(string user, string message) { m_LSL_Functions.llInstantMessage(user, message); }
- public void llEmail(string address, string subject, string message) { m_LSL_Functions.llEmail(address, subject, message); }
- public void llGetNextEmail(string address, string subject) { m_LSL_Functions.llGetNextEmail(address, subject); }
- public string llGetKey() { return m_LSL_Functions.llGetKey(); }
- public void llSetBuoyancy(double buoyancy) { m_LSL_Functions.llSetBuoyancy(buoyancy); }
- public void llSetHoverHeight(double height, int water, double tau) { m_LSL_Functions.llSetHoverHeight(height, water, tau); }
- public void llStopHover() { m_LSL_Functions.llStopHover(); }
- public void llMinEventDelay(double delay) { m_LSL_Functions.llMinEventDelay(delay); }
- public void llSoundPreload() { m_LSL_Functions.llSoundPreload(); }
- public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping) { m_LSL_Functions.llRotLookAt(target, strength, damping); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public int llStringLength(string str) { return m_LSL_Functions.llStringLength(str); }
- public void llStartAnimation(string anim) { m_LSL_Functions.llStartAnimation(anim); }
- public void llStopAnimation(string anim) { m_LSL_Functions.llStopAnimation(anim); }
- public void llPointAt() { m_LSL_Functions.llPointAt(); }
- public void llStopPointAt() { m_LSL_Functions.llStopPointAt(); }
- public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) { m_LSL_Functions.llTargetOmega(axis, spinrate, gain); }
- public int llGetStartParameter() { return m_LSL_Functions.llGetStartParameter(); }
- public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos) { m_LSL_Functions.llGodLikeRezObject(inventory, pos); }
- public void llRequestPermissions(string agent, int perm) { m_LSL_Functions.llRequestPermissions(agent, perm); }
- public string llGetPermissionsKey() { return m_LSL_Functions.llGetPermissionsKey(); }
- public int llGetPermissions() { return m_LSL_Functions.llGetPermissions(); }
- public int llGetLinkNumber() { return m_LSL_Functions.llGetLinkNumber(); }
- public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face) { m_LSL_Functions.llSetLinkColor(linknumber, color, face); }
- public void llCreateLink(string target, int parent) { m_LSL_Functions.llCreateLink(target, parent); }
- public void llBreakLink(int linknum) { m_LSL_Functions.llBreakLink(linknum); }
- public void llBreakAllLinks() { m_LSL_Functions.llBreakAllLinks(); }
- public string llGetLinkKey(int linknum) { return m_LSL_Functions.llGetLinkKey(linknum); }
- public void llGetLinkName(int linknum) { m_LSL_Functions.llGetLinkName(linknum); }
- public int llGetInventoryNumber(int type) { return m_LSL_Functions.llGetInventoryNumber(type); }
- public string llGetInventoryName(int type, int number) { return m_LSL_Functions.llGetInventoryName(type, number); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public void llSetScriptState(string name, int run) { m_LSL_Functions.llSetScriptState(name, run); }
- public double llGetEnergy() { return m_LSL_Functions.llGetEnergy(); }
- public void llGiveInventory(string destination, string inventory) { m_LSL_Functions.llGiveInventory(destination, inventory); }
- public void llRemoveInventory(string item) { m_LSL_Functions.llRemoveInventory(item); }
- public void llSetText(string text, LSL_Types.Vector3 color, double alpha) { m_LSL_Functions.llSetText(text, color, alpha); }
- public double llWater(LSL_Types.Vector3 offset) { return m_LSL_Functions.llWater(offset); }
- public void llPassTouches(int pass) { m_LSL_Functions.llPassTouches(pass); }
- public string llRequestAgentData(string id, int data) { return m_LSL_Functions.llRequestAgentData(id, data); }
- public string llRequestInventoryData(string name) { return m_LSL_Functions.llRequestInventoryData(name); }
- public void llSetDamage(double damage) { m_LSL_Functions.llSetDamage(damage); }
- public void llTeleportAgentHome(string agent) { m_LSL_Functions.llTeleportAgentHome(agent); }
- public void llModifyLand(int action, int brush) { m_LSL_Functions.llModifyLand(action, brush); }
- public void llCollisionSound(string impact_sound, double impact_volume) { m_LSL_Functions.llCollisionSound(impact_sound, impact_volume); }
- public void llCollisionSprite(string impact_sprite) { m_LSL_Functions.llCollisionSprite(impact_sprite); }
- public string llGetAnimation(string id) { return m_LSL_Functions.llGetAnimation(id); }
- public void llResetScript() { m_LSL_Functions.llResetScript(); }
- public void llMessageLinked(int linknum, int num, string str, string id) { m_LSL_Functions.llMessageLinked(linknum, num, str, id); }
- public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local) { m_LSL_Functions.llPushObject(target, impulse, ang_impulse, local); }
- public void llPassCollisions(int pass) { m_LSL_Functions.llPassCollisions(pass); }
- public string llGetScriptName() { return m_LSL_Functions.llGetScriptName(); }
- public int llGetNumberOfSides() { return m_LSL_Functions.llGetNumberOfSides(); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) { return m_LSL_Functions.llAxisAngle2Rot(axis, angle); }
- public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) { return m_LSL_Functions.llRot2Axis(rot); }
- public void llRot2Angle() { m_LSL_Functions.llRot2Angle(); }
- public double llAcos(double val) { return m_LSL_Functions.llAcos(val); }
- public double llAsin(double val) { return m_LSL_Functions.llAsin(val); }
- public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) { return m_LSL_Functions.llAngleBetween(a, b); }
- public string llGetInventoryKey(string name) { return m_LSL_Functions.llGetInventoryKey(name); }
- public void llAllowInventoryDrop(int add) { m_LSL_Functions.llAllowInventoryDrop(add); }
- public LSL_Types.Vector3 llGetSunDirection() { return m_LSL_Functions.llGetSunDirection(); }
- public LSL_Types.Vector3 llGetTextureOffset(int face) { return m_LSL_Functions.llGetTextureOffset(face); }
- public LSL_Types.Vector3 llGetTextureScale(int side) { return m_LSL_Functions.llGetTextureScale(side); }
- public double llGetTextureRot(int side) { return m_LSL_Functions.llGetTextureRot(side); }
- public int llSubStringIndex(string source, string pattern) { return m_LSL_Functions.llSubStringIndex(source, pattern); }
- public string llGetOwnerKey(string id) { return m_LSL_Functions.llGetOwnerKey(id); }
- public LSL_Types.Vector3 llGetCenterOfMass() { return m_LSL_Functions.llGetCenterOfMass(); }
- public List llListSort(List src, int stride, int ascending) { return m_LSL_Functions.llListSort(src, stride, ascending); }
- public int llGetListLength(List src) { return m_LSL_Functions.llGetListLength(src); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public int llList2Integer(List src, int index) { return m_LSL_Functions.llList2Integer(src, index); }
- public double llList2double(List src, int index) { return m_LSL_Functions.llList2double(src, index); }
- public string llList2String(List src, int index) { return m_LSL_Functions.llList2String(src, index); }
- public string llList2Key(List src, int index) { return m_LSL_Functions.llList2Key(src, index); }
- public LSL_Types.Vector3 llList2Vector(List src, int index) { return m_LSL_Functions.llList2Vector(src, index); }
- public LSL_Types.Quaternion llList2Rot(List src, int index) { return m_LSL_Functions.llList2Rot(src, index); }
- public List llList2List(List src, int start, int end) { return m_LSL_Functions.llList2List(src, start, end); }
- public List llDeleteSubList(List src, int start, int end) { return m_LSL_Functions.llDeleteSubList(src, start, end); }
- public int llGetListEntryType(List src, int index) { return m_LSL_Functions.llGetListEntryType(src, index); }
- public string llList2CSV(List src) { return m_LSL_Functions.llList2CSV(src); }
- public List llCSV2List(string src) { return m_LSL_Functions.llCSV2List(src); }
- public List llListRandomize(List src, int stride) { return m_LSL_Functions.llListRandomize(src, stride); }
- public List llList2ListStrided(List src, int start, int end, int stride) { return m_LSL_Functions.llList2ListStrided(src, start, end, stride); }
- public LSL_Types.Vector3 llGetRegionCorner() { return m_LSL_Functions.llGetRegionCorner(); }
- public List llListInsertList(List dest, List src, int start) { return m_LSL_Functions.llListInsertList(dest, src, start); }
- public int llListFindList(List src, List test) { return m_LSL_Functions.llListFindList(src, test); }
- public string llGetObjectName() { return m_LSL_Functions.llGetObjectName(); }
- public void llSetObjectName(string name) { m_LSL_Functions.llSetObjectName(name); }
- public string llGetDate() { return m_LSL_Functions.llGetDate(); }
- public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir) { return m_LSL_Functions.llEdgeOfWorld(pos, dir); }
- public int llGetAgentInfo(string id) { return m_LSL_Functions.llGetAgentInfo(id); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public void llAdjustSoundVolume(double volume) { m_LSL_Functions.llAdjustSoundVolume(volume); }
- public void llSetSoundQueueing(int queue) { m_LSL_Functions.llSetSoundQueueing(queue); }
- public void llSetSoundRadius(double radius) { m_LSL_Functions.llSetSoundRadius(radius); }
- public string llKey2Name(string id) { return m_LSL_Functions.llKey2Name(id); }
- public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) { m_LSL_Functions.llSetTextureAnim(mode, face, sizex, sizey, start, length, rate); }
- public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, LSL_Types.Vector3 bottom_south_west) { m_LSL_Functions.llTriggerSoundLimited(sound, volume, top_north_east, bottom_south_west); }
- public void llEjectFromLand(string pest) { m_LSL_Functions.llEjectFromLand(pest); }
- public void llParseString2List() { m_LSL_Functions.llParseString2List(); }
- public int llOverMyLand(string id) { return m_LSL_Functions.llOverMyLand(id); }
- public string llGetLandOwnerAt(LSL_Types.Vector3 pos) { return m_LSL_Functions.llGetLandOwnerAt(pos); }
- public string llGetNotecardLine(string name, int line) { return m_LSL_Functions.llGetNotecardLine(name, line); }
- public LSL_Types.Vector3 llGetAgentSize(string id) { return m_LSL_Functions.llGetAgentSize(id); }
- public int llSameGroup(string agent) { return m_LSL_Functions.llSameGroup(agent); }
- public void llUnSit(string id) { m_LSL_Functions.llUnSit(id); }
- public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGroundSlope(offset); }
- public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGroundNormal(offset); }
- public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGroundContour(offset); }
- public int llGetAttached() { return m_LSL_Functions.llGetAttached(); }
- public int llGetFreeMemory() { return m_LSL_Functions.llGetFreeMemory(); }
- public string llGetRegionName() { return m_LSL_Functions.llGetRegionName(); }
- public double llGetRegionTimeDilation() { return m_LSL_Functions.llGetRegionTimeDilation(); }
- public double llGetRegionFPS() { return m_LSL_Functions.llGetRegionFPS(); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public void llParticleSystem(List rules) { m_LSL_Functions.llParticleSystem(rules); }
- public void llGroundRepel(double height, int water, double tau) { m_LSL_Functions.llGroundRepel(height, water, tau); }
- public void llGiveInventoryList() { m_LSL_Functions.llGiveInventoryList(); }
- public void llSetVehicleType(int type) { m_LSL_Functions.llSetVehicleType(type); }
- public void llSetVehicledoubleParam(int param, double value) { m_LSL_Functions.llSetVehicledoubleParam(param, value); }
- public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec) { m_LSL_Functions.llSetVehicleVectorParam(param, vec); }
- public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot) { m_LSL_Functions.llSetVehicleRotationParam(param, rot); }
- public void llSetVehicleFlags(int flags) { m_LSL_Functions.llSetVehicleFlags(flags); }
- public void llRemoveVehicleFlags(int flags) { m_LSL_Functions.llRemoveVehicleFlags(flags); }
- public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot) { m_LSL_Functions.llSitTarget(offset, rot); }
- public string llAvatarOnSitTarget() { return m_LSL_Functions.llAvatarOnSitTarget(); }
- public void llAddToLandPassList(string avatar, double hours) { m_LSL_Functions.llAddToLandPassList(avatar, hours); }
- public void llSetTouchText(string text) { m_LSL_Functions.llSetTouchText(text); }
- public void llSetSitText(string text) { m_LSL_Functions.llSetSitText(text); }
- public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) { m_LSL_Functions.llSetCameraEyeOffset(offset); }
- public void llSetCameraAtOffset(LSL_Types.Vector3 offset) { m_LSL_Functions.llSetCameraAtOffset(offset); }
- public void llDumpList2String() { m_LSL_Functions.llDumpList2String(); }
- public void llScriptDanger(LSL_Types.Vector3 pos) { m_LSL_Functions.llScriptDanger(pos); }
- public void llDialog(string avatar, string message, List buttons, int chat_channel) { m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel); }
- public void llVolumeDetect(int detect) { m_LSL_Functions.llVolumeDetect(detect); }
- public void llResetOtherScript(string name) { m_LSL_Functions.llResetOtherScript(name); }
- public int llGetScriptState(string name) { return m_LSL_Functions.llGetScriptState(name); }
- public void llRemoteLoadScript() { m_LSL_Functions.llRemoteLoadScript(); }
- public void llSetRemoteScriptAccessPin(int pin) { m_LSL_Functions.llSetRemoteScriptAccessPin(pin); }
- public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) { m_LSL_Functions.llRemoteLoadScriptPin(target, name, pin, running, start_param); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public void llOpenRemoteDataChannel() { m_LSL_Functions.llOpenRemoteDataChannel(); }
- public string llSendRemoteData(string channel, string dest, int idata, string sdata) { return m_LSL_Functions.llSendRemoteData(channel, dest, idata, sdata); }
- public void llRemoteDataReply(string channel, string message_id, string sdata, int idata) { m_LSL_Functions.llRemoteDataReply(channel, message_id, sdata, idata); }
- public void llCloseRemoteDataChannel(string channel) { m_LSL_Functions.llCloseRemoteDataChannel(channel); }
- public string llMD5String(string src, int nonce) { return m_LSL_Functions.llMD5String(src, nonce); }
- public void llSetPrimitiveParams(List rules) { m_LSL_Functions.llSetPrimitiveParams(rules); }
- public string llStringToBase64(string str) { return m_LSL_Functions.llStringToBase64(str); }
- public string llBase64ToString(string str) { return m_LSL_Functions.llBase64ToString(str); }
- public void llXorBase64Strings() { m_LSL_Functions.llXorBase64Strings(); }
- public void llRemoteDataSetRegion() { m_LSL_Functions.llRemoteDataSetRegion(); }
- public double llLog10(double val) { return m_LSL_Functions.llLog10(val); }
- public double llLog(double val) { return m_LSL_Functions.llLog(val); }
- public List llGetAnimationList(string id) { return m_LSL_Functions.llGetAnimationList(id); }
- public void llSetParcelMusicURL(string url) { m_LSL_Functions.llSetParcelMusicURL(url); }
- public LSL_Types.Vector3 llGetRootPosition() { return m_LSL_Functions.llGetRootPosition(); }
- public LSL_Types.Quaternion llGetRootRotation() { return m_LSL_Functions.llGetRootRotation(); }
- public string llGetObjectDesc() { return m_LSL_Functions.llGetObjectDesc(); }
- public void llSetObjectDesc(string desc) { m_LSL_Functions.llSetObjectDesc(desc); }
- public string llGetCreator() { return m_LSL_Functions.llGetCreator(); }
- public string llGetTimestamp() { return m_LSL_Functions.llGetTimestamp(); }
- public void llSetLinkAlpha(int linknumber, double alpha, int face) { m_LSL_Functions.llSetLinkAlpha(linknumber, alpha, face); }
- public int llGetNumberOfPrims() { return m_LSL_Functions.llGetNumberOfPrims(); }
- public string llGetNumberOfNotecardLines(string name) { return m_LSL_Functions.llGetNumberOfNotecardLines(name); }
- public List llGetBoundingBox(string obj) { return m_LSL_Functions.llGetBoundingBox(obj); }
- public LSL_Types.Vector3 llGetGeometricCenter() { return m_LSL_Functions.llGetGeometricCenter(); }
- public void llGetPrimitiveParams() { m_LSL_Functions.llGetPrimitiveParams(); }
- //
- // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
- //
- public string llIntegerToBase64(int number) { return m_LSL_Functions.llIntegerToBase64(number); }
- public int llBase64ToInteger(string str) { return m_LSL_Functions.llBase64ToInteger(str); }
- public double llGetGMTclock() { return m_LSL_Functions.llGetGMTclock(); }
- public string llGetSimulatorHostname() { return m_LSL_Functions.llGetSimulatorHostname(); }
- public void llSetLocalRot(LSL_Types.Quaternion rot) { m_LSL_Functions.llSetLocalRot(rot); }
- public List llParseStringKeepNulls(string src, List seperators, List spacers) { return m_LSL_Functions.llParseStringKeepNulls(src, seperators, spacers); }
- public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, LSL_Types.Quaternion rot, int param) { m_LSL_Functions.llRezAtRoot(inventory, position, velocity, rot, param); }
- public int llGetObjectPermMask(int mask) { return m_LSL_Functions.llGetObjectPermMask(mask); }
- public void llSetObjectPermMask(int mask, int value) { m_LSL_Functions.llSetObjectPermMask(mask, value); }
- public void llGetInventoryPermMask(string item, int mask) { m_LSL_Functions.llGetInventoryPermMask(item, mask); }
- public void llSetInventoryPermMask(string item, int mask, int value) { m_LSL_Functions.llSetInventoryPermMask(item, mask, value); }
- public string llGetInventoryCreator(string item) { return m_LSL_Functions.llGetInventoryCreator(item); }
- public void llOwnerSay(string msg) { m_LSL_Functions.llOwnerSay(msg); }
- public void llRequestSimulatorData(string simulator, int data) { m_LSL_Functions.llRequestSimulatorData(simulator, data); }
- public void llForceMouselook(int mouselook) { m_LSL_Functions.llForceMouselook(mouselook); }
- public double llGetObjectMass(string id) { return m_LSL_Functions.llGetObjectMass(id); }
- public void llListReplaceList() { m_LSL_Functions.llListReplaceList(); }
- public void llLoadURL(string avatar_id, string message, string url) { m_LSL_Functions.llLoadURL(avatar_id, message, url); }
- public void llParcelMediaCommandList(List commandList) { m_LSL_Functions.llParcelMediaCommandList(commandList); }
- public void llParcelMediaQuery() { m_LSL_Functions.llParcelMediaQuery(); }
- public int llModPow(int a, int b, int c) { return m_LSL_Functions.llModPow(a, b, c); }
+ public string llIntegerToBase64(int number)
+ {
+ return m_LSL_Functions.llIntegerToBase64(number);
+ }
+
+ public int llBase64ToInteger(string str)
+ {
+ return m_LSL_Functions.llBase64ToInteger(str);
+ }
+
+ public double llGetGMTclock()
+ {
+ return m_LSL_Functions.llGetGMTclock();
+ }
+
+ public string llGetSimulatorHostname()
+ {
+ return m_LSL_Functions.llGetSimulatorHostname();
+ }
+
+ public void llSetLocalRot(rotation rot)
+ {
+ m_LSL_Functions.llSetLocalRot(rot);
+ }
+
+ public List llParseStringKeepNulls(string src, List seperators, List spacers)
+ {
+ return m_LSL_Functions.llParseStringKeepNulls(src, seperators, spacers);
+ }
+
+ public void llRezAtRoot(string inventory, vector position, vector velocity, rotation rot, int param)
+ {
+ m_LSL_Functions.llRezAtRoot(inventory, position, velocity, rot, param);
+ }
+
+ public int llGetObjectPermMask(int mask)
+ {
+ return m_LSL_Functions.llGetObjectPermMask(mask);
+ }
+
+ public void llSetObjectPermMask(int mask, int value)
+ {
+ m_LSL_Functions.llSetObjectPermMask(mask, value);
+ }
+
+ public void llGetInventoryPermMask(string item, int mask)
+ {
+ m_LSL_Functions.llGetInventoryPermMask(item, mask);
+ }
+
+ public void llSetInventoryPermMask(string item, int mask, int value)
+ {
+ m_LSL_Functions.llSetInventoryPermMask(item, mask, value);
+ }
+
+ public string llGetInventoryCreator(string item)
+ {
+ return m_LSL_Functions.llGetInventoryCreator(item);
+ }
+
+ public void llOwnerSay(string msg)
+ {
+ m_LSL_Functions.llOwnerSay(msg);
+ }
+
+ public void llRequestSimulatorData(string simulator, int data)
+ {
+ m_LSL_Functions.llRequestSimulatorData(simulator, data);
+ }
+
+ public void llForceMouselook(int mouselook)
+ {
+ m_LSL_Functions.llForceMouselook(mouselook);
+ }
+
+ public double llGetObjectMass(string id)
+ {
+ return m_LSL_Functions.llGetObjectMass(id);
+ }
+
+ public void llListReplaceList()
+ {
+ m_LSL_Functions.llListReplaceList();
+ }
+
+ public void llLoadURL(string avatar_id, string message, string url)
+ {
+ m_LSL_Functions.llLoadURL(avatar_id, message, url);
+ }
+
+ public void llParcelMediaCommandList(List commandList)
+ {
+ m_LSL_Functions.llParcelMediaCommandList(commandList);
+ }
+
+ public void llParcelMediaQuery()
+ {
+ m_LSL_Functions.llParcelMediaQuery();
+ }
+
+ public int llModPow(int a, int b, int c)
+ {
+ return m_LSL_Functions.llModPow(a, b, c);
+ }
+
//
// DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
//
- public int llGetInventoryType(string name) { return m_LSL_Functions.llGetInventoryType(name); }
- public void llSetPayPrice(int price, List quick_pay_buttons) { m_LSL_Functions.llSetPayPrice(price, quick_pay_buttons); }
- public LSL_Types.Vector3 llGetCameraPos() { return m_LSL_Functions.llGetCameraPos(); }
- public LSL_Types.Quaternion llGetCameraRot() { return m_LSL_Functions.llGetCameraRot(); }
- public void llSetPrimURL() { m_LSL_Functions.llSetPrimURL(); }
- public void llRefreshPrimURL() { m_LSL_Functions.llRefreshPrimURL(); }
- public string llEscapeURL(string url) { return m_LSL_Functions.llEscapeURL(url); }
- public string llUnescapeURL(string url) { return m_LSL_Functions.llUnescapeURL(url); }
- public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at) { m_LSL_Functions.llMapDestination(simname, pos, look_at); }
- public void llAddToLandBanList(string avatar, double hours) { m_LSL_Functions.llAddToLandBanList(avatar, hours); }
- public void llRemoveFromLandPassList(string avatar) { m_LSL_Functions.llRemoveFromLandPassList(avatar); }
- public void llRemoveFromLandBanList(string avatar) { m_LSL_Functions.llRemoveFromLandBanList(avatar); }
- public void llSetCameraParams(List rules) { m_LSL_Functions.llSetCameraParams(rules); }
- public void llClearCameraParams() { m_LSL_Functions.llClearCameraParams(); }
- public double llListStatistics(int operation, List src) { return m_LSL_Functions.llListStatistics(operation, src); }
- public int llGetUnixTime() { return m_LSL_Functions.llGetUnixTime(); }
- public int llGetParcelFlags(LSL_Types.Vector3 pos) { return m_LSL_Functions.llGetParcelFlags(pos); }
- public int llGetRegionFlags() { return m_LSL_Functions.llGetRegionFlags(); }
- public string llXorBase64StringsCorrect(string str1, string str2) { return m_LSL_Functions.llXorBase64StringsCorrect(str1, str2); }
- public void llHTTPRequest(string url, List parameters, string body) { m_LSL_Functions.llHTTPRequest(url, parameters, body); }
- public void llResetLandBanList() { m_LSL_Functions.llResetLandBanList(); }
- public void llResetLandPassList() { m_LSL_Functions.llResetLandPassList(); }
- public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) { return m_LSL_Functions.llGetParcelPrimCount(pos, category, sim_wide); }
- public List llGetParcelPrimOwners(LSL_Types.Vector3 pos) { return m_LSL_Functions.llGetParcelPrimOwners(pos); }
- public int llGetObjectPrimCount(string object_id) { return m_LSL_Functions.llGetObjectPrimCount(object_id); }
+ public int llGetInventoryType(string name)
+ {
+ return m_LSL_Functions.llGetInventoryType(name);
+ }
+
+ public void llSetPayPrice(int price, List quick_pay_buttons)
+ {
+ m_LSL_Functions.llSetPayPrice(price, quick_pay_buttons);
+ }
+
+ public vector llGetCameraPos()
+ {
+ return m_LSL_Functions.llGetCameraPos();
+ }
+
+ public rotation llGetCameraRot()
+ {
+ return m_LSL_Functions.llGetCameraRot();
+ }
+
+ public void llSetPrimURL()
+ {
+ m_LSL_Functions.llSetPrimURL();
+ }
+
+ public void llRefreshPrimURL()
+ {
+ m_LSL_Functions.llRefreshPrimURL();
+ }
+
+ public string llEscapeURL(string url)
+ {
+ return m_LSL_Functions.llEscapeURL(url);
+ }
+
+ public string llUnescapeURL(string url)
+ {
+ return m_LSL_Functions.llUnescapeURL(url);
+ }
+
+ public void llMapDestination(string simname, vector pos, vector look_at)
+ {
+ m_LSL_Functions.llMapDestination(simname, pos, look_at);
+ }
+
+ public void llAddToLandBanList(string avatar, double hours)
+ {
+ m_LSL_Functions.llAddToLandBanList(avatar, hours);
+ }
+
+ public void llRemoveFromLandPassList(string avatar)
+ {
+ m_LSL_Functions.llRemoveFromLandPassList(avatar);
+ }
+
+ public void llRemoveFromLandBanList(string avatar)
+ {
+ m_LSL_Functions.llRemoveFromLandBanList(avatar);
+ }
+
+ public void llSetCameraParams(List rules)
+ {
+ m_LSL_Functions.llSetCameraParams(rules);
+ }
+
+ public void llClearCameraParams()
+ {
+ m_LSL_Functions.llClearCameraParams();
+ }
+
+ public double llListStatistics(int operation, List src)
+ {
+ return m_LSL_Functions.llListStatistics(operation, src);
+ }
+
+ public int llGetUnixTime()
+ {
+ return m_LSL_Functions.llGetUnixTime();
+ }
+
+ public int llGetParcelFlags(vector pos)
+ {
+ return m_LSL_Functions.llGetParcelFlags(pos);
+ }
+
+ public int llGetRegionFlags()
+ {
+ return m_LSL_Functions.llGetRegionFlags();
+ }
+
+ public string llXorBase64StringsCorrect(string str1, string str2)
+ {
+ return m_LSL_Functions.llXorBase64StringsCorrect(str1, str2);
+ }
+
+ public void llHTTPRequest(string url, List parameters, string body)
+ {
+ m_LSL_Functions.llHTTPRequest(url, parameters, body);
+ }
+
+ public void llResetLandBanList()
+ {
+ m_LSL_Functions.llResetLandBanList();
+ }
+
+ public void llResetLandPassList()
+ {
+ m_LSL_Functions.llResetLandPassList();
+ }
+
+ public int llGetParcelPrimCount(vector pos, int category, int sim_wide)
+ {
+ return m_LSL_Functions.llGetParcelPrimCount(pos, category, sim_wide);
+ }
+
+ public List llGetParcelPrimOwners(vector pos)
+ {
+ return m_LSL_Functions.llGetParcelPrimOwners(pos);
+ }
+
+ public int llGetObjectPrimCount(string object_id)
+ {
+ return m_LSL_Functions.llGetObjectPrimCount(object_id);
+ }
+
//
// DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
//
- public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide) { return m_LSL_Functions.llGetParcelMaxPrims(pos, sim_wide); }
- public List llGetParcelDetails(LSL_Types.Vector3 pos, List param) { return m_LSL_Functions.llGetParcelDetails(pos, param); }
+ public int llGetParcelMaxPrims(vector pos, int sim_wide)
+ {
+ return m_LSL_Functions.llGetParcelMaxPrims(pos, sim_wide);
+ }
+
+ public List llGetParcelDetails(vector pos, List param)
+ {
+ return m_LSL_Functions.llGetParcelDetails(pos, param);
+ }
//
// OpenSim Functions
//
- public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer) { return m_LSL_Functions.osSetDynamicTextureURL(dynamicID, contentType, url, extraParams, timer); }
+ public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
+ int timer)
+ {
+ return m_LSL_Functions.osSetDynamicTextureURL(dynamicID, contentType, url, extraParams, timer);
+ }
// LSL CONSTANTS
public const int TRUE = 1;
@@ -803,10 +2115,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
public const double SQRT2 = 1.414213538f;
// Can not be public const?
- public LSL_Types.Vector3 ZERO_VECTOR = new LSL_Types.Vector3(0, 0, 0);
- public LSL_Types.Quaternion ZERO_ROTATION = new LSL_Types.Quaternion(0, 0, 0, 0);
-
-
-
+ public vector ZERO_VECTOR = new vector(0, 0, 0);
+ public rotation ZERO_ROTATION = new rotation(0, 0, 0, 0);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Common.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Common.cs
index 00eb899..190e6d7 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Common.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Common.cs
@@ -27,31 +27,32 @@
*/
/* Original code: Tedd Hansen */
using System;
-using System.Collections.Generic;
-using System.Text;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{
public static class Common
{
- static public bool Debug = true;
- static public bool IL_UseTryCatch = true;
- static public bool IL_CreateConstructor = true;
- static public bool IL_CreateFunctionList = true;
- static public bool IL_ProcessCodeChunks = true;
+ public static bool Debug = true;
+ public static bool IL_UseTryCatch = true;
+ public static bool IL_CreateConstructor = true;
+ public static bool IL_CreateFunctionList = true;
+ public static bool IL_ProcessCodeChunks = true;
public delegate void SendToDebugEventDelegate(string Message);
+
public delegate void SendToLogEventDelegate(string Message);
- static public event SendToDebugEventDelegate SendToDebugEvent;
- static public event SendToLogEventDelegate SendToLogEvent;
- static public void SendToDebug(string Message)
+ public static event SendToDebugEventDelegate SendToDebugEvent;
+ public static event SendToLogEventDelegate SendToLogEvent;
+
+ public static void SendToDebug(string Message)
{
//if (Debug == true)
Console.WriteLine("COMPILER:Debug: " + Message);
SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
}
- static public void SendToLog(string Message)
+
+ public static void SendToLog(string Message)
{
//if (Debug == true)
Console.WriteLine("COMPILER:LOG: " + Message);
@@ -68,6 +69,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
Common.SendToDebug("ReverseFormatString format: " + format);
return string.Format(format, text1);
}
+
public static string ReverseFormatString(string text1, UInt32 text2, string format)
{
Common.SendToDebug("ReverseFormatString text1: " + text1);
@@ -75,10 +77,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
Common.SendToDebug("ReverseFormatString format: " + format);
return string.Format(format, text1, text2.ToString());
}
+
public static string Cast_ToString(object obj)
{
Common.SendToDebug("OBJECT TO BE CASTED: " + obj.GetType().ToString());
return "ABCDEFGIHJKLMNOPQ123";
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Engine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Engine.cs
index f060f06..97981cc 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Engine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Engine.cs
@@ -27,20 +27,19 @@
*/
/* Original code: Tedd Hansen */
using System;
+using System.IO;
using System.Reflection;
using System.Reflection.Emit;
+using System.Text;
using System.Threading;
-
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{
-
-
public class Engine
{
//private string LSO_FileName = @"LSO\AdditionTest.lso";
- private string LSO_FileName;// = @"LSO\CloseToDefault.lso";
- AppDomain appDomain;
+ private string LSO_FileName; // = @"LSO\CloseToDefault.lso";
+ private AppDomain appDomain;
public string Compile(string LSOFileName)
{
@@ -52,20 +51,19 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
// Create Assembly Name
AssemblyName asmName = new AssemblyName();
- asmName.Name = System.IO.Path.GetFileNameWithoutExtension(LSO_FileName);
+ asmName.Name = Path.GetFileNameWithoutExtension(LSO_FileName);
//asmName.Name = "TestAssembly";
string DLL_FileName = asmName.Name + ".dll";
- string DLL_FileName_WithPath = System.IO.Path.GetDirectoryName(LSO_FileName) + @"\" + DLL_FileName;
+ string DLL_FileName_WithPath = Path.GetDirectoryName(LSO_FileName) + @"\" + DLL_FileName;
- Common.SendToLog("LSO File Name: " + System.IO.Path.GetFileName(LSO_FileName));
+ Common.SendToLog("LSO File Name: " + Path.GetFileName(LSO_FileName));
Common.SendToLog("Assembly name: " + asmName.Name);
Common.SendToLog("Assembly File Name: " + asmName.Name + ".dll");
Common.SendToLog("Starting processing of LSL ByteCode...");
Common.SendToLog("");
-
// Create Assembly
AssemblyBuilder asmBuilder = appDomain.DefineDynamicAssembly(
asmName,
@@ -78,15 +76,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
// Create a module (and save to disk)
ModuleBuilder modBuilder = asmBuilder.DefineDynamicModule
- (asmName.Name,
- DLL_FileName);
+ (asmName.Name,
+ DLL_FileName);
//Common.SendToDebug("asmName.Name is still \"" + asmName.Name + "\"");
// Create a Class (/Type)
TypeBuilder typeBuilder = modBuilder.DefineType(
- "LSL_ScriptObject",
- TypeAttributes.Public | TypeAttributes.BeforeFieldInit,
- typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass));
+ "LSL_ScriptObject",
+ TypeAttributes.Public | TypeAttributes.BeforeFieldInit,
+ typeof (LSL_BaseClass));
//,
// typeof());
//, typeof(LSL_BuiltIn_Commands_Interface));
@@ -95,7 +93,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
// new Type[] { typeof(LSL_CLRInterface.LSLScript) });
-
/*
* Generate the IL itself
*/
@@ -123,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
asmBuilder.Save(DLL_FileName);
Common.SendToLog("Returning assembly filename: " + DLL_FileName);
-
+
return DLL_FileName;
@@ -135,9 +132,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
//object MyScript = (object)Activator.CreateInstance(type);
-
-
-
//System.Reflection.MemberInfo[] Members = type.GetMembers();
//Common.SendToLog("Members of assembly " + type.ToString() + ":");
@@ -165,29 +159,25 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
// type.InvokeMember(s, BindingFlags.InvokeMethod, null, MyScript, new object[] { "Test" });
//}
-
-
}
private static void IL_CREATE_CONSTRUCTOR(TypeBuilder typeBuilder, LSO_Parser LSOP)
{
-
-
Common.SendToDebug("IL_CREATE_CONSTRUCTOR()");
//ConstructorBuilder constructor = typeBuilder.DefineConstructor(
// MethodAttributes.Public,
// CallingConventions.Standard,
// new Type[0]);
ConstructorBuilder constructor = typeBuilder.DefineConstructor(
- MethodAttributes.Public |
- MethodAttributes.SpecialName |
- MethodAttributes.RTSpecialName,
- CallingConventions.Standard,
- new Type[0]);
+ MethodAttributes.Public |
+ MethodAttributes.SpecialName |
+ MethodAttributes.RTSpecialName,
+ CallingConventions.Standard,
+ new Type[0]);
//Define the reflection ConstructorInfor for System.Object
- ConstructorInfo conObj = typeof(LSL_BaseClass).GetConstructor(new Type[0]);
+ ConstructorInfo conObj = typeof (LSL_BaseClass).GetConstructor(new Type[0]);
//call constructor of base object
ILGenerator il = constructor.GetILGenerator();
@@ -230,58 +220,61 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
LSO_Struct.StaticBlock sb;
LSOP.StaticBlocks.TryGetValue(pos, out sb);
- if (sb.ObjectType > 0 && sb.ObjectType < 8) { // We don't want void or null's
-
- il.Emit(OpCodes.Ldarg_0);
- // Push position to stack
- il.Emit(OpCodes.Ldc_I4, pos);
- //il.Emit(OpCodes.Box, typeof(UInt32));
-
-
- Type datatype = null;
-
- // Push data to stack
- Common.SendToDebug("Adding to static (" + pos + ") type: " + ((LSO_Enums.Variable_Type_Codes)sb.ObjectType).ToString() + " (" + sb.ObjectType + ")");
- switch ((LSO_Enums.Variable_Type_Codes)sb.ObjectType)
+ if (sb.ObjectType > 0 && sb.ObjectType < 8)
{
- case LSO_Enums.Variable_Type_Codes.Float:
- case LSO_Enums.Variable_Type_Codes.Integer:
- //UInt32
- il.Emit(OpCodes.Ldc_I4, BitConverter.ToUInt32(sb.BlockVariable, 0));
- datatype = typeof(UInt32);
- il.Emit(OpCodes.Box, datatype);
- break;
- case LSO_Enums.Variable_Type_Codes.String:
- case LSO_Enums.Variable_Type_Codes.Key:
- //String
- LSO_Struct.HeapBlock hb = LSOP.GetHeap(LSOP.myHeader.HR + BitConverter.ToUInt32(sb.BlockVariable, 0) - 1);
- il.Emit(OpCodes.Ldstr, System.Text.Encoding.UTF8.GetString(hb.Data));
- datatype = typeof(string);
- break;
- case LSO_Enums.Variable_Type_Codes.Vector:
- datatype = typeof(LSO_Enums.Vector);
- //TODO: Not implemented
- break;
- case LSO_Enums.Variable_Type_Codes.Rotation:
- //Object
- //TODO: Not implemented
- datatype = typeof(LSO_Enums.Rotation);
- break;
- default:
- datatype = typeof(object);
- break;
- }
-
-
- // Make call
- il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddToStatic", new Type[] { typeof(UInt32), datatype }));
+ // We don't want void or null's
+
+ il.Emit(OpCodes.Ldarg_0);
+ // Push position to stack
+ il.Emit(OpCodes.Ldc_I4, pos);
+ //il.Emit(OpCodes.Box, typeof(UInt32));
+
+
+ Type datatype = null;
+
+ // Push data to stack
+ Common.SendToDebug("Adding to static (" + pos + ") type: " +
+ ((LSO_Enums.Variable_Type_Codes) sb.ObjectType).ToString() + " (" + sb.ObjectType +
+ ")");
+ switch ((LSO_Enums.Variable_Type_Codes) sb.ObjectType)
+ {
+ case LSO_Enums.Variable_Type_Codes.Float:
+ case LSO_Enums.Variable_Type_Codes.Integer:
+ //UInt32
+ il.Emit(OpCodes.Ldc_I4, BitConverter.ToUInt32(sb.BlockVariable, 0));
+ datatype = typeof (UInt32);
+ il.Emit(OpCodes.Box, datatype);
+ break;
+ case LSO_Enums.Variable_Type_Codes.String:
+ case LSO_Enums.Variable_Type_Codes.Key:
+ //String
+ LSO_Struct.HeapBlock hb =
+ LSOP.GetHeap(LSOP.myHeader.HR + BitConverter.ToUInt32(sb.BlockVariable, 0) - 1);
+ il.Emit(OpCodes.Ldstr, Encoding.UTF8.GetString(hb.Data));
+ datatype = typeof (string);
+ break;
+ case LSO_Enums.Variable_Type_Codes.Vector:
+ datatype = typeof (LSO_Enums.Vector);
+ //TODO: Not implemented
+ break;
+ case LSO_Enums.Variable_Type_Codes.Rotation:
+ //Object
+ //TODO: Not implemented
+ datatype = typeof (LSO_Enums.Rotation);
+ break;
+ default:
+ datatype = typeof (object);
+ break;
+ }
+
+
+ // Make call
+ il.Emit(OpCodes.Call,
+ typeof (LSL_BaseClass).GetMethod("AddToStatic", new Type[] {typeof (UInt32), datatype}));
}
-
}
-
-
////il.Emit(OpCodes.Newobj, typeof(UInt32));
//il.Emit(OpCodes.Starg_0);
//// Create LSL function library
@@ -293,8 +286,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
}
-
-
// End of class
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/IL_common_functions.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/IL_common_functions.cs
index 65be5e3..2dc8055 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/IL_common_functions.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/IL_common_functions.cs
@@ -27,30 +27,25 @@
*/
/* Original code: Tedd Hansen */
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Reflection;
using System.Reflection.Emit;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{
- partial class LSO_Parser
+ internal partial class LSO_Parser
{
private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName)
{
TypeBuilder typeBuilder = modBuilder.DefineType(typeName,
- TypeAttributes.Public |
- TypeAttributes.Class |
- TypeAttributes.AutoClass |
- TypeAttributes.AnsiClass |
- TypeAttributes.BeforeFieldInit |
- TypeAttributes.AutoLayout,
- typeof(object),
- new Type[] { typeof(object) });
+ TypeAttributes.Public |
+ TypeAttributes.Class |
+ TypeAttributes.AutoClass |
+ TypeAttributes.AnsiClass |
+ TypeAttributes.BeforeFieldInit |
+ TypeAttributes.AutoLayout,
+ typeof (object),
+ new Type[] {typeof (object)});
return typeBuilder;
-
}
-
-
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass.cs
index 2fb8e45..b84400c 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass.cs
@@ -28,9 +28,6 @@
using System;
using System.Collections.Generic;
-using System.Text;
-using System.IO;
-using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler;
using OpenSim.Region.ScriptEngine.Common;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
@@ -39,9 +36,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{
//public MemoryStream LSLStack = new MemoryStream();
public Stack LSLStack = new Stack();
- public Dictionary StaticVariables = new Dictionary();
- public Dictionary GlobalVariables = new Dictionary();
- public Dictionary LocalVariables = new Dictionary();
+ public Dictionary StaticVariables = new Dictionary();
+ public Dictionary GlobalVariables = new Dictionary();
+ public Dictionary LocalVariables = new Dictionary();
//public System.Collections.Generic.List