From 070047ce1bc74cceebd5e817a0e042a7390c5f24 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 26 Oct 2007 14:08:36 +0000 Subject: * Added prototypical AvatarFactory module interface to load avatar parameters * Added dump_assets_to_file option to enable asset dumping for debug * normalized some namespaces * InventoryFolder renamed to InventoryFolderImpl to --- OpenSim/Region/Application/OpenSimMain.cs | 103 +++++++++++++-------- .../Communications/Local/CommunicationsLocal.cs | 11 ++- .../Communications/Local/LocalInventoryService.cs | 10 +- .../Communications/OGS1/CommunicationsOGS1.cs | 2 +- .../Communications/OGS1/OGS1InventoryService.cs | 4 +- .../Environment/Interfaces/IAvatarFactory.cs | 13 +++ OpenSim/Region/Environment/ModuleLoader.cs | 6 ++ .../Environment/Modules/AvatarFactoryModule.cs | 57 ++++++++++++ OpenSim/Region/Environment/Modules/ChatModule.cs | 2 + .../Region/Environment/Scenes/Scene.Inventory.cs | 1 - OpenSim/Region/Environment/Scenes/Scene.cs | 29 ++++-- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 75 +++++++-------- OpenSim/Region/Examples/SimpleApp/MyWorld.cs | 2 +- OpenSim/Region/Examples/SimpleApp/Program.cs | 2 +- 14 files changed, 212 insertions(+), 105 deletions(-) create mode 100644 OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs create mode 100644 OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index f550ee2..fdaaa51 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -44,7 +44,7 @@ using OpenSim.Region.Environment; using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Physics.Manager; using System.Globalization; -using RegionInfo=OpenSim.Framework.Types.RegionInfo; +using RegionInfo = OpenSim.Framework.Types.RegionInfo; namespace OpenSim { @@ -78,21 +78,25 @@ namespace OpenSim private readonly string m_logFilename = ("region-console.log"); private bool m_permissions = false; - private bool standaloneAuthenticate = false; - private string standaloneWelcomeMessage = null; - private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll"; - private string standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll"; - private string standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll"; + private bool m_standaloneAuthenticate = false; + private string m_standaloneWelcomeMessage = null; + private string m_standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll"; + private string m_standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll"; + private string m_standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll"; private string m_assetStorage = "db4o"; public ConsoleCommand CreateAccount = null; + private bool m_dumpAssetsToFile; public OpenSimMain(IConfigSource configSource) : base() { - string iniFile = configSource.Configs["Startup"].GetString("inifile", "OpenSim.ini"); - string useExecutePathString = configSource.Configs["Startup"].GetString("useexecutepath", "false").ToLower(); + IConfig startupConfig = configSource.Configs["Startup"]; + + string iniFile = startupConfig.GetString("inifile", "OpenSim.ini"); + string useExecutePathString = startupConfig.GetString("useexecutepath", "false").ToLower(); + bool useExecutePath = false; if (useExecutePathString == "true" || useExecutePathString == "" || useExecutePathString == "1" || useExecutePathString == "yes") { @@ -112,38 +116,57 @@ namespace OpenSim //(as if someone has bothered to enter a command line arg, we should take notice of it) m_config.Merge(configSource); } + else + { + m_config = configSource; + } ReadConfigSettings(); - } protected void ReadConfigSettings() { m_networkServersInfo = new NetworkServersInfo(); - m_sandbox = !m_config.Configs["Startup"].GetBoolean("gridmode", false); - m_physicsEngine = m_config.Configs["Startup"].GetString("physics", "basicphysics"); - m_verbose = m_config.Configs["Startup"].GetBoolean("verbose", true); - m_permissions = m_config.Configs["Startup"].GetBoolean("serverside_object_permissions", false); - m_storageDLL = m_config.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); + IConfig startupConfig = m_config.Configs["Startup"]; + + if (startupConfig != null ) + { + m_sandbox = !startupConfig.GetBoolean("gridmode", false); + m_physicsEngine = startupConfig.GetString("physics", "basicphysics"); + m_verbose = startupConfig.GetBoolean("verbose", true); + m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false); + + m_storageDLL = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); - m_startupCommandsFile = m_config.Configs["Startup"].GetString("startup_console_commands_file", ""); - m_shutdownCommandsFile = m_config.Configs["Startup"].GetString("shutdown_console_commands_file", ""); + m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", ""); + m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", ""); - m_scriptEngine = m_config.Configs["Startup"].GetString("script_engine", "DotNetEngine"); + m_scriptEngine = startupConfig.GetString("script_engine", "DotNetEngine"); - m_assetStorage = m_config.Configs["Startup"].GetString("asset_database", "db4o"); + m_assetStorage = startupConfig.GetString("asset_database", "db4o"); - m_config.Configs["Startup"].GetBoolean("default_modules", true); - m_config.Configs["Startup"].GetBoolean("default_shared_modules", true); - m_config.Configs["Startup"].GetString("except_modules", ""); - m_config.Configs["Startup"].GetString("except_shared_modules", ""); + // wtf? + startupConfig.GetBoolean("default_modules", true); + startupConfig.GetBoolean("default_shared_modules", true); + startupConfig.GetString("except_modules", ""); + startupConfig.GetString("except_shared_modules", ""); + } + + IConfig standaloneConfig = m_config.Configs["StandAlone"]; + if (standaloneConfig != null) + { + m_standaloneAuthenticate = standaloneConfig.GetBoolean("accounts_authenticate", false); + m_standaloneWelcomeMessage = standaloneConfig.GetString("welcome_message", "Welcome to OpenSim"); + m_standaloneInventoryPlugin = + 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_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); + } - standaloneAuthenticate = m_config.Configs["StandAlone"].GetBoolean("accounts_authenticate", false); - standaloneWelcomeMessage = m_config.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim"); - standaloneInventoryPlugin = m_config.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll"); - standaloneUserPlugin = m_config.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll"); - standaloneAssetPlugin = m_config.Configs["StandAlone"].GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll"); m_networkServersInfo.loadFromConfiguration(m_config); } @@ -168,22 +191,22 @@ namespace OpenSim if (m_sandbox) { LocalInventoryService inventoryService = new LocalInventoryService(); - inventoryService.AddPlugin(standaloneInventoryPlugin); - - LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService ); - userService.AddPlugin( standaloneUserPlugin ); + inventoryService.AddPlugin(m_standaloneInventoryPlugin); + + 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); + CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService, m_dumpAssetsToFile); m_commsManager = localComms; - m_loginService = new LocalLoginService(userService, standaloneWelcomeMessage, localComms, m_networkServersInfo, 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 (standaloneAuthenticate) + if (m_standaloneAuthenticate) { this.CreateAccount = localComms.doCreate; } @@ -209,7 +232,7 @@ namespace OpenSim configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); } - m_moduleLoader = new ModuleLoader( m_log, m_config ); + m_moduleLoader = new ModuleLoader(m_log, m_config); MainLog.Instance.Verbose("Loading Shared Modules"); m_moduleLoader.LoadDefaultSharedModules(); @@ -240,10 +263,10 @@ namespace OpenSim } else { - MainLog.Instance.Verbose("STARTUP","No startup command script specified. Moving on..."); + 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) @@ -289,7 +312,7 @@ namespace OpenSim protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager) { - return new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer, m_moduleLoader); + return new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer, m_moduleLoader, m_dumpAssetsToFile); } protected override void Initialize() @@ -307,7 +330,7 @@ namespace OpenSim } else { - SQLAssetServer sqlAssetServer = new SQLAssetServer(standaloneAssetPlugin); + SQLAssetServer sqlAssetServer = new SQLAssetServer(m_standaloneAssetPlugin); sqlAssetServer.LoadDefaultAssets(); assetServer = sqlAssetServer; } @@ -408,7 +431,7 @@ namespace OpenSim } else { - MainLog.Instance.Error("COMMANDFILE","Command script missing. Can not run commands"); + MainLog.Instance.Error("COMMANDFILE", "Command script missing. Can not run commands"); } } diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index e57e445..13af96c 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -35,8 +35,15 @@ 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) - : base(serversInfo, httpServer, assetCache) + public CommunicationsLocal( + 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; diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index 5d450bb..fd6002a 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs @@ -29,8 +29,8 @@ using System.Collections.Generic; using libsecondlife; using OpenSim.Framework.Communications; +using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Types; -using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder; namespace OpenSim.Region.Communications.Local { @@ -45,14 +45,14 @@ namespace OpenSim.Region.Communications.Local public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) { List folders = this.RequestFirstLevelFolders(userID); - InventoryFolder rootFolder = null; + InventoryFolderImpl rootFolder = null; //need to make sure we send root folder first foreach (InventoryFolderBase folder in folders) { if (folder.parentID == libsecondlife.LLUUID.Zero) { - InventoryFolder newfolder = new InventoryFolder(folder); + InventoryFolderImpl newfolder = new InventoryFolderImpl(folder); rootFolder = newfolder; folderCallBack(userID, newfolder); } @@ -64,7 +64,7 @@ namespace OpenSim.Region.Communications.Local { if (folder.folderID != rootFolder.folderID) { - InventoryFolder newfolder = new InventoryFolder(folder); + InventoryFolderImpl newfolder = new InventoryFolderImpl(folder); folderCallBack(userID, newfolder); List items = this.RequestFolderItems(newfolder.folderID); @@ -77,7 +77,7 @@ namespace OpenSim.Region.Communications.Local } } - public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) + public override void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder) { this.AddFolder(folder); } diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index 8ebeeca..4be31d8 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs @@ -36,7 +36,7 @@ namespace OpenSim.Region.Communications.OGS1 { public class CommunicationsOGS1 : CommunicationsManager { - public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache) + public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache, false) { OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); m_gridService = gridInterComms; diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 77713af..d8f5a22 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -29,8 +29,8 @@ using System.Collections.Generic; using libsecondlife; using OpenSim.Framework.Communications; +using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Types; -using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; namespace OpenSim.Region.Communications.OGS1 @@ -50,7 +50,7 @@ namespace OpenSim.Region.Communications.OGS1 } - public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) + public void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder) { } diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs new file mode 100644 index 0000000..b6f24c3 --- /dev/null +++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using OpenSim.Framework.Types; + +namespace OpenSim.Region.Environment.Interfaces +{ + public interface IAvatarFactory : IRegionModule + { + bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, out byte[] visualParams); + } +} diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index 4fc45a0..160b740 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs @@ -67,12 +67,18 @@ namespace OpenSim.Region.Environment { DynamicTextureModule dynamicModule = new DynamicTextureModule(); LoadedSharedModules.Add(dynamicModule.Name, dynamicModule); + ChatModule chat = new ChatModule(); LoadedSharedModules.Add(chat.Name, chat); + InstantMessageModule imMod = new InstantMessageModule(); LoadedSharedModules.Add(imMod.Name, imMod); + LoadImageURLModule loadMod = new LoadImageURLModule(); LoadedSharedModules.Add(loadMod.Name, loadMod); + + AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); + LoadedSharedModules.Add(avatarFactory.Name, avatarFactory); } public void InitialiseSharedModules(Scene scene) diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs new file mode 100644 index 0000000..f825b7a --- /dev/null +++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using Nini.Config; +using OpenSim.Framework.Types; +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + +namespace OpenSim.Region.Environment.Modules +{ + public class AvatarFactoryModule : IAvatarFactory + { + public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, out byte[] visualParams) + { + GetDefaultAvatarAppearance(out wearables, out visualParams); + return true; + } + + public void Initialise(Scene scene, IConfigSource source) + { + scene.RegisterModuleInterface(this); + } + + public void PostInitialise() + { + } + + public void Close() + { + } + + public string Name + { + get { return "Default Avatar Factory"; } + } + + public bool IsSharedModule + { + get { return true; } + } + + public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) + { + visualParams = new byte[218]; + for (int i = 0; i < 218; i++) + { + visualParams[i] = 100; + } + + wearables = AvatarWearable.DefaultWearables; + } + } + + + +} diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index 2fe308d..c2611d0 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs @@ -126,7 +126,9 @@ namespace OpenSim.Region.Environment.Modules LLUUID fromAgentID = LLUUID.Zero; if (e.Sender != null) + { avatar = scene.GetScenePresence(e.Sender.AgentId); + } if (avatar != null) { diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 96beb05..4c04592 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -30,7 +30,6 @@ using Axiom.Math; using libsecondlife; using libsecondlife.Packets; using OpenSim.Framework.Communications.Cache; -using OpenSim.Framework.Communications.Caches; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Framework.Utilities; diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 69c3f9e..e86562d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -50,6 +50,7 @@ using OpenSim.Region.Environment.Types; using OpenSim.Region.Physics.Manager; using OpenSim.Region.Terrain; using Timer = System.Timers.Timer; +using OpenSim.Region.Environment.Modules; namespace OpenSim.Region.Environment.Scenes { @@ -90,11 +91,11 @@ namespace OpenSim.Region.Environment.Scenes public IXfer XferManager; - private IHttpRequests m_httpRequestModule = null; - private ISimChat m_simChatModule = null; - private IXMLRPC m_xmlrpcModule = null; - private IWorldComm m_worldCommModule = null; - + private IHttpRequests m_httpRequestModule; + private ISimChat m_simChatModule; + private IXMLRPC m_xmlrpcModule; + private IWorldComm m_worldCommModule; + private IAvatarFactory m_AvatarFactory; // Central Update Loop @@ -165,7 +166,7 @@ namespace OpenSim.Region.Environment.Scenes public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, - ModuleLoader moduleLoader) + ModuleLoader moduleLoader, bool dumpAssetsToFile) { updateLock = new Mutex(false); @@ -205,6 +206,7 @@ namespace OpenSim.Region.Environment.Scenes ScenePresence.LoadAnims(); httpListener = httpServer; + m_dumpAssetsToFile = dumpAssetsToFile; } #endregion @@ -215,7 +217,6 @@ namespace OpenSim.Region.Environment.Scenes m_httpRequestModule = RequestModuleInterface(); m_xmlrpcModule = RequestModuleInterface(); m_worldCommModule = RequestModuleInterface(); - XferManager = RequestModuleInterface(); } @@ -855,7 +856,15 @@ namespace OpenSim.Region.Environment.Scenes { ScenePresence newAvatar = null; - newAvatar = new ScenePresence(client, this, m_regInfo); + byte[] visualParams; + AvatarWearable[] wearables; + + if( m_AvatarFactory == null || !m_AvatarFactory.TryGetIntialAvatarAppearance( client.AgentId, out wearables, out visualParams)) + { + AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams); + } + + newAvatar = new ScenePresence(client, this, m_regInfo, visualParams, wearables); newAvatar.IsChildAgent = child; if (child) @@ -1096,7 +1105,8 @@ namespace OpenSim.Region.Environment.Scenes //Console.WriteLine("new user, so creating caps handler for it"); Caps cap = new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port, - agent.CapsPath, agent.AgentID); + agent.CapsPath, agent.AgentID, m_dumpAssetsToFile); + Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + "/CAPS/" + agent.CapsPath + "0000/"); @@ -1456,6 +1466,7 @@ namespace OpenSim.Region.Environment.Scenes #region Script Engine private List ScriptEngines = new List(); + private bool m_dumpAssetsToFile; public void AddScriptEngine(ScriptEngineInterface ScriptEngine, LogBase m_logger) { diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 99f78c9..256b6b5 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -53,8 +53,8 @@ namespace OpenSim.Region.Environment.Scenes private short m_updateCount = 0; private Quaternion bodyRot; - private byte[] visualParams; - private AvatarWearable[] Wearables; + private byte[] m_visualParams; + private AvatarWearable[] m_wearables; private LLObject.TextureEntry m_textureEntry; public bool IsRestrictedToRegion = false; @@ -90,10 +90,10 @@ namespace OpenSim.Region.Environment.Scenes //public List InterestList = new List(); - // private string m_currentQuadNode = " "; + // private string m_currentQuadNode = " "; - // private Queue m_fullPartUpdates = new Queue(); - //private Queue m_tersePartUpdates = new Queue(); + // private Queue m_fullPartUpdates = new Queue(); + //private Queue m_tersePartUpdates = new Queue(); private UpdateQueue m_partsUpdateQueue = new UpdateQueue(); private Dictionary m_updateTimes = new Dictionary(); @@ -173,8 +173,8 @@ namespace OpenSim.Region.Environment.Scenes m_pos = value; } - } - + } + public override LLVector3 Velocity { get @@ -220,14 +220,7 @@ namespace OpenSim.Region.Environment.Scenes #region Constructor(s) - /// - /// - /// - /// - /// - /// - /// - public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) + public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, AvatarWearable[] wearables) { m_scene = world; m_uuid = client.AgentId; @@ -240,13 +233,9 @@ namespace OpenSim.Region.Environment.Scenes m_localId = m_scene.NextLocalId; AbsolutePosition = m_controllingClient.StartPos; - visualParams = new byte[218]; - for (int i = 0; i < 218; i++) - { - visualParams[i] = 100; - } + m_visualParams = visualParams; + m_wearables = wearables; - Wearables = AvatarWearable.DefaultWearables; Animations = new AvatarAnimations(); Animations.LoadAnims(); @@ -351,7 +340,7 @@ namespace OpenSim.Region.Environment.Scenes AbsolutePosition = pos; - AddToPhysicalScene( ); + AddToPhysicalScene(); m_physicsActor.Flying = isFlying; @@ -410,7 +399,7 @@ namespace OpenSim.Region.Environment.Scenes for (int i = 0; i < visualParam.Length; i++) { - visualParams[i] = visualParam[i].ParamValue; + m_visualParams[i] = visualParam[i].ParamValue; } SendAppearanceToAllOtherAgents(); @@ -459,7 +448,7 @@ 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; @@ -470,23 +459,23 @@ namespace OpenSim.Region.Environment.Scenes bodyRot = q; update_rotation = true; } - 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; } } @@ -531,10 +520,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; @@ -619,7 +608,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendTerseUpdateToAllClients() { - m_scene.Broadcast( SendTerseUpdateToClient ); + m_scene.Broadcast(SendTerseUpdateToClient); } public void SendCoarseLocations() @@ -628,7 +617,7 @@ namespace OpenSim.Region.Environment.Scenes List avatars = m_scene.GetAvatars(); for (int i = 0; i < avatars.Count; i++) { - if (avatars[i] != this ) + if (avatars[i] != this) { CoarseLocations.Add(avatars[i].AbsolutePosition); } @@ -642,7 +631,7 @@ namespace OpenSim.Region.Environment.Scenes m_newCoarseLocations = true; } - + /// @@ -695,7 +684,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendOurAppearance(IClientAPI OurClient) { - m_controllingClient.SendWearables(Wearables); + m_controllingClient.SendWearables(m_wearables); //this.SendFullUpdateToAllClients(); //this.SendAppearanceToAllOtherAgents(); @@ -734,7 +723,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendAppearanceToOtherAgent(ScenePresence avatarInfo) { - avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, visualParams, + avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, m_visualParams, m_textureEntry.ToBytes()); } @@ -793,9 +782,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)) { @@ -840,7 +829,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) { @@ -940,7 +929,7 @@ namespace OpenSim.Region.Environment.Scenes throw new Exception("Can't set Text on avatar."); } - public void AddToPhysicalScene( ) + public void AddToPhysicalScene() { PhysicsScene scene = m_scene.PhysScene; @@ -948,7 +937,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(this.Firstname + "." + this.Lastname, pVec); } internal void Close() diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs index 8492aa5..d642103 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs @@ -47,7 +47,7 @@ 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) + : base( regionInfo, authen, commsMan, assetCach, storeMan, httpServer, moduleLoader, false) { m_avatars = new List(); } diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 36be3e8..4783a17 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -72,7 +72,7 @@ namespace SimpleApp 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); + 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); -- cgit v1.1